diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 00000000000..5aa69189f42 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[env] +__TAURI_WORKSPACE__ = "true" diff --git a/.changes/custom-buttons-api.md b/.changes/custom-buttons-api.md new file mode 100644 index 00000000000..15c9058ac7b --- /dev/null +++ b/.changes/custom-buttons-api.md @@ -0,0 +1,5 @@ +--- +"api": minor +--- + +Allow setting the text of the dialog buttons. diff --git a/.changes/custom-buttons.md b/.changes/custom-buttons.md new file mode 100644 index 00000000000..81b4dfd3e05 --- /dev/null +++ b/.changes/custom-buttons.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +Added `OkWithLabel` and `OkCancelWithLabels` variants to the `api::dialog::MessageDialogButtons` enum to set the text of the dialog buttons. diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index d6ed266532a..02f56e655dc 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -87,7 +87,7 @@ ico = { version = "0.2.0", optional = true } encoding_rs = "0.8.31" [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] -rfd = { version = "0.10", optional = true } +rfd = { version = "0.10", optional = true, features=["gtk3", "common-controls-v6"] } notify-rust = { version = "4.5", default-features = false, features = [ "d" ], optional = true } [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] diff --git a/core/tauri/Windows Manifest.xml b/core/tauri/Windows Manifest.xml new file mode 100644 index 00000000000..9340ebc6759 --- /dev/null +++ b/core/tauri/Windows Manifest.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/core/tauri/build.rs b/core/tauri/build.rs index 0b5f471c6b0..cf57fc20f82 100644 --- a/core/tauri/build.rs +++ b/core/tauri/build.rs @@ -141,6 +141,18 @@ fn main() { CHECKED_FEATURES.get().unwrap().lock().unwrap().join(","), ) .expect("failed to write checked_features file"); + + // workaround needed to preven `STATUS_ENTRYPOINT_NOT_FOUND` error + // see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864 + let target_os = std::env::var("CARGO_CFG_TARGET_OS"); + let target_env = std::env::var("CARGO_CFG_TARGET_ENV"); + let is_tauri_workspace = std::env::var("__TAURI_WORKSPACE__").map_or(false, |v| v == "true"); + if is_tauri_workspace + && Ok("windows") == target_os.as_deref() + && Ok("msvc") == target_env.as_deref() + { + add_manifest(); + } } // create aliases for the given module with its apis. @@ -170,3 +182,20 @@ fn alias_module(module: &str, apis: &[&str], api_all: bool) { alias(&format!("{}_any", AsSnakeCase(module)), any); } + +fn add_manifest() { + static WINDOWS_MANIFEST_FILE: &str = "Windows Manifest.xml"; + + let mut manifest = std::env::current_dir().unwrap(); + manifest.push(WINDOWS_MANIFEST_FILE); + + println!("cargo:rerun-if-changed={}", WINDOWS_MANIFEST_FILE); + // Embed the Windows application manifest file. + println!("cargo:rustc-link-arg=/MANIFEST:EMBED"); + println!( + "cargo:rustc-link-arg=/MANIFESTINPUT:{}", + manifest.to_str().unwrap() + ); + // Turn linker warnings into errors. + println!("cargo:rustc-link-arg=/WX"); +} diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index 9619b01dafe..b459e56550a 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1,8 +1,8 @@ -"use strict";var __TAURI_IIFE__=(()=>{var R=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)R(t,n,{get:e[n],enumerable:!0})},ge=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!pe.call(t,s)&&s!==n&&R(t,s,{get:()=>e[s],enumerable:!(r=ce(e,s))||r.enumerable});return t};var he=t=>ge(R({},"__esModule",{value:!0}),t);var Jt={};d(Jt,{app:()=>k,cli:()=>U,clipboard:()=>I,dialog:()=>z,event:()=>V,fs:()=>j,globalShortcut:()=>q,http:()=>$,invoke:()=>$t,notification:()=>J,os:()=>ne,path:()=>K,process:()=>Q,shell:()=>Z,tauri:()=>L,updater:()=>X,window:()=>te});var k={};d(k,{getName:()=>be,getTauriVersion:()=>Pe,getVersion:()=>_e,hide:()=>ve,show:()=>we});var L={};d(L,{convertFileSrc:()=>fe,invoke:()=>f,transformCallback:()=>c});function ye(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function c(t,e=!1){let n=ye(),r=`_${n}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),t?.(s)),writable:!1,configurable:!0}),n}async function f(t,e={}){return new Promise((n,r)=>{let s=c(l=>{n(l),Reflect.deleteProperty(window,`_${a}`)},!0),a=c(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:t,callback:s,error:a,...e})})}function fe(t,e="asset"){let n=encodeURIComponent(t);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${n}`:`${e}://localhost/${n}`}async function i(t){return f("tauri",t)}async function _e(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function be(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Pe(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function we(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function ve(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var U={};d(U,{getMatches:()=>Me});async function Me(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var I={};d(I,{readText:()=>Oe,writeText:()=>Te});async function Te(t){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})}async function Oe(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var z={};d(z,{ask:()=>Ce,confirm:()=>De,message:()=>Ae,open:()=>Fe,save:()=>Ee});async function Fe(t={}){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})}async function Ee(t={}){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})}async function Ae(t,e){let n=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:n?.title?.toString(),type:n?.type}})}async function Ce(t,e){let n=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:n?.title?.toString(),type:n?.type}})}async function De(t,e){let n=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:n?.title?.toString(),type:n?.type}})}var V={};d(V,{TauriEvent:()=>M,emit:()=>T,listen:()=>N,once:()=>H});async function ie(t,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:e}})}async function w(t,e,n){await i({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})}async function _(t,e,n){return i({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:e,handler:c(n)}}).then(r=>async()=>ie(t,r))}async function v(t,e,n){return _(t,e,r=>{n(r),ie(t,r.id).catch(()=>{})})}var M=(u=>(u.WINDOW_RESIZED="tauri://resize",u.WINDOW_MOVED="tauri://move",u.WINDOW_CLOSE_REQUESTED="tauri://close-requested",u.WINDOW_CREATED="tauri://window-created",u.WINDOW_DESTROYED="tauri://destroyed",u.WINDOW_FOCUS="tauri://focus",u.WINDOW_BLUR="tauri://blur",u.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",u.WINDOW_THEME_CHANGED="tauri://theme-changed",u.WINDOW_FILE_DROP="tauri://file-drop",u.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",u.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",u.MENU="tauri://menu",u.CHECK_UPDATE="tauri://update",u.UPDATE_AVAILABLE="tauri://update-available",u.INSTALL_UPDATE="tauri://update-install",u.STATUS_UPDATE="tauri://update-status",u.DOWNLOAD_PROGRESS="tauri://update-download-progress",u))(M||{});async function N(t,e){return _(t,null,e)}async function H(t,e){return v(t,null,e)}async function T(t,e){return w(t,void 0,e)}var j={};d(j,{BaseDirectory:()=>O,Dir:()=>O,copyFile:()=>ze,createDir:()=>Ue,exists:()=>Ve,readBinaryFile:()=>xe,readDir:()=>ke,readTextFile:()=>Se,removeDir:()=>Ie,removeFile:()=>Ne,renameFile:()=>He,writeBinaryFile:()=>Le,writeFile:()=>Re,writeTextFile:()=>Re});var O=(o=>(o[o.Audio=1]="Audio",o[o.Cache=2]="Cache",o[o.Config=3]="Config",o[o.Data=4]="Data",o[o.LocalData=5]="LocalData",o[o.Desktop=6]="Desktop",o[o.Document=7]="Document",o[o.Download=8]="Download",o[o.Executable=9]="Executable",o[o.Font=10]="Font",o[o.Home=11]="Home",o[o.Picture=12]="Picture",o[o.Public=13]="Public",o[o.Runtime=14]="Runtime",o[o.Template=15]="Template",o[o.Video=16]="Video",o[o.Resource=17]="Resource",o[o.App=18]="App",o[o.Log=19]="Log",o[o.Temp=20]="Temp",o[o.AppConfig=21]="AppConfig",o[o.AppData=22]="AppData",o[o.AppLocalData=23]="AppLocalData",o[o.AppCache=24]="AppCache",o[o.AppLog=25]="AppLog",o))(O||{});async function Se(t,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})}async function xe(t,e={}){let n=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}});return Uint8Array.from(n)}async function Re(t,e,n){typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t);let r={path:"",contents:""},s=n;return typeof t=="string"?r.path=t:(r.path=t.path,r.contents=t.contents),typeof e=="string"?r.contents=e??"":s=e,i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(new TextEncoder().encode(r.contents)),options:s}})}async function Le(t,e,n){typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t);let r={path:"",contents:[]},s=n;return typeof t=="string"?r.path=t:(r.path=t.path,r.contents=t.contents),e&&"dir"in e?s=e:typeof t=="string"&&(r.contents=e??[]),i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(r.contents instanceof ArrayBuffer?new Uint8Array(r.contents):r.contents),options:s}})}async function ke(t,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})}async function Ue(t,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})}async function Ie(t,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})}async function ze(t,e,n={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})}async function Ne(t,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})}async function He(t,e,n={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})}async function Ve(t,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:e}})}var q={};d(q,{isRegistered:()=>Ge,register:()=>je,registerAll:()=>qe,unregister:()=>$e,unregisterAll:()=>Je});async function je(t,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:c(e)}})}async function qe(t,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:c(e)}})}async function Ge(t){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})}async function $e(t){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})}async function Je(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var $={};d($,{Body:()=>p,Client:()=>E,Response:()=>F,ResponseType:()=>re,fetch:()=>Ke,getClient:()=>se});var re=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(re||{}),p=class{constructor(e,n){this.type=e,this.payload=n}static form(e){let n={},r=(s,a)=>{if(a!==null){let l;typeof a=="string"?l=a:a instanceof Uint8Array||Array.isArray(a)?l=Array.from(a):a instanceof File?l={file:a.name,mime:a.type,fileName:a.name}:typeof a.file=="string"?l={file:a.file,mime:a.mime,fileName:a.fileName}:l={file:Array.from(a.file),mime:a.mime,fileName:a.fileName},n[String(s)]=l}};if(e instanceof FormData)for(let[s,a]of e)r(s,a);else for(let[s,a]of Object.entries(e))r(s,a);return new p("Form",n)}static json(e){return new p("Json",e)}static text(e){return new p("Text",e)}static bytes(e){return new p("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},F=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},E=class{constructor(e){this.id=e}async drop(){return i({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let n=!e.responseType||e.responseType===1;return n&&(e.responseType=2),i({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(r=>{let s=new F(r);if(n){try{s.data=JSON.parse(s.data)}catch(a){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${a}; - try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return s}return s})}async get(e,n){return this.request({method:"GET",url:e,...n})}async post(e,n,r){return this.request({method:"POST",url:e,body:n,...r})}async put(e,n,r){return this.request({method:"PUT",url:e,body:n,...r})}async patch(e,n){return this.request({method:"PATCH",url:e,...n})}async delete(e,n){return this.request({method:"DELETE",url:e,...n})}};async function se(t){return i({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(e=>new E(e))}var G=null;async function Ke(t,e){return G===null&&(G=await se()),G.request({url:t,method:e?.method??"GET",...e})}var J={};d(J,{isPermissionGranted:()=>Qe,requestPermission:()=>Ze,sendNotification:()=>Ye});async function Qe(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):i({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Ze(){return window.Notification.requestPermission()}function Ye(t){typeof t=="string"?new window.Notification(t):new window.Notification(t.title,t)}var K={};d(K,{BaseDirectory:()=>O,appCacheDir:()=>tt,appConfigDir:()=>ae,appDataDir:()=>Be,appDir:()=>Xe,appLocalDataDir:()=>et,appLogDir:()=>oe,audioDir:()=>nt,basename:()=>At,cacheDir:()=>it,configDir:()=>rt,dataDir:()=>st,delimiter:()=>vt,desktopDir:()=>at,dirname:()=>Ft,documentDir:()=>ot,downloadDir:()=>lt,executableDir:()=>ut,extname:()=>Et,fontDir:()=>dt,homeDir:()=>ct,isAbsolute:()=>Ct,join:()=>Ot,localDataDir:()=>mt,logDir:()=>Pt,normalize:()=>Tt,pictureDir:()=>pt,publicDir:()=>gt,resolve:()=>Mt,resolveResource:()=>yt,resourceDir:()=>ht,runtimeDir:()=>ft,sep:()=>wt,templateDir:()=>_t,videoDir:()=>bt});function b(){return navigator.appVersion.includes("Win")}async function Xe(){return ae()}async function ae(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function Be(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function et(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function tt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function nt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function it(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function rt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function st(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function at(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function lt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function ut(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function dt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function ct(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function mt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function gt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function ht(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function yt(t){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:17}})}async function ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function _t(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function bt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Pt(){return oe()}async function oe(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var wt=b()?"\\":"/",vt=b()?";":":";async function Mt(...t){return i({__tauriModule:"Path",message:{cmd:"resolve",paths:t}})}async function Tt(t){return i({__tauriModule:"Path",message:{cmd:"normalize",path:t}})}async function Ot(...t){return i({__tauriModule:"Path",message:{cmd:"join",paths:t}})}async function Ft(t){return i({__tauriModule:"Path",message:{cmd:"dirname",path:t}})}async function Et(t){return i({__tauriModule:"Path",message:{cmd:"extname",path:t}})}async function At(t,e){return i({__tauriModule:"Path",message:{cmd:"basename",path:t,ext:e}})}async function Ct(t){return i({__tauriModule:"Path",message:{cmd:"isAbsolute",path:t}})}var Q={};d(Q,{exit:()=>Dt,relaunch:()=>Wt});async function Dt(t=0){return i({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})}async function Wt(){return i({__tauriModule:"Process",message:{cmd:"relaunch"}})}var Z={};d(Z,{Child:()=>A,Command:()=>P,EventEmitter:()=>g,open:()=>xt});async function St(t,e,n=[],r){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:n,options:r,onEventFn:c(t)}})}var g=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,n){return this.on(e,n)}removeListener(e,n){return this.off(e,n)}on(e,n){return e in this.eventListeners?this.eventListeners[e].push(n):this.eventListeners[e]=[n],this}once(e,n){let r=(...s)=>{this.removeListener(e,r),n(...s)};return this.addListener(e,r)}off(e,n){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(r=>r!==n)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...n){if(e in this.eventListeners){let r=this.eventListeners[e];for(let s of r)s(...n);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,n){return e in this.eventListeners?this.eventListeners[e].unshift(n):this.eventListeners[e]=[n],this}prependOnceListener(e,n){let r=(...s)=>{this.removeListener(e,r),n(...s)};return this.prependListener(e,r)}},A=class{constructor(e){this.pid=e}async write(e){return i({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return i({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},P=class extends g{constructor(n,r=[],s){super();this.stdout=new g;this.stderr=new g;this.program=n,this.args=typeof r=="string"?[r]:r,this.options=s??{}}static sidecar(n,r=[],s){let a=new P(n,r,s);return a.options.sidecar=!0,a}async spawn(){return St(n=>{switch(n.event){case"Error":this.emit("error",n.payload);break;case"Terminated":this.emit("close",n.payload);break;case"Stdout":this.stdout.emit("data",n.payload);break;case"Stderr":this.stderr.emit("data",n.payload);break}},this.program,this.args,this.options).then(n=>new A(n))}async execute(){return new Promise((n,r)=>{this.on("error",r);let s=[],a=[];this.stdout.on("data",l=>{s.push(l)}),this.stderr.on("data",l=>{a.push(l)}),this.on("close",l=>{n({code:l.code,signal:l.signal,stdout:s.join(` +"use strict";var __TAURI_IIFE__=(()=>{var L=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},ge=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!pe.call(n,s)&&s!==t&&L(n,s,{get:()=>e[s],enumerable:!(r=de(e,s))||r.enumerable});return n};var he=n=>ge(L({},"__esModule",{value:!0}),n);var Jt={};c(Jt,{app:()=>k,cli:()=>U,clipboard:()=>I,dialog:()=>z,event:()=>V,fs:()=>j,globalShortcut:()=>q,http:()=>$,invoke:()=>$t,notification:()=>J,os:()=>ne,path:()=>K,process:()=>Q,shell:()=>Y,tauri:()=>R,updater:()=>X,window:()=>te});var k={};c(k,{getName:()=>_e,getTauriVersion:()=>Pe,getVersion:()=>be,hide:()=>ve,show:()=>we});var R={};c(R,{convertFileSrc:()=>fe,invoke:()=>f,transformCallback:()=>d});function ye(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function d(n,e=!1){let t=ye(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n?.(s)),writable:!1,configurable:!0}),t}async function f(n,e={}){return new Promise((t,r)=>{let s=d(l=>{t(l),Reflect.deleteProperty(window,`_${a}`)},!0),a=d(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:n,callback:s,error:a,...e})})}function fe(n,e="asset"){let t=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${t}`:`${e}://localhost/${t}`}async function i(n){return f("tauri",n)}async function be(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function _e(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Pe(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function we(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function ve(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var U={};c(U,{getMatches:()=>Me});async function Me(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var I={};c(I,{readText:()=>Oe,writeText:()=>Te});async function Te(n){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:n}})}async function Oe(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var z={};c(z,{ask:()=>Ae,confirm:()=>De,message:()=>Ce,open:()=>Fe,save:()=>Ee});async function Fe(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:n}})}async function Ee(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:n}})}async function Ce(n,e){let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:n.toString(),title:t?.title?.toString(),type:t?.type,buttonLabel:t?.okLabel?.toString()}})}async function Ae(n,e){let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:n.toString(),title:t?.title?.toString(),type:t?.type,buttonLabels:[t?.okLabel?.toString()??"Yes",t?.cancelLabel?.toString()??"No"]}})}async function De(n,e){let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:n.toString(),title:t?.title?.toString(),type:t?.type,buttonLabels:[t?.okLabel?.toString()??"Ok",t?.cancelLabel?.toString()??"Cancel"]}})}var V={};c(V,{TauriEvent:()=>M,emit:()=>T,listen:()=>N,once:()=>H});async function ie(n,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:e}})}async function w(n,e,t){await i({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:e,payload:t}})}async function b(n,e,t){return i({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:e,handler:d(t)}}).then(r=>async()=>ie(n,r))}async function v(n,e,t){return b(n,e,r=>{t(r),ie(n,r.id).catch(()=>{})})}var M=(u=>(u.WINDOW_RESIZED="tauri://resize",u.WINDOW_MOVED="tauri://move",u.WINDOW_CLOSE_REQUESTED="tauri://close-requested",u.WINDOW_CREATED="tauri://window-created",u.WINDOW_DESTROYED="tauri://destroyed",u.WINDOW_FOCUS="tauri://focus",u.WINDOW_BLUR="tauri://blur",u.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",u.WINDOW_THEME_CHANGED="tauri://theme-changed",u.WINDOW_FILE_DROP="tauri://file-drop",u.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",u.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",u.MENU="tauri://menu",u.CHECK_UPDATE="tauri://update",u.UPDATE_AVAILABLE="tauri://update-available",u.INSTALL_UPDATE="tauri://update-install",u.STATUS_UPDATE="tauri://update-status",u.DOWNLOAD_PROGRESS="tauri://update-download-progress",u))(M||{});async function N(n,e){return b(n,null,e)}async function H(n,e){return v(n,null,e)}async function T(n,e){return w(n,void 0,e)}var j={};c(j,{BaseDirectory:()=>O,Dir:()=>O,copyFile:()=>ze,createDir:()=>Ue,exists:()=>Ve,readBinaryFile:()=>xe,readDir:()=>ke,readTextFile:()=>We,removeDir:()=>Ie,removeFile:()=>Ne,renameFile:()=>He,writeBinaryFile:()=>Re,writeFile:()=>Le,writeTextFile:()=>Le});var O=(o=>(o[o.Audio=1]="Audio",o[o.Cache=2]="Cache",o[o.Config=3]="Config",o[o.Data=4]="Data",o[o.LocalData=5]="LocalData",o[o.Desktop=6]="Desktop",o[o.Document=7]="Document",o[o.Download=8]="Download",o[o.Executable=9]="Executable",o[o.Font=10]="Font",o[o.Home=11]="Home",o[o.Picture=12]="Picture",o[o.Public=13]="Public",o[o.Runtime=14]="Runtime",o[o.Template=15]="Template",o[o.Video=16]="Video",o[o.Resource=17]="Resource",o[o.App=18]="App",o[o.Log=19]="Log",o[o.Temp=20]="Temp",o[o.AppConfig=21]="AppConfig",o[o.AppData=22]="AppData",o[o.AppLocalData=23]="AppLocalData",o[o.AppCache=24]="AppCache",o[o.AppLog=25]="AppLog",o))(O||{});async function We(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:n,options:e}})}async function xe(n,e={}){let t=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:n,options:e}});return Uint8Array.from(t)}async function Le(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:""},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),typeof e=="string"?r.contents=e??"":s=e,i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(new TextEncoder().encode(r.contents)),options:s}})}async function Re(n,e,t){typeof t=="object"&&Object.freeze(t),typeof n=="object"&&Object.freeze(n);let r={path:"",contents:[]},s=t;return typeof n=="string"?r.path=n:(r.path=n.path,r.contents=n.contents),e&&"dir"in e?s=e:typeof n=="string"&&(r.contents=e??[]),i({__tauriModule:"Fs",message:{cmd:"writeFile",path:r.path,contents:Array.from(r.contents instanceof ArrayBuffer?new Uint8Array(r.contents):r.contents),options:s}})}async function ke(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:n,options:e}})}async function Ue(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:n,options:e}})}async function Ie(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:n,options:e}})}async function ze(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:n,destination:e,options:t}})}async function Ne(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:n,options:e}})}async function He(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:n,newPath:e,options:t}})}async function Ve(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:n,options:e}})}var q={};c(q,{isRegistered:()=>Ge,register:()=>je,registerAll:()=>qe,unregister:()=>$e,unregisterAll:()=>Je});async function je(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:n,handler:d(e)}})}async function qe(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:n,handler:d(e)}})}async function Ge(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:n}})}async function $e(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:n}})}async function Je(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var $={};c($,{Body:()=>p,Client:()=>E,Response:()=>F,ResponseType:()=>re,fetch:()=>Ke,getClient:()=>se});var re=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(re||{}),p=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},r=(s,a)=>{if(a!==null){let l;typeof a=="string"?l=a:a instanceof Uint8Array||Array.isArray(a)?l=Array.from(a):a instanceof File?l={file:a.name,mime:a.type,fileName:a.name}:typeof a.file=="string"?l={file:a.file,mime:a.mime,fileName:a.fileName}:l={file:Array.from(a.file),mime:a.mime,fileName:a.fileName},t[String(s)]=l}};if(e instanceof FormData)for(let[s,a]of e)r(s,a);else for(let[s,a]of Object.entries(e))r(s,a);return new p("Form",t)}static json(e){return new p("Json",e)}static text(e){return new p("Text",e)}static bytes(e){return new p("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},F=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},E=class{constructor(e){this.id=e}async drop(){return i({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),i({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(r=>{let s=new F(r);if(t){try{s.data=JSON.parse(s.data)}catch(a){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${a}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return s}return s})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,r){return this.request({method:"POST",url:e,body:t,...r})}async put(e,t,r){return this.request({method:"PUT",url:e,body:t,...r})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function se(n){return i({__tauriModule:"Http",message:{cmd:"createClient",options:n}}).then(e=>new E(e))}var G=null;async function Ke(n,e){return G===null&&(G=await se()),G.request({url:n,method:e?.method??"GET",...e})}var J={};c(J,{isPermissionGranted:()=>Qe,requestPermission:()=>Ye,sendNotification:()=>Ze});async function Qe(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):i({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Ye(){return window.Notification.requestPermission()}function Ze(n){typeof n=="string"?new window.Notification(n):new window.Notification(n.title,n)}var K={};c(K,{BaseDirectory:()=>O,appCacheDir:()=>tt,appConfigDir:()=>ae,appDataDir:()=>Be,appDir:()=>Xe,appLocalDataDir:()=>et,appLogDir:()=>oe,audioDir:()=>nt,basename:()=>Ct,cacheDir:()=>it,configDir:()=>rt,dataDir:()=>st,delimiter:()=>vt,desktopDir:()=>at,dirname:()=>Ft,documentDir:()=>ot,downloadDir:()=>lt,executableDir:()=>ut,extname:()=>Et,fontDir:()=>ct,homeDir:()=>dt,isAbsolute:()=>At,join:()=>Ot,localDataDir:()=>mt,logDir:()=>Pt,normalize:()=>Tt,pictureDir:()=>pt,publicDir:()=>gt,resolve:()=>Mt,resolveResource:()=>yt,resourceDir:()=>ht,runtimeDir:()=>ft,sep:()=>wt,templateDir:()=>bt,videoDir:()=>_t});function _(){return navigator.appVersion.includes("Win")}async function Xe(){return ae()}async function ae(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function Be(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function et(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function tt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function nt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function it(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function rt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function st(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function at(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function lt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function ut(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function ct(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function dt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function mt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function gt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function ht(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function yt(n){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:n,directory:17}})}async function ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function bt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function _t(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Pt(){return oe()}async function oe(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var wt=_()?"\\":"/",vt=_()?";":":";async function Mt(...n){return i({__tauriModule:"Path",message:{cmd:"resolve",paths:n}})}async function Tt(n){return i({__tauriModule:"Path",message:{cmd:"normalize",path:n}})}async function Ot(...n){return i({__tauriModule:"Path",message:{cmd:"join",paths:n}})}async function Ft(n){return i({__tauriModule:"Path",message:{cmd:"dirname",path:n}})}async function Et(n){return i({__tauriModule:"Path",message:{cmd:"extname",path:n}})}async function Ct(n,e){return i({__tauriModule:"Path",message:{cmd:"basename",path:n,ext:e}})}async function At(n){return i({__tauriModule:"Path",message:{cmd:"isAbsolute",path:n}})}var Q={};c(Q,{exit:()=>Dt,relaunch:()=>St});async function Dt(n=0){return i({__tauriModule:"Process",message:{cmd:"exit",exitCode:n}})}async function St(){return i({__tauriModule:"Process",message:{cmd:"relaunch"}})}var Y={};c(Y,{Child:()=>C,Command:()=>P,EventEmitter:()=>g,open:()=>xt});async function Wt(n,e,t=[],r){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:t,options:r,onEventFn:d(n)}})}var g=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.addListener(e,r)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(r=>r!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let r=this.eventListeners[e];for(let s of r)s(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let r=(...s)=>{this.removeListener(e,r),t(...s)};return this.prependListener(e,r)}},C=class{constructor(e){this.pid=e}async write(e){return i({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return i({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},P=class extends g{constructor(t,r=[],s){super();this.stdout=new g;this.stderr=new g;this.program=t,this.args=typeof r=="string"?[r]:r,this.options=s??{}}static sidecar(t,r=[],s){let a=new P(t,r,s);return a.options.sidecar=!0,a}async spawn(){return Wt(t=>{switch(t.event){case"Error":this.emit("error",t.payload);break;case"Terminated":this.emit("close",t.payload);break;case"Stdout":this.stdout.emit("data",t.payload);break;case"Stderr":this.stderr.emit("data",t.payload);break}},this.program,this.args,this.options).then(t=>new C(t))}async execute(){return new Promise((t,r)=>{this.on("error",r);let s=[],a=[];this.stdout.on("data",l=>{s.push(l)}),this.stderr.on("data",l=>{a.push(l)}),this.on("close",l=>{t({code:l.code,signal:l.signal,stdout:s.join(` `),stderr:a.join(` -`)})}),this.spawn().catch(r)})}};async function xt(t,e){return i({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})}var X={};d(X,{checkUpdate:()=>Lt,installUpdate:()=>Rt,onUpdaterEvent:()=>Y});async function Y(t){return N("tauri://update-status",e=>{t(e?.payload)})}async function Rt(){let t;function e(){t&&t(),t=void 0}return new Promise((n,r)=>{function s(a){if(a.error)return e(),r(a.error);if(a.status==="DONE")return e(),n()}Y(s).then(a=>{t=a}).catch(a=>{throw e(),a}),T("tauri://update-install").catch(a=>{throw e(),a})})}async function Lt(){let t;function e(){t&&t(),t=void 0}return new Promise((n,r)=>{function s(l){return e(),n({manifest:l,shouldUpdate:!0})}function a(l){if(l.error)return e(),r(l.error);if(l.status==="UPTODATE")return e(),n({shouldUpdate:!1})}H("tauri://update-available",l=>{s(l?.payload)}).catch(l=>{throw e(),l}),Y(a).then(l=>{t=l}).catch(l=>{throw e(),l}),T("tauri://update").catch(l=>{throw e(),l})})}var te={};d(te,{CloseRequestedEvent:()=>x,LogicalPosition:()=>D,LogicalSize:()=>C,PhysicalPosition:()=>y,PhysicalSize:()=>h,UserAttentionType:()=>ue,WebviewWindow:()=>m,WebviewWindowHandle:()=>W,WindowManager:()=>S,appWindow:()=>B,availableMonitors:()=>zt,currentMonitor:()=>Ut,getAll:()=>de,getCurrent:()=>kt,primaryMonitor:()=>It});var C=class{constructor(e,n){this.type="Logical";this.width=e,this.height=n}},h=class{constructor(e,n){this.type="Physical";this.width=e,this.height=n}toLogical(e){return new C(this.width/e,this.height/e)}},D=class{constructor(e,n){this.type="Logical";this.x=e,this.y=n}},y=class{constructor(e,n){this.type="Physical";this.x=e,this.y=n}toLogical(e){return new D(this.x/e,this.y/e)}},ue=(n=>(n[n.Critical=1]="Critical",n[n.Informational=2]="Informational",n))(ue||{});function kt(){return new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function de(){return window.__TAURI_METADATA__.__windows.map(t=>new m(t.label,{skip:!0}))}var le=["tauri://created","tauri://error"],W=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(n),1)}):_(e,this.label,n)}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(n),1)}):v(e,this.label,n)}async emit(e,n){if(le.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return w(e,this.label,n)}_handleTauriEvent(e,n){return le.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}},S=class extends W{async scaleFactor(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:n})=>new y(e,n))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:n})=>new y(e,n))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:n})=>new h(e,n))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:n})=>new h(e,n))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let n=null;return e&&(e===1?n={type:"Critical"}:n={type:"Informational"}),i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:n}}}})}async setResizable(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",n=>{let r=new x(n);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let n=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),r=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{n(),r()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let n=await this.listen("tauri://file-drop",a=>{e({...a,payload:{type:"drop",paths:a.payload}})}),r=await this.listen("tauri://file-drop-hover",a=>{e({...a,payload:{type:"hover",paths:a.payload}})}),s=await this.listen("tauri://file-drop-cancelled",a=>{e({...a,payload:{type:"cancel"}})});return()=>{n(),r(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},x=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},m=class extends S{constructor(e,n={}){super(e),n?.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...n}}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return de().some(n=>n.label===e)?new m(e,{skip:!0}):null}},B;"__TAURI_METADATA__"in window?B=new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. -Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),B=new m("main",{skip:!0}));function ee(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:new y(t.position.x,t.position.y),size:new h(t.size.width,t.size.height)}}async function Ut(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(ee)}async function It(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(ee)}async function zt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(t=>t.map(ee))}var ne={};d(ne,{EOL:()=>Nt,arch:()=>qt,platform:()=>Ht,tempdir:()=>Gt,type:()=>jt,version:()=>Vt});var Nt=b()?`\r +`)})}),this.spawn().catch(r)})}};async function xt(n,e){return i({__tauriModule:"Shell",message:{cmd:"open",path:n,with:e}})}var X={};c(X,{checkUpdate:()=>Rt,installUpdate:()=>Lt,onUpdaterEvent:()=>Z});async function Z(n){return N("tauri://update-status",e=>{n(e?.payload)})}async function Lt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(a){if(a.error)return e(),r(a.error);if(a.status==="DONE")return e(),t()}Z(s).then(a=>{n=a}).catch(a=>{throw e(),a}),T("tauri://update-install").catch(a=>{throw e(),a})})}async function Rt(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(l){return e(),t({manifest:l,shouldUpdate:!0})}function a(l){if(l.error)return e(),r(l.error);if(l.status==="UPTODATE")return e(),t({shouldUpdate:!1})}H("tauri://update-available",l=>{s(l?.payload)}).catch(l=>{throw e(),l}),Z(a).then(l=>{n=l}).catch(l=>{throw e(),l}),T("tauri://update").catch(l=>{throw e(),l})})}var te={};c(te,{CloseRequestedEvent:()=>x,LogicalPosition:()=>D,LogicalSize:()=>A,PhysicalPosition:()=>y,PhysicalSize:()=>h,UserAttentionType:()=>ue,WebviewWindow:()=>m,WebviewWindowHandle:()=>S,WindowManager:()=>W,appWindow:()=>B,availableMonitors:()=>zt,currentMonitor:()=>Ut,getAll:()=>ce,getCurrent:()=>kt,primaryMonitor:()=>It});var A=class{constructor(e,t){this.type="Logical";this.width=e,this.height=t}},h=class{constructor(e,t){this.type="Physical";this.width=e,this.height=t}toLogical(e){return new A(this.width/e,this.height/e)}},D=class{constructor(e,t){this.type="Logical";this.x=e,this.y=t}},y=class{constructor(e,t){this.type="Physical";this.x=e,this.y=t}toLogical(e){return new D(this.x/e,this.y/e)}},ue=(t=>(t[t.Critical=1]="Critical",t[t.Informational=2]="Informational",t))(ue||{});function kt(){return new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function ce(){return window.__TAURI_METADATA__.__windows.map(n=>new m(n.label,{skip:!0}))}var le=["tauri://created","tauri://error"],S=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):b(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let r=this.listeners[e];r.splice(r.indexOf(t),1)}):v(e,this.label,t)}async emit(e,t){if(le.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return w(e,this.label,t)}_handleTauriEvent(e,t){return le.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},W=class extends S{async scaleFactor(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new y(e,t))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new h(e,t))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let r=new x(t);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),r=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{t(),r()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",a=>{e({...a,payload:{type:"drop",paths:a.payload}})}),r=await this.listen("tauri://file-drop-hover",a=>{e({...a,payload:{type:"hover",paths:a.payload}})}),s=await this.listen("tauri://file-drop-cancelled",a=>{e({...a,payload:{type:"cancel"}})});return()=>{t(),r(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},x=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},m=class extends W{constructor(e,t={}){super(e),t?.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return ce().some(t=>t.label===e)?new m(e,{skip:!0}):null}},B;"__TAURI_METADATA__"in window?B=new m(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),B=new m("main",{skip:!0}));function ee(n){return n===null?null:{name:n.name,scaleFactor:n.scaleFactor,position:new y(n.position.x,n.position.y),size:new h(n.size.width,n.size.height)}}async function Ut(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(ee)}async function It(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(ee)}async function zt(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(n=>n.map(ee))}var ne={};c(ne,{EOL:()=>Nt,arch:()=>qt,platform:()=>Ht,tempdir:()=>Gt,type:()=>jt,version:()=>Vt});var Nt=_()?`\r `:` `;async function Ht(){return i({__tauriModule:"Os",message:{cmd:"platform"}})}async function Vt(){return i({__tauriModule:"Os",message:{cmd:"version"}})}async function jt(){return i({__tauriModule:"Os",message:{cmd:"osType"}})}async function qt(){return i({__tauriModule:"Os",message:{cmd:"arch"}})}async function Gt(){return i({__tauriModule:"Os",message:{cmd:"tempdir"}})}var $t=f;return he(Jt);})(); window.__TAURI__ = __TAURI_IIFE__ diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js new file mode 100644 index 00000000000..4a7da586b92 --- /dev/null +++ b/core/tauri/scripts/bundle.js @@ -0,0 +1 @@ +function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;R(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,"_".concat(i))}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,"_".concat(o))}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m=Object.freeze({__proto__:null,getMatches:function(){return d.apply(this,arguments)}});function _(){return(_=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=Object.freeze({__proto__:null,writeText:function(e){return _.apply(this,arguments)},readText:function(){return y.apply(this,arguments)}});function v(e,t){return null!=e?e:t()}function w(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function R(){return R=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function k(){return k=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:w([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:w([n,"optionalAccess",function(e){return e.type}]),buttonLabel:w([n,"optionalAccess",function(e){return e.okLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}])}}));case 2:case"end":return e.stop()}}),e)}))),k.apply(this,arguments)}function x(){return x=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:w([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:w([n,"optionalAccess",function(e){return e.type}]),buttonLabels:[v(w([n,"optionalAccess",function(e){return e.okLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"Yes"})),v(w([n,"optionalAccess",function(e){return e.cancelLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"No"}))]}}));case 2:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function T(){return T=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:w([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:w([n,"optionalAccess",function(e){return e.type}]),buttonLabels:[v(w([n,"optionalAccess",function(e){return e.okLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"Ok"})),v(w([n,"optionalAccess",function(e){return e.cancelLabel},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),(function(){return"Cancel"}))]}}));case 2:case"end":return e.stop()}}),e)}))),T.apply(this,arguments)}var G,P=Object.freeze({__proto__:null,open:function(){return b.apply(this,arguments)},save:function(){return R.apply(this,arguments)},message:function(e,t){return k.apply(this,arguments)},ask:function(e,t){return x.apply(this,arguments)},confirm:function(e,t){return T.apply(this,arguments)}});function O(e,t){return A.apply(this,arguments)}function A(){return A=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}function L(e,t,r){return M.apply(this,arguments)}function M(){return M=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)}))),M.apply(this,arguments)}function E(e,t,r){return D.apply(this,arguments)}function D(){return D=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(_regeneratorRuntime().mark((function r(){return _regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",O(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)}))),D.apply(this,arguments)}function C(e,t,r){return S.apply(this,arguments)}function S(){return S=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,r,(function(e){n(e),O(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}function j(e,t){return W.apply(this,arguments)}function W(){return W=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,null,r));case 1:case"end":return e.stop()}}),e)}))),W.apply(this,arguments)}function N(e,t){return I.apply(this,arguments)}function I(){return I=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",C(t,null,r));case 1:case"end":return e.stop()}}),e)}))),I.apply(this,arguments)}function z(e,t){return F.apply(this,arguments)}function F(){return F=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",L(t,void 0,r));case 1:case"end":return e.stop()}}),e)}))),F.apply(this,arguments)}!function(e){e.WINDOW_RESIZED="tauri://resize";e.WINDOW_MOVED="tauri://move";e.WINDOW_CLOSE_REQUESTED="tauri://close-requested";e.WINDOW_CREATED="tauri://window-created";e.WINDOW_DESTROYED="tauri://destroyed";e.WINDOW_FOCUS="tauri://focus";e.WINDOW_BLUR="tauri://blur";e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change";e.WINDOW_THEME_CHANGED="tauri://theme-changed";e.WINDOW_FILE_DROP="tauri://file-drop";e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover";e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled";e.MENU="tauri://menu";e.CHECK_UPDATE="tauri://update";e.UPDATE_AVAILABLE="tauri://update-available";e.INSTALL_UPDATE="tauri://update-install";e.STATUS_UPDATE="tauri://update-status";e.DOWNLOAD_PROGRESS="tauri://update-download-progress"}(G||(G={}));var U,H=Object.freeze({__proto__:null,listen:j,once:N,emit:z});function V(e,t){return null!=e?e:t()}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),B.apply(this,arguments)}function q(){return q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)}))),q.apply(this,arguments)}function J(e,t,r){return Y.apply(this,arguments)}function Y(){return Y=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:""},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),"string"==typeof r?a.contents=V(r,(function(){return""})):o=r,e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from((new TextEncoder).encode(a.contents)),options:o}}));case 7:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:[]},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),r&&"dir"in r?o=r:"string"==typeof t&&(a.contents=V(r,(function(){return[]}))),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from(a.contents instanceof ArrayBuffer?new Uint8Array(a.contents):a.contents),options:o}}));case 7:case"end":return e.stop()}}),e)}))),K.apply(this,arguments)}function Q(){return Q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Q.apply(this,arguments)}function Z(){return Z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Z.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),$.apply(this,arguments)}function X(){return X=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),X.apply(this,arguments)}function ee(){return ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),ee.apply(this,arguments)}function te(){return te=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),te.apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(U||(U={}));var re=Object.freeze({__proto__:null,get BaseDirectory(){return U},get Dir(){return U},readTextFile:function(e){return B.apply(this,arguments)},readBinaryFile:function(e){return q.apply(this,arguments)},writeTextFile:J,writeFile:J,writeBinaryFile:function(e,t,r){return K.apply(this,arguments)},readDir:function(e){return Q.apply(this,arguments)},createDir:function(e){return Z.apply(this,arguments)},removeDir:function(e){return $.apply(this,arguments)},copyFile:function(e,t){return X.apply(this,arguments)},removeFile:function(e){return ee.apply(this,arguments)},renameFile:function(e,t){return te.apply(this,arguments)}});function ne(){return(ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(){return(ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(){return(oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ue(){return(ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var se,ce=Object.freeze({__proto__:null,register:function(e,t){return ne.apply(this,arguments)},registerAll:function(e,t){return ae.apply(this,arguments)},isRegistered:function(e){return oe.apply(this,arguments)},unregister:function(e){return ie.apply(this,arguments)},unregisterAll:function(){return ue.apply(this,arguments)}});function pe(e,t){return null!=e?e:t()}function le(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),de=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===se.JSON)&&(t.responseType=se.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new he(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function me(e){return _e.apply(this,arguments)}function _e(){return(_e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new de(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=null;function ge(){return(ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==ye){e.next=4;break}return e.next=3,me();case 3:ye=e.sent;case 4:return e.abrupt("return",ye.request(_objectSpread({url:t,method:pe(le([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ve=Object.freeze({__proto__:null,getClient:me,fetch:function(e,t){return ge.apply(this,arguments)},Body:fe,Client:de,Response:he,get ResponseType(){return se}});function we(){return(we=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return be.apply(this,arguments)},isPermissionGranted:function(){return we.apply(this,arguments)}});function ke(){return navigator.appVersion.includes("Win")}function xe(){return(xe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){return(Ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(){return(Ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:U.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(){return(Fe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(){return(Ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function He(){return(He=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:U.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ve=ke()?"\\":"/",Be=ke()?";":":";function qe(){return qe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)}))),et.apply(this,arguments)}function tt(){return(tt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rt=Object.freeze({__proto__:null,exit:function(){return et.apply(this,arguments)},relaunch:function(){return tt.apply(this,arguments)}});function nt(e,t){return null!=e?e:t()}function at(e,t){return ot.apply(this,arguments)}function ot(){return ot=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)}))),ot.apply(this,arguments)}var it=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}},{key:"on",value:function(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}},{key:"once",value:function(e,t){var r=this;return this.addListener(e,(function n(){r.removeListener(e,n),t.apply(void 0,arguments)}))}},{key:"off",value:function(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((function(e){return e!==t}))),this}},{key:"removeAllListeners",value:function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}},{key:"emit",value:function(e){if(e in this.eventListeners){for(var t=this.eventListeners[e],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=nt(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new it}},{key:"__init3",value:function(){this.stderr=new it}},{key:"spawn",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",at((function(e){switch(e.event){case"Error":t.emit("error",e.payload);break;case"Terminated":t.emit("close",e.payload);break;case"Stdout":t.stdout.emit("data",e.payload);break;case"Stderr":t.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new ut(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(it);function ct(){return ct=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)}))),ct.apply(this,arguments)}var pt=Object.freeze({__proto__:null,Command:st,Child:ut,EventEmitter:it,open:function(e,t){return ct.apply(this,arguments)}});function lt(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),yt([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return kt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(Pt);function Lt(){return(Lt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Et(){return(Et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?xt=new At(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),xt=new At("main",{skip:!0}));var Dt=Object.freeze({__proto__:null,WebviewWindow:At,WebviewWindowHandle:Gt,WindowManager:Pt,CloseRequestedEvent:Ot,getCurrent:function(){return new At(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:kt,get appWindow(){return xt},LogicalSize:vt,PhysicalSize:wt,LogicalPosition:bt,PhysicalPosition:Rt,get UserAttentionType(){return gt},currentMonitor:function(){return Lt.apply(this,arguments)},primaryMonitor:function(){return Mt.apply(this,arguments)},availableMonitors:function(){return Et.apply(this,arguments)}}),Ct=ke()?"\r\n":"\n";function St(){return(St=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return(jt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(){return(Wt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(){return(It=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var zt=Object.freeze({__proto__:null,EOL:Ct,platform:function(){return St.apply(this,arguments)},version:function(){return jt.apply(this,arguments)},type:function(){return Wt.apply(this,arguments)},arch:function(){return Nt.apply(this,arguments)},tempdir:function(){return It.apply(this,arguments)}}),Ft=o;e.app=h,e.cli=m,e.clipboard=g,e.dialog=P,e.event=H,e.fs=re,e.globalShortcut=ce,e.http=ve,e.invoke=Ft,e.notification=Re,e.os=zt,e.path=Xe,e.process=rt,e.shell=pt,e.tauri=u,e.updater=_t,e.window=Dt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/src/api/dialog.rs b/core/tauri/src/api/dialog.rs index 313c075b2fa..b7e50408510 100644 --- a/core/tauri/src/api/dialog.rs +++ b/core/tauri/src/api/dialog.rs @@ -171,7 +171,7 @@ macro_rules! message_dialog_builder { /// Options for action buttons on message dialogs. #[non_exhaustive] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MessageDialogButtons { /// Ok button. Ok, @@ -179,6 +179,10 @@ pub enum MessageDialogButtons { OkCancel, /// Yes and No buttons. YesNo, + /// OK button with customized text. + OkWithLabel(String), + /// Ok and Cancel buttons with customized text. + OkCancelWithLabels(String, String), } impl From for rfd::MessageButtons { @@ -187,6 +191,10 @@ impl From for rfd::MessageButtons { MessageDialogButtons::Ok => Self::Ok, MessageDialogButtons::OkCancel => Self::OkCancel, MessageDialogButtons::YesNo => Self::YesNo, + MessageDialogButtons::OkWithLabel(ok_text) => Self::OkCustom(ok_text), + MessageDialogButtons::OkCancelWithLabels(ok_text, cancel_text) => { + Self::OkCancelCustom(ok_text, cancel_text) + } } } } diff --git a/core/tauri/src/endpoints/dialog.rs b/core/tauri/src/endpoints/dialog.rs index aaba2d04672..f71923cefe8 100644 --- a/core/tauri/src/endpoints/dialog.rs +++ b/core/tauri/src/endpoints/dialog.rs @@ -14,19 +14,21 @@ use tauri_macros::{command_enum, module_command_handler, CommandModule}; use std::path::PathBuf; macro_rules! message_dialog { - ($fn_name: ident, $allowlist: ident, $buttons: expr) => { + ($fn_name: ident, $allowlist: ident, $button_labels_type: ty, $buttons: expr) => { #[module_command_handler($allowlist)] fn $fn_name( context: InvokeContext, title: Option, message: String, level: Option, + button_labels: $button_labels_type, ) -> super::Result { + let determine_button = $buttons; let mut builder = crate::api::dialog::blocking::MessageDialogBuilder::new( title.unwrap_or_else(|| context.window.app_handle.package_info().name.clone()), message, ) - .buttons($buttons); + .buttons(determine_button(button_labels)); #[cfg(any(windows, target_os = "macos"))] { builder = builder.parent(&context.window); @@ -139,6 +141,8 @@ pub enum Cmd { message: String, #[serde(rename = "type")] level: Option, + #[serde(rename = "buttonLabel")] + button_label: Option, }, #[cmd(dialog_ask, "dialog > ask")] AskDialog { @@ -146,6 +150,8 @@ pub enum Cmd { message: String, #[serde(rename = "type")] level: Option, + #[serde(rename = "buttonLabels")] + button_label: Option<(String, String)>, }, #[cmd(dialog_confirm, "dialog > confirm")] ConfirmDialog { @@ -153,6 +159,8 @@ pub enum Cmd { message: String, #[serde(rename = "type")] level: Option, + #[serde(rename = "buttonLabels")] + button_labels: Option<(String, String)>, }, } @@ -255,19 +263,36 @@ impl Cmd { message_dialog!( message_dialog, dialog_message, - crate::api::dialog::MessageDialogButtons::Ok + Option, + |label: Option| { + label + .map(crate::api::dialog::MessageDialogButtons::OkWithLabel) + .unwrap_or(crate::api::dialog::MessageDialogButtons::Ok) + } ); message_dialog!( ask_dialog, dialog_ask, - crate::api::dialog::MessageDialogButtons::YesNo + Option<(String, String)>, + |labels: Option<(String, String)>| { + labels + .map(|(yes, no)| crate::api::dialog::MessageDialogButtons::OkCancelWithLabels(yes, no)) + .unwrap_or(crate::api::dialog::MessageDialogButtons::YesNo) + } ); message_dialog!( confirm_dialog, dialog_confirm, - crate::api::dialog::MessageDialogButtons::OkCancel + Option<(String, String)>, + |labels: Option<(String, String)>| { + labels + .map(|(ok, cancel)| { + crate::api::dialog::MessageDialogButtons::OkCancelWithLabels(ok, cancel) + }) + .unwrap_or(crate::api::dialog::MessageDialogButtons::OkCancel) + } ); } diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 6893f62f017..88023314d09 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,20 +1,20 @@ -const so=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};so();function G(){}function ws(e){return e()}function Vl(){return Object.create(null)}function re(e){e.forEach(ws)}function oo(e){return typeof e=="function"}function pe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Gn;function ro(e,t){return Gn||(Gn=document.createElement("a")),Gn.href=t,e===Gn.href}function ao(e){return Object.keys(e).length===0}function uo(e,...t){if(e==null)return G;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ks(e,t,n){e.$$.on_destroy.push(uo(t,n))}function s(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function ht(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function Zn(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function oe(e){return e===""?null:+e}function fo(e){return Array.from(e.childNodes)}function Q(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=t==null?"":t}function Pt(e,t){for(let n=0;n{Kn.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function xn(e){e&&e.c()}function Jt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Wt(()=>{const c=o.map(ws).filter(oo);u?u.push(...c):re(c),e.$$.on_mount=[]}),d.forEach(Wt)}function Xt(e,t){const n=e.$$;n.fragment!==null&&(re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bo(e,t){e.$$.dirty[0]===-1&&(qt.push(e),ho(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const v=y.length?y[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=v)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](v),g&&bo(e,k)),_}):[],f.update(),g=!0,re(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=fo(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&Le(e.$$.fragment),Jt(e,t.target,t.anchor,t.customElement),Cs()}Vt(c)}class ve{$destroy(){Xt(this,1),this.$destroy=G}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!ao(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dt=[];function Ts(e,t=G){let n;const i=new Set;function l(d){if(pe(e,d)&&(e=d,n)){const c=!Dt.length;for(const f of i)f[1](),Dt.push(f,e);if(c){for(let f=0;f{i.delete(f),i.size===0&&(n(),n=null)}}return{set:l,update:o,subscribe:u}}var go=Object.defineProperty,ke=(e,t)=>{for(var n in t)go(e,n,{get:t[n],enumerable:!0})},vo={};ke(vo,{convertFileSrc:()=>As,invoke:()=>ei,transformCallback:()=>_t});function yo(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function _t(e,t=!1){let n=yo(),i=`_${n}`;return Object.defineProperty(window,i,{value:l=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(l)),writable:!1,configurable:!0}),n}async function ei(e,t={}){return new Promise((n,i)=>{let l=_t(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=_t(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function As(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function L(e){return ei("tauri",e)}var wo={};ke(wo,{Child:()=>Ls,Command:()=>Hi,EventEmitter:()=>Qn,open:()=>Fi});async function ko(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),L({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:_t(e)}})}var Qn=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(n=>n!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let i of n)i(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.prependListener(e,n)}},Ls=class{constructor(e){this.pid=e}async write(e){return L({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return L({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Hi=class extends Qn{constructor(e,t=[],n){super(),this.stdout=new Qn,this.stderr=new Qn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Hi(e,t,n);return i.options.sidecar=!0,i}async spawn(){return ko(e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload);break}},this.program,this.args,this.options).then(e=>new Ls(e))}async execute(){return new Promise((e,t)=>{this.on("error",t);let n=[],i=[];this.stdout.on("data",l=>{n.push(l)}),this.stderr.on("data",l=>{i.push(l)}),this.on("close",l=>{e({code:l.code,signal:l.signal,stdout:n.join(` +const so=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};so();function G(){}function ws(e){return e()}function Vl(){return Object.create(null)}function re(e){e.forEach(ws)}function oo(e){return typeof e=="function"}function pe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Gn;function ro(e,t){return Gn||(Gn=document.createElement("a")),Gn.href=t,e===Gn.href}function ao(e){return Object.keys(e).length===0}function uo(e,...t){if(e==null)return G;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ks(e,t,n){e.$$.on_destroy.push(uo(t,n))}function s(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function ht(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function Zn(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function oe(e){return e===""?null:+e}function fo(e){return Array.from(e.childNodes)}function Q(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=t==null?"":t}function Pt(e,t){for(let n=0;n{Kn.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function xn(e){e&&e.c()}function Jt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Wt(()=>{const c=o.map(ws).filter(oo);u?u.push(...c):re(c),e.$$.on_mount=[]}),d.forEach(Wt)}function Xt(e,t){const n=e.$$;n.fragment!==null&&(re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bo(e,t){e.$$.dirty[0]===-1&&(qt.push(e),ho(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const v=y.length?y[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=v)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](v),g&&bo(e,k)),_}):[],f.update(),g=!0,re(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=fo(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&Ae(e.$$.fragment),Jt(e,t.target,t.anchor,t.customElement),Cs()}Vt(c)}class ve{$destroy(){Xt(this,1),this.$destroy=G}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!ao(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dt=[];function Ts(e,t=G){let n;const i=new Set;function l(d){if(pe(e,d)&&(e=d,n)){const c=!Dt.length;for(const f of i)f[1](),Dt.push(f,e);if(c){for(let f=0;f{i.delete(f),i.size===0&&(n(),n=null)}}return{set:l,update:o,subscribe:u}}var go=Object.defineProperty,ke=(e,t)=>{for(var n in t)go(e,n,{get:t[n],enumerable:!0})},vo={};ke(vo,{convertFileSrc:()=>Ls,invoke:()=>ei,transformCallback:()=>_t});function yo(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function _t(e,t=!1){let n=yo(),i=`_${n}`;return Object.defineProperty(window,i,{value:l=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(l)),writable:!1,configurable:!0}),n}async function ei(e,t={}){return new Promise((n,i)=>{let l=_t(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=_t(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function Ls(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function A(e){return ei("tauri",e)}var wo={};ke(wo,{Child:()=>As,Command:()=>Hi,EventEmitter:()=>Qn,open:()=>Fi});async function ko(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),A({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:_t(e)}})}var Qn=class{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(n=>n!==t)),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,...t){if(e in this.eventListeners){let n=this.eventListeners[e];for(let i of n)i(...t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){let n=(...i)=>{this.removeListener(e,n),t(...i)};return this.prependListener(e,n)}},As=class{constructor(e){this.pid=e}async write(e){return A({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return A({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Hi=class extends Qn{constructor(e,t=[],n){super(),this.stdout=new Qn,this.stderr=new Qn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Hi(e,t,n);return i.options.sidecar=!0,i}async spawn(){return ko(e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload);break}},this.program,this.args,this.options).then(e=>new As(e))}async execute(){return new Promise((e,t)=>{this.on("error",t);let n=[],i=[];this.stdout.on("data",l=>{n.push(l)}),this.stderr.on("data",l=>{i.push(l)}),this.on("close",l=>{e({code:l.code,signal:l.signal,stdout:n.join(` `),stderr:i.join(` -`)})}),this.spawn().catch(t)})}};async function Fi(e,t){return L({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Mo={};ke(Mo,{TauriEvent:()=>Ds,emit:()=>oi,listen:()=>Kt,once:()=>Ps});async function Ss(e,t){return L({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Es(e,t,n){await L({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Ni(e,t,n){return L({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:_t(n)}}).then(i=>async()=>Ss(e,i))}async function zs(e,t,n){return Ni(e,t,i=>{n(i),Ss(e,i.id).catch(()=>{})})}var Ds=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(Ds||{});async function Kt(e,t){return Ni(e,null,t)}async function Ps(e,t){return zs(e,null,t)}async function oi(e,t){return Es(e,void 0,t)}var Co={};ke(Co,{CloseRequestedEvent:()=>Hs,LogicalPosition:()=>Ws,LogicalSize:()=>ti,PhysicalPosition:()=>nt,PhysicalSize:()=>mt,UserAttentionType:()=>ji,WebviewWindow:()=>bt,WebviewWindowHandle:()=>Rs,WindowManager:()=>Is,appWindow:()=>qe,availableMonitors:()=>Lo,currentMonitor:()=>To,getAll:()=>Os,getCurrent:()=>Bt,primaryMonitor:()=>Ao});var ti=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},mt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new ti(this.width/e,this.height/e)}},Ws=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},nt=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Ws(this.x/e,this.y/e)}},ji=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(ji||{});function Bt(){return new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Os(){return window.__TAURI_METADATA__.__windows.map(e=>new bt(e.label,{skip:!0}))}var Jl=["tauri://created","tauri://error"],Rs=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):Ni(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):zs(e,this.label,t)}async emit(e,t){if(Jl.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return Es(e,this.label,t)}_handleTauriEvent(e,t){return Jl.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Is=class extends Rs{async scaleFactor(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async outerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async innerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new mt(e,t))}async outerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new mt(e,t))}async isFullscreen(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new Hs(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),n=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),n=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),i=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Hs=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},bt=class extends Is{constructor(e,t={}){super(e),t!=null&&t.skip||L({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Os().some(t=>t.label===e)?new bt(e,{skip:!0}):null}},qe;"__TAURI_METADATA__"in window?qe=new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. -Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),qe=new bt("main",{skip:!0}));function Ui(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new nt(e.position.x,e.position.y),size:new mt(e.size.width,e.size.height)}}async function To(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Ui)}async function Ao(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Ui)}async function Lo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Ui))}function So(){return navigator.appVersion.includes("Win")}var Eo={};ke(Eo,{EOL:()=>zo,arch:()=>Wo,platform:()=>Fs,tempdir:()=>Oo,type:()=>Po,version:()=>Do});var zo=So()?`\r +`)})}),this.spawn().catch(t)})}};async function Fi(e,t){return A({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Mo={};ke(Mo,{TauriEvent:()=>Ds,emit:()=>oi,listen:()=>Kt,once:()=>Ps});async function Ss(e,t){return A({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Es(e,t,n){await A({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Ni(e,t,n){return A({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:_t(n)}}).then(i=>async()=>Ss(e,i))}async function zs(e,t,n){return Ni(e,t,i=>{n(i),Ss(e,i.id).catch(()=>{})})}var Ds=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(Ds||{});async function Kt(e,t){return Ni(e,null,t)}async function Ps(e,t){return zs(e,null,t)}async function oi(e,t){return Es(e,void 0,t)}var Co={};ke(Co,{CloseRequestedEvent:()=>Hs,LogicalPosition:()=>Ws,LogicalSize:()=>ti,PhysicalPosition:()=>nt,PhysicalSize:()=>mt,UserAttentionType:()=>ji,WebviewWindow:()=>bt,WebviewWindowHandle:()=>Rs,WindowManager:()=>Is,appWindow:()=>qe,availableMonitors:()=>Ao,currentMonitor:()=>To,getAll:()=>Os,getCurrent:()=>Bt,primaryMonitor:()=>Lo});var ti=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},mt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new ti(this.width/e,this.height/e)}},Ws=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},nt=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Ws(this.x/e,this.y/e)}},ji=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(ji||{});function Bt(){return new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Os(){return window.__TAURI_METADATA__.__windows.map(e=>new bt(e.label,{skip:!0}))}var Jl=["tauri://created","tauri://error"],Rs=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):Ni(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):zs(e,this.label,t)}async emit(e,t){if(Jl.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return Es(e,this.label,t)}_handleTauriEvent(e,t){return Jl.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Is=class extends Rs{async scaleFactor(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async outerPosition(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async innerSize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new mt(e,t))}async outerSize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new mt(e,t))}async isFullscreen(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new Hs(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),n=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),n=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),i=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Hs=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},bt=class extends Is{constructor(e,t={}){super(e),t!=null&&t.skip||A({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Os().some(t=>t.label===e)?new bt(e,{skip:!0}):null}},qe;"__TAURI_METADATA__"in window?qe=new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),qe=new bt("main",{skip:!0}));function Ui(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new nt(e.position.x,e.position.y),size:new mt(e.size.width,e.size.height)}}async function To(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Ui)}async function Lo(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Ui)}async function Ao(){return A({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Ui))}function So(){return navigator.appVersion.includes("Win")}var Eo={};ke(Eo,{EOL:()=>zo,arch:()=>Wo,platform:()=>Fs,tempdir:()=>Oo,type:()=>Po,version:()=>Do});var zo=So()?`\r `:` -`;async function Fs(){return L({__tauriModule:"Os",message:{cmd:"platform"}})}async function Do(){return L({__tauriModule:"Os",message:{cmd:"version"}})}async function Po(){return L({__tauriModule:"Os",message:{cmd:"osType"}})}async function Wo(){return L({__tauriModule:"Os",message:{cmd:"arch"}})}async function Oo(){return L({__tauriModule:"Os",message:{cmd:"tempdir"}})}var Ro={};ke(Ro,{getName:()=>js,getTauriVersion:()=>Us,getVersion:()=>Ns,hide:()=>Bs,show:()=>qs});async function Ns(){return L({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function js(){return L({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Us(){return L({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function qs(){return L({__tauriModule:"App",message:{cmd:"show"}})}async function Bs(){return L({__tauriModule:"App",message:{cmd:"hide"}})}var Io={};ke(Io,{exit:()=>Vs,relaunch:()=>qi});async function Vs(e=0){return L({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function qi(){return L({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Ho(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,A,D,H,W,j,E,M,T,P,C,F;return{c(){t=r("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +`;async function Fs(){return A({__tauriModule:"Os",message:{cmd:"platform"}})}async function Do(){return A({__tauriModule:"Os",message:{cmd:"version"}})}async function Po(){return A({__tauriModule:"Os",message:{cmd:"osType"}})}async function Wo(){return A({__tauriModule:"Os",message:{cmd:"arch"}})}async function Oo(){return A({__tauriModule:"Os",message:{cmd:"tempdir"}})}var Ro={};ke(Ro,{getName:()=>js,getTauriVersion:()=>Us,getVersion:()=>Ns,hide:()=>Bs,show:()=>qs});async function Ns(){return A({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function js(){return A({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Us(){return A({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function qs(){return A({__tauriModule:"App",message:{cmd:"show"}})}async function Bs(){return A({__tauriModule:"App",message:{cmd:"hide"}})}var Io={};ke(Io,{exit:()=>Vs,relaunch:()=>qi});async function Vs(e=0){return A({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function qi(){return A({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Ho(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P,C,F;return{c(){t=r("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration tests.`,n=h(),i=r("br"),l=h(),o=r("br"),u=h(),d=r("pre"),c=z("App name: "),f=r("code"),g=z(e[2]),k=z(` App version: `),_=r("code"),y=z(e[0]),v=z(` -Tauri version: `),b=r("code"),A=z(e[1]),D=z(` -`),H=h(),W=r("br"),j=h(),E=r("div"),M=r("button"),M.textContent="Close application",T=h(),P=r("button"),P.textContent="Relaunch application",a(M,"class","btn"),a(P,"class","btn"),a(E,"class","flex flex-wrap gap-1 shadow-")},m(U,J){m(U,t,J),m(U,n,J),m(U,i,J),m(U,l,J),m(U,o,J),m(U,u,J),m(U,d,J),s(d,c),s(d,f),s(f,g),s(d,k),s(d,_),s(_,y),s(d,v),s(d,b),s(b,A),s(d,D),m(U,H,J),m(U,W,J),m(U,j,J),m(U,E,J),s(E,M),s(E,T),s(E,P),C||(F=[S(M,"click",e[3]),S(P,"click",e[4])],C=!0)},p(U,[J]){J&4&&Q(g,U[2]),J&1&&Q(y,U[0]),J&2&&Q(A,U[1])},i:G,o:G,d(U){U&&p(t),U&&p(n),U&&p(i),U&&p(l),U&&p(o),U&&p(u),U&&p(d),U&&p(H),U&&p(W),U&&p(j),U&&p(E),C=!1,re(F)}}}function Fo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";js().then(c=>{n(2,o=c)}),Ns().then(c=>{n(0,i=c)}),Us().then(c=>{n(1,l=c)});async function u(){await Vs()}async function d(){await qi()}return[i,l,o,u,d]}class No extends ve{constructor(t){super(),ge(this,t,Fo,Ho,pe,{})}}var jo={};ke(jo,{getMatches:()=>Gs});async function Gs(){return L({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function Uo(e){let t,n,i,l,o,u,d,c,f,g,k,_,y;return{c(){t=r("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments: +Tauri version: `),b=r("code"),L=z(e[1]),D=z(` +`),H=h(),W=r("br"),j=h(),E=r("div"),M=r("button"),M.textContent="Close application",T=h(),P=r("button"),P.textContent="Relaunch application",a(M,"class","btn"),a(P,"class","btn"),a(E,"class","flex flex-wrap gap-1 shadow-")},m(U,J){m(U,t,J),m(U,n,J),m(U,i,J),m(U,l,J),m(U,o,J),m(U,u,J),m(U,d,J),s(d,c),s(d,f),s(f,g),s(d,k),s(d,_),s(_,y),s(d,v),s(d,b),s(b,L),s(d,D),m(U,H,J),m(U,W,J),m(U,j,J),m(U,E,J),s(E,M),s(E,T),s(E,P),C||(F=[S(M,"click",e[3]),S(P,"click",e[4])],C=!0)},p(U,[J]){J&4&&Q(g,U[2]),J&1&&Q(y,U[0]),J&2&&Q(L,U[1])},i:G,o:G,d(U){U&&p(t),U&&p(n),U&&p(i),U&&p(l),U&&p(o),U&&p(u),U&&p(d),U&&p(H),U&&p(W),U&&p(j),U&&p(E),C=!1,re(F)}}}function Fo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";js().then(c=>{n(2,o=c)}),Ns().then(c=>{n(0,i=c)}),Us().then(c=>{n(1,l=c)});async function u(){await Vs()}async function d(){await qi()}return[i,l,o,u,d]}class No extends ve{constructor(t){super(),ge(this,t,Fo,Ho,pe,{})}}var jo={};ke(jo,{getMatches:()=>Gs});async function Gs(){return A({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function Uo(e){let t,n,i,l,o,u,d,c,f,g,k,_,y;return{c(){t=r("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments:
  --config <PATH>
   --theme <light|dark|system>
   --verbose
