5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-11 22:49:29 +08:00
wails/v3/internal/assetserver/bundledassets/runtime.js
2025-02-25 14:03:52 +01:00

2 lines
33 KiB
JavaScript

var Le=Object.defineProperty,ln=Object.defineProperties;var cn=Object.getOwnPropertyDescriptors;var Oe=Object.getOwnPropertySymbols;var dn=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable;var Fe=(n,e,i)=>e in n?Le(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,Ue=(n,e)=>{for(var i in e||(e={}))dn.call(e,i)&&Fe(n,i,e[i]);if(Oe)for(var i of Oe(e))mn.call(e,i)&&Fe(n,i,e[i]);return n},Ie=(n,e)=>ln(n,cn(e));var w=(n,e)=>{for(var i in e)Le(n,i,{get:e[i],enumerable:!0})};var C=(n,e,i)=>new Promise((o,t)=>{var s=l=>{try{c(i.next(l))}catch(u){t(u)}},a=l=>{try{c(i.throw(l))}catch(u){t(u)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,a);c((i=i.apply(n,e)).next())});var ce={};w(ce,{Application:()=>ye,Browser:()=>_,Call:()=>xe,CancelError:()=>k,CancellablePromise:()=>F,CancelledRejectionError:()=>O,Clipboard:()=>Re,Create:()=>Ae,Dialogs:()=>ee,Events:()=>oe,Flags:()=>we,Screens:()=>ke,System:()=>ue,WML:()=>le,Window:()=>Z});var le={};w(le,{Enable:()=>ae,Reload:()=>Ye});var _={};w(_,{OpenURL:()=>q});var un="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function P(n=21){let e="",i=n|0;for(;i--;)e+=un[Math.random()*64|0];return e}var wn=window.location.origin+"/wails/runtime",d=Object.freeze({Call:0,Clipboard:1,Application:2,Events:3,ContextMenu:4,Dialog:5,Window:6,Screens:7,System:8,Browser:9,CancelCall:10}),pn=P();function m(n,e=""){return function(i,o=null){return fn(n,i,e,o)}}function fn(n,e,i,o){return C(this,null,function*(){var c,l;let t=new URL(wn);t.searchParams.append("object",n.toString()),t.searchParams.append("method",e.toString()),o&&t.searchParams.append("args",JSON.stringify(o));let s={"x-wails-client-id":pn};i&&(s["x-wails-window-name"]=i);let a=yield fetch(t,{headers:s});if(!a.ok)throw new Error(yield a.text());return((l=(c=a.headers.get("Content-Type"))==null?void 0:c.indexOf("application/json"))!=null?l:-1)!==-1?a.json():a.text()})}var gn=m(d.Browser),hn=0;function q(n){return gn(hn,{url:n.toString()})}var ee={};w(ee,{Error:()=>An,Info:()=>xn,OpenFile:()=>En,Question:()=>$,SaveFile:()=>kn,Warning:()=>Rn});window._wails=window._wails||{};window._wails.dialogErrorCallback=Sn;window._wails.dialogResultCallback=Mn;var Wn=m(d.Dialog),U=new Map,bn=0,yn=1,vn=2,Cn=3,Pn=4,Dn=5;function Mn(n,e,i){let o=ze(n);if(o)if(i)try{o.resolve(JSON.parse(e))}catch(t){o.reject(new TypeError("could not parse result: "+t.message,{cause:t}))}else o.resolve(e)}function Sn(n,e){var i;(i=ze(n))==null||i.reject(new window.Error(e))}function ze(n){let e=U.get(n);return U.delete(n),e}function Tn(){let n;do n=P();while(U.has(n));return n}function D(n,e={}){let i=Tn();return new Promise((o,t)=>{U.set(i,{resolve:o,reject:t}),Wn(n,Object.assign({"dialog-id":i},e)).catch(s=>{U.delete(i),t(s)})})}function xn(n){return D(bn,n)}function Rn(n){return D(yn,n)}function An(n){return D(vn,n)}function $(n){return D(Cn,n)}function En(n){var e;return(e=D(Pn,n))!=null?e:[]}function kn(n){return D(Dn,n)}var oe={};w(oe,{Emit:()=>ie,Off:()=>zn,OffAll:()=>jn,On:()=>Un,OnMultiple:()=>ne,Once:()=>In,Types:()=>Be,WailsEvent:()=>M});var f=new Map,H=class{constructor(e,i,o){this.eventName=e,this.callback=i,this.maxCallbacks=o||-1}dispatch(e){try{this.callback(e)}catch(i){}return this.maxCallbacks===-1?!1:(this.maxCallbacks-=1,this.maxCallbacks===0)}};function je(n){let e=f.get(n.eventName);e&&(e=e.filter(i=>i!==n),e.length===0?f.delete(n.eventName):f.set(n.eventName,e))}var Be=Object.freeze({Windows:Object.freeze({APMPowerSettingChange:"windows:APMPowerSettingChange",APMPowerStatusChange:"windows:APMPowerStatusChange",APMResumeAutomatic:"windows:APMResumeAutomatic",APMResumeSuspend:"windows:APMResumeSuspend",APMSuspend:"windows:APMSuspend",ApplicationStarted:"windows:ApplicationStarted",SystemThemeChanged:"windows:SystemThemeChanged",WebViewNavigationCompleted:"windows:WebViewNavigationCompleted",WindowActive:"windows:WindowActive",WindowBackgroundErase:"windows:WindowBackgroundErase",WindowClickActive:"windows:WindowClickActive",WindowClosing:"windows:WindowClosing",WindowDidMove:"windows:WindowDidMove",WindowDidResize:"windows:WindowDidResize",WindowDPIChanged:"windows:WindowDPIChanged",WindowDragDrop:"windows:WindowDragDrop",WindowDragEnter:"windows:WindowDragEnter",WindowDragLeave:"windows:WindowDragLeave",WindowDragOver:"windows:WindowDragOver",WindowEndMove:"windows:WindowEndMove",WindowEndResize:"windows:WindowEndResize",WindowFullscreen:"windows:WindowFullscreen",WindowHide:"windows:WindowHide",WindowInactive:"windows:WindowInactive",WindowKeyDown:"windows:WindowKeyDown",WindowKeyUp:"windows:WindowKeyUp",WindowKillFocus:"windows:WindowKillFocus",WindowNonClientHit:"windows:WindowNonClientHit",WindowNonClientMouseDown:"windows:WindowNonClientMouseDown",WindowNonClientMouseLeave:"windows:WindowNonClientMouseLeave",WindowNonClientMouseMove:"windows:WindowNonClientMouseMove",WindowNonClientMouseUp:"windows:WindowNonClientMouseUp",WindowPaint:"windows:WindowPaint",WindowRestore:"windows:WindowRestore",WindowSetFocus:"windows:WindowSetFocus",WindowShow:"windows:WindowShow",WindowStartMove:"windows:WindowStartMove",WindowStartResize:"windows:WindowStartResize",WindowUnFullscreen:"windows:WindowUnFullscreen",WindowZOrderChanged:"windows:WindowZOrderChanged",WindowMinimise:"windows:WindowMinimise",WindowUnMinimise:"windows:WindowUnMinimise",WindowMaximise:"windows:WindowMaximise",WindowUnMaximise:"windows:WindowUnMaximise"}),Mac:Object.freeze({ApplicationDidBecomeActive:"mac:ApplicationDidBecomeActive",ApplicationDidChangeBackingProperties:"mac:ApplicationDidChangeBackingProperties",ApplicationDidChangeEffectiveAppearance:"mac:ApplicationDidChangeEffectiveAppearance",ApplicationDidChangeIcon:"mac:ApplicationDidChangeIcon",ApplicationDidChangeOcclusionState:"mac:ApplicationDidChangeOcclusionState",ApplicationDidChangeScreenParameters:"mac:ApplicationDidChangeScreenParameters",ApplicationDidChangeStatusBarFrame:"mac:ApplicationDidChangeStatusBarFrame",ApplicationDidChangeStatusBarOrientation:"mac:ApplicationDidChangeStatusBarOrientation",ApplicationDidChangeTheme:"mac:ApplicationDidChangeTheme",ApplicationDidFinishLaunching:"mac:ApplicationDidFinishLaunching",ApplicationDidHide:"mac:ApplicationDidHide",ApplicationDidResignActive:"mac:ApplicationDidResignActive",ApplicationDidUnhide:"mac:ApplicationDidUnhide",ApplicationDidUpdate:"mac:ApplicationDidUpdate",ApplicationShouldHandleReopen:"mac:ApplicationShouldHandleReopen",ApplicationWillBecomeActive:"mac:ApplicationWillBecomeActive",ApplicationWillFinishLaunching:"mac:ApplicationWillFinishLaunching",ApplicationWillHide:"mac:ApplicationWillHide",ApplicationWillResignActive:"mac:ApplicationWillResignActive",ApplicationWillTerminate:"mac:ApplicationWillTerminate",ApplicationWillUnhide:"mac:ApplicationWillUnhide",ApplicationWillUpdate:"mac:ApplicationWillUpdate",MenuDidAddItem:"mac:MenuDidAddItem",MenuDidBeginTracking:"mac:MenuDidBeginTracking",MenuDidClose:"mac:MenuDidClose",MenuDidDisplayItem:"mac:MenuDidDisplayItem",MenuDidEndTracking:"mac:MenuDidEndTracking",MenuDidHighlightItem:"mac:MenuDidHighlightItem",MenuDidOpen:"mac:MenuDidOpen",MenuDidPopUp:"mac:MenuDidPopUp",MenuDidRemoveItem:"mac:MenuDidRemoveItem",MenuDidSendAction:"mac:MenuDidSendAction",MenuDidSendActionToItem:"mac:MenuDidSendActionToItem",MenuDidUpdate:"mac:MenuDidUpdate",MenuWillAddItem:"mac:MenuWillAddItem",MenuWillBeginTracking:"mac:MenuWillBeginTracking",MenuWillDisplayItem:"mac:MenuWillDisplayItem",MenuWillEndTracking:"mac:MenuWillEndTracking",MenuWillHighlightItem:"mac:MenuWillHighlightItem",MenuWillOpen:"mac:MenuWillOpen",MenuWillPopUp:"mac:MenuWillPopUp",MenuWillRemoveItem:"mac:MenuWillRemoveItem",MenuWillSendAction:"mac:MenuWillSendAction",MenuWillSendActionToItem:"mac:MenuWillSendActionToItem",MenuWillUpdate:"mac:MenuWillUpdate",WebViewDidCommitNavigation:"mac:WebViewDidCommitNavigation",WebViewDidFinishNavigation:"mac:WebViewDidFinishNavigation",WebViewDidReceiveServerRedirectForProvisionalNavigation:"mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",WebViewDidStartProvisionalNavigation:"mac:WebViewDidStartProvisionalNavigation",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",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",WindowDidZoom:"mac:WindowDidZoom",WindowFileDraggingEntered:"mac:WindowFileDraggingEntered",WindowFileDraggingExited:"mac:WindowFileDraggingExited",WindowFileDraggingPerformed:"mac:WindowFileDraggingPerformed",WindowHide:"mac:WindowHide",WindowMaximise:"mac:WindowMaximise",WindowUnMaximise:"mac:WindowUnMaximise",WindowMinimise:"mac:WindowMinimise",WindowUnMinimise:"mac:WindowUnMinimise",WindowShouldClose:"mac:WindowShouldClose",WindowShow:"mac:WindowShow",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",WindowZoomIn:"mac:WindowZoomIn",WindowZoomOut:"mac:WindowZoomOut",WindowZoomReset:"mac:WindowZoomReset"}),Linux:Object.freeze({ApplicationStartup:"linux:ApplicationStartup",SystemThemeChanged:"linux:SystemThemeChanged",WindowDeleteEvent:"linux:WindowDeleteEvent",WindowDidMove:"linux:WindowDidMove",WindowDidResize:"linux:WindowDidResize",WindowFocusIn:"linux:WindowFocusIn",WindowFocusOut:"linux:WindowFocusOut",WindowLoadChanged:"linux:WindowLoadChanged"}),Common:Object.freeze({ApplicationOpenedWithFile:"common:ApplicationOpenedWithFile",ApplicationStarted:"common:ApplicationStarted",ThemeChanged:"common:ThemeChanged",WindowClosing:"common:WindowClosing",WindowDidMove:"common:WindowDidMove",WindowDidResize:"common:WindowDidResize",WindowDPIChanged:"common:WindowDPIChanged",WindowFilesDropped:"common:WindowFilesDropped",WindowFocus:"common:WindowFocus",WindowFullscreen:"common:WindowFullscreen",WindowHide:"common:WindowHide",WindowLostFocus:"common:WindowLostFocus",WindowMaximise:"common:WindowMaximise",WindowMinimise:"common:WindowMinimise",WindowRestore:"common:WindowRestore",WindowRuntimeReady:"common:WindowRuntimeReady",WindowShow:"common:WindowShow",WindowUnFullscreen:"common:WindowUnFullscreen",WindowUnMaximise:"common:WindowUnMaximise",WindowUnMinimise:"common:WindowUnMinimise",WindowZoom:"common:WindowZoom",WindowZoomIn:"common:WindowZoomIn",WindowZoomOut:"common:WindowZoomOut",WindowZoomReset:"common:WindowZoomReset"})});window._wails=window._wails||{};window._wails.dispatchWailsEvent=Ln;var On=m(d.Events),Fn=0,M=class{constructor(e,i=null){this.name=e,this.data=i}};function Ln(n){let e=f.get(n.name);if(!e)return;let i=new M(n.name,n.data);"sender"in n&&(i.sender=n.sender),e=e.filter(o=>!o.dispatch(i)),e.length===0?f.delete(n.name):f.set(n.name,e)}function ne(n,e,i){let o=f.get(n)||[],t=new H(n,e,i);return o.push(t),f.set(n,o),()=>je(t)}function Un(n,e){return ne(n,e,-1)}function In(n,e){return ne(n,e,1)}function zn(...n){n.forEach(e=>f.delete(e))}function jn(){f.clear()}function ie(n){return On(Fn,n)}function He(){return new MouseEvent("mousedown").buttons===0}function Ne(){if(!EventTarget||!AbortSignal||!AbortController)return!1;let n=!0,e=new EventTarget,i=new AbortController;return e.addEventListener("test",()=>{n=!1},{signal:i.signal}),i.abort(),e.dispatchEvent(new CustomEvent("test")),n}var Ze=!1;document.addEventListener("DOMContentLoaded",()=>{Ze=!0});function Ve(n){Ze||document.readyState==="complete"?n():document.addEventListener("DOMContentLoaded",n)}var Bn=0,Hn=1,Nn=2,Zn=3,Vn=4,Kn=5,Gn=6,Yn=7,Xn=8,Jn=9,Qn=10,qn=11,_n=12,$n=13,ei=14,ni=15,ii=16,oi=17,ti=18,ri=19,si=20,ai=21,li=22,ci=23,di=24,mi=25,ui=26,wi=27,pi=28,fi=29,gi=30,hi=31,Wi=32,bi=33,yi=34,vi=35,Ci=36,Pi=37,Di=38,Mi=39,Si=40,Ti=41,xi=42,Ri=43,Ai=44,Ei=45,ki=46,Oi=47,r=Symbol("caller");r;var N=class N{constructor(e=""){this[r]=m(d.Window,e);for(let i of Object.getOwnPropertyNames(N.prototype))i!=="constructor"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this))}Get(e){return new N(e)}Position(){return this[r](Bn)}Center(){return this[r](Hn)}Close(){return this[r](Nn)}DisableSizeConstraints(){return this[r](Zn)}EnableSizeConstraints(){return this[r](Vn)}Focus(){return this[r](Kn)}ForceReload(){return this[r](Gn)}Fullscreen(){return this[r](Yn)}GetScreen(){return this[r](Xn)}GetZoom(){return this[r](Jn)}Height(){return this[r](Qn)}Hide(){return this[r](qn)}IsFocused(){return this[r](_n)}IsFullscreen(){return this[r]($n)}IsMaximised(){return this[r](ei)}IsMinimised(){return this[r](ni)}Maximise(){return this[r](ii)}Minimise(){return this[r](oi)}Name(){return this[r](ti)}OpenDevTools(){return this[r](ri)}RelativePosition(){return this[r](si)}Reload(){return this[r](ai)}Resizable(){return this[r](li)}Restore(){return this[r](ci)}SetPosition(e,i){return this[r](di,{x:e,y:i})}SetAlwaysOnTop(e){return this[r](mi,{alwaysOnTop:e})}SetBackgroundColour(e,i,o,t){return this[r](ui,{r:e,g:i,b:o,a:t})}SetFrameless(e){return this[r](wi,{frameless:e})}SetFullscreenButtonEnabled(e){return this[r](pi,{enabled:e})}SetMaxSize(e,i){return this[r](fi,{width:e,height:i})}SetMinSize(e,i){return this[r](gi,{width:e,height:i})}SetRelativePosition(e,i){return this[r](hi,{x:e,y:i})}SetResizable(e){return this[r](Wi,{resizable:e})}SetSize(e,i){return this[r](bi,{width:e,height:i})}SetTitle(e){return this[r](yi,{title:e})}SetZoom(e){return this[r](vi,{zoom:e})}Show(){return this[r](Ci)}Size(){return this[r](Pi)}ToggleFullscreen(){return this[r](Di)}ToggleMaximise(){return this[r](Mi)}UnFullscreen(){return this[r](Si)}UnMaximise(){return this[r](Ti)}UnMinimise(){return this[r](xi)}Width(){return this[r](Ri)}Zoom(){return this[r](Ai)}ZoomIn(){return this[r](Ei)}ZoomOut(){return this[r](ki)}ZoomReset(){return this[r](Oi)}},te=N,Fi=new te(""),Z=Fi;function Li(n,e=null){ie(new M(n,e))}function Ui(n,e){let i=Z.Get(n),o=i[e];if(typeof o=="function")try{o.call(i)}catch(t){}}function Ke(n){let e=n.currentTarget;function i(t="Yes"){if(t!=="Yes")return;let s=e.getAttribute("wml-event")||e.getAttribute("data-wml-event"),a=e.getAttribute("wml-target-window")||e.getAttribute("data-wml-target-window")||"",c=e.getAttribute("wml-window")||e.getAttribute("data-wml-window"),l=e.getAttribute("wml-openurl")||e.getAttribute("data-wml-openurl");s!==null&&Li(s),c!==null&&Ui(a,c),l!==null&&q(l)}let o=e.getAttribute("wml-confirm")||e.getAttribute("data-wml-confirm");o?$({Title:"Confirm",Message:o,Detached:!1,Buttons:[{Label:"Yes"},{Label:"No",IsDefault:!0}]}).then(i):i()}var I=Symbol("controller"),S=Symbol("triggerMap"),W=Symbol("elementCount");I;var re=class{constructor(){this[I]=new AbortController}set(e,i){return{signal:this[I].signal}}reset(){this[I].abort(),this[I]=new AbortController}};S,W;var se=class{constructor(){this[S]=new WeakMap,this[W]=0}set(e,i){return this[S].has(e)||this[W]++,this[S].set(e,i),{}}reset(){if(!(this[W]<=0)){for(let e of document.body.querySelectorAll("*")){if(this[W]<=0)break;let i=this[S].get(e);i!=null&&this[W]--;for(let o of i||[])e.removeEventListener(o,Ke)}this[S]=new WeakMap,this[W]=0}}},Ge=Ne()?new re:new se;function Ii(n){let e=/\S+/g,i=n.getAttribute("wml-trigger")||n.getAttribute("data-wml-trigger")||"click",o=[],t;for(;(t=e.exec(i))!==null;)o.push(t[0]);let s=Ge.set(n,o);for(let a of o)n.addEventListener(a,Ke,s)}function ae(){Ve(Ye)}function Ye(){Ge.reset(),document.body.querySelectorAll("[wml-event], [wml-window], [wml-openurl], [data-wml-event], [data-wml-window], [data-wml-openurl]").forEach(Ii)}window.wails=ce;ae();var ue={};w(ue,{Capabilities:()=>Hi,Environment:()=>Ni,IsAMD64:()=>Ki,IsARM:()=>Gi,IsARM64:()=>Yi,IsDarkMode:()=>Bi,IsDebug:()=>me,IsLinux:()=>Zi,IsMac:()=>Vi,IsWindows:()=>V,invoke:()=>b});var Xe=m(d.System),zi=0,ji=1,de=function(){var n,e,i,o,t;try{if((e=(n=window.chrome)==null?void 0:n.webview)!=null&&e.postMessage)return window.chrome.webview.postMessage.bind(window.chrome.webview);if((t=(o=(i=window.webkit)==null?void 0:i.messageHandlers)==null?void 0:o.external)!=null&&t.postMessage)return window.webkit.messageHandlers.external.postMessage.bind(window.webkit.messageHandlers.external)}catch(s){}return null}();function b(n){return de==null?void 0:de(n)}function Bi(){return Xe(zi)}function Hi(){return C(this,null,function*(){let n=yield fetch("/wails/capabilities");if(n.ok)return n.json();throw new Error("could not fetch capabilities: "+n.statusText)})}function Ni(){return Xe(ji)}function V(){return window._wails.environment.OS==="windows"}function Zi(){return window._wails.environment.OS==="linux"}function Vi(){return window._wails.environment.OS==="darwin"}function Ki(){return window._wails.environment.Arch==="amd64"}function Gi(){return window._wails.environment.Arch==="arm"}function Yi(){return window._wails.environment.Arch==="arm64"}function me(){return!!window._wails.environment.Debug}window.addEventListener("contextmenu",qi);var Xi=m(d.ContextMenu),Ji=0;function Qi(n,e,i,o){Xi(Ji,{id:n,x:e,y:i,data:o})}function qi(n){var o;let e;n.target instanceof HTMLElement?e=n.target:!(n.target instanceof HTMLElement)&&n.target instanceof Node?e=(o=n.target.parentElement)!=null?o:document.body:e=document.body;let i=window.getComputedStyle(e).getPropertyValue("--custom-contextmenu").trim();if(i){n.preventDefault();let t=window.getComputedStyle(e).getPropertyValue("--custom-contextmenu-data");Qi(i,n.clientX,n.clientY,t);return}_i(n)}function _i(n){var i;if(me())return;let e;switch(n.target instanceof HTMLElement?e=n.target:!(n.target instanceof HTMLElement)&&n.target instanceof Node?e=(i=n.target.parentElement)!=null?i:document.body:e=document.body,window.getComputedStyle(e).getPropertyValue("--default-contextmenu").trim()){case"show":return;case"hide":n.preventDefault();return;default:if(e.isContentEditable)return;let o=window.getSelection(),t=o&&o.toString().length>0;if(t)for(let s=0;s<o.rangeCount;s++){let c=o.getRangeAt(s).getClientRects();for(let l=0;l<c.length;l++){let u=c[l];if(document.elementFromPoint(u.left,u.top)===e)return}}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(t||!e.readOnly&&!e.disabled))return;n.preventDefault()}}var we={};w(we,{GetFlag:()=>z});function z(n){try{return window._wails.flags[n]}catch(e){throw new Error("Unable to retrieve flag '"+n+"': "+e,{cause:e})}}var j=!1,B=!1,he=!1,x=!1,R=!1,y="",Je="auto",T=0,pe=He();window._wails=window._wails||{};window._wails.setResizable=n=>{he=n,he||(x=R=!1,p())};window.addEventListener("mousedown",We,{capture:!0});window.addEventListener("mousemove",We,{capture:!0});window.addEventListener("mouseup",We,{capture:!0});for(let n of["click","contextmenu","dblclick"])window.addEventListener(n,$i,{capture:!0});function $i(n){(B||R)&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault())}var fe=0,eo=1,ge=2;function We(n){let e,i=n.buttons;switch(n.type){case"mousedown":e=fe,pe||(i=T|1<<n.button);break;case"mouseup":e=eo,pe||(i=T&~(1<<n.button));break;default:e=ge,pe||(i=T);break}let o=T&~i,t=i&~T;T=i,e===fe&&!(t&n.button)&&(o|=1<<n.button,t|=1<<n.button),(e!==ge&&R||B&&(e===fe||n.button!==0))&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault()),o&1&&io(n),t&1&&no(n),e===ge&&to(n)}function no(n){var o;if(j=!1,x=!1,!V()&&n.type==="mousedown"&&n.button===0&&n.detail!==1)return;if(y){x=!0;return}let e;n.target instanceof HTMLElement?e=n.target:!(n.target instanceof HTMLElement)&&n.target instanceof Node?e=(o=n.target.parentElement)!=null?o:document.body:e=document.body;let i=window.getComputedStyle(e);j=i.getPropertyValue("--wails-draggable").trim()==="drag"&&n.offsetX-parseFloat(i.paddingLeft)<e.clientWidth&&n.offsetY-parseFloat(i.paddingTop)<e.clientHeight}function io(n){j=!1,B=!1,x=!1,R=!1}var oo=Object.freeze({"se-resize":"nwse-resize","sw-resize":"nesw-resize","nw-resize":"nwse-resize","ne-resize":"nesw-resize","w-resize":"ew-resize","n-resize":"ns-resize","s-resize":"ns-resize","e-resize":"ew-resize"});function p(n){n?(y||(Je=document.body.style.cursor),document.body.style.cursor=oo[n]):!n&&y&&(document.body.style.cursor=Je),y=n||""}function to(n){if(x&&y?(R=!0,b("wails:resize:"+y)):j&&(B=!0,b("wails:drag")),B||R){j=x=!1;return}if(!he||!V()){y&&p();return}let e=z("system.resizeHandleHeight")||5,i=z("system.resizeHandleWidth")||5,o=z("resizeCornerExtra")||10,t=window.outerWidth-n.clientX<i,s=n.clientX<i,a=n.clientY<e,c=window.outerHeight-n.clientY<e,l=window.outerWidth-n.clientX<i+o,u=n.clientX<i+o,J=n.clientY<e+o,Q=window.outerHeight-n.clientY<e+o;!u&&!J&&!Q&&!l?p():l&&Q?p("se-resize"):u&&Q?p("sw-resize"):u&&J?p("nw-resize"):J&&l?p("ne-resize"):s?p("w-resize"):a?p("n-resize"):c?p("s-resize"):t?p("e-resize"):p()}var ye={};w(ye,{Hide:()=>lo,Quit:()=>mo,Show:()=>co});var be=m(d.Application),ro=0,so=1,ao=2;function lo(){return be(ro)}function co(){return be(so)}function mo(){return be(ao)}var xe={};w(xe,{ByID:()=>Oo,ByName:()=>ko,Call:()=>Te,RuntimeError:()=>X});var qe=Function.prototype.toString,A=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ve,K;if(typeof A=="function"&&typeof Object.defineProperty=="function")try{ve=Object.defineProperty({},"length",{get:function(){throw K}}),K={},A(function(){throw 42},null,ve)}catch(n){n!==K&&(A=null)}else A=null;var uo=/^\s*class\b/,Pe=function(e){try{var i=qe.call(e);return uo.test(i)}catch(o){return!1}},Ce=function(e){try{return Pe(e)?!1:(qe.call(e),!0)}catch(i){return!1}},G=Object.prototype.toString,wo="[object Object]",po="[object Function]",fo="[object GeneratorFunction]",go="[object HTMLAllCollection]",ho="[object HTML document.all class]",Wo="[object HTMLCollection]",bo=typeof Symbol=="function"&&!!Symbol.toStringTag,yo=!(0 in[,]),De=function(){return!1};typeof document=="object"&&(Qe=document.all,G.call(Qe)===G.call(document.all)&&(De=function(e){if((yo||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var i=G.call(e);return(i===go||i===ho||i===Wo||i===wo)&&e("")==null}catch(o){}return!1}));var Qe;function vo(n){if(De(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{A(n,null,ve)}catch(e){if(e!==K)return!1}return!Pe(n)&&Ce(n)}function Co(n){if(De(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(bo)return Ce(n);if(Pe(n))return!1;var e=G.call(n);return e!==po&&e!==fo&&!/^\[object HTML/.test(e)?!1:Ce(n)}var h=A?vo:Co;var k=class extends Error{constructor(e,i){super(e,i),this.name="CancelError"}},O=class extends Error{constructor(e,i,o){super((o!=null?o:"Unhandled rejection in cancelled promise.")+" Reason: "+Po(i),{cause:i}),this.promise=e,this.name="CancelledRejectionError"}},g=Symbol("barrier"),Me=Symbol("cancelImpl"),nn,_e=(nn=Symbol.species)!=null?nn:Symbol("speciesPolyfill"),F=class n extends Promise{constructor(e,i){let o,t;if(super((l,u)=>{o=l,t=u}),this.constructor[_e]!==Promise)throw new TypeError("CancellablePromise does not support transparent subclassing. Please refrain from overriding the [Symbol.species] static property.");let s={promise:this,resolve:o,reject:t,get oncancelled(){return i!=null?i:null},set oncancelled(l){i=l!=null?l:void 0}},a={get root(){return a},resolving:!1,settled:!1};Object.defineProperties(this,{[g]:{configurable:!1,enumerable:!1,writable:!0,value:null},[Me]:{configurable:!1,enumerable:!1,writable:!1,value:on(s,a)}});let c=rn(s,a);try{e(tn(s,a),c)}catch(l){a.resolving||c(l)}}cancel(e){return new n(i=>{Promise.allSettled([this[Me](new k("Promise cancelled.",{cause:e})),Do(this)]).then(()=>i(),()=>i())})}cancelOn(e){return e.aborted?this.cancel(e.reason):e.addEventListener("abort",()=>void this.cancel(e.reason),{capture:!0}),this}then(e,i,o){if(!(this instanceof n))throw new TypeError("CancellablePromise.prototype.then called on an invalid object.");if(h(e)||(e=$e),h(i)||(i=en),e===$e&&i==en)return new n(s=>s(this));let t={};return this[g]=t,new n((s,a)=>{Se.call(this,c=>{var l;this[g]===t&&(this[g]=null),(l=t.resolve)==null||l.call(t);try{s(e(c))}catch(u){a(u)}},c=>{var l;this[g]===t&&(this[g]=null),(l=t.resolve)==null||l.call(t);try{s(i(c))}catch(u){a(u)}})},s=>C(this,null,function*(){try{return o==null?void 0:o(s)}finally{yield this.cancel(s)}}))}catch(e,i){return this.then(void 0,e,i)}finally(e,i){if(!(this instanceof n))throw new TypeError("CancellablePromise.prototype.finally called on an invalid object.");return h(e)?this.then(o=>n.resolve(e()).then(()=>o),o=>n.resolve(e()).then(()=>{throw o}),i):this.then(e,e,i)}static get[(g,Me,_e)](){return Promise}static all(e){let i=Array.from(e);return i.length===0?n.resolve(i):new n((o,t)=>{Promise.all(i).then(o,t)},Y(i))}static allSettled(e){let i=Array.from(e);return i.length===0?n.resolve(i):new n((o,t)=>{Promise.allSettled(i).then(o,t)},Y(i))}static any(e){let i=Array.from(e);return i.length===0?n.resolve(i):new n((o,t)=>{Promise.any(i).then(o,t)},Y(i))}static race(e){let i=Array.from(e);return new n((o,t)=>{Promise.race(i).then(o,t)},Y(i))}static cancel(e){let i=new n(()=>{});return i.cancel(e),i}static timeout(e,i){let o=new n(()=>{});return AbortSignal&&typeof AbortSignal=="function"&&AbortSignal.timeout&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(e).addEventListener("abort",()=>void o.cancel(i)):setTimeout(()=>void o.cancel(i),e),o}static sleep(e,i){return new n(o=>{setTimeout(()=>o(i),e)})}static reject(e){return new n((i,o)=>o(e))}static resolve(e){return e instanceof n?e:new n(i=>i(e))}static withResolvers(){let e={oncancelled:null};return e.promise=new n((i,o)=>{e.resolve=i,e.reject=o},i=>{var o;(o=e.oncancelled)==null||o.call(e,i)}),e}};function on(n,e){let i;return o=>{if(e.settled||(e.settled=!0,e.reason=o,n.reject(o),Se.call(n.promise,void 0,t=>{if(t!==o)throw t})),!(!e.reason||!n.oncancelled))return i=new Promise(t=>{try{t(n.oncancelled(e.reason.cause))}catch(s){Promise.reject(new O(n.promise,s,"Unhandled exception in oncancelled callback."))}}),i.then(void 0,t=>{throw new O(n.promise,t,"Unhandled rejection in oncancelled callback.")}),n.oncancelled=null,i}}function tn(n,e){return i=>{if(!e.resolving){if(e.resolving=!0,i===n.promise){if(e.settled)return;e.settled=!0,n.reject(new TypeError("A promise cannot be resolved with itself."));return}if(i!=null&&(typeof i=="object"||typeof i=="function")){let o;try{o=i.then}catch(t){e.settled=!0,n.reject(t);return}if(h(o)){try{let a=i.cancel;if(h(a)){let c=l=>{Reflect.apply(a,i,[l])};e.reason?on(Ie(Ue({},n),{oncancelled:c}),e)(e.reason):n.oncancelled=c}}catch(a){}let t={root:e.root,resolving:!1,get settled(){return this.root.settled},set settled(a){this.root.settled=a},get reason(){return this.root.reason}},s=rn(n,t);try{Reflect.apply(o,i,[tn(n,t),s])}catch(a){s(a)}return}}e.settled||(e.settled=!0,n.resolve(i))}}}function rn(n,e){return i=>{if(!e.resolving)if(e.resolving=!0,e.settled){try{if(i instanceof k&&e.reason instanceof k&&Object.is(i.cause,e.reason.cause))return}catch(o){}Promise.reject(new O(n.promise,i))}else e.settled=!0,n.reject(i)}}function Y(n){return e=>{for(let i of n)try{if(h(i.then)){let o=i.cancel;h(o)&&Reflect.apply(o,i,[e])}}catch(o){}}}function $e(n){return n}function en(n){throw n}function Po(n){try{if(n instanceof Error||typeof n!="object"||n.toString!==Object.prototype.toString)return""+n}catch(e){}try{return JSON.stringify(n)}catch(e){}try{return Object.prototype.toString.call(n)}catch(e){}return"<could not convert error to string>"}function Do(n){var i;let e=(i=n[g])!=null?i:{};return"promise"in e||Object.assign(e,E()),n[g]==null&&(e.resolve(),n[g]=e),e.promise}var Se=Promise.prototype.then;Promise.prototype.then=function(...n){return this instanceof F?this.then(...n):Reflect.apply(Se,this,n)};var E=Promise.withResolvers;E&&typeof E=="function"?E=E.bind(Promise):E=function(){let n,e;return{promise:new Promise((o,t)=>{n=o,e=t}),resolve:n,reject:e}};window._wails=window._wails||{};window._wails.callResultHandler=Ro;window._wails.callErrorHandler=Ao;var Mo=m(d.Call),So=m(d.CancelCall),L=new Map,To=0,xo=0,X=class extends Error{constructor(e,i){super(e,i),this.name="RuntimeError"}};function Ro(n,e,i){let o=sn(n);if(o)if(!e)o.resolve(void 0);else if(!i)o.resolve(e);else try{o.resolve(JSON.parse(e))}catch(t){o.reject(new TypeError("could not parse result: "+t.message,{cause:t}))}}function Ao(n,e,i){let o=sn(n);if(o)if(!i)o.reject(new Error(e));else{let t;try{t=JSON.parse(e)}catch(c){o.reject(new TypeError("could not parse error: "+c.message,{cause:c}));return}let s={};t.cause&&(s.cause=t.cause);let a;switch(t.kind){case"ReferenceError":a=new ReferenceError(t.message,s);break;case"TypeError":a=new TypeError(t.message,s);break;case"RuntimeError":a=new X(t.message,s);break;default:a=new Error(t.message,s);break}o.reject(a)}}function sn(n){let e=L.get(n);return L.delete(n),e}function Eo(){let n;do n=P();while(L.has(n));return n}function Te(n){let e=Eo(),i=F.withResolvers();L.set(e,{resolve:i.resolve,reject:i.reject});let o=Mo(To,Object.assign({"call-id":e},n)),t=!1;o.then(()=>{t=!0},a=>{L.delete(e),i.reject(a)});let s=()=>(L.delete(e),So(xo,{"call-id":e}).catch(a=>{}));return i.oncancelled=()=>t?s():o.then(s),i.promise}function ko(n,...e){return Te({methodName:n,args:e})}function Oo(n,...e){return Te({methodID:n,args:e})}var Re={};w(Re,{SetText:()=>Uo,Text:()=>Io});var an=m(d.Clipboard),Fo=0,Lo=1;function Uo(n){return an(Fo,{text:n})}function Io(){return an(Lo)}var Ae={};w(Ae,{Any:()=>v,Array:()=>jo,ByteSlice:()=>zo,Map:()=>Bo,Nullable:()=>Ho,Struct:()=>No});function v(n){return n}function zo(n){return n==null?"":n}function jo(n){return n===v?e=>e===null?[]:e:e=>{if(e===null)return[];for(let i=0;i<e.length;i++)e[i]=n(e[i]);return e}}function Bo(n,e){return e===v?i=>i===null?{}:i:i=>{if(i===null)return{};for(let o in i)i[o]=e(i[o]);return i}}function Ho(n){return n===v?v:e=>e===null?null:n(e)}function No(n){let e=!0;for(let i in n)if(n[i]!==v){e=!1;break}return e?v:i=>{for(let o in n)o in i&&(i[o]=n[o](i[o]));return i}}var ke={};w(ke,{GetAll:()=>Go,GetCurrent:()=>Xo,GetPrimary:()=>Yo});var Ee=m(d.Screens),Zo=0,Vo=1,Ko=2;function Go(){return Ee(Zo)}function Yo(){return Ee(Vo)}function Xo(){return Ee(Ko)}window._wails=window._wails||{};window._wails.invoke=b;b("wails:runtime:ready");export{ye as Application,_ as Browser,xe as Call,k as CancelError,F as CancellablePromise,O as CancelledRejectionError,Re as Clipboard,Ae as Create,ee as Dialogs,oe as Events,we as Flags,ke as Screens,ue as System,le as WML,Z as Window};