5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-10 08:50:40 +08:00
wails/v3/internal/assetserver/bundledassets/runtime.js
2024-04-28 19:43:37 +10:00

2 lines
21 KiB
JavaScript

var he=Object.defineProperty;var u=(e,i)=>{for(var n in i)he(e,n,{get:i[n],enumerable:!0})};var j={};u(j,{Application:()=>J,Browser:()=>P,Call:()=>$,Clipboard:()=>ee,Dialogs:()=>T,Events:()=>k,Flags:()=>X,Screens:()=>ne,System:()=>K,WML:()=>Z,Window:()=>R});var Z={};u(Z,{Enable:()=>_,Reload:()=>ce});var P={};u(P,{OpenURL:()=>O});var We="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var f=(e=21)=>{let i="",n=e;for(;n--;)i+=We[Math.random()*64|0];return i};var ge=window.location.origin+"/wails/runtime",l={Call:0,Clipboard:1,Application:2,Events:3,ContextMenu:4,Dialog:5,Window:6,Screens:7,System:8,Browser:9,CancelCall:10},fe=f();function d(e,i){return function(n,t=null){return De(e,n,i,t)}}function De(e,i,n,t){let r=new URL(ge);r.searchParams.append("object",e),r.searchParams.append("method",i);let s={headers:{}};return n&&(s.headers["x-wails-window-name"]=n),t&&r.searchParams.append("args",JSON.stringify(t)),s.headers["x-wails-client-id"]=fe,new Promise((c,m)=>{fetch(r,s).then(a=>{if(a.ok)return a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/json")!==-1?a.json():a.text();m(Error(a.statusText))}).then(a=>c(a)).catch(a=>m(a))})}var Me=d(l.Browser,""),Ce=0;function O(e){return Me(Ce,{url:e})}var T={};u(T,{Error:()=>Ie,Info:()=>Oe,OpenFile:()=>Te,Question:()=>I,SaveFile:()=>Be,Warning:()=>Pe});window._wails=window._wails||{};window._wails.dialogErrorCallback=Fe;window._wails.dialogResultCallback=Ue;var Se=0,xe=1,Ae=2,be=3,ve=4,Re=5,Ee=d(l.Dialog,""),W=new Map;function ye(){let e;do e=f();while(W.has(e));return e}function D(e,i={}){let n=ye();return i["dialog-id"]=n,new Promise((t,r)=>{W.set(n,{resolve:t,reject:r}),Ee(e,i).catch(s=>{r(s),W.delete(n)})})}function Ue(e,i,n){let t=W.get(e);t&&(n?t.resolve(JSON.parse(i)):t.resolve(i),W.delete(e))}function Fe(e,i){let n=W.get(e);n&&(n.reject(i),W.delete(e))}var Oe=e=>D(Se,e),Pe=e=>D(xe,e),Ie=e=>D(Ae,e),I=e=>D(be,e),Te=e=>D(ve,e),Be=e=>D(Re,e);var k={};u(k,{Emit:()=>L,Off:()=>je,OffAll:()=>Ge,On:()=>Ve,OnMultiple:()=>z,Once:()=>_e,Types:()=>ze,WailsEvent:()=>x,setup:()=>Ne});var oe={Windows:{SystemThemeChanged:"windows:SystemThemeChanged",APMPowerStatusChange:"windows:APMPowerStatusChange",APMSuspend:"windows:APMSuspend",APMResumeAutomatic:"windows:APMResumeAutomatic",APMResumeSuspend:"windows:APMResumeSuspend",APMPowerSettingChange:"windows:APMPowerSettingChange",ApplicationStarted:"windows:ApplicationStarted",WebViewNavigationCompleted:"windows:WebViewNavigationCompleted",WindowInactive:"windows:WindowInactive",WindowActive:"windows:WindowActive",WindowClickActive:"windows:WindowClickActive",WindowMaximise:"windows:WindowMaximise",WindowUnMaximise:"windows:WindowUnMaximise",WindowFullscreen:"windows:WindowFullscreen",WindowUnFullscreen:"windows:WindowUnFullscreen",WindowRestore:"windows:WindowRestore",WindowMinimise:"windows:WindowMinimise",WindowUnMinimise:"windows:WindowUnMinimise",WindowClose:"windows:WindowClose",WindowSetFocus:"windows:WindowSetFocus",WindowKillFocus:"windows:WindowKillFocus",WindowDragDrop:"windows:WindowDragDrop",WindowDragEnter:"windows:WindowDragEnter",WindowDragLeave:"windows:WindowDragLeave",WindowDragOver:"windows:WindowDragOver"},Mac:{ApplicationDidBecomeActive:"mac:ApplicationDidBecomeActive",ApplicationDidChangeBackingProperties:"mac:ApplicationDidChangeBackingProperties",ApplicationDidChangeEffectiveAppearance:"mac:ApplicationDidChangeEffectiveAppearance",ApplicationDidChangeIcon:"mac:ApplicationDidChangeIcon",ApplicationDidChangeOcclusionState:"mac:ApplicationDidChangeOcclusionState",ApplicationDidChangeScreenParameters:"mac:ApplicationDidChangeScreenParameters",ApplicationDidChangeStatusBarFrame:"mac:ApplicationDidChangeStatusBarFrame",ApplicationDidChangeStatusBarOrientation:"mac:ApplicationDidChangeStatusBarOrientation",ApplicationDidFinishLaunching:"mac:ApplicationDidFinishLaunching",ApplicationDidHide:"mac:ApplicationDidHide",ApplicationDidResignActiveNotification:"mac:ApplicationDidResignActiveNotification",ApplicationDidUnhide:"mac:ApplicationDidUnhide",ApplicationDidUpdate:"mac:ApplicationDidUpdate",ApplicationWillBecomeActive:"mac:ApplicationWillBecomeActive",ApplicationWillFinishLaunching:"mac:ApplicationWillFinishLaunching",ApplicationWillHide:"mac:ApplicationWillHide",ApplicationWillResignActive:"mac:ApplicationWillResignActive",ApplicationWillTerminate:"mac:ApplicationWillTerminate",ApplicationWillUnhide:"mac:ApplicationWillUnhide",ApplicationWillUpdate:"mac:ApplicationWillUpdate",ApplicationDidChangeTheme:"mac:ApplicationDidChangeTheme!",ApplicationShouldHandleReopen:"mac:ApplicationShouldHandleReopen!",WindowDidBecomeKey:"mac:WindowDidBecomeKey",WindowDidBecomeMain:"mac:WindowDidBecomeMain",WindowDidBeginSheet:"mac:WindowDidBeginSheet",WindowDidChangeAlpha:"mac:WindowDidChangeAlpha",WindowDidChangeBackingLocation:"mac:WindowDidChangeBackingLocation",WindowDidChangeBackingProperties:"mac:WindowDidChangeBackingProperties",WindowDidChangeCollectionBehavior:"mac:WindowDidChangeCollectionBehavior",WindowDidChangeEffectiveAppearance:"mac:WindowDidChangeEffectiveAppearance",WindowDidChangeOcclusionState:"mac:WindowDidChangeOcclusionState",WindowDidChangeOrderingMode:"mac:WindowDidChangeOrderingMode",WindowDidChangeScreen:"mac:WindowDidChangeScreen",WindowDidChangeScreenParameters:"mac:WindowDidChangeScreenParameters",WindowDidChangeScreenProfile:"mac:WindowDidChangeScreenProfile",WindowDidChangeScreenSpace:"mac:WindowDidChangeScreenSpace",WindowDidChangeScreenSpaceProperties:"mac:WindowDidChangeScreenSpaceProperties",WindowDidChangeSharingType:"mac:WindowDidChangeSharingType",WindowDidChangeSpace:"mac:WindowDidChangeSpace",WindowDidChangeSpaceOrderingMode:"mac:WindowDidChangeSpaceOrderingMode",WindowDidChangeTitle:"mac:WindowDidChangeTitle",WindowDidChangeToolbar:"mac:WindowDidChangeToolbar",WindowDidChangeVisibility:"mac:WindowDidChangeVisibility",WindowDidDeminiaturize:"mac:WindowDidDeminiaturize",WindowDidEndSheet:"mac:WindowDidEndSheet",WindowDidEnterFullScreen:"mac:WindowDidEnterFullScreen",WindowDidEnterVersionBrowser:"mac:WindowDidEnterVersionBrowser",WindowDidExitFullScreen:"mac:WindowDidExitFullScreen",WindowDidExitVersionBrowser:"mac:WindowDidExitVersionBrowser",WindowDidExpose:"mac:WindowDidExpose",WindowDidFocus:"mac:WindowDidFocus",WindowDidMiniaturize:"mac:WindowDidMiniaturize",WindowDidMove:"mac:WindowDidMove",WindowDidOrderOffScreen:"mac:WindowDidOrderOffScreen",WindowDidOrderOnScreen:"mac:WindowDidOrderOnScreen",WindowDidResignKey:"mac:WindowDidResignKey",WindowDidResignMain:"mac:WindowDidResignMain",WindowDidResize:"mac:WindowDidResize",WindowDidUpdate:"mac:WindowDidUpdate",WindowDidUpdateAlpha:"mac:WindowDidUpdateAlpha",WindowDidUpdateCollectionBehavior:"mac:WindowDidUpdateCollectionBehavior",WindowDidUpdateCollectionProperties:"mac:WindowDidUpdateCollectionProperties",WindowDidUpdateShadow:"mac:WindowDidUpdateShadow",WindowDidUpdateTitle:"mac:WindowDidUpdateTitle",WindowDidUpdateToolbar:"mac:WindowDidUpdateToolbar",WindowDidUpdateVisibility:"mac:WindowDidUpdateVisibility",WindowShouldClose:"mac:WindowShouldClose!",WindowWillBecomeKey:"mac:WindowWillBecomeKey",WindowWillBecomeMain:"mac:WindowWillBecomeMain",WindowWillBeginSheet:"mac:WindowWillBeginSheet",WindowWillChangeOrderingMode:"mac:WindowWillChangeOrderingMode",WindowWillClose:"mac:WindowWillClose",WindowWillDeminiaturize:"mac:WindowWillDeminiaturize",WindowWillEnterFullScreen:"mac:WindowWillEnterFullScreen",WindowWillEnterVersionBrowser:"mac:WindowWillEnterVersionBrowser",WindowWillExitFullScreen:"mac:WindowWillExitFullScreen",WindowWillExitVersionBrowser:"mac:WindowWillExitVersionBrowser",WindowWillFocus:"mac:WindowWillFocus",WindowWillMiniaturize:"mac:WindowWillMiniaturize",WindowWillMove:"mac:WindowWillMove",WindowWillOrderOffScreen:"mac:WindowWillOrderOffScreen",WindowWillOrderOnScreen:"mac:WindowWillOrderOnScreen",WindowWillResignMain:"mac:WindowWillResignMain",WindowWillResize:"mac:WindowWillResize",WindowWillUnfocus:"mac:WindowWillUnfocus",WindowWillUpdate:"mac:WindowWillUpdate",WindowWillUpdateAlpha:"mac:WindowWillUpdateAlpha",WindowWillUpdateCollectionBehavior:"mac:WindowWillUpdateCollectionBehavior",WindowWillUpdateCollectionProperties:"mac:WindowWillUpdateCollectionProperties",WindowWillUpdateShadow:"mac:WindowWillUpdateShadow",WindowWillUpdateTitle:"mac:WindowWillUpdateTitle",WindowWillUpdateToolbar:"mac:WindowWillUpdateToolbar",WindowWillUpdateVisibility:"mac:WindowWillUpdateVisibility",WindowWillUseStandardFrame:"mac:WindowWillUseStandardFrame",MenuWillOpen:"mac:MenuWillOpen",MenuDidOpen:"mac:MenuDidOpen",MenuDidClose:"mac:MenuDidClose",MenuWillSendAction:"mac:MenuWillSendAction",MenuDidSendAction:"mac:MenuDidSendAction",MenuWillHighlightItem:"mac:MenuWillHighlightItem",MenuDidHighlightItem:"mac:MenuDidHighlightItem",MenuWillDisplayItem:"mac:MenuWillDisplayItem",MenuDidDisplayItem:"mac:MenuDidDisplayItem",MenuWillAddItem:"mac:MenuWillAddItem",MenuDidAddItem:"mac:MenuDidAddItem",MenuWillRemoveItem:"mac:MenuWillRemoveItem",MenuDidRemoveItem:"mac:MenuDidRemoveItem",MenuWillBeginTracking:"mac:MenuWillBeginTracking",MenuDidBeginTracking:"mac:MenuDidBeginTracking",MenuWillEndTracking:"mac:MenuWillEndTracking",MenuDidEndTracking:"mac:MenuDidEndTracking",MenuWillUpdate:"mac:MenuWillUpdate",MenuDidUpdate:"mac:MenuDidUpdate",MenuWillPopUp:"mac:MenuWillPopUp",MenuDidPopUp:"mac:MenuDidPopUp",MenuWillSendActionToItem:"mac:MenuWillSendActionToItem",MenuDidSendActionToItem:"mac:MenuDidSendActionToItem",WebViewDidStartProvisionalNavigation:"mac:WebViewDidStartProvisionalNavigation",WebViewDidReceiveServerRedirectForProvisionalNavigation:"mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",WebViewDidFinishNavigation:"mac:WebViewDidFinishNavigation",WebViewDidCommitNavigation:"mac:WebViewDidCommitNavigation",WindowFileDraggingEntered:"mac:WindowFileDraggingEntered",WindowFileDraggingPerformed:"mac:WindowFileDraggingPerformed",WindowFileDraggingExited:"mac:WindowFileDraggingExited"},Linux:{SystemThemeChanged:"linux:SystemThemeChanged",WindowLoadChanged:"linux:WindowLoadChanged",WindowDeleteEvent:"linux:WindowDeleteEvent",WindowFocusIn:"linux:WindowFocusIn",WindowFocusOut:"linux:WindowFocusOut",ApplicationStartup:"linux:ApplicationStartup"},Common:{ApplicationStarted:"common:ApplicationStarted",WindowMaximise:"common:WindowMaximise",WindowUnMaximise:"common:WindowUnMaximise",WindowFullscreen:"common:WindowFullscreen",WindowUnFullscreen:"common:WindowUnFullscreen",WindowRestore:"common:WindowRestore",WindowMinimise:"common:WindowMinimise",WindowUnMinimise:"common:WindowUnMinimise",WindowClosing:"common:WindowClosing",WindowZoom:"common:WindowZoom",WindowZoomIn:"common:WindowZoomIn",WindowZoomOut:"common:WindowZoomOut",WindowZoomReset:"common:WindowZoomReset",WindowFocus:"common:WindowFocus",WindowLostFocus:"common:WindowLostFocus",WindowShow:"common:WindowShow",WindowHide:"common:WindowHide",WindowDPIChanged:"common:WindowDPIChanged",WindowFilesDropped:"common:WindowFilesDropped",WindowRuntimeReady:"common:WindowRuntimeReady",ThemeChanged:"common:ThemeChanged"}};var ze=oe;window._wails=window._wails||{};window._wails.dispatchWailsEvent=He;var Le=d(l.Events,""),ke=0,w=new Map,B=class{constructor(i,n,t){this.eventName=i,this.maxCallbacks=t||-1,this.Callback=r=>(n(r),this.maxCallbacks===-1?!1:(this.maxCallbacks-=1,this.maxCallbacks===0))}},x=class{constructor(i,n=null){this.name=i,this.data=n}};function Ne(){}function He(e){let i=w.get(e.name);if(i){let n=i.filter(t=>{if(t.Callback(e))return!0});n.length>0&&(i=i.filter(t=>!n.includes(t)),i.length===0?w.delete(e.name):w.set(e.name,i))}}function z(e,i,n){let t=w.get(e)||[],r=new B(e,i,n);return t.push(r),w.set(e,t),()=>Ze(r)}function Ve(e,i){return z(e,i,-1)}function _e(e,i){return z(e,i,1)}function Ze(e){let i=e.eventName,n=w.get(i).filter(t=>t!==e);n.length===0?w.delete(i):w.set(i,n)}function je(e,...i){[e,...i].forEach(t=>w.delete(t))}function Ge(){w.clear()}function L(e){return Le(ke,e)}function re(){if(!EventTarget||!AbortSignal||!AbortController)return!1;let e=!0,i=new EventTarget,n=new AbortController;return i.addEventListener("test",()=>{e=!1},{signal:n.signal}),n.abort(),i.dispatchEvent(new CustomEvent("test")),e}var ae=!1;document.addEventListener("DOMContentLoaded",()=>ae=!0);function le(e){ae||document.readyState==="complete"?e():document.addEventListener("DOMContentLoaded",e)}var Ye=0,Ke=1,Xe=2,Qe=3,qe=4,Je=5,$e=6,ei=7,ii=8,ni=9,ti=10,oi=11,ri=12,ai=13,li=14,di=15,si=16,ci=17,mi=18,ui=19,wi=20,pi=21,hi=22,Wi=23,gi=24,fi=25,Di=26,Mi=27,Ci=28,Si=29,xi=30,Ai=31,bi=32,vi=33,Ri=34,Ei=35,yi=36,Ui=37,Fi=38,Oi=39,Pi=40,Ii=41,Ti=42,Bi=43,zi=44,Li=45,ki=46,Ni=47,o=Symbol(),N=class e{constructor(i=""){this[o]=d(l.Window,i);for(let n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this))}Get(i){return new e(i)}AbsolutePosition(){return this[o](Ye)}Center(){return this[o](Ke)}Close(){return this[o](Xe)}DisableSizeConstraints(){return this[o](Qe)}EnableSizeConstraints(){return this[o](qe)}Focus(){return this[o](Je)}ForceReload(){return this[o]($e)}Fullscreen(){return this[o](ei)}GetScreen(){return this[o](ii)}GetZoom(){return this[o](ni)}Height(){return this[o](ti)}Hide(){return this[o](oi)}IsFocused(){return this[o](ri)}IsFullscreen(){return this[o](ai)}IsMaximised(){return this[o](li)}IsMinimised(){return this[o](di)}Maximise(){return this[o](si)}Minimise(){return this[o](ci)}Name(){return this[o](mi)}OpenDevTools(){return this[o](ui)}RelativePosition(){return this[o](wi)}Reload(){return this[o](pi)}Resizable(){return this[o](hi)}Restore(){return this[o](Wi)}SetAbsolutePosition(i,n){return this[o](gi,{x:i,y:n})}SetAlwaysOnTop(i){return this[o](fi,{alwaysOnTop:i})}SetBackgroundColour(i,n,t,r){return this[o](Di,{r:i,g:n,b:t,a:r})}SetFrameless(i){return this[o](Mi,{frameless:i})}SetFullscreenButtonEnabled(i){return this[o](Ci,{enabled:i})}SetMaxSize(i,n){return this[o](Si,{width:i,height:n})}SetMinSize(i,n){return this[o](xi,{width:i,height:n})}SetRelativePosition(i,n){return this[o](Ai,{x:i,y:n})}SetResizable(i){return this[o](bi,{resizable:i})}SetSize(i,n){return this[o](vi,{width:i,height:n})}SetTitle(i){return this[o](Ri,{title:i})}SetZoom(i){return this[o](Ei,{zoom:i})}Show(){return this[o](yi)}Size(){return this[o](Ui)}ToggleFullscreen(){return this[o](Fi)}ToggleMaximise(){return this[o](Oi)}UnFullscreen(){return this[o](Pi)}UnMaximise(){return this[o](Ii)}UnMinimise(){return this[o](Ti)}Width(){return this[o](Bi)}Zoom(){return this[o](zi)}ZoomIn(){return this[o](Li)}ZoomOut(){return this[o](ki)}ZoomReset(){return this[o](Ni)}},Hi=new N(""),R=Hi;function Vi(e,i=null){L(new x(e,i))}function _i(e,i){let n=R.Get(e),t=n[i];if(typeof t=="function")try{t.call(n)}catch{}}function de(e){let i=e.currentTarget;function n(r="Yes"){if(r!=="Yes")return;let s=i.getAttribute("wml-event"),c=i.getAttribute("wml-target-window")||"",m=i.getAttribute("wml-window"),a=i.getAttribute("wml-openurl");s!==null&&Vi(s),m!==null&&_i(c,m),a!==null&&O(a)}let t=i.getAttribute("wml-confirm");t?I({Title:"Confirm",Message:t,Detached:!1,Buttons:[{Label:"Yes"},{Label:"No",IsDefault:!0}]}).then(n):n()}var E=Symbol(),H=class{constructor(){this[E]=new AbortController}set(i,n){return{signal:this[E].signal}}reset(){this[E].abort(),this[E]=new AbortController}},A=Symbol(),M=Symbol(),V=class{constructor(){this[A]=new WeakMap,this[M]=0}set(i,n){return this[M]+=!this[A].has(i),this[A].set(i,n),{}}reset(){if(!(this[M]<=0)){for(let i of document.body.querySelectorAll("*")){if(this[M]<=0)break;let n=this[A].get(i);this[M]-=typeof n<"u";for(let t of n||[])i.removeEventListener(t,de)}this[A]=new WeakMap,this[M]=0}}},se=re()?new H:new V;function Zi(e){let i=/\S+/g,n=e.getAttribute("wml-trigger")||"click",t=[],r;for(;(r=i.exec(n))!==null;)t.push(r[0]);let s=se.set(e,t);for(let c of t)e.addEventListener(c,de,s)}function _(){le(ce)}function ce(){se.reset(),document.body.querySelectorAll("[wml-event], [wml-window], [wml-openurl]").forEach(Zi)}window.wails=j;_();var K={};u(K,{Capabilities:()=>Ki,Environment:()=>Xi,IsAMD64:()=>Ji,IsARM:()=>$i,IsARM64:()=>en,IsDarkMode:()=>Yi,IsDebug:()=>Y,IsLinux:()=>Qi,IsMac:()=>qi,IsWindows:()=>G,invoke:()=>g});var me=d(l.System,""),ji=0,Gi=1;function g(e){return window.chrome?window.chrome.webview.postMessage(e):window.webkit.messageHandlers.external.postMessage(e)}function Yi(){return me(ji)}function Ki(){return fetch("/wails/capabilities").json()}function Xi(){return me(Gi)}function G(){return window._wails.environment.OS==="windows"}function Qi(){return window._wails.environment.OS==="linux"}function qi(){return window._wails.environment.OS==="darwin"}function Ji(){return window._wails.environment.Arch==="amd64"}function $i(){return window._wails.environment.Arch==="arm"}function en(){return window._wails.environment.Arch==="arm64"}function Y(){return window._wails.environment.Debug===!0}window.addEventListener("contextmenu",rn);var nn=d(l.ContextMenu,""),tn=0;function on(e,i,n,t){nn(tn,{id:e,x:i,y:n,data:t})}function rn(e){let i=e.target,n=window.getComputedStyle(i).getPropertyValue("--custom-contextmenu");if(n=n?n.trim():"",n){e.preventDefault();let t=window.getComputedStyle(i).getPropertyValue("--custom-contextmenu-data");on(n,e.clientX,e.clientY,t);return}an(e)}function an(e){if(Y())return;let i=e.target;switch(window.getComputedStyle(i).getPropertyValue("--default-contextmenu").trim()){case"show":return;case"hide":e.preventDefault();return;default:if(i.isContentEditable)return;let r=window.getSelection(),s=r.toString().length>0;if(s)for(let c=0;c<r.rangeCount;c++){let a=r.getRangeAt(c).getClientRects();for(let p=0;p<a.length;p++){let S=a[p];if(document.elementFromPoint(S.left,S.top)===i)return}}if((i.tagName==="INPUT"||i.tagName==="TEXTAREA")&&(s||!i.readOnly&&!i.disabled))return;e.preventDefault()}}var X={};u(X,{GetFlag:()=>b});function b(e){try{return window._wails.flags[e]}catch(i){throw new Error("Unable to retrieve flag '"+e+"': "+i)}}var C=!1,ue=!1,y=null,Q="auto";window._wails=window._wails||{};window._wails.setResizable=function(e){ue=e};window._wails.endDrag=function(){document.body.style.cursor="default",C=!1};window.addEventListener("mousedown",dn);window.addEventListener("mousemove",cn);window.addEventListener("mouseup",sn);function ln(e){let i=window.getComputedStyle(e.target).getPropertyValue("--wails-draggable"),n=e.buttons!==void 0?e.buttons:e.which;return!i||i===""||i.trim()!=="drag"||n===0?!1:e.detail===1}function dn(e){if(y){g("resize:"+y),e.preventDefault();return}if(ln(e)){if(e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight)return;C=!0}else C=!1}function sn(){C=!1}function h(e){document.documentElement.style.cursor=e||Q,y=e}function cn(e){if(C&&(C=!1,(e.buttons!==void 0?e.buttons:e.which)>0)){g("drag");return}if(!ue||!G())return;Q==null&&(Q=document.documentElement.style.cursor);let i=b("system.resizeHandleHeight")||5,n=b("system.resizeHandleWidth")||5,t=b("resizeCornerExtra")||10,r=window.outerWidth-e.clientX<n,s=e.clientX<n,c=e.clientY<i,m=window.outerHeight-e.clientY<i,a=window.outerWidth-e.clientX<n+t,p=e.clientX<n+t,S=e.clientY<i+t,te=window.outerHeight-e.clientY<i+t;!s&&!r&&!c&&!m&&y!==void 0?h():a&&te?h("se-resize"):p&&te?h("sw-resize"):p&&S?h("nw-resize"):S&&a?h("ne-resize"):s?h("w-resize"):c?h("n-resize"):m?h("s-resize"):r&&h("e-resize")}var J={};u(J,{Hide:()=>pn,Quit:()=>Wn,Show:()=>hn});var q=d(l.Application,""),mn=0,un=1,wn=2;function pn(){return q(mn)}function hn(){return q(un)}function Wn(){return q(wn)}var $={};u($,{ByID:()=>An,ByName:()=>xn,Call:()=>Sn,Plugin:()=>bn});window._wails=window._wails||{};window._wails.callResultHandler=Mn;window._wails.callErrorHandler=Cn;var U=0,gn=d(l.Call,""),fn=d(l.CancelCall,""),v=new Map;function Dn(){let e;do e=f();while(v.has(e));return e}function Mn(e,i,n){let t=we(e);t&&t.resolve(n?JSON.parse(i):i)}function Cn(e,i){let n=we(e);n&&n.reject(i)}function we(e){let i=v.get(e);return v.delete(e),i}function F(e,i={}){let n=Dn(),t=()=>fn(e,{"call-id":n}),r=!1,s=!1,c=new Promise((m,a)=>{i["call-id"]=n,v.set(n,{resolve:m,reject:a}),gn(e,i).then(p=>{if(s=!0,r)return t()}).catch(p=>{a(p),v.delete(n)})});return c.cancel=()=>{if(s)return t();r=!0},c}function Sn(e){return F(U,e)}function xn(e,...i){if(typeof e!="string"||e.split(".").length!==3)throw new Error("CallByName requires a string in the format 'package.struct.method'");let[n,t,r]=e.split(".");return F(U,{packageName:n,structName:t,methodName:r,args:i})}function An(e,...i){return F(U,{methodID:e,args:i})}function bn(e,i,...n){return F(U,{packageName:"wails-plugins",structName:e,methodName:i,args:n})}var ee={};u(ee,{SetText:()=>En,Text:()=>yn});var pe=d(l.Clipboard,""),vn=0,Rn=1;function En(e){return pe(vn,{text:e})}function yn(){return pe(Rn)}var ne={};u(ne,{GetAll:()=>Pn,GetCurrent:()=>Tn,GetPrimary:()=>In});var ie=d(l.Screens,""),Un=0,Fn=1,On=2;function Pn(){return ie(Un)}function In(){return ie(Fn)}function Tn(){return ie(On)}window._wails=window._wails||{};window._wails.invoke=g;g("wails:runtime:ready");export{J as Application,P as Browser,$ as Call,ee as Clipboard,T as Dialogs,k as Events,X as Flags,ne as Screens,K as System,Z as WML,R as Window};