- Additionally, it has a update --background subcommand.`,n=h(),i=r("br"),l=h(),o=r("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=r("br"),c=h(),f=r("br"),g=h(),k=r("button"),k.textContent="Get matches",a(o,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(v,b){m(v,t,b),m(v,n,b),m(v,i,b),m(v,l,b),m(v,o,b),m(v,u,b),m(v,d,b),m(v,c,b),m(v,f,b),m(v,g,b),m(v,k,b),_||(y=S(k,"click",e[0]),_=!0)},p:G,i:G,o:G,d(v){v&&p(t),v&&p(n),v&&p(i),v&&p(l),v&&p(o),v&&p(u),v&&p(d),v&&p(c),v&&p(f),v&&p(g),v&&p(k),_=!1,y()}}}function qo(e,t,n){let{onMessage:i}=t;function l(){Gs().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class Bo extends ve{constructor(t){super(),ge(this,t,qo,Uo,pe,{onMessage:1})}}function Vo(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("button"),n.textContent="Call Log API",i=h(),l=r("button"),l.textContent="Call Request (async) API",o=h(),u=r("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(l,"class","btn"),a(l,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(f,g){m(f,t,g),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[S(n,"click",e[0]),S(l,"click",e[1]),S(u,"click",e[2])],d=!0)},p:G,i:G,o:G,d(f){f&&p(t),d=!1,re(c)}}}function Go(e,t,n){let{onMessage:i}=t,l;ft(async()=>{l=await Kt("rust-event",i)}),Ii(()=>{l&&l()});function o(){ei("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ei("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){oi("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class Jo extends ve{constructor(t){super(),ge(this,t,Go,Vo,pe,{onMessage:3})}}var Xo={};ke(Xo,{ask:()=>Xs,confirm:()=>Ko,message:()=>Yo,open:()=>Bi,save:()=>Js});async function Bi(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function Js(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Yo(e,t){var i;let n=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type}})}async function Xs(e,t){var i;let n=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type}})}async function Ko(e,t){var i;let n=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type}})}var Qo={};ke(Qo,{BaseDirectory:()=>Yt,Dir:()=>Yt,copyFile:()=>tr,createDir:()=>xo,exists:()=>lr,readBinaryFile:()=>Vi,readDir:()=>Ys,readTextFile:()=>Zo,removeDir:()=>er,removeFile:()=>nr,renameFile:()=>ir,writeBinaryFile:()=>$o,writeFile:()=>Ri,writeTextFile:()=>Ri});var Yt=(e=>(e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log",e[e.Temp=20]="Temp",e[e.AppConfig=21]="AppConfig",e[e.AppData=22]="AppData",e[e.AppLocalData=23]="AppLocalData",e[e.AppCache=24]="AppCache",e[e.AppLog=25]="AppLog",e))(Yt||{});async function Zo(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function Vi(e,t={}){let n=await L({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Ri(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:""},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),typeof t=="string"?i.contents=t!=null?t:"":l=t,L({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function $o(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:[]},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),t&&"dir"in t?l=t:typeof e=="string"&&(i.contents=t!=null?t:[]),L({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:l}})}async function Ys(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function xo(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function er(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function tr(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function nr(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function ir(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function lr(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function sr(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,A,D,H,W,j,E,M,T,P;return{c(){t=r("div"),n=r("input"),i=h(),l=r("input"),o=h(),u=r("br"),d=h(),c=r("div"),f=r("input"),g=h(),k=r("label"),k.textContent="Multiple",_=h(),y=r("div"),v=r("input"),b=h(),A=r("label"),A.textContent="Directory",D=h(),H=r("br"),W=h(),j=r("button"),j.textContent="Open dialog",E=h(),M=r("button"),M.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(l,"class","input"),a(l,"id","dialog-filter"),a(l,"placeholder","Extensions filter, comma-separated"),a(t,"class","flex gap-2 children:grow"),a(f,"type","checkbox"),a(f,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(v,"type","checkbox"),a(v,"id","dialog-directory"),a(A,"for","dialog-directory"),a(j,"class","btn"),a(j,"id","open-dialog"),a(M,"class","btn"),a(M,"id","save-dialog")},m(C,F){m(C,t,F),s(t,n),B(n,e[0]),s(t,i),s(t,l),B(l,e[1]),m(C,o,F),m(C,u,F),m(C,d,F),m(C,c,F),s(c,f),f.checked=e[2],s(c,g),s(c,k),m(C,_,F),m(C,y,F),s(y,v),v.checked=e[3],s(y,b),s(y,A),m(C,D,F),m(C,H,F),m(C,W,F),m(C,j,F),m(C,E,F),m(C,M,F),T||(P=[S(n,"input",e[8]),S(l,"input",e[9]),S(f,"change",e[10]),S(v,"change",e[11]),S(j,"click",e[4]),S(M,"click",e[5])],T=!0)},p(C,[F]){F&1&&n.value!==C[0]&&B(n,C[0]),F&2&&l.value!==C[1]&&B(l,C[1]),F&4&&(f.checked=C[2]),F&8&&(v.checked=C[3])},i:G,o:G,d(C){C&&p(t),C&&p(o),C&&p(u),C&&p(d),C&&p(c),C&&p(_),C&&p(y),C&&p(D),C&&p(H),C&&p(W),C&&p(j),C&&p(E),C&&p(M),T=!1,re(P)}}}function or(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){var o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function rr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){Bi({title:"My wonderful open dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:d,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var A=b,D=A.match(/\S+\.\S+$/g);Vi(A).then(function(H){D&&(A.includes(".png")||A.includes(".jpg"))?or(new Uint8Array(H),function(W){var j="data:image/png;base64,"+W;l('')}):i(b)}).catch(i(b))}}).catch(i)}function g(){Js({title:"My wonderful save dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){o=this.value,n(0,o)}function _(){u=this.value,n(1,u)}function y(){d=this.checked,n(2,d)}function v(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,g,i,l,k,_,y,v]}class ar extends ve{constructor(t){super(),ge(this,t,rr,sr,pe,{onMessage:6,insecureRenderHtml:7})}}function Xl(e,t,n){const i=e.slice();return i[9]=t[n],i}function Yl(e){let t,n=e[9][0]+"",i,l;return{c(){t=r("option"),i=z(n),t.__value=l=e[9][1],t.value=t.__value},m(o,u){m(o,t,u),s(t,i)},p:G,d(o){o&&p(t)}}}function ur(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,A,D,H,W,j=e[2],E=[];for(let M=0;MisNaN(parseInt(_))).map(_=>[_,Yt[_]]);function c(){const _=o.match(/\S+\.\S+$/g),y={dir:Kl()};(_?Vi(o,y):Ys(o,y)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))cr(new Uint8Array(b),function(A){const D="data:image/png;base64,"+A;l('')});else{const A=String.fromCharCode.apply(null,b);l(''),setTimeout(()=>{const D=document.getElementById("file-response");D.value=A,document.getElementById("file-save").addEventListener("click",function(){Ri(o,D.value,{dir:Kl()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=As(o),u)}function g(){o=this.value,n(0,o)}function k(_){$n[_?"unshift":"push"](()=>{u=_,n(1,u)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,l=_.insecureRenderHtml)},[o,u,d,c,f,i,l,g,k]}class fr extends ve{constructor(t){super(),ge(this,t,dr,ur,pe,{onMessage:5,insecureRenderHtml:6})}}var pr={};ke(pr,{Body:()=>it,Client:()=>Qs,Response:()=>Ks,ResponseType:()=>Gi,fetch:()=>mr,getClient:()=>ni});var Gi=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Gi||{}),it=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},n=(i,l)=>{if(l!==null){let o;typeof l=="string"?o=l:l instanceof Uint8Array||Array.isArray(l)?o=Array.from(l):l instanceof File?o={file:l.name,mime:l.type,fileName:l.name}:typeof l.file=="string"?o={file:l.file,mime:l.mime,fileName:l.fileName}:o={file:Array.from(l.file),mime:l.mime,fileName:l.fileName},t[String(i)]=o}};if(e instanceof FormData)for(let[i,l]of e)n(i,l);else for(let[i,l]of Object.entries(e))n(i,l);return new it("Form",t)}static json(e){return new it("Json",e)}static text(e){return new it("Text",e)}static bytes(e){return new it("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},Ks=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},Qs=class{constructor(e){this.id=e}async drop(){return L({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),L({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(n=>{let i=new Ks(n);if(t){try{i.data=JSON.parse(i.data)}catch(l){if(i.ok&&i.data==="")i.data={};else if(i.ok)throw Error(`Failed to parse response \`${i.data}\` as JSON: ${l}; - try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return i}return i})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,n){return this.request({method:"POST",url:e,body:t,...n})}async put(e,t,n){return this.request({method:"PUT",url:e,body:t,...n})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function ni(e){return L({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new Qs(t))}var Pi=null;async function mr(e,t){var n;return Pi===null&&(Pi=await ni()),Pi.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function Ql(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Zl(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,A,D,H=e[5],W=[];for(let T=0;THe(W[T],1,1,()=>{W[T]=null});let E=!e[3]&&ts(),M=!e[3]&&e[8]&&ns();return{c(){t=r("span"),n=r("span"),i=z(e[6]),l=h(),o=r("ul");for(let T=0;T{g[v]=null}),si(),o=g[l],o?o.p(_,y):(o=g[l]=f[l](_),o.c()),Le(o,1),o.m(t,u))},i(_){d||(Le(o),d=!0)},o(_){He(o),d=!1},d(_){_&&p(t),c&&c.d(),g[l].d()}}}function ts(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ns(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function br(e){let t,n,i=e[5].length&&Zl(e);return{c(){i&&i.c(),t=ii()},m(l,o){i&&i.m(l,o),m(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&Le(i,1)):(i=Zl(l),i.c(),Le(i,1),i.m(t.parentNode,t)):i&&(li(),He(i,1,1,()=>{i=null}),si())},i(l){n||(Le(i),n=!0)},o(l){He(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const gr="...";function vr(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=b=>b===null?"null":typeof b;let c,f,g,k,_;const y=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},v=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,g=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(M,"class","input"),a(P,"class","input"),a(E,"class","flex gap-2 children:grow"),a(x,"type","checkbox"),a(X,"class","btn"),a(X,"type","button")},m(R,q){m(R,t,q),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),Pt(n,e[0]),s(t,c),s(t,f),s(t,g),s(t,k),B(k,e[1]),s(t,_),s(t,y),s(t,v),s(t,b),m(R,A,q),m(R,D,q),m(R,H,q),m(R,W,q),m(R,j,q),m(R,E,q),s(E,M),B(M,e[2]),s(E,T),s(E,P),B(P,e[3]),m(R,C,q),m(R,F,q),m(R,U,q),m(R,J,q),s(J,x),x.checked=e[5],s(J,me),m(R,te,q),m(R,ie,q),m(R,Y,q),m(R,he,q),m(R,O,q),m(R,X,q),m(R,ne,q),m(R,ce,q),m(R,ae,q),m(R,ye,q),m(R,de,q),Jt(_e,R,q),$=!0,le||(Me=[S(n,"change",e[9]),S(k,"input",e[10]),S(t,"submit",Zn(e[6])),S(M,"input",e[11]),S(P,"input",e[12]),S(x,"change",e[13]),S(X,"click",e[7])],le=!0)},p(R,[q]){q&1&&Pt(n,R[0]),q&2&&B(k,R[1]),q&4&&M.value!==R[2]&&B(M,R[2]),q&8&&P.value!==R[3]&&B(P,R[3]),q&32&&(x.checked=R[5]);const We={};q&16&&(We.json=R[4]),_e.$set(We)},i(R){$||(Le(_e.$$.fragment,R),$=!0)},o(R){He(_e.$$.fragment,R),$=!1},d(R){R&&p(t),R&&p(A),R&&p(D),R&&p(H),R&&p(W),R&&p(j),R&&p(E),R&&p(C),R&&p(F),R&&p(U),R&&p(J),R&&p(te),R&&p(ie),R&&p(Y),R&&p(he),R&&p(O),R&&p(X),R&&p(ne),R&&p(ce),R&&p(ae),R&&p(ye),R&&p(de),Xt(_e,R),le=!1,re(Me)}}}function wr(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await ni().catch(j=>{throw o(j),j}),W={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?W.body=it.json(JSON.parse(l)):l!==""&&(W.body=it.text(l)),D.request(W).then(o).catch(o)}let d="baz",c="qux",f=null,g=!0;async function k(){const D=await ni().catch(H=>{throw o(H),H});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:it.form({foo:d,bar:c}),headers:g?{"Content-Type":"multipart/form-data"}:void 0,responseType:Gi.Text}))}function _(){i=Wi(this),n(0,i)}function y(){l=this.value,n(1,l)}function v(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function A(){g=this.checked,n(5,g)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,g,u,k,o,_,y,v,b,A]}class kr extends ve{constructor(t){super(),ge(this,t,wr,yr,pe,{onMessage:8})}}function Mr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Send test notification",a(t,"class","btn"),a(t,"id","notification")},m(l,o){m(l,t,o),n||(i=S(t,"click",Cr),n=!0)},p:G,i:G,o:G,d(l){l&&p(t),n=!1,i()}}}function Cr(){new Notification("Notification title",{body:"This is the notification body"})}function Tr(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class Ar extends ve{constructor(t){super(),ge(this,t,Tr,Mr,pe,{onMessage:0})}}function is(e,t,n){const i=e.slice();return i[69]=t[n],i}function ls(e,t,n){const i=e.slice();return i[72]=t[n],i}function ss(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[40].call(i))},m(f,g){m(f,t,g),m(f,n,g),m(f,i,g),s(i,l);for(let k=0;kupdate --background subcommand.`,n=h(),i=r("br"),l=h(),o=r("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=r("br"),c=h(),f=r("br"),g=h(),k=r("button"),k.textContent="Get matches",a(o,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(v,b){m(v,t,b),m(v,n,b),m(v,i,b),m(v,l,b),m(v,o,b),m(v,u,b),m(v,d,b),m(v,c,b),m(v,f,b),m(v,g,b),m(v,k,b),_||(y=S(k,"click",e[0]),_=!0)},p:G,i:G,o:G,d(v){v&&p(t),v&&p(n),v&&p(i),v&&p(l),v&&p(o),v&&p(u),v&&p(d),v&&p(c),v&&p(f),v&&p(g),v&&p(k),_=!1,y()}}}function qo(e,t,n){let{onMessage:i}=t;function l(){Gs().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class Bo extends ve{constructor(t){super(),ge(this,t,qo,Uo,pe,{onMessage:1})}}function Vo(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("button"),n.textContent="Call Log API",i=h(),l=r("button"),l.textContent="Call Request (async) API",o=h(),u=r("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(l,"class","btn"),a(l,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(f,g){m(f,t,g),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[S(n,"click",e[0]),S(l,"click",e[1]),S(u,"click",e[2])],d=!0)},p:G,i:G,o:G,d(f){f&&p(t),d=!1,re(c)}}}function Go(e,t,n){let{onMessage:i}=t,l;ft(async()=>{l=await Kt("rust-event",i)}),Ii(()=>{l&&l()});function o(){ei("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ei("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){oi("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class Jo extends ve{constructor(t){super(),ge(this,t,Go,Vo,pe,{onMessage:3})}}var Xo={};ke(Xo,{ask:()=>Xs,confirm:()=>Ko,message:()=>Yo,open:()=>Bi,save:()=>Js});async function Bi(e={}){return typeof e=="object"&&Object.freeze(e),A({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function Js(e={}){return typeof e=="object"&&Object.freeze(e),A({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Yo(e,t){var i,l;let n=typeof t=="string"?{title:t}:t;return A({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabel:(l=n==null?void 0:n.okLabel)==null?void 0:l.toString()}})}async function Xs(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return A({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Yes",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"No"]}})}async function Ko(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return A({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Ok",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"Cancel"]}})}var Qo={};ke(Qo,{BaseDirectory:()=>Yt,Dir:()=>Yt,copyFile:()=>tr,createDir:()=>xo,exists:()=>lr,readBinaryFile:()=>Vi,readDir:()=>Ys,readTextFile:()=>Zo,removeDir:()=>er,removeFile:()=>nr,renameFile:()=>ir,writeBinaryFile:()=>$o,writeFile:()=>Ri,writeTextFile:()=>Ri});var Yt=(e=>(e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log",e[e.Temp=20]="Temp",e[e.AppConfig=21]="AppConfig",e[e.AppData=22]="AppData",e[e.AppLocalData=23]="AppLocalData",e[e.AppCache=24]="AppCache",e[e.AppLog=25]="AppLog",e))(Yt||{});async function Zo(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function Vi(e,t={}){let n=await A({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Ri(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:""},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),typeof t=="string"?i.contents=t!=null?t:"":l=t,A({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function $o(e,t,n){typeof n=="object"&&Object.freeze(n),typeof e=="object"&&Object.freeze(e);let i={path:"",contents:[]},l=n;return typeof e=="string"?i.path=e:(i.path=e.path,i.contents=e.contents),t&&"dir"in t?l=t:typeof e=="string"&&(i.contents=t!=null?t:[]),A({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:l}})}async function Ys(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function xo(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function er(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function tr(e,t,n={}){return A({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function nr(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function ir(e,t,n={}){return A({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function lr(e,t={}){return A({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function sr(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P;return{c(){t=r("div"),n=r("input"),i=h(),l=r("input"),o=h(),u=r("br"),d=h(),c=r("div"),f=r("input"),g=h(),k=r("label"),k.textContent="Multiple",_=h(),y=r("div"),v=r("input"),b=h(),L=r("label"),L.textContent="Directory",D=h(),H=r("br"),W=h(),j=r("button"),j.textContent="Open dialog",E=h(),M=r("button"),M.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(l,"class","input"),a(l,"id","dialog-filter"),a(l,"placeholder","Extensions filter, comma-separated"),a(t,"class","flex gap-2 children:grow"),a(f,"type","checkbox"),a(f,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(v,"type","checkbox"),a(v,"id","dialog-directory"),a(L,"for","dialog-directory"),a(j,"class","btn"),a(j,"id","open-dialog"),a(M,"class","btn"),a(M,"id","save-dialog")},m(C,F){m(C,t,F),s(t,n),B(n,e[0]),s(t,i),s(t,l),B(l,e[1]),m(C,o,F),m(C,u,F),m(C,d,F),m(C,c,F),s(c,f),f.checked=e[2],s(c,g),s(c,k),m(C,_,F),m(C,y,F),s(y,v),v.checked=e[3],s(y,b),s(y,L),m(C,D,F),m(C,H,F),m(C,W,F),m(C,j,F),m(C,E,F),m(C,M,F),T||(P=[S(n,"input",e[8]),S(l,"input",e[9]),S(f,"change",e[10]),S(v,"change",e[11]),S(j,"click",e[4]),S(M,"click",e[5])],T=!0)},p(C,[F]){F&1&&n.value!==C[0]&&B(n,C[0]),F&2&&l.value!==C[1]&&B(l,C[1]),F&4&&(f.checked=C[2]),F&8&&(v.checked=C[3])},i:G,o:G,d(C){C&&p(t),C&&p(o),C&&p(u),C&&p(d),C&&p(c),C&&p(_),C&&p(y),C&&p(D),C&&p(H),C&&p(W),C&&p(j),C&&p(E),C&&p(M),T=!1,re(P)}}}function or(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){var o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function rr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){Bi({title:"My wonderful open dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:d,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var L=b,D=L.match(/\S+\.\S+$/g);Vi(L).then(function(H){D&&(L.includes(".png")||L.includes(".jpg"))?or(new Uint8Array(H),function(W){var j="data:image/png;base64,"+W;l('')}):i(b)}).catch(i(b))}}).catch(i)}function g(){Js({title:"My wonderful save dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){o=this.value,n(0,o)}function _(){u=this.value,n(1,u)}function y(){d=this.checked,n(2,d)}function v(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,g,i,l,k,_,y,v]}class ar extends ve{constructor(t){super(),ge(this,t,rr,sr,pe,{onMessage:6,insecureRenderHtml:7})}}function Xl(e,t,n){const i=e.slice();return i[9]=t[n],i}function Yl(e){let t,n=e[9][0]+"",i,l;return{c(){t=r("option"),i=z(n),t.__value=l=e[9][1],t.value=t.__value},m(o,u){m(o,t,u),s(t,i)},p:G,d(o){o&&p(t)}}}function ur(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j=e[2],E=[];for(let M=0;MisNaN(parseInt(_))).map(_=>[_,Yt[_]]);function c(){const _=o.match(/\S+\.\S+$/g),y={dir:Kl()};(_?Vi(o,y):Ys(o,y)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))cr(new Uint8Array(b),function(L){const D="data:image/png;base64,"+L;l('')});else{const L=String.fromCharCode.apply(null,b);l(''),setTimeout(()=>{const D=document.getElementById("file-response");D.value=L,document.getElementById("file-save").addEventListener("click",function(){Ri(o,D.value,{dir:Kl()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=Ls(o),u)}function g(){o=this.value,n(0,o)}function k(_){$n[_?"unshift":"push"](()=>{u=_,n(1,u)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,l=_.insecureRenderHtml)},[o,u,d,c,f,i,l,g,k]}class fr extends ve{constructor(t){super(),ge(this,t,dr,ur,pe,{onMessage:5,insecureRenderHtml:6})}}var pr={};ke(pr,{Body:()=>it,Client:()=>Qs,Response:()=>Ks,ResponseType:()=>Gi,fetch:()=>mr,getClient:()=>ni});var Gi=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Gi||{}),it=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={},n=(i,l)=>{if(l!==null){let o;typeof l=="string"?o=l:l instanceof Uint8Array||Array.isArray(l)?o=Array.from(l):l instanceof File?o={file:l.name,mime:l.type,fileName:l.name}:typeof l.file=="string"?o={file:l.file,mime:l.mime,fileName:l.fileName}:o={file:Array.from(l.file),mime:l.mime,fileName:l.fileName},t[String(i)]=o}};if(e instanceof FormData)for(let[i,l]of e)n(i,l);else for(let[i,l]of Object.entries(e))n(i,l);return new it("Form",t)}static json(e){return new it("Json",e)}static text(e){return new it("Text",e)}static bytes(e){return new it("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},Ks=class{constructor(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data}},Qs=class{constructor(e){this.id=e}async drop(){return A({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),A({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(n=>{let i=new Ks(n);if(t){try{i.data=JSON.parse(i.data)}catch(l){if(i.ok&&i.data==="")i.data={};else if(i.ok)throw Error(`Failed to parse response \`${i.data}\` as JSON: ${l}; + try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return i}return i})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,n){return this.request({method:"POST",url:e,body:t,...n})}async put(e,t,n){return this.request({method:"PUT",url:e,body:t,...n})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function ni(e){return A({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new Qs(t))}var Pi=null;async function mr(e,t){var n;return Pi===null&&(Pi=await ni()),Pi.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function Ql(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Zl(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H=e[5],W=[];for(let T=0;THe(W[T],1,1,()=>{W[T]=null});let E=!e[3]&&ts(),M=!e[3]&&e[8]&&ns();return{c(){t=r("span"),n=r("span"),i=z(e[6]),l=h(),o=r("ul");for(let T=0;T{g[v]=null}),si(),o=g[l],o?o.p(_,y):(o=g[l]=f[l](_),o.c()),Ae(o,1),o.m(t,u))},i(_){d||(Ae(o),d=!0)},o(_){He(o),d=!1},d(_){_&&p(t),c&&c.d(),g[l].d()}}}function ts(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ns(e){let t;return{c(){t=r("span"),t.textContent=",",a(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function br(e){let t,n,i=e[5].length&&Zl(e);return{c(){i&&i.c(),t=ii()},m(l,o){i&&i.m(l,o),m(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&Ae(i,1)):(i=Zl(l),i.c(),Ae(i,1),i.m(t.parentNode,t)):i&&(li(),He(i,1,1,()=>{i=null}),si())},i(l){n||(Ae(i),n=!0)},o(l){He(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const gr="...";function vr(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=b=>b===null?"null":typeof b;let c,f,g,k,_;const y=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},v=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,g=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(M,"class","input"),a(P,"class","input"),a(E,"class","flex gap-2 children:grow"),a(x,"type","checkbox"),a(X,"class","btn"),a(X,"type","button")},m(R,q){m(R,t,q),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),Pt(n,e[0]),s(t,c),s(t,f),s(t,g),s(t,k),B(k,e[1]),s(t,_),s(t,y),s(t,v),s(t,b),m(R,L,q),m(R,D,q),m(R,H,q),m(R,W,q),m(R,j,q),m(R,E,q),s(E,M),B(M,e[2]),s(E,T),s(E,P),B(P,e[3]),m(R,C,q),m(R,F,q),m(R,U,q),m(R,J,q),s(J,x),x.checked=e[5],s(J,me),m(R,te,q),m(R,ie,q),m(R,Y,q),m(R,he,q),m(R,O,q),m(R,X,q),m(R,ne,q),m(R,ce,q),m(R,ae,q),m(R,ye,q),m(R,de,q),Jt(_e,R,q),$=!0,le||(Me=[S(n,"change",e[9]),S(k,"input",e[10]),S(t,"submit",Zn(e[6])),S(M,"input",e[11]),S(P,"input",e[12]),S(x,"change",e[13]),S(X,"click",e[7])],le=!0)},p(R,[q]){q&1&&Pt(n,R[0]),q&2&&B(k,R[1]),q&4&&M.value!==R[2]&&B(M,R[2]),q&8&&P.value!==R[3]&&B(P,R[3]),q&32&&(x.checked=R[5]);const We={};q&16&&(We.json=R[4]),_e.$set(We)},i(R){$||(Ae(_e.$$.fragment,R),$=!0)},o(R){He(_e.$$.fragment,R),$=!1},d(R){R&&p(t),R&&p(L),R&&p(D),R&&p(H),R&&p(W),R&&p(j),R&&p(E),R&&p(C),R&&p(F),R&&p(U),R&&p(J),R&&p(te),R&&p(ie),R&&p(Y),R&&p(he),R&&p(O),R&&p(X),R&&p(ne),R&&p(ce),R&&p(ae),R&&p(ye),R&&p(de),Xt(_e,R),le=!1,re(Me)}}}function wr(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await ni().catch(j=>{throw o(j),j}),W={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?W.body=it.json(JSON.parse(l)):l!==""&&(W.body=it.text(l)),D.request(W).then(o).catch(o)}let d="baz",c="qux",f=null,g=!0;async function k(){const D=await ni().catch(H=>{throw o(H),H});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:it.form({foo:d,bar:c}),headers:g?{"Content-Type":"multipart/form-data"}:void 0,responseType:Gi.Text}))}function _(){i=Wi(this),n(0,i)}function y(){l=this.value,n(1,l)}function v(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function L(){g=this.checked,n(5,g)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,g,u,k,o,_,y,v,b,L]}class kr extends ve{constructor(t){super(),ge(this,t,wr,yr,pe,{onMessage:8})}}function Mr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Send test notification",a(t,"class","btn"),a(t,"id","notification")},m(l,o){m(l,t,o),n||(i=S(t,"click",Cr),n=!0)},p:G,i:G,o:G,d(l){l&&p(t),n=!1,i()}}}function Cr(){new Notification("Notification title",{body:"This is the notification body"})}function Tr(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class Lr extends ve{constructor(t){super(),ge(this,t,Tr,Mr,pe,{onMessage:0})}}function is(e,t,n){const i=e.slice();return i[69]=t[n],i}function ls(e,t,n){const i=e.slice();return i[72]=t[n],i}function ss(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[40].call(i))},m(f,g){m(f,t,g),m(f,n,g),m(f,i,g),s(i,l);for(let k=0;ke[59].call(Ue)),a($e,"class","input"),a($e,"type","number"),a(xe,"class","input"),a(xe,"type","number"),a(je,"class","flex gap-2"),a(et,"class","input grow"),a(et,"id","title"),a(jt,"class","btn"),a(jt,"type","submit"),a(ct,"class","flex gap-1"),a(tt,"class","input grow"),a(tt,"id","url"),a(Ut,"class","btn"),a(Ut,"id","open-url"),a(dt,"class","flex gap-1"),a(ut,"class","flex flex-col gap-1")},m(w,I){m(w,t,I),m(w,n,I),m(w,i,I),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,g),s(i,k),s(i,_),m(w,y,I),m(w,v,I),m(w,b,I),m(w,A,I),s(A,D),s(D,H),s(D,W),W.checked=e[3],s(A,j),s(A,E),s(E,M),s(E,T),T.checked=e[2],s(A,P),s(A,C),s(C,F),s(C,U),U.checked=e[4],s(A,J),s(A,x),s(x,me),s(x,te),te.checked=e[5],s(A,ie),s(A,Y),s(Y,he),s(Y,O),O.checked=e[6],s(A,X),s(A,ne),s(ne,ce),s(ne,ae),ae.checked=e[7],m(w,ye,I),m(w,de,I),m(w,_e,I),m(w,$,I),s($,le),s(le,Me),s(Me,R),s(Me,q),B(q,e[14]),s(le,We),s(le,ze),s(ze,Ce),s(ze,Z),B(Z,e[15]),s($,De),s($,ee),s(ee,Te),s(Te,lt),s(Te,fe),B(fe,e[8]),s(ee,ue),s(ee,N),s(N,se),s(N,V),B(V,e[9]),s($,Oe),s($,Be),s(Be,gt),s(gt,Qt),s(gt,Re),B(Re,e[10]),s(Be,Zt),s(Be,vt),s(vt,$t),s(vt,Ie),B(Ie,e[11]),s($,xt),s($,Ve),s(Ve,K),s(K,Ot),s(K,Se),B(Se,e[12]),s(Ve,Rt),s(Ve,st),s(st,It),s(st,Ee),B(Ee,e[13]),m(w,yt,I),m(w,wt,I),m(w,kt,I),m(w,Ae,I),s(Ae,Fe),s(Fe,Pe),s(Pe,ot),s(Pe,Ht),s(Pe,rt),s(rt,Ft),s(rt,Mt),s(Pe,en),s(Pe,tn),s(tn,Xi),s(tn,ri),s(Fe,Yi),s(Fe,Ge),s(Ge,ln),s(Ge,Ki),s(Ge,sn),s(sn,Qi),s(sn,ai),s(Ge,Zi),s(Ge,rn),s(rn,$i),s(rn,ui),s(Ae,xi),s(Ae,Ct),s(Ct,Je),s(Je,un),s(Je,el),s(Je,cn),s(cn,tl),s(cn,ci),s(Je,nl),s(Je,fn),s(fn,il),s(fn,di),s(Ct,ll),s(Ct,Xe),s(Xe,mn),s(Xe,sl),s(Xe,hn),s(hn,ol),s(hn,fi),s(Xe,rl),s(Xe,bn),s(bn,al),s(bn,pi),s(Ae,ul),s(Ae,Tt),s(Tt,Ye),s(Ye,vn),s(Ye,cl),s(Ye,yn),s(yn,dl),s(yn,mi),s(Ye,fl),s(Ye,kn),s(kn,pl),s(kn,hi),s(Tt,ml),s(Tt,Ke),s(Ke,Cn),s(Ke,hl),s(Ke,Tn),s(Tn,_l),s(Tn,_i),s(Ke,bl),s(Ke,Ln),s(Ln,gl),s(Ln,bi),s(Ae,vl),s(Ae,At),s(At,Qe),s(Qe,En),s(Qe,yl),s(Qe,zn),s(zn,wl),s(zn,gi),s(Qe,kl),s(Qe,Pn),s(Pn,Ml),s(Pn,vi),s(At,Cl),s(At,Ze),s(Ze,On),s(Ze,Tl),s(Ze,Rn),s(Rn,Al),s(Rn,yi),s(Ze,Ll),s(Ze,Hn),s(Hn,Sl),s(Hn,wi),m(w,ki,I),m(w,Mi,I),m(w,Ci,I),m(w,Nt,I),m(w,Ti,I),m(w,Ne,I),s(Ne,Nn),s(Nn,Lt),Lt.checked=e[16],s(Nn,El),s(Ne,zl),s(Ne,jn),s(jn,St),St.checked=e[17],s(jn,Dl),s(Ne,Pl),s(Ne,Un),s(Un,Et),Et.checked=e[21],s(Un,Wl),m(w,Ai,I),m(w,je,I),s(je,qn),s(qn,Ol),s(qn,Ue);for(let be=0;be=1,g,k,_,y=f&&ss(e),v=e[1][e[0]]&&rs(e);return{c(){t=r("div"),n=r("div"),i=r("input"),l=h(),o=r("button"),o.textContent="New window",u=h(),d=r("br"),c=h(),y&&y.c(),g=h(),v&&v.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(o,"class","btn"),a(n,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(b,A){m(b,t,A),s(t,n),s(n,i),B(i,e[22]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),y&&y.m(t,null),s(t,g),v&&v.m(t,null),k||(_=[S(i,"input",e[39]),S(o,"click",e[36])],k=!0)},p(b,A){A[0]&4194304&&i.value!==b[22]&&B(i,b[22]),A[0]&2&&(f=Object.keys(b[1]).length>=1),f?y?y.p(b,A):(y=ss(b),y.c(),y.m(t,g)):y&&(y.d(1),y=null),b[1][b[0]]?v?v.p(b,A):(v=rs(b),v.c(),v.m(t,null)):v&&(v.d(1),v=null)},i:G,o:G,d(b){b&&p(t),y&&y.d(),v&&v.d(),k=!1,re(_)}}}function Sr(e,t,n){let i=qe.label;const l={[qe.label]:qe},o=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=t,d,c="https://tauri.app",f=!0,g=!1,k=!0,_=!1,y=!0,v=!1,b=null,A=null,D=null,H=null,W=null,j=null,E=null,M=null,T=1,P=new nt(E,M),C=new nt(E,M),F=new mt(b,A),U=new mt(b,A),J,x,me=!1,te=!0,ie=null,Y=null,he="default",O=!1,X="Awesome Tauri Example!";function ne(){Fi(c)}function ce(){l[i].setTitle(X)}function ae(){l[i].hide(),setTimeout(l[i].show,2e3)}function ye(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function de(){Bi({multiple:!1}).then(K=>{typeof K=="string"&&l[i].setIcon(K)})}function _e(){if(!d)return;const K=new bt(d);n(1,l[d]=K,l),K.once("tauri://error",function(){u("Error creating new webview")})}function $(){l[i].innerSize().then(K=>{n(27,F=K),n(8,b=F.width),n(9,A=F.height)}),l[i].outerSize().then(K=>{n(28,U=K)})}function le(){l[i].innerPosition().then(K=>{n(25,P=K)}),l[i].outerPosition().then(K=>{n(26,C=K),n(14,E=C.x),n(15,M=C.y)})}async function Me(K){!K||(J&&J(),x&&x(),x=await K.listen("tauri://move",le),J=await K.listen("tauri://resize",$))}async function R(){await l[i].minimize(),await l[i].requestUserAttention(ji.Critical),await new Promise(K=>setTimeout(K,3e3)),await l[i].requestUserAttention(null)}function q(){d=this.value,n(22,d)}function We(){i=Wi(this),n(0,i),n(1,l)}const ze=()=>l[i].center();function Ce(){g=this.checked,n(3,g)}function Z(){f=this.checked,n(2,f)}function De(){k=this.checked,n(4,k)}function ee(){_=this.checked,n(5,_)}function Te(){y=this.checked,n(6,y)}function lt(){v=this.checked,n(7,v)}function fe(){E=oe(this.value),n(14,E)}function ue(){M=oe(this.value),n(15,M)}function N(){b=oe(this.value),n(8,b)}function se(){A=oe(this.value),n(9,A)}function V(){D=oe(this.value),n(10,D)}function Oe(){H=oe(this.value),n(11,H)}function Be(){W=oe(this.value),n(12,W)}function gt(){j=oe(this.value),n(13,j)}function Qt(){me=this.checked,n(16,me)}function Re(){te=this.checked,n(17,te)}function Zt(){O=this.checked,n(21,O)}function vt(){he=Wi(this),n(20,he),n(30,o)}function $t(){ie=oe(this.value),n(18,ie)}function Ie(){Y=oe(this.value),n(19,Y)}function xt(){X=this.value,n(29,X)}function Ve(){c=this.value,n(23,c)}return e.$$set=K=>{"onMessage"in K&&n(38,u=K.onMessage)},e.$$.update=()=>{var K,Ot,Se,Rt,st,It,Ee,yt,wt,kt,Ae,Fe,Pe,ot,Ht,rt,Ft,at,Mt;e.$$.dirty[0]&3&&(l[i],le(),$()),e.$$.dirty[0]&7&&((K=l[i])==null||K.setResizable(f)),e.$$.dirty[0]&11&&(g?(Ot=l[i])==null||Ot.maximize():(Se=l[i])==null||Se.unmaximize()),e.$$.dirty[0]&19&&((Rt=l[i])==null||Rt.setDecorations(k)),e.$$.dirty[0]&35&&((st=l[i])==null||st.setAlwaysOnTop(_)),e.$$.dirty[0]&67&&((It=l[i])==null||It.setContentProtected(y)),e.$$.dirty[0]&131&&((Ee=l[i])==null||Ee.setFullscreen(v)),e.$$.dirty[0]&771&&b&&A&&((yt=l[i])==null||yt.setSize(new mt(b,A))),e.$$.dirty[0]&3075&&(D&&H?(wt=l[i])==null||wt.setMinSize(new ti(D,H)):(kt=l[i])==null||kt.setMinSize(null)),e.$$.dirty[0]&12291&&(W>800&&j>400?(Ae=l[i])==null||Ae.setMaxSize(new ti(W,j)):(Fe=l[i])==null||Fe.setMaxSize(null)),e.$$.dirty[0]&49155&&E!==null&&M!==null&&((Pe=l[i])==null||Pe.setPosition(new nt(E,M))),e.$$.dirty[0]&3&&((ot=l[i])==null||ot.scaleFactor().then(en=>n(24,T=en))),e.$$.dirty[0]&3&&Me(l[i]),e.$$.dirty[0]&65539&&((Ht=l[i])==null||Ht.setCursorGrab(me)),e.$$.dirty[0]&131075&&((rt=l[i])==null||rt.setCursorVisible(te)),e.$$.dirty[0]&1048579&&((Ft=l[i])==null||Ft.setCursorIcon(he)),e.$$.dirty[0]&786435&&ie!==null&&Y!==null&&((at=l[i])==null||at.setCursorPosition(new nt(ie,Y))),e.$$.dirty[0]&2097155&&((Mt=l[i])==null||Mt.setIgnoreCursorEvents(O))},[i,l,f,g,k,_,y,v,b,A,D,H,W,j,E,M,me,te,ie,Y,he,O,d,c,T,P,C,F,U,X,o,ne,ce,ae,ye,de,_e,R,u,q,We,ze,Ce,Z,De,ee,Te,lt,fe,ue,N,se,V,Oe,Be,gt,Qt,Re,Zt,vt,$t,Ie,xt,Ve]}class Er extends ve{constructor(t){super(),ge(this,t,Sr,Lr,pe,{onMessage:38},null,[-1,-1,-1])}}var zr={};ke(zr,{isRegistered:()=>Pr,register:()=>$s,registerAll:()=>Dr,unregister:()=>xs,unregisterAll:()=>eo});async function $s(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:_t(t)}})}async function Dr(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:_t(t)}})}async function Pr(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function xs(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function eo(){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function us(e,t,n){const i=e.slice();return i[9]=t[n],i}function cs(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=r("div"),i=z(n),l=h(),o=r("button"),o.textContent="Unregister",a(o,"class","btn"),a(o,"type","button"),a(t,"class","flex justify-between")},m(f,g){m(f,t,g),s(t,i),s(t,l),s(t,o),u||(d=S(o,"click",c),u=!0)},p(f,g){e=f,g&2&&n!==(n=e[9]+"")&&Q(i,n)},d(f){f&&p(t),u=!1,d()}}}function ds(e){let t,n,i,l,o;return{c(){t=r("br"),n=h(),i=r("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=S(i,"click",e[5]),l=!0)},p:G,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Wr(e){let t,n,i,l,o,u,d,c,f,g,k,_=e[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=cs(us(e,_,b));let v=e[1].length>1&&ds(e);return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Register",o=h(),u=r("br"),d=h(),c=r("div");for(let b=0;b1?v?v.p(b,A):(v=ds(b),v.c(),v.m(c,null)):v&&(v.d(1),v=null)},i:G,o:G,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),ht(y,b),v&&v.d(),g=!1,re(k)}}}function Or(e,t,n){let i,{onMessage:l}=t;const o=Ts([]);ks(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;$s(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(y=>[...y,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const y=_;xs(y).then(()=>{o.update(v=>v.filter(b=>b!==y)),l(`Shortcut ${y} unregistered`)}).catch(l)}function f(){eo().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function g(){u=this.value,n(0,u)}const k=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,g,k]}class Rr extends ve{constructor(t){super(),ge(this,t,Or,Wr,pe,{onMessage:6})}}function fs(e){let t,n,i,l,o,u,d;return{c(){t=r("br"),n=h(),i=r("input"),l=h(),o=r("button"),o.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),B(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[S(i,"input",e[14]),S(o,"click",e[8])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&B(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,re(d)}}}function Ir(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,A,D,H,W,j,E,M,T,P,C=e[5]&&fs(e);return{c(){t=r("div"),n=r("div"),i=z(`Script: + `),xe=r("input"),Ai=h(),Si=r("br"),Ei=h(),ut=r("div"),ct=r("form"),et=r("input"),Nl=h(),jt=r("button"),jt.textContent="Set title",jl=h(),dt=r("form"),tt=r("input"),Ul=h(),Ut=r("button"),Ut.textContent="Open URL",a(l,"class","btn"),a(l,"title","Unminimizes after 2 seconds"),a(u,"class","btn"),a(u,"title","Unminimizes after 2 seconds"),a(c,"class","btn"),a(c,"title","Visible again after 2 seconds"),a(g,"class","btn"),a(_,"class","btn"),a(_,"title","Minimizes the window, requests attention for 3s and then resets it"),a(i,"class","flex flex-wrap gap-2"),a(W,"type","checkbox"),a(T,"type","checkbox"),a(U,"type","checkbox"),a(te,"type","checkbox"),a(O,"type","checkbox"),a(ae,"type","checkbox"),a(L,"class","flex flex-wrap gap-2"),a(q,"class","input"),a(q,"type","number"),a(q,"min","0"),a(Z,"class","input"),a(Z,"type","number"),a(Z,"min","0"),a(le,"class","flex children:grow flex-col"),a(fe,"class","input"),a(fe,"type","number"),a(fe,"min","400"),a(V,"class","input"),a(V,"type","number"),a(V,"min","400"),a(ee,"class","flex children:grow flex-col"),a(Re,"class","input"),a(Re,"type","number"),a(Ie,"class","input"),a(Ie,"type","number"),a(Be,"class","flex children:grow flex-col"),a(Se,"class","input"),a(Se,"type","number"),a(Se,"min","800"),a(Ee,"class","input"),a(Ee,"type","number"),a(Ee,"min","400"),a(Ve,"class","flex children:grow flex-col"),a($,"class","flex flex-row gap-2 flex-wrap"),a(ot,"class","text-accent dark:text-darkAccent font-700"),a(Pe,"class","grow"),a(ln,"class","text-accent dark:text-darkAccent font-700"),a(Ge,"class","grow"),a(Fe,"class","flex"),a(un,"class","text-accent dark:text-darkAccent font-700"),a(Je,"class","grow"),a(mn,"class","text-accent dark:text-darkAccent font-700"),a(Xe,"class","grow"),a(Ct,"class","flex"),a(vn,"class","text-accent dark:text-darkAccent font-700"),a(Ye,"class","grow"),a(Cn,"class","text-accent dark:text-darkAccent font-700"),a(Ke,"class","grow"),a(Tt,"class","flex"),a(En,"class","text-accent dark:text-darkAccent font-700"),a(Qe,"class","grow"),a(On,"class","text-accent dark:text-darkAccent font-700"),a(Ze,"class","grow"),a(Lt,"class","flex"),a(Nt,"class","mb-2"),a(At,"type","checkbox"),a(St,"type","checkbox"),a(Et,"type","checkbox"),a(Ne,"class","flex gap-2"),a(Ue,"class","input"),e[20]===void 0&&Wt(()=>e[59].call(Ue)),a($e,"class","input"),a($e,"type","number"),a(xe,"class","input"),a(xe,"type","number"),a(je,"class","flex gap-2"),a(et,"class","input grow"),a(et,"id","title"),a(jt,"class","btn"),a(jt,"type","submit"),a(ct,"class","flex gap-1"),a(tt,"class","input grow"),a(tt,"id","url"),a(Ut,"class","btn"),a(Ut,"id","open-url"),a(dt,"class","flex gap-1"),a(ut,"class","flex flex-col gap-1")},m(w,I){m(w,t,I),m(w,n,I),m(w,i,I),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,g),s(i,k),s(i,_),m(w,y,I),m(w,v,I),m(w,b,I),m(w,L,I),s(L,D),s(D,H),s(D,W),W.checked=e[3],s(L,j),s(L,E),s(E,M),s(E,T),T.checked=e[2],s(L,P),s(L,C),s(C,F),s(C,U),U.checked=e[4],s(L,J),s(L,x),s(x,me),s(x,te),te.checked=e[5],s(L,ie),s(L,Y),s(Y,he),s(Y,O),O.checked=e[6],s(L,X),s(L,ne),s(ne,ce),s(ne,ae),ae.checked=e[7],m(w,ye,I),m(w,de,I),m(w,_e,I),m(w,$,I),s($,le),s(le,Me),s(Me,R),s(Me,q),B(q,e[14]),s(le,We),s(le,ze),s(ze,Ce),s(ze,Z),B(Z,e[15]),s($,De),s($,ee),s(ee,Te),s(Te,lt),s(Te,fe),B(fe,e[8]),s(ee,ue),s(ee,N),s(N,se),s(N,V),B(V,e[9]),s($,Oe),s($,Be),s(Be,gt),s(gt,Qt),s(gt,Re),B(Re,e[10]),s(Be,Zt),s(Be,vt),s(vt,$t),s(vt,Ie),B(Ie,e[11]),s($,xt),s($,Ve),s(Ve,K),s(K,Ot),s(K,Se),B(Se,e[12]),s(Ve,Rt),s(Ve,st),s(st,It),s(st,Ee),B(Ee,e[13]),m(w,yt,I),m(w,wt,I),m(w,kt,I),m(w,Le,I),s(Le,Fe),s(Fe,Pe),s(Pe,ot),s(Pe,Ht),s(Pe,rt),s(rt,Ft),s(rt,Mt),s(Pe,en),s(Pe,tn),s(tn,Xi),s(tn,ri),s(Fe,Yi),s(Fe,Ge),s(Ge,ln),s(Ge,Ki),s(Ge,sn),s(sn,Qi),s(sn,ai),s(Ge,Zi),s(Ge,rn),s(rn,$i),s(rn,ui),s(Le,xi),s(Le,Ct),s(Ct,Je),s(Je,un),s(Je,el),s(Je,cn),s(cn,tl),s(cn,ci),s(Je,nl),s(Je,fn),s(fn,il),s(fn,di),s(Ct,ll),s(Ct,Xe),s(Xe,mn),s(Xe,sl),s(Xe,hn),s(hn,ol),s(hn,fi),s(Xe,rl),s(Xe,bn),s(bn,al),s(bn,pi),s(Le,ul),s(Le,Tt),s(Tt,Ye),s(Ye,vn),s(Ye,cl),s(Ye,yn),s(yn,dl),s(yn,mi),s(Ye,fl),s(Ye,kn),s(kn,pl),s(kn,hi),s(Tt,ml),s(Tt,Ke),s(Ke,Cn),s(Ke,hl),s(Ke,Tn),s(Tn,_l),s(Tn,_i),s(Ke,bl),s(Ke,An),s(An,gl),s(An,bi),s(Le,vl),s(Le,Lt),s(Lt,Qe),s(Qe,En),s(Qe,yl),s(Qe,zn),s(zn,wl),s(zn,gi),s(Qe,kl),s(Qe,Pn),s(Pn,Ml),s(Pn,vi),s(Lt,Cl),s(Lt,Ze),s(Ze,On),s(Ze,Tl),s(Ze,Rn),s(Rn,Ll),s(Rn,yi),s(Ze,Al),s(Ze,Hn),s(Hn,Sl),s(Hn,wi),m(w,ki,I),m(w,Mi,I),m(w,Ci,I),m(w,Nt,I),m(w,Ti,I),m(w,Ne,I),s(Ne,Nn),s(Nn,At),At.checked=e[16],s(Nn,El),s(Ne,zl),s(Ne,jn),s(jn,St),St.checked=e[17],s(jn,Dl),s(Ne,Pl),s(Ne,Un),s(Un,Et),Et.checked=e[21],s(Un,Wl),m(w,Li,I),m(w,je,I),s(je,qn),s(qn,Ol),s(qn,Ue);for(let be=0;be=1,g,k,_,y=f&&ss(e),v=e[1][e[0]]&&rs(e);return{c(){t=r("div"),n=r("div"),i=r("input"),l=h(),o=r("button"),o.textContent="New window",u=h(),d=r("br"),c=h(),y&&y.c(),g=h(),v&&v.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(o,"class","btn"),a(n,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(b,L){m(b,t,L),s(t,n),s(n,i),B(i,e[22]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),y&&y.m(t,null),s(t,g),v&&v.m(t,null),k||(_=[S(i,"input",e[39]),S(o,"click",e[36])],k=!0)},p(b,L){L[0]&4194304&&i.value!==b[22]&&B(i,b[22]),L[0]&2&&(f=Object.keys(b[1]).length>=1),f?y?y.p(b,L):(y=ss(b),y.c(),y.m(t,g)):y&&(y.d(1),y=null),b[1][b[0]]?v?v.p(b,L):(v=rs(b),v.c(),v.m(t,null)):v&&(v.d(1),v=null)},i:G,o:G,d(b){b&&p(t),y&&y.d(),v&&v.d(),k=!1,re(_)}}}function Sr(e,t,n){let i=qe.label;const l={[qe.label]:qe},o=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=t,d,c="https://tauri.app",f=!0,g=!1,k=!0,_=!1,y=!0,v=!1,b=null,L=null,D=null,H=null,W=null,j=null,E=null,M=null,T=1,P=new nt(E,M),C=new nt(E,M),F=new mt(b,L),U=new mt(b,L),J,x,me=!1,te=!0,ie=null,Y=null,he="default",O=!1,X="Awesome Tauri Example!";function ne(){Fi(c)}function ce(){l[i].setTitle(X)}function ae(){l[i].hide(),setTimeout(l[i].show,2e3)}function ye(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function de(){Bi({multiple:!1}).then(K=>{typeof K=="string"&&l[i].setIcon(K)})}function _e(){if(!d)return;const K=new bt(d);n(1,l[d]=K,l),K.once("tauri://error",function(){u("Error creating new webview")})}function $(){l[i].innerSize().then(K=>{n(27,F=K),n(8,b=F.width),n(9,L=F.height)}),l[i].outerSize().then(K=>{n(28,U=K)})}function le(){l[i].innerPosition().then(K=>{n(25,P=K)}),l[i].outerPosition().then(K=>{n(26,C=K),n(14,E=C.x),n(15,M=C.y)})}async function Me(K){!K||(J&&J(),x&&x(),x=await K.listen("tauri://move",le),J=await K.listen("tauri://resize",$))}async function R(){await l[i].minimize(),await l[i].requestUserAttention(ji.Critical),await new Promise(K=>setTimeout(K,3e3)),await l[i].requestUserAttention(null)}function q(){d=this.value,n(22,d)}function We(){i=Wi(this),n(0,i),n(1,l)}const ze=()=>l[i].center();function Ce(){g=this.checked,n(3,g)}function Z(){f=this.checked,n(2,f)}function De(){k=this.checked,n(4,k)}function ee(){_=this.checked,n(5,_)}function Te(){y=this.checked,n(6,y)}function lt(){v=this.checked,n(7,v)}function fe(){E=oe(this.value),n(14,E)}function ue(){M=oe(this.value),n(15,M)}function N(){b=oe(this.value),n(8,b)}function se(){L=oe(this.value),n(9,L)}function V(){D=oe(this.value),n(10,D)}function Oe(){H=oe(this.value),n(11,H)}function Be(){W=oe(this.value),n(12,W)}function gt(){j=oe(this.value),n(13,j)}function Qt(){me=this.checked,n(16,me)}function Re(){te=this.checked,n(17,te)}function Zt(){O=this.checked,n(21,O)}function vt(){he=Wi(this),n(20,he),n(30,o)}function $t(){ie=oe(this.value),n(18,ie)}function Ie(){Y=oe(this.value),n(19,Y)}function xt(){X=this.value,n(29,X)}function Ve(){c=this.value,n(23,c)}return e.$$set=K=>{"onMessage"in K&&n(38,u=K.onMessage)},e.$$.update=()=>{var K,Ot,Se,Rt,st,It,Ee,yt,wt,kt,Le,Fe,Pe,ot,Ht,rt,Ft,at,Mt;e.$$.dirty[0]&3&&(l[i],le(),$()),e.$$.dirty[0]&7&&((K=l[i])==null||K.setResizable(f)),e.$$.dirty[0]&11&&(g?(Ot=l[i])==null||Ot.maximize():(Se=l[i])==null||Se.unmaximize()),e.$$.dirty[0]&19&&((Rt=l[i])==null||Rt.setDecorations(k)),e.$$.dirty[0]&35&&((st=l[i])==null||st.setAlwaysOnTop(_)),e.$$.dirty[0]&67&&((It=l[i])==null||It.setContentProtected(y)),e.$$.dirty[0]&131&&((Ee=l[i])==null||Ee.setFullscreen(v)),e.$$.dirty[0]&771&&b&&L&&((yt=l[i])==null||yt.setSize(new mt(b,L))),e.$$.dirty[0]&3075&&(D&&H?(wt=l[i])==null||wt.setMinSize(new ti(D,H)):(kt=l[i])==null||kt.setMinSize(null)),e.$$.dirty[0]&12291&&(W>800&&j>400?(Le=l[i])==null||Le.setMaxSize(new ti(W,j)):(Fe=l[i])==null||Fe.setMaxSize(null)),e.$$.dirty[0]&49155&&E!==null&&M!==null&&((Pe=l[i])==null||Pe.setPosition(new nt(E,M))),e.$$.dirty[0]&3&&((ot=l[i])==null||ot.scaleFactor().then(en=>n(24,T=en))),e.$$.dirty[0]&3&&Me(l[i]),e.$$.dirty[0]&65539&&((Ht=l[i])==null||Ht.setCursorGrab(me)),e.$$.dirty[0]&131075&&((rt=l[i])==null||rt.setCursorVisible(te)),e.$$.dirty[0]&1048579&&((Ft=l[i])==null||Ft.setCursorIcon(he)),e.$$.dirty[0]&786435&&ie!==null&&Y!==null&&((at=l[i])==null||at.setCursorPosition(new nt(ie,Y))),e.$$.dirty[0]&2097155&&((Mt=l[i])==null||Mt.setIgnoreCursorEvents(O))},[i,l,f,g,k,_,y,v,b,L,D,H,W,j,E,M,me,te,ie,Y,he,O,d,c,T,P,C,F,U,X,o,ne,ce,ae,ye,de,_e,R,u,q,We,ze,Ce,Z,De,ee,Te,lt,fe,ue,N,se,V,Oe,Be,gt,Qt,Re,Zt,vt,$t,Ie,xt,Ve]}class Er extends ve{constructor(t){super(),ge(this,t,Sr,Ar,pe,{onMessage:38},null,[-1,-1,-1])}}var zr={};ke(zr,{isRegistered:()=>Pr,register:()=>$s,registerAll:()=>Dr,unregister:()=>xs,unregisterAll:()=>eo});async function $s(e,t){return A({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:_t(t)}})}async function Dr(e,t){return A({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:_t(t)}})}async function Pr(e){return A({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function xs(e){return A({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function eo(){return A({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function us(e,t,n){const i=e.slice();return i[9]=t[n],i}function cs(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=r("div"),i=z(n),l=h(),o=r("button"),o.textContent="Unregister",a(o,"class","btn"),a(o,"type","button"),a(t,"class","flex justify-between")},m(f,g){m(f,t,g),s(t,i),s(t,l),s(t,o),u||(d=S(o,"click",c),u=!0)},p(f,g){e=f,g&2&&n!==(n=e[9]+"")&&Q(i,n)},d(f){f&&p(t),u=!1,d()}}}function ds(e){let t,n,i,l,o;return{c(){t=r("br"),n=h(),i=r("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=S(i,"click",e[5]),l=!0)},p:G,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Wr(e){let t,n,i,l,o,u,d,c,f,g,k,_=e[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=cs(us(e,_,b));let v=e[1].length>1&&ds(e);return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Register",o=h(),u=r("br"),d=h(),c=r("div");for(let b=0;b1?v?v.p(b,L):(v=ds(b),v.c(),v.m(c,null)):v&&(v.d(1),v=null)},i:G,o:G,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),ht(y,b),v&&v.d(),g=!1,re(k)}}}function Or(e,t,n){let i,{onMessage:l}=t;const o=Ts([]);ks(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;$s(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(y=>[...y,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const y=_;xs(y).then(()=>{o.update(v=>v.filter(b=>b!==y)),l(`Shortcut ${y} unregistered`)}).catch(l)}function f(){eo().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function g(){u=this.value,n(0,u)}const k=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,g,k]}class Rr extends ve{constructor(t){super(),ge(this,t,Or,Wr,pe,{onMessage:6})}}function fs(e){let t,n,i,l,o,u,d;return{c(){t=r("br"),n=h(),i=r("input"),l=h(),o=r("button"),o.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),B(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[S(i,"input",e[14]),S(o,"click",e[8])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&B(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,re(d)}}}function Ir(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,L,D,H,W,j,E,M,T,P,C=e[5]&&fs(e);return{c(){t=r("div"),n=r("div"),i=z(`Script: `),l=r("input"),o=h(),u=r("div"),d=z(`Encoding: `),c=r("input"),f=h(),g=r("div"),k=z(`Working directory: `),_=r("input"),y=h(),v=r("div"),b=z(`Arguments: - `),A=r("input"),D=h(),H=r("div"),W=r("button"),W.textContent="Run",j=h(),E=r("button"),E.textContent="Kill",M=h(),C&&C.c(),a(l,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(g,"class","flex items-center gap-1"),a(A,"class","grow input"),a(A,"placeholder","Environment variables"),a(v,"class","flex items-center gap-1"),a(W,"class","btn"),a(E,"class","btn"),a(H,"class","flex children:grow gap-1"),a(t,"class","flex flex-col childre:grow gap-1")},m(F,U){m(F,t,U),s(t,n),s(n,i),s(n,l),B(l,e[0]),s(t,o),s(t,u),s(u,d),s(u,c),B(c,e[3]),s(t,f),s(t,g),s(g,k),s(g,_),B(_,e[1]),s(t,y),s(t,v),s(v,b),s(v,A),B(A,e[2]),s(t,D),s(t,H),s(H,W),s(H,j),s(H,E),s(t,M),C&&C.m(t,null),T||(P=[S(l,"input",e[10]),S(c,"input",e[11]),S(_,"input",e[12]),S(A,"input",e[13]),S(W,"click",e[6]),S(E,"click",e[7])],T=!0)},p(F,[U]){U&1&&l.value!==F[0]&&B(l,F[0]),U&8&&c.value!==F[3]&&B(c,F[3]),U&2&&_.value!==F[1]&&B(_,F[1]),U&4&&A.value!==F[2]&&B(A,F[2]),F[5]?C?C.p(F,U):(C=fs(F),C.c(),C.m(t,null)):C&&(C.d(1),C=null)},i:G,o:G,d(F){F&&p(t),C&&C.d(),T=!1,re(P)}}}function Hr(e,t,n){const i=navigator.userAgent.includes("Windows");let l=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:u}=t,d='echo "hello world"',c=null,f="SOMETHING=value ANOTHER=2",g="",k="",_;function y(){return f.split(" ").reduce((M,T)=>{let[P,C]=T.split("=");return{...M,[P]:C}},{})}function v(){n(5,_=null);const M=new Hi(l,[...o,d],{cwd:c||null,env:y(),encoding:g});M.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,_=null)}),M.on("error",T=>u(`command error: "${T}"`)),M.stdout.on("data",T=>u(`command stdout: "${T}"`)),M.stderr.on("data",T=>u(`command stderr: "${T}"`)),M.spawn().then(T=>{n(5,_=T)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function A(){_.write(k).catch(u)}function D(){d=this.value,n(0,d)}function H(){g=this.value,n(3,g)}function W(){c=this.value,n(1,c)}function j(){f=this.value,n(2,f)}function E(){k=this.value,n(4,k)}return e.$$set=M=>{"onMessage"in M&&n(9,u=M.onMessage)},[d,c,f,g,k,_,v,b,A,u,D,H,W,j,E]}class Fr extends ve{constructor(t){super(),ge(this,t,Hr,Ir,pe,{onMessage:9})}}var Nr={};ke(Nr,{checkUpdate:()=>no,installUpdate:()=>to,onUpdaterEvent:()=>Ji});async function Ji(e){return Kt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function to(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error)return t(),i(o.error);if(o.status==="DONE")return t(),n()}Ji(l).then(o=>{e=o}).catch(o=>{throw t(),o}),oi("tauri://update-install").catch(o=>{throw t(),o})})}async function no(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){return t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error)return t(),i(u.error);if(u.status==="UPTODATE")return t(),n({shouldUpdate:!1})}Ps("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),Ji(o).then(u=>{e=u}).catch(u=>{throw t(),u}),oi("tauri://update").catch(u=>{throw t(),u})})}function jr(e){let t;return{c(){t=r("button"),t.innerHTML='
',a(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,t,i)},p:G,d(n){n&&p(t)}}}function Ur(e){let t,n,i;return{c(){t=r("button"),t.textContent="Install update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=S(t,"click",e[4]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function qr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Check update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=S(t,"click",e[3]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function Br(e){let t;function n(o,u){return!o[0]&&!o[2]?qr:!o[1]&&o[2]?Ur:jr}let i=n(e),l=i(e);return{c(){t=r("div"),l.c(),a(t,"class","flex children:grow children:h10")},m(o,u){m(o,t,u),l.m(t,null)},p(o,[u]){i===(i=n(o))&&l?l.p(o,u):(l.d(1),l=i(o),l&&(l.c(),l.m(t,null)))},i:G,o:G,d(o){o&&p(t),l.d()}}}function Vr(e,t,n){let{onMessage:i}=t,l;ft(async()=>{l=await Kt("tauri://update-status",i)}),Ii(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:g,manifest:k}=await no();i(`Should update: ${g}`),i(k),n(2,d=g)}catch(g){i(g)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await to(),i("Installation complete, restart required."),await qi()}catch(g){i(g)}finally{n(1,u=!1)}}return e.$$set=g=>{"onMessage"in g&&n(5,i=g.onMessage)},[o,u,d,c,f,i]}class Gr extends ve{constructor(t){super(),ge(this,t,Vr,Br,pe,{onMessage:5})}}var Jr={};ke(Jr,{readText:()=>lo,writeText:()=>io});async function io(e){return L({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function lo(){return L({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Xr(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Write",o=h(),u=r("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(l,"class","btn"),a(l,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(t,"class","flex gap-1")},m(f,g){m(f,t,g),s(t,n),B(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[S(n,"input",e[4]),S(l,"click",e[1]),S(u,"click",e[2])],d=!0)},p(f,[g]){g&1&&n.value!==f[0]&&B(n,f[0])},i:G,o:G,d(f){f&&p(t),d=!1,re(c)}}}function Yr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){io(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){lo().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function d(){l=this.value,n(0,l)}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,o,u,i,d]}class Kr extends ve{constructor(t){super(),ge(this,t,Yr,Xr,pe,{onMessage:3})}}function Qr(e){let t;return{c(){t=r("div"),t.innerHTML=`
Not available for Linux
- `,a(t,"class","flex flex-col gap-2")},m(n,i){m(n,t,i)},p:G,i:G,o:G,d(n){n&&p(t)}}}function Zr(e,t,n){let{onMessage:i}=t;const l=window.constraints={audio:!0,video:!0};function o(d){const c=document.querySelector("video"),f=d.getVideoTracks();i("Got stream with constraints:",l),i(`Using video device: ${f[0].label}`),window.stream=d,c.srcObject=d}function u(d){if(d.name==="ConstraintNotSatisfiedError"){const c=l.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else d.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${d.name}`,d)}return ft(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Ii(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class $r extends ve{constructor(t){super(),ge(this,t,Zr,Qr,pe,{onMessage:0})}}function xr(e){let t,n,i,l,o,u;return{c(){t=r("div"),n=r("button"),n.textContent="Show",i=h(),l=r("button"),l.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(l,"class","btn"),a(l,"id","hide")},m(d,c){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[S(n,"click",e[0]),S(l,"click",e[1])],o=!0)},p:G,i:G,o:G,d(d){d&&p(t),o=!1,re(u)}}}function ea(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{qs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Bs().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class ta extends ve{constructor(t){super(),ge(this,t,ea,xr,pe,{onMessage:2})}}function ps(e,t,n){const i=e.slice();return i[32]=t[n],i}function ms(e,t,n){const i=e.slice();return i[35]=t[n],i}function hs(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b;function A(M,T){return M[3]?ia:na}let D=A(e),H=D(e);function W(M,T){return M[2]?sa:la}let j=W(e),E=j(e);return{c(){t=r("div"),n=r("span"),n.textContent="Tauri API Validation",i=h(),l=r("span"),o=r("span"),H.c(),d=h(),c=r("span"),c.innerHTML='
',f=h(),g=r("span"),E.c(),_=h(),y=r("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),a(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(g,"title",k=e[2]?"Restore":"Maximize"),a(g,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(t,"data-tauri-drag-region","")},m(M,T){m(M,t,T),s(t,n),s(t,i),s(t,l),s(l,o),H.m(o,null),s(l,d),s(l,c),s(l,f),s(l,g),E.m(g,null),s(l,_),s(l,y),v||(b=[S(o,"click",e[12]),S(c,"click",e[9]),S(g,"click",e[10]),S(y,"click",e[11])],v=!0)},p(M,T){D!==(D=A(M))&&(H.d(1),H=D(M),H&&(H.c(),H.m(o,null))),T[0]&8&&u!==(u=M[3]?"Switch to Light mode":"Switch to Dark mode")&&a(o,"title",u),j!==(j=W(M))&&(E.d(1),E=j(M),E&&(E.c(),E.m(g,null))),T[0]&4&&k!==(k=M[2]?"Restore":"Maximize")&&a(g,"title",k)},d(M){M&&p(t),H.d(),E.d(),v=!1,re(b)}}}function na(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ia(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function la(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function sa(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function oa(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ra(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function _s(e){let t,n,i,l,o,u,d,c,f;function g(y,v){return y[3]?ua:aa}let k=g(e),_=k(e);return{c(){t=r("a"),_.c(),n=h(),i=r("br"),l=h(),o=r("div"),u=h(),d=r("br"),a(t,"href","##"),a(t,"class","nv justify-between h-8"),a(o,"class","bg-white/5 h-2px")},m(y,v){m(y,t,v),_.m(t,null),m(y,n,v),m(y,i,v),m(y,l,v),m(y,o,v),m(y,u,v),m(y,d,v),c||(f=S(t,"click",e[12]),c=!0)},p(y,v){k!==(k=g(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(t,null)))},d(y){y&&p(t),_.d(),y&&p(n),y&&p(i),y&&p(l),y&&p(o),y&&p(u),y&&p(d),c=!1,f()}}}function aa(e){let t,n;return{c(){t=z(`Switch to Dark mode + `),L=r("input"),D=h(),H=r("div"),W=r("button"),W.textContent="Run",j=h(),E=r("button"),E.textContent="Kill",M=h(),C&&C.c(),a(l,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(g,"class","flex items-center gap-1"),a(L,"class","grow input"),a(L,"placeholder","Environment variables"),a(v,"class","flex items-center gap-1"),a(W,"class","btn"),a(E,"class","btn"),a(H,"class","flex children:grow gap-1"),a(t,"class","flex flex-col childre:grow gap-1")},m(F,U){m(F,t,U),s(t,n),s(n,i),s(n,l),B(l,e[0]),s(t,o),s(t,u),s(u,d),s(u,c),B(c,e[3]),s(t,f),s(t,g),s(g,k),s(g,_),B(_,e[1]),s(t,y),s(t,v),s(v,b),s(v,L),B(L,e[2]),s(t,D),s(t,H),s(H,W),s(H,j),s(H,E),s(t,M),C&&C.m(t,null),T||(P=[S(l,"input",e[10]),S(c,"input",e[11]),S(_,"input",e[12]),S(L,"input",e[13]),S(W,"click",e[6]),S(E,"click",e[7])],T=!0)},p(F,[U]){U&1&&l.value!==F[0]&&B(l,F[0]),U&8&&c.value!==F[3]&&B(c,F[3]),U&2&&_.value!==F[1]&&B(_,F[1]),U&4&&L.value!==F[2]&&B(L,F[2]),F[5]?C?C.p(F,U):(C=fs(F),C.c(),C.m(t,null)):C&&(C.d(1),C=null)},i:G,o:G,d(F){F&&p(t),C&&C.d(),T=!1,re(P)}}}function Hr(e,t,n){const i=navigator.userAgent.includes("Windows");let l=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:u}=t,d='echo "hello world"',c=null,f="SOMETHING=value ANOTHER=2",g="",k="",_;function y(){return f.split(" ").reduce((M,T)=>{let[P,C]=T.split("=");return{...M,[P]:C}},{})}function v(){n(5,_=null);const M=new Hi(l,[...o,d],{cwd:c||null,env:y(),encoding:g});M.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,_=null)}),M.on("error",T=>u(`command error: "${T}"`)),M.stdout.on("data",T=>u(`command stdout: "${T}"`)),M.stderr.on("data",T=>u(`command stderr: "${T}"`)),M.spawn().then(T=>{n(5,_=T)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function L(){_.write(k).catch(u)}function D(){d=this.value,n(0,d)}function H(){g=this.value,n(3,g)}function W(){c=this.value,n(1,c)}function j(){f=this.value,n(2,f)}function E(){k=this.value,n(4,k)}return e.$$set=M=>{"onMessage"in M&&n(9,u=M.onMessage)},[d,c,f,g,k,_,v,b,L,u,D,H,W,j,E]}class Fr extends ve{constructor(t){super(),ge(this,t,Hr,Ir,pe,{onMessage:9})}}var Nr={};ke(Nr,{checkUpdate:()=>no,installUpdate:()=>to,onUpdaterEvent:()=>Ji});async function Ji(e){return Kt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function to(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error)return t(),i(o.error);if(o.status==="DONE")return t(),n()}Ji(l).then(o=>{e=o}).catch(o=>{throw t(),o}),oi("tauri://update-install").catch(o=>{throw t(),o})})}async function no(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){return t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error)return t(),i(u.error);if(u.status==="UPTODATE")return t(),n({shouldUpdate:!1})}Ps("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),Ji(o).then(u=>{e=u}).catch(u=>{throw t(),u}),oi("tauri://update").catch(u=>{throw t(),u})})}function jr(e){let t;return{c(){t=r("button"),t.innerHTML='
',a(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,t,i)},p:G,d(n){n&&p(t)}}}function Ur(e){let t,n,i;return{c(){t=r("button"),t.textContent="Install update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=S(t,"click",e[4]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function qr(e){let t,n,i;return{c(){t=r("button"),t.textContent="Check update",a(t,"class","btn")},m(l,o){m(l,t,o),n||(i=S(t,"click",e[3]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function Br(e){let t;function n(o,u){return!o[0]&&!o[2]?qr:!o[1]&&o[2]?Ur:jr}let i=n(e),l=i(e);return{c(){t=r("div"),l.c(),a(t,"class","flex children:grow children:h10")},m(o,u){m(o,t,u),l.m(t,null)},p(o,[u]){i===(i=n(o))&&l?l.p(o,u):(l.d(1),l=i(o),l&&(l.c(),l.m(t,null)))},i:G,o:G,d(o){o&&p(t),l.d()}}}function Vr(e,t,n){let{onMessage:i}=t,l;ft(async()=>{l=await Kt("tauri://update-status",i)}),Ii(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:g,manifest:k}=await no();i(`Should update: ${g}`),i(k),n(2,d=g)}catch(g){i(g)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await to(),i("Installation complete, restart required."),await qi()}catch(g){i(g)}finally{n(1,u=!1)}}return e.$$set=g=>{"onMessage"in g&&n(5,i=g.onMessage)},[o,u,d,c,f,i]}class Gr extends ve{constructor(t){super(),ge(this,t,Vr,Br,pe,{onMessage:5})}}var Jr={};ke(Jr,{readText:()=>lo,writeText:()=>io});async function io(e){return A({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function lo(){return A({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Xr(e){let t,n,i,l,o,u,d,c;return{c(){t=r("div"),n=r("input"),i=h(),l=r("button"),l.textContent="Write",o=h(),u=r("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(l,"class","btn"),a(l,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(t,"class","flex gap-1")},m(f,g){m(f,t,g),s(t,n),B(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[S(n,"input",e[4]),S(l,"click",e[1]),S(u,"click",e[2])],d=!0)},p(f,[g]){g&1&&n.value!==f[0]&&B(n,f[0])},i:G,o:G,d(f){f&&p(t),d=!1,re(c)}}}function Yr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){io(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){lo().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function d(){l=this.value,n(0,l)}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,o,u,i,d]}class Kr extends ve{constructor(t){super(),ge(this,t,Yr,Xr,pe,{onMessage:3})}}function Qr(e){let t;return{c(){t=r("div"),t.innerHTML=`
Not available for Linux
+ `,a(t,"class","flex flex-col gap-2")},m(n,i){m(n,t,i)},p:G,i:G,o:G,d(n){n&&p(t)}}}function Zr(e,t,n){let{onMessage:i}=t;const l=window.constraints={audio:!0,video:!0};function o(d){const c=document.querySelector("video"),f=d.getVideoTracks();i("Got stream with constraints:",l),i(`Using video device: ${f[0].label}`),window.stream=d,c.srcObject=d}function u(d){if(d.name==="ConstraintNotSatisfiedError"){const c=l.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else d.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${d.name}`,d)}return ft(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Ii(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class $r extends ve{constructor(t){super(),ge(this,t,Zr,Qr,pe,{onMessage:0})}}function xr(e){let t,n,i,l,o,u;return{c(){t=r("div"),n=r("button"),n.textContent="Show",i=h(),l=r("button"),l.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(l,"class","btn"),a(l,"id","hide")},m(d,c){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[S(n,"click",e[0]),S(l,"click",e[1])],o=!0)},p:G,i:G,o:G,d(d){d&&p(t),o=!1,re(u)}}}function ea(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{qs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Bs().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class ta extends ve{constructor(t){super(),ge(this,t,ea,xr,pe,{onMessage:2})}}function ps(e,t,n){const i=e.slice();return i[32]=t[n],i}function ms(e,t,n){const i=e.slice();return i[35]=t[n],i}function hs(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b;function L(M,T){return M[3]?ia:na}let D=L(e),H=D(e);function W(M,T){return M[2]?sa:la}let j=W(e),E=j(e);return{c(){t=r("div"),n=r("span"),n.textContent="Tauri API Validation",i=h(),l=r("span"),o=r("span"),H.c(),d=h(),c=r("span"),c.innerHTML='
',f=h(),g=r("span"),E.c(),_=h(),y=r("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),a(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(g,"title",k=e[2]?"Restore":"Maximize"),a(g,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(t,"data-tauri-drag-region","")},m(M,T){m(M,t,T),s(t,n),s(t,i),s(t,l),s(l,o),H.m(o,null),s(l,d),s(l,c),s(l,f),s(l,g),E.m(g,null),s(l,_),s(l,y),v||(b=[S(o,"click",e[12]),S(c,"click",e[9]),S(g,"click",e[10]),S(y,"click",e[11])],v=!0)},p(M,T){D!==(D=L(M))&&(H.d(1),H=D(M),H&&(H.c(),H.m(o,null))),T[0]&8&&u!==(u=M[3]?"Switch to Light mode":"Switch to Dark mode")&&a(o,"title",u),j!==(j=W(M))&&(E.d(1),E=j(M),E&&(E.c(),E.m(g,null))),T[0]&4&&k!==(k=M[2]?"Restore":"Maximize")&&a(g,"title",k)},d(M){M&&p(t),H.d(),E.d(),v=!1,re(b)}}}function na(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ia(e){let t;return{c(){t=r("div"),a(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function la(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function sa(e){let t;return{c(){t=r("div"),a(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function oa(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function ra(e){let t;return{c(){t=r("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function _s(e){let t,n,i,l,o,u,d,c,f;function g(y,v){return y[3]?ua:aa}let k=g(e),_=k(e);return{c(){t=r("a"),_.c(),n=h(),i=r("br"),l=h(),o=r("div"),u=h(),d=r("br"),a(t,"href","##"),a(t,"class","nv justify-between h-8"),a(o,"class","bg-white/5 h-2px")},m(y,v){m(y,t,v),_.m(t,null),m(y,n,v),m(y,i,v),m(y,l,v),m(y,o,v),m(y,u,v),m(y,d,v),c||(f=S(t,"click",e[12]),c=!0)},p(y,v){k!==(k=g(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(t,null)))},d(y){y&&p(t),_.d(),y&&p(n),y&&p(i),y&&p(l),y&&p(o),y&&p(u),y&&p(d),c=!1,f()}}}function aa(e){let t,n;return{c(){t=z(`Switch to Dark mode `),n=r("div"),a(n,"class","i-ph-moon")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function ua(e){let t,n;return{c(){t=z(`Switch to Light mode - `),n=r("div"),a(n,"class","i-ph-sun")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function ca(e){let t,n,i,l,o,u=e[35].label+"",d,c,f,g;function k(){return e[20](e[35])}return{c(){t=r("a"),n=r("div"),l=h(),o=r("p"),d=z(u),a(n,"class",i=e[35].icon+" mr-2"),a(t,"href","##"),a(t,"class",c="nv "+(e[1]===e[35]?"nv_selected":""))},m(_,y){m(_,t,y),s(t,n),s(t,l),s(t,o),s(o,d),f||(g=S(t,"click",k),f=!0)},p(_,y){e=_,y[0]&2&&c!==(c="nv "+(e[1]===e[35]?"nv_selected":""))&&a(t,"class",c)},d(_){_&&p(t),f=!1,g()}}}function bs(e){let t,n=e[35]&&ca(e);return{c(){n&&n.c(),t=ii()},m(i,l){n&&n.m(i,l),m(i,t,l)},p(i,l){i[35]&&n.p(i,l)},d(i){n&&n.d(i),i&&p(t)}}}function gs(e){let t,n=e[32].html+"",i;return{c(){t=new po(!1),i=ii(),t.a=i},m(l,o){t.m(n,l,o),m(l,i,o)},p(l,o){o[0]&64&&n!==(n=l[32].html+"")&&t.p(n)},d(l){l&&p(i),l&&t.d()}}}function da(e){let t,n,i,l,o,u,d,c,f,g,k,_,y,v,b,A,D,H,W,j,E,M,T,P,C,F,U,J=e[1].label+"",x,me,te,ie,Y,he,O,X,ne,ce,ae,ye,de,_e,$,le,Me,R,q=e[5]&&hs(e);function We(N,se){return N[0]?ra:oa}let ze=We(e),Ce=ze(e),Z=!e[5]&&_s(e),De=e[7],ee=[];for(let N=0;N`,k=h(),_=r("a"),_.innerHTML=`GitHub `,y=h(),v=r("a"),v.innerHTML=`Source - `,b=h(),A=r("br"),D=h(),H=r("div"),W=h(),j=r("br"),E=h(),M=r("div");for(let N=0;N',_e=h(),$=r("div");for(let N=0;N{Xt(V,1)}),si()}Te?(Y=new Te(lt(N)),xn(Y.$$.fragment),Le(Y.$$.fragment,1),Jt(Y,ie,null)):Y=null}if(se[0]&64){fe=N[6];let V;for(V=0;V{await confirm("Are you sure?")||O.preventDefault()}),qe.onFileDropEvent(O=>{D(`File drop: ${JSON.stringify(O.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:No,icon:"i-ph-hand-waving"},{label:"Communication",component:Jo,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:Bo,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:ar,icon:"i-codicon-multiple-windows"},{label:"File system",component:fr,icon:"i-codicon-files"},{label:"HTTP",component:kr,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:Ar,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:ta,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Er,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:Rr,icon:"i-codicon-record-keys"},{label:"Shell",component:Fr,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:Gr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:Kr,icon:"i-codicon-clippy"},{label:"WebRTC",component:$r,icon:"i-ph-broadcast"}];let d=u[0];function c(O){n(1,d=O)}let f;ft(async()=>{const O=Bt();n(2,f=await O.isMaximized()),Kt("tauri://resize",async()=>{n(2,f=await O.isMaximized())})});function g(){Bt().minimize()}async function k(){const O=Bt();await O.isMaximized()?O.unmaximize():O.maximize()}let _=!1;async function y(){_||(_=await Xs("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Bt().close())}let v;ft(()=>{n(3,v=localStorage&&localStorage.getItem("theme")=="dark"),ys(v)});function b(){n(3,v=!v),ys(v)}let A=Ts([]);ks(e,A,O=>n(6,i=O));function D(O){A.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof O=="string"?O:JSON.stringify(O,null,1))+"
"},...X])}function H(O){A.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+O+"
"},...X])}function W(){A.update(()=>[])}let j,E,M;function T(O){M=O.clientY;const X=window.getComputedStyle(j);E=parseInt(X.height,10);const ne=ae=>{const ye=ae.clientY-M,de=E-ye;n(4,j.style.height=`${de{document.removeEventListener("mouseup",ce),document.removeEventListener("mousemove",ne)};document.addEventListener("mouseup",ce),document.addEventListener("mousemove",ne)}let P;ft(async()=>{n(5,P=await Fs()==="win32")});let C=!1,F,U,J=!1,x=0,me=0;const te=(O,X,ne)=>Math.min(Math.max(X,O),ne);ft(()=>{n(18,F=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",O=>{U.contains(O.target)?n(0,C=!C):C&&!F.contains(O.target)&&n(0,C=!1)}),document.addEventListener("touchstart",O=>{if(U.contains(O.target))return;const X=O.touches[0].clientX;(0{if(J){const X=O.touches[0].clientX;me=X;const ne=(X-x)/10;F.style.setProperty("--translate-x",`-${te(0,C?0-ne:18.75-ne,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const O=(me-x)/10;n(0,C=C?O>-(18.75/2):O>18.75/2)}J=!1})});const ie=()=>Fi("https://tauri.app/"),Y=O=>{c(O),n(0,C=!1)};function he(O){$n[O?"unshift":"push"](()=>{j=O,n(4,j)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const O=document.querySelector("#sidebar");O&&fa(O,C)}},[C,d,f,v,j,P,i,u,c,g,k,y,b,A,D,H,W,T,F,ie,Y,he]}class ma extends ve{constructor(t){super(),ge(this,t,pa,da,pe,{},null,[-1,-1])}}new ma({target:document.querySelector("#app")}); + `,b=h(),L=r("br"),D=h(),H=r("div"),W=h(),j=r("br"),E=h(),M=r("div");for(let N=0;N',_e=h(),$=r("div");for(let N=0;N{Xt(V,1)}),si()}Te?(Y=new Te(lt(N)),xn(Y.$$.fragment),Ae(Y.$$.fragment,1),Jt(Y,ie,null)):Y=null}if(se[0]&64){fe=N[6];let V;for(V=0;V{await confirm("Are you sure?")||O.preventDefault()}),qe.onFileDropEvent(O=>{D(`File drop: ${JSON.stringify(O.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:No,icon:"i-ph-hand-waving"},{label:"Communication",component:Jo,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:Bo,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:ar,icon:"i-codicon-multiple-windows"},{label:"File system",component:fr,icon:"i-codicon-files"},{label:"HTTP",component:kr,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:Lr,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:ta,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Er,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:Rr,icon:"i-codicon-record-keys"},{label:"Shell",component:Fr,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:Gr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:Kr,icon:"i-codicon-clippy"},{label:"WebRTC",component:$r,icon:"i-ph-broadcast"}];let d=u[0];function c(O){n(1,d=O)}let f;ft(async()=>{const O=Bt();n(2,f=await O.isMaximized()),Kt("tauri://resize",async()=>{n(2,f=await O.isMaximized())})});function g(){Bt().minimize()}async function k(){const O=Bt();await O.isMaximized()?O.unmaximize():O.maximize()}let _=!1;async function y(){_||(_=await Xs("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Bt().close())}let v;ft(()=>{n(3,v=localStorage&&localStorage.getItem("theme")=="dark"),ys(v)});function b(){n(3,v=!v),ys(v)}let L=Ts([]);ks(e,L,O=>n(6,i=O));function D(O){L.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof O=="string"?O:JSON.stringify(O,null,1))+"
"},...X])}function H(O){L.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+O+"
"},...X])}function W(){L.update(()=>[])}let j,E,M;function T(O){M=O.clientY;const X=window.getComputedStyle(j);E=parseInt(X.height,10);const ne=ae=>{const ye=ae.clientY-M,de=E-ye;n(4,j.style.height=`${de{document.removeEventListener("mouseup",ce),document.removeEventListener("mousemove",ne)};document.addEventListener("mouseup",ce),document.addEventListener("mousemove",ne)}let P;ft(async()=>{n(5,P=await Fs()==="win32")});let C=!1,F,U,J=!1,x=0,me=0;const te=(O,X,ne)=>Math.min(Math.max(X,O),ne);ft(()=>{n(18,F=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",O=>{U.contains(O.target)?n(0,C=!C):C&&!F.contains(O.target)&&n(0,C=!1)}),document.addEventListener("touchstart",O=>{if(U.contains(O.target))return;const X=O.touches[0].clientX;(0{if(J){const X=O.touches[0].clientX;me=X;const ne=(X-x)/10;F.style.setProperty("--translate-x",`-${te(0,C?0-ne:18.75-ne,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const O=(me-x)/10;n(0,C=C?O>-(18.75/2):O>18.75/2)}J=!1})});const ie=()=>Fi("https://tauri.app/"),Y=O=>{c(O),n(0,C=!1)};function he(O){$n[O?"unshift":"push"](()=>{j=O,n(4,j)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const O=document.querySelector("#sidebar");O&&fa(O,C)}},[C,d,f,v,j,P,i,u,c,g,k,y,b,L,D,H,W,T,F,ie,Y,he]}class ma extends ve{constructor(t){super(),ge(this,t,pa,da,pe,{},null,[-1,-1])}}new ma({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/src/desktop.rs b/examples/api/src-tauri/src/desktop.rs index adbfce9a1b3..2244c1d1bad 100644 --- a/examples/api/src-tauri/src/desktop.rs +++ b/examples/api/src-tauri/src/desktop.rs @@ -1,7 +1,11 @@ use std::sync::atomic::{AtomicBool, Ordering}; use tauri::{ - api::dialog::ask, CustomMenuItem, GlobalShortcutManager, Manager, RunEvent, SystemTray, - SystemTrayEvent, SystemTrayMenu, WindowBuilder, WindowEvent, WindowUrl, + api::{ + dialog::{ask, MessageDialogBuilder, MessageDialogButtons}, + shell, + }, + CustomMenuItem, GlobalShortcutManager, Manager, RunEvent, SystemTray, SystemTrayEvent, + SystemTrayMenu, WindowBuilder, WindowEvent, WindowUrl, }; pub fn main() { @@ -71,6 +75,7 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { tray_menu1 = tray_menu1 .add_item(CustomMenuItem::new("switch_menu", "Switch Menu")) + .add_item(CustomMenuItem::new("about", "About")) .add_item(CustomMenuItem::new("exit_app", "Quit")) .add_item(CustomMenuItem::new("destroy", "Destroy")); @@ -78,6 +83,7 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { .add_item(CustomMenuItem::new("toggle", "Toggle")) .add_item(CustomMenuItem::new("new", "New window")) .add_item(CustomMenuItem::new("switch_menu", "Switch Menu")) + .add_item(CustomMenuItem::new("about", "About")) .add_item(CustomMenuItem::new("exit_app", "Quit")) .add_item(CustomMenuItem::new("destroy", "Destroy")); let is_menu1 = AtomicBool::new(true); @@ -161,6 +167,20 @@ fn create_tray(app: &tauri::App) -> tauri::Result<()> { .unwrap(); is_menu1.store(!flag, Ordering::Relaxed); } + "about" => { + let window = handle.get_window("main").unwrap(); + MessageDialogBuilder::new("About app", "Tauri demo app") + .parent(&window) + .buttons(MessageDialogButtons::OkCancelCustom( + "Homepage".into(), + "know it".into(), + )) + .show(move |ok| { + if ok { + shell::open(&window.shell_scope(), "https://tauri.app/", None).unwrap(); + } + }); + } _ => {} } } diff --git a/tooling/api/src/dialog.ts b/tooling/api/src/dialog.ts index bc22c63ebac..168990e4be6 100644 --- a/tooling/api/src/dialog.ts +++ b/tooling/api/src/dialog.ts @@ -97,6 +97,19 @@ interface MessageDialogOptions { title?: string /** The type of the dialog. Defaults to `info`. */ type?: 'info' | 'warning' | 'error' + /** The label of the confirm button. */ + okLabel?: string +} + +interface ConfirmDialogOptions { + /** The title of the dialog. Defaults to the app name. */ + title?: string + /** The type of the dialog. Defaults to `info`. */ + type?: 'info' | 'warning' | 'error' + /** The label of the confirm button. */ + okLabel?: string + /** The label of the cancel button. */ + cancelLabel?: string } /** @@ -233,7 +246,8 @@ async function message( cmd: 'messageDialog', message: message.toString(), title: opts?.title?.toString(), - type: opts?.type + type: opts?.type, + buttonLabel: opts?.okLabel?.toString() } }) } @@ -256,7 +270,7 @@ async function message( */ async function ask( message: string, - options?: string | MessageDialogOptions + options?: string | ConfirmDialogOptions ): Promise { const opts = typeof options === 'string' ? { title: options } : options return invokeTauriCommand({ @@ -265,7 +279,11 @@ async function ask( cmd: 'askDialog', message: message.toString(), title: opts?.title?.toString(), - type: opts?.type + type: opts?.type, + buttonLabels: [ + opts?.okLabel?.toString() ?? 'Yes', + opts?.cancelLabel?.toString() ?? 'No' + ] } }) } @@ -288,7 +306,7 @@ async function ask( */ async function confirm( message: string, - options?: string | MessageDialogOptions + options?: string | ConfirmDialogOptions ): Promise { const opts = typeof options === 'string' ? { title: options } : options return invokeTauriCommand({ @@ -297,7 +315,11 @@ async function confirm( cmd: 'confirmDialog', message: message.toString(), title: opts?.title?.toString(), - type: opts?.type + type: opts?.type, + buttonLabels: [ + opts?.okLabel?.toString() ?? 'Ok', + opts?.cancelLabel?.toString() ?? 'Cancel' + ] } }) } @@ -306,7 +328,8 @@ export type { DialogFilter, OpenDialogOptions, SaveDialogOptions, - MessageDialogOptions + MessageDialogOptions, + ConfirmDialogOptions } export { open, save, message, ask, confirm }