diff --git a/.changes/custom-protocol-uri-parse.md b/.changes/custom-protocol-uri-parse.md new file mode 100644 index 00000000000..c5b89ee7999 --- /dev/null +++ b/.changes/custom-protocol-uri-parse.md @@ -0,0 +1,5 @@ +--- +"tauri": minor +--- + +The custom protocol now validates the request URI. This has implications when using the `asset` protocol without the `convertFileSrc` helper, the URL must now use the `asset://localhost/$filePath` format. diff --git a/.changes/linux-header-support.md b/.changes/linux-header-support.md new file mode 100644 index 00000000000..7a77dd6a35d --- /dev/null +++ b/.changes/linux-header-support.md @@ -0,0 +1,6 @@ +--- +"tauri": minor +"tauri-runtime-wry": minor +--- + +Custom protocol headers are now implemented on Linux when running on webkit2gtk 2.36 or above. diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 9316e150ca0..5e39e9e8879 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -29,7 +29,7 @@ webview2-com = "0.19.1" [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] gtk = { version = "0.15", features = [ "v3_20" ] } -webkit2gtk = { version = "0.18", features = [ "v2_22" ] } +webkit2gtk = { version = "0.18.2", features = [ "v2_36" ] } percent-encoding = "2.1" [target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies] diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index b1795801821..fb651181068 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -93,7 +93,7 @@ notify-rust = { version = "4.5", default-features = false, features = [ "d" ], o [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] gtk = { version = "0.15", features = [ "v3_20" ] } glib = "0.15" -webkit2gtk = { version = "0.18", features = [ "v2_22" ] } +webkit2gtk = { version = "0.18.2", features = [ "v2_36" ] } [target."cfg(target_os = \"macos\")".dependencies] embed_plist = "1.2" diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index 587438227b6..9deebe7967f 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1,4 +1,4 @@ -var __TAURI_IIFE__=(()=>{var M=Object.defineProperty,ye=Object.defineProperties,fe=Object.getOwnPropertyDescriptor,_e=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var ae=(n,e,t)=>e in n?M(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,d=(n,e)=>{for(var t in e||(e={}))oe.call(e,t)&&ae(n,t,e[t]);if(se)for(var t of se(e))be.call(e,t)&&ae(n,t,e[t]);return n},h=(n,e)=>ye(n,_e(e));var c=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},we=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Pe(e))!oe.call(n,s)&&s!==t&&M(n,s,{get:()=>e[s],enumerable:!(r=fe(e,s))||r.enumerable});return n};var ve=n=>we(M({},"__esModule",{value:!0}),n);var en={};c(en,{app:()=>I,cli:()=>N,clipboard:()=>z,dialog:()=>H,event:()=>q,fs:()=>G,globalShortcut:()=>$,http:()=>K,invoke:()=>Bt,notification:()=>Q,os:()=>re,path:()=>Z,process:()=>Y,shell:()=>X,tauri:()=>k,updater:()=>ee,window:()=>ie});var I={};c(I,{getName:()=>Fe,getTauriVersion:()=>Ee,getVersion:()=>Oe,hide:()=>Ce,show:()=>Ae});var k={};c(k,{convertFileSrc:()=>Te,invoke:()=>P,transformCallback:()=>m});function Me(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function m(n,e=!1){let t=Me(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n==null?void 0:n(s)),writable:!1,configurable:!0}),t}async function P(n,e={}){return new Promise((t,r)=>{let s=m(l=>{t(l),Reflect.deleteProperty(window,`_${o}`)},!0),o=m(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__(d({cmd:n,callback:s,error:o},e))})}function Te(n,e="asset"){let t=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${t}`:`${e}://${t}`}async function i(n){return P("tauri",n)}async function Oe(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function Fe(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Ee(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function Ae(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function Ce(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var N={};c(N,{getMatches:()=>De});async function De(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var z={};c(z,{readText:()=>We,writeText:()=>Se});async function Se(n){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:n}})}async function We(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var H={};c(H,{ask:()=>Ue,confirm:()=>ke,message:()=>Re,open:()=>xe,save:()=>Le});async function xe(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:n}})}async function Le(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:n}})}async function Re(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function Ue(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function ke(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}var q={};c(q,{TauriEvent:()=>F,emit:()=>E,listen:()=>V,once:()=>j});async function le(n,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:e}})}async function T(n,e,t){await i({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:e,payload:typeof t=="string"?t:JSON.stringify(t)}})}async function b(n,e,t){return i({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:e,handler:m(t)}}).then(r=>async()=>le(n,r))}async function O(n,e,t){return b(n,e,r=>{t(r),le(n,r.id).catch(()=>{})})}var F=(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))(F||{});async function V(n,e){return b(n,null,e)}async function j(n,e){return O(n,null,e)}async function E(n,e){return T(n,void 0,e)}var G={};c(G,{BaseDirectory:()=>A,Dir:()=>A,copyFile:()=>$e,createDir:()=>qe,exists:()=>Qe,readBinaryFile:()=>ze,readDir:()=>je,readTextFile:()=>Ne,removeDir:()=>Ge,removeFile:()=>Je,renameFile:()=>Ke,writeBinaryFile:()=>Ve,writeFile:()=>He,writeTextFile:()=>He});var A=(a=>(a[a.Audio=1]="Audio",a[a.Cache=2]="Cache",a[a.Config=3]="Config",a[a.Data=4]="Data",a[a.LocalData=5]="LocalData",a[a.Desktop=6]="Desktop",a[a.Document=7]="Document",a[a.Download=8]="Download",a[a.Executable=9]="Executable",a[a.Font=10]="Font",a[a.Home=11]="Home",a[a.Picture=12]="Picture",a[a.Public=13]="Public",a[a.Runtime=14]="Runtime",a[a.Template=15]="Template",a[a.Video=16]="Video",a[a.Resource=17]="Resource",a[a.App=18]="App",a[a.Log=19]="Log",a[a.Temp=20]="Temp",a[a.AppConfig=21]="AppConfig",a[a.AppData=22]="AppData",a[a.AppLocalData=23]="AppLocalData",a[a.AppCache=24]="AppCache",a[a.AppLog=25]="AppLog",a))(A||{});async function Ne(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:n,options:e}})}async function ze(n,e={}){let t=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:n,options:e}});return Uint8Array.from(t)}async function He(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 Ve(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 je(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:n,options:e}})}async function qe(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:n,options:e}})}async function Ge(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:n,options:e}})}async function $e(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:n,destination:e,options:t}})}async function Je(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:n,options:e}})}async function Ke(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:n,newPath:e,options:t}})}async function Qe(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:n,options:e}})}var $={};c($,{isRegistered:()=>Xe,register:()=>Ze,registerAll:()=>Ye,unregister:()=>Be,unregisterAll:()=>et});async function Ze(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:n,handler:m(e)}})}async function Ye(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:n,handler:m(e)}})}async function Xe(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:n}})}async function Be(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:n}})}async function et(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var K={};c(K,{Body:()=>g,Client:()=>D,Response:()=>C,ResponseType:()=>ue,fetch:()=>tt,getClient:()=>ce});var ue=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(ue||{}),g=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={};for(let r in e){let s=e[r],o;typeof s=="string"?o=s:s instanceof Uint8Array||Array.isArray(s)?o=Array.from(s):typeof s.file=="string"?o={file:s.file,mime:s.mime,fileName:s.fileName}:o={file:Array.from(s.file),mime:s.mime,fileName:s.fileName},t[r]=o}return new g("Form",t)}static json(e){return new g("Json",e)}static text(e){return new g("Text",e)}static bytes(e){return new g("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},C=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}},D=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 C(r);if(t){try{s.data=JSON.parse(s.data)}catch(o){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${o}; +var __TAURI_IIFE__=(()=>{var M=Object.defineProperty,ye=Object.defineProperties,fe=Object.getOwnPropertyDescriptor,_e=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var ae=(n,e,t)=>e in n?M(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,d=(n,e)=>{for(var t in e||(e={}))oe.call(e,t)&&ae(n,t,e[t]);if(se)for(var t of se(e))be.call(e,t)&&ae(n,t,e[t]);return n},h=(n,e)=>ye(n,_e(e));var c=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},we=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Pe(e))!oe.call(n,s)&&s!==t&&M(n,s,{get:()=>e[s],enumerable:!(r=fe(e,s))||r.enumerable});return n};var ve=n=>we(M({},"__esModule",{value:!0}),n);var en={};c(en,{app:()=>I,cli:()=>N,clipboard:()=>z,dialog:()=>H,event:()=>q,fs:()=>G,globalShortcut:()=>$,http:()=>K,invoke:()=>Bt,notification:()=>Q,os:()=>re,path:()=>Z,process:()=>Y,shell:()=>X,tauri:()=>k,updater:()=>ee,window:()=>ie});var I={};c(I,{getName:()=>Fe,getTauriVersion:()=>Ee,getVersion:()=>Oe,hide:()=>Ce,show:()=>Ae});var k={};c(k,{convertFileSrc:()=>Te,invoke:()=>P,transformCallback:()=>m});function Me(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function m(n,e=!1){let t=Me(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n==null?void 0:n(s)),writable:!1,configurable:!0}),t}async function P(n,e={}){return new Promise((t,r)=>{let s=m(l=>{t(l),Reflect.deleteProperty(window,`_${o}`)},!0),o=m(l=>{r(l),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__(d({cmd:n,callback:s,error:o},e))})}function Te(n,e="asset"){let t=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${t}`:`${e}://localhost/${t}`}async function i(n){return P("tauri",n)}async function Oe(){return i({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function Fe(){return i({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Ee(){return i({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function Ae(){return i({__tauriModule:"App",message:{cmd:"show"}})}async function Ce(){return i({__tauriModule:"App",message:{cmd:"hide"}})}var N={};c(N,{getMatches:()=>De});async function De(){return i({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}var z={};c(z,{readText:()=>We,writeText:()=>Se});async function Se(n){return i({__tauriModule:"Clipboard",message:{cmd:"writeText",data:n}})}async function We(){return i({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var H={};c(H,{ask:()=>Ue,confirm:()=>ke,message:()=>Re,open:()=>xe,save:()=>Le});async function xe(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"openDialog",options:n}})}async function Le(n={}){return typeof n=="object"&&Object.freeze(n),i({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:n}})}async function Re(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function Ue(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"askDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}async function ke(n,e){var r;let t=typeof e=="string"?{title:e}:e;return i({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:n.toString(),title:(r=t==null?void 0:t.title)==null?void 0:r.toString(),type:t==null?void 0:t.type}})}var q={};c(q,{TauriEvent:()=>F,emit:()=>E,listen:()=>V,once:()=>j});async function le(n,e){return i({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:e}})}async function T(n,e,t){await i({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:e,payload:typeof t=="string"?t:JSON.stringify(t)}})}async function b(n,e,t){return i({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:e,handler:m(t)}}).then(r=>async()=>le(n,r))}async function O(n,e,t){return b(n,e,r=>{t(r),le(n,r.id).catch(()=>{})})}var F=(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))(F||{});async function V(n,e){return b(n,null,e)}async function j(n,e){return O(n,null,e)}async function E(n,e){return T(n,void 0,e)}var G={};c(G,{BaseDirectory:()=>A,Dir:()=>A,copyFile:()=>$e,createDir:()=>qe,exists:()=>Qe,readBinaryFile:()=>ze,readDir:()=>je,readTextFile:()=>Ne,removeDir:()=>Ge,removeFile:()=>Je,renameFile:()=>Ke,writeBinaryFile:()=>Ve,writeFile:()=>He,writeTextFile:()=>He});var A=(a=>(a[a.Audio=1]="Audio",a[a.Cache=2]="Cache",a[a.Config=3]="Config",a[a.Data=4]="Data",a[a.LocalData=5]="LocalData",a[a.Desktop=6]="Desktop",a[a.Document=7]="Document",a[a.Download=8]="Download",a[a.Executable=9]="Executable",a[a.Font=10]="Font",a[a.Home=11]="Home",a[a.Picture=12]="Picture",a[a.Public=13]="Public",a[a.Runtime=14]="Runtime",a[a.Template=15]="Template",a[a.Video=16]="Video",a[a.Resource=17]="Resource",a[a.App=18]="App",a[a.Log=19]="Log",a[a.Temp=20]="Temp",a[a.AppConfig=21]="AppConfig",a[a.AppData=22]="AppData",a[a.AppLocalData=23]="AppLocalData",a[a.AppCache=24]="AppCache",a[a.AppLog=25]="AppLog",a))(A||{});async function Ne(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readTextFile",path:n,options:e}})}async function ze(n,e={}){let t=await i({__tauriModule:"Fs",message:{cmd:"readFile",path:n,options:e}});return Uint8Array.from(t)}async function He(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 Ve(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 je(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"readDir",path:n,options:e}})}async function qe(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"createDir",path:n,options:e}})}async function Ge(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeDir",path:n,options:e}})}async function $e(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"copyFile",source:n,destination:e,options:t}})}async function Je(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"removeFile",path:n,options:e}})}async function Ke(n,e,t={}){return i({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:n,newPath:e,options:t}})}async function Qe(n,e={}){return i({__tauriModule:"Fs",message:{cmd:"exists",path:n,options:e}})}var $={};c($,{isRegistered:()=>Xe,register:()=>Ze,registerAll:()=>Ye,unregister:()=>Be,unregisterAll:()=>et});async function Ze(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:n,handler:m(e)}})}async function Ye(n,e){return i({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:n,handler:m(e)}})}async function Xe(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:n}})}async function Be(n){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:n}})}async function et(){return i({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var K={};c(K,{Body:()=>g,Client:()=>D,Response:()=>C,ResponseType:()=>ue,fetch:()=>tt,getClient:()=>ce});var ue=(r=>(r[r.JSON=1]="JSON",r[r.Text=2]="Text",r[r.Binary=3]="Binary",r))(ue||{}),g=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={};for(let r in e){let s=e[r],o;typeof s=="string"?o=s:s instanceof Uint8Array||Array.isArray(s)?o=Array.from(s):typeof s.file=="string"?o={file:s.file,mime:s.mime,fileName:s.fileName}:o={file:Array.from(s.file),mime:s.mime,fileName:s.fileName},t[r]=o}return new g("Form",t)}static json(e){return new g("Json",e)}static text(e){return new g("Text",e)}static bytes(e){return new g("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},C=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}},D=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 C(r);if(t){try{s.data=JSON.parse(s.data)}catch(o){if(s.ok&&s.data==="")s.data={};else if(s.ok)throw Error(`Failed to parse response \`${s.data}\` as JSON: ${o}; 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(d({method:"GET",url:e},t))}async post(e,t,r){return this.request(d({method:"POST",url:e,body:t},r))}async put(e,t,r){return this.request(d({method:"PUT",url:e,body:t},r))}async patch(e,t){return this.request(d({method:"PATCH",url:e},t))}async delete(e,t){return this.request(d({method:"DELETE",url:e},t))}};async function ce(n){return i({__tauriModule:"Http",message:{cmd:"createClient",options:n}}).then(e=>new D(e))}var J=null;async function tt(n,e){return J===null&&(J=await ce()),J.request(d({url:n,method:(e==null?void 0:e.method)??"GET"},e))}var Q={};c(Q,{isPermissionGranted:()=>nt,requestPermission:()=>it,sendNotification:()=>rt});async function nt(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):i({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function it(){return window.Notification.requestPermission()}function rt(n){typeof n=="string"?new window.Notification(n):new window.Notification(n.title,n)}var Z={};c(Z,{BaseDirectory:()=>A,appCacheDir:()=>lt,appConfigDir:()=>de,appDataDir:()=>at,appDir:()=>st,appLocalDataDir:()=>ot,appLogDir:()=>me,audioDir:()=>ut,basename:()=>Rt,cacheDir:()=>ct,configDir:()=>dt,dataDir:()=>mt,delimiter:()=>Ct,desktopDir:()=>pt,dirname:()=>xt,documentDir:()=>gt,downloadDir:()=>ht,executableDir:()=>yt,extname:()=>Lt,fontDir:()=>ft,homeDir:()=>_t,isAbsolute:()=>Ut,join:()=>Wt,localDataDir:()=>Pt,logDir:()=>Et,normalize:()=>St,pictureDir:()=>bt,publicDir:()=>wt,resolve:()=>Dt,resolveResource:()=>Mt,resourceDir:()=>vt,runtimeDir:()=>Tt,sep:()=>At,templateDir:()=>Ot,videoDir:()=>Ft});function w(){return navigator.appVersion.includes("Win")}async function st(){return de()}async function de(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:21}})}async function at(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:22}})}async function ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:23}})}async function lt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:24}})}async function ut(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:1}})}async function ct(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:2}})}async function dt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:3}})}async function mt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:4}})}async function pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:6}})}async function gt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:7}})}async function ht(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:8}})}async function yt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:9}})}async function ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:10}})}async function _t(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:11}})}async function Pt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:5}})}async function bt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:12}})}async function wt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:13}})}async function vt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:17}})}async function Mt(n){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:n,directory:17}})}async function Tt(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:14}})}async function Ot(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:15}})}async function Ft(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:16}})}async function Et(){return me()}async function me(){return i({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:25}})}var At=w()?"\\":"/",Ct=w()?";":":";async function Dt(...n){return i({__tauriModule:"Path",message:{cmd:"resolve",paths:n}})}async function St(n){return i({__tauriModule:"Path",message:{cmd:"normalize",path:n}})}async function Wt(...n){return i({__tauriModule:"Path",message:{cmd:"join",paths:n}})}async function xt(n){return i({__tauriModule:"Path",message:{cmd:"dirname",path:n}})}async function Lt(n){return i({__tauriModule:"Path",message:{cmd:"extname",path:n}})}async function Rt(n,e){return i({__tauriModule:"Path",message:{cmd:"basename",path:n,ext:e}})}async function Ut(n){return i({__tauriModule:"Path",message:{cmd:"isAbsolute",path:n}})}var Y={};c(Y,{exit:()=>kt,relaunch:()=>It});async function kt(n=0){return i({__tauriModule:"Process",message:{cmd:"exit",exitCode:n}})}async function It(){return i({__tauriModule:"Process",message:{cmd:"relaunch"}})}var X={};c(X,{Child:()=>S,Command:()=>v,EventEmitter:()=>y,open:()=>zt});async function Nt(n,e,t=[],r){return typeof t=="object"&&Object.freeze(t),i({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:t,options:r,onEventFn:m(n)}})}var y=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)}},S=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}})}},v=class extends y{constructor(t,r=[],s){super();this.stdout=new y;this.stderr=new y;this.program=t,this.args=typeof r=="string"?[r]:r,this.options=s??{}}static sidecar(t,r=[],s){let o=new v(t,r,s);return o.options.sidecar=!0,o}async spawn(){return Nt(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 S(t))}async execute(){return new Promise((t,r)=>{this.on("error",r);let s=[],o=[];this.stdout.on("data",l=>{s.push(l)}),this.stderr.on("data",l=>{o.push(l)}),this.on("close",l=>{t({code:l.code,signal:l.signal,stdout:s.join(` `),stderr:o.join(` `)})}),this.spawn().catch(r)})}};async function zt(n,e){return i({__tauriModule:"Shell",message:{cmd:"open",path:n,with:e}})}var ee={};c(ee,{checkUpdate:()=>Vt,installUpdate:()=>Ht,onUpdaterEvent:()=>B});async function B(n){return V("tauri://update-status",e=>{n(e==null?void 0:e.payload)})}async function Ht(){let n;function e(){n&&n(),n=void 0}return new Promise((t,r)=>{function s(o){if(o.error)return e(),r(o.error);if(o.status==="DONE")return e(),t()}B(s).then(o=>{n=o}).catch(o=>{throw e(),o}),E("tauri://update-install").catch(o=>{throw e(),o})})}async function Vt(){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 o(l){if(l.error)return e(),r(l.error);if(l.status==="UPTODATE")return e(),t({shouldUpdate:!1})}j("tauri://update-available",l=>{s(l==null?void 0:l.payload)}).catch(l=>{throw e(),l}),B(o).then(l=>{n=l}).catch(l=>{throw e(),l}),E("tauri://update").catch(l=>{throw e(),l})})}var ie={};c(ie,{CloseRequestedEvent:()=>U,LogicalPosition:()=>x,LogicalSize:()=>W,PhysicalPosition:()=>_,PhysicalSize:()=>f,UserAttentionType:()=>ge,WebviewWindow:()=>p,WebviewWindowHandle:()=>L,WindowManager:()=>R,appWindow:()=>te,availableMonitors:()=>$t,currentMonitor:()=>qt,getAll:()=>he,getCurrent:()=>jt,primaryMonitor:()=>Gt});var W=class{constructor(e,t){this.type="Logical";this.width=e,this.height=t}},f=class{constructor(e,t){this.type="Physical";this.width=e,this.height=t}toLogical(e){return new W(this.width/e,this.height/e)}},x=class{constructor(e,t){this.type="Logical";this.x=e,this.y=t}},_=class{constructor(e,t){this.type="Physical";this.x=e,this.y=t}toLogical(e){return new x(this.x/e,this.y/e)}},ge=(t=>(t[t.Critical=1]="Critical",t[t.Informational=2]="Informational",t))(ge||{});function jt(){return new p(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function he(){return window.__TAURI_METADATA__.__windows.map(n=>new p(n.label,{skip:!0}))}var pe=["tauri://created","tauri://error"],L=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)}):O(e,this.label,t)}async emit(e,t){if(pe.includes(e)){for(let r of this.listeners[e]||[])r({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return T(e,this.label,t)}_handleTauriEvent(e,t){return pe.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},R=class extends L{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 _(e,t))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new _(e,t))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new f(e,t))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new f(e,t))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}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 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 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 U(t);Promise.resolve(e(r)).then(()=>{if(!r.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",s=>{e(h(d({},s),{payload:!0}))}),r=await this.listen("tauri://blur",s=>{e(h(d({},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",o=>{e(h(d({},o),{payload:{type:"drop",paths:o.payload}}))}),r=await this.listen("tauri://file-drop-hover",o=>{e(h(d({},o),{payload:{type:"hover",paths:o.payload}}))}),s=await this.listen("tauri://file-drop-cancelled",o=>{e(h(d({},o),{payload:{type:"cancel"}}))});return()=>{t(),r(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},U=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}},p=class extends R{constructor(e,t={}){super(e),t!=null&&t.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:d({label:e},t)}}}).then(async()=>this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static getByLabel(e){return he().some(t=>t.label===e)?new p(e,{skip:!0}):null}},te;"__TAURI_METADATA__"in window?te=new p(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index e031087fa8d..e04dc3d4b70 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -513,15 +513,11 @@ impl WindowManager { pending.register_uri_scheme_protocol("asset", move |request| { let parsed_path = Url::parse(request.uri())?; let filtered_path = &parsed_path[..Position::AfterPath]; - #[cfg(target_os = "windows")] let path = filtered_path .strip_prefix("asset://localhost/") // the `strip_prefix` only returns None when a request is made to `https://tauri.$P` on Windows // where `$P` is not `localhost/*` .unwrap_or(""); - // safe to unwrap: request.uri() always starts with this prefix - #[cfg(not(target_os = "windows"))] - let path = filtered_path.strip_prefix("asset://").unwrap(); let path = percent_encoding::percent_decode(path.as_bytes()) .decode_utf8_lossy() .to_string(); diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 7dc8b55dd7e..93e265832b6 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,45 +1,46 @@ -const rr=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};rr();function J(){}function kl(t){return t()}function Go(){return Object.create(null)}function ue(t){t.forEach(kl)}function sr(t){return typeof t=="function"}function be(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Gn;function ur(t,e){return Gn||(Gn=document.createElement("a")),Gn.href=e,t===Gn.href}function ar(t){return Object.keys(t).length===0}function cr(t,...e){if(t==null)return J;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ml(t,e,n){t.$$.on_destroy.push(cr(e,n))}function r(t,e){t.appendChild(e)}function m(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode.removeChild(t)}function ht(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function Zn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function re(t){return t===""?null:+t}function dr(t){return Array.from(t.childNodes)}function Z(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function G(t,e){t.value=e==null?"":e}function Dt(t,e){for(let n=0;n{Kn.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function ei(t){t&&t.c()}function Yt(t,e,n,i){const{fragment:o,on_mount:l,on_destroy:u,after_update:f}=t.$$;o&&o.m(e,n),i||zt(()=>{const c=l.map(kl).filter(sr);u?u.push(...c):ue(c),t.$$.on_mount=[]}),f.forEach(zt)}function Kt(t,e){const n=t.$$;n.fragment!==null&&(ue(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function _r(t,e){t.$$.dirty[0]===-1&&(Vt.push(t),mr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=y.length?y[0]:_;return p.ctx&&o(p.ctx[k],p.ctx[k]=g)&&(!p.skip_bound&&p.bound[k]&&p.bound[k](g),d&&_r(t,k)),_}):[],p.update(),d=!0,ue(p.before_update),p.fragment=i?i(p.ctx):!1,e.target){if(e.hydrate){const k=dr(e.target);p.fragment&&p.fragment.l(k),k.forEach(h)}else p.fragment&&p.fragment.c();e.intro&&We(t.$$.fragment),Yt(t,e.target,e.anchor,e.customElement),Tl()}Jt(c)}class Te{$destroy(){Kt(this,1),this.$destroy=J}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!ar(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ot=[];function Al(t,e=J){let n;const i=new Set;function o(f){if(be(t,f)&&(t=f,n)){const c=!Ot.length;for(const p of i)p[1](),Ot.push(p,t);if(c){for(let p=0;p{i.delete(p),i.size===0&&(n(),n=null)}}return{set:o,update:l,subscribe:u}}var Ii=function(t,e){return Ii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Ii(t,e)};function Hi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ii(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var se=function(){return se=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){u=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]{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)}};oo();function V(){}function ws(e){return e()}function ql(){return Object.create(null)}function se(e){e.forEach(ws)}function ro(e){return typeof e=="function"}function me(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Bn;function ao(e,t){return Bn||(Bn=document.createElement("a")),Bn.href=t,e===Bn.href}function uo(e){return Object.keys(e).length===0}function co(e,...t){if(e==null)return V;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ks(e,t,n){e.$$.on_destroy.push(co(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 pt(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function Yn(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 le(e){return e===""?null:+e}function po(e){return Array.from(e.childNodes)}function K(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=t==null?"":t}function Dt(e,t){for(let n=0;n{$n.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Qn(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||Pt(()=>{const c=o.map(ws).filter(ro);u?u.push(...c):se(c),e.$$.on_mount=[]}),d.forEach(Pt)}function $t(e,t){const n=e.$$;n.fragment!==null&&(se(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function go(e,t){e.$$.dirty[0]===-1&&(qt.push(e),_o(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const g=y.length?y[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=g)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](g),v&&go(e,k)),_}):[],f.update(),v=!0,se(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=po(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&De(e.$$.fragment),Jt(e,t.target,t.anchor,t.customElement),Cs()}Vt(c)}class we{$destroy(){$t(this,1),this.$destroy=V}$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&&!uo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const zt=[];function Ts(e,t=V){let n;const i=new Set;function l(d){if(me(e,d)&&(e=d,n)){const c=!zt.length;for(const f of i)f[1](),zt.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 As=Object.defineProperty,vo=Object.defineProperties,yo=Object.getOwnPropertyDescriptors,Vl=Object.getOwnPropertySymbols,wo=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable,Gl=(e,t,n)=>t in e?As(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ze=(e,t)=>{for(var n in t||(t={}))wo.call(t,n)&&Gl(e,n,t[n]);if(Vl)for(var n of Vl(t))ko.call(t,n)&&Gl(e,n,t[n]);return e},Ut=(e,t)=>vo(e,yo(t)),Te=(e,t)=>{for(var n in t)As(e,n,{get:t[n],enumerable:!0})},Mo={};Te(Mo,{convertFileSrc:()=>Ls,invoke:()=>Zn,transformCallback:()=>mt});function Co(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function mt(e,t=!1){let n=Co(),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 Zn(e,t={}){return new Promise((n,i)=>{let l=mt(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=mt(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__(ze({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 L(e){return Zn("tauri",e)}var To={};Te(To,{Child:()=>Ss,Command:()=>Ri,EventEmitter:()=>Xn,open:()=>Ii});async function Ao(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),L({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:mt(e)}})}var Xn=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)}},Ss=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}})}},Ri=class extends Xn{constructor(e,t=[],n){super(),this.stdout=new Xn,this.stderr=new Xn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Ri(e,t,n);return i.options.sidecar=!0,i}async spawn(){return Ao(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 Ss(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 Ii(e,t){return L({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Lo={};Te(Lo,{TauriEvent:()=>Ps,emit:()=>li,listen:()=>Yt,once:()=>Os});async function Es(e,t){return L({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function zs(e,t,n){await L({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})}async function Hi(e,t,n){return L({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:mt(n)}}).then(i=>async()=>Es(e,i))}async function Ds(e,t,n){return Hi(e,t,i=>{n(i),Es(e,i.id).catch(()=>{})})}var Ps=(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))(Ps||{});async function Yt(e,t){return Hi(e,null,t)}async function Os(e,t){return Ds(e,null,t)}async function li(e,t){return zs(e,void 0,t)}var So={};Te(So,{CloseRequestedEvent:()=>js,LogicalPosition:()=>Ws,LogicalSize:()=>xn,PhysicalPosition:()=>et,PhysicalSize:()=>ft,UserAttentionType:()=>ji,WebviewWindow:()=>ht,WebviewWindowHandle:()=>Is,WindowManager:()=>Hs,appWindow:()=>Ue,availableMonitors:()=>Do,currentMonitor:()=>Eo,getAll:()=>Rs,getCurrent:()=>Bt,primaryMonitor:()=>zo});var xn=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},ft=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new xn(this.width/e,this.height/e)}},Ws=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},et=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 ht(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Rs(){return window.__TAURI_METADATA__.__windows.map(e=>new ht(e.label,{skip:!0}))}var Jl=["tauri://created","tauri://error"],Is=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)}):Hi(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)}):Ds(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 zs(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}},Hs=class extends Is{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 et(e,t))}async outerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new et(e,t))}async innerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new ft(e,t))}async outerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new ft(e,t))}async isFullscreen(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}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 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 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 js(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e(Ut(ze({},i),{payload:!0}))}),n=await this.listen("tauri://blur",i=>{e(Ut(ze({},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(Ut(ze({},l),{payload:{type:"drop",paths:l.payload}}))}),n=await this.listen("tauri://file-drop-hover",l=>{e(Ut(ze({},l),{payload:{type:"hover",paths:l.payload}}))}),i=await this.listen("tauri://file-drop-cancelled",l=>{e(Ut(ze({},l),{payload:{type:"cancel"}}))});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},js=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}},ht=class extends Hs{constructor(e,t={}){super(e),t!=null&&t.skip||L({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:ze({label:e},t)}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Rs().some(t=>t.label===e)?new ht(e,{skip:!0}):null}},Ue;"__TAURI_METADATA__"in window?Ue=new ht(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.`),Ue=new ht("main",{skip:!0}));function Ni(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new et(e.position.x,e.position.y),size:new ft(e.size.width,e.size.height)}}async function Eo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Ni)}async function zo(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Ni)}async function Do(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Ni))}function Po(){return navigator.appVersion.includes("Win")}var Oo={};Te(Oo,{EOL:()=>Wo,arch:()=>Ho,platform:()=>Ns,tempdir:()=>jo,type:()=>Io,version:()=>Ro});var Wo=Po()?`\r `:` -`;function Hl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"platform"}})]})})}function Cr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"version"}})]})})}function Tr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"osType"}})]})})}function Ar(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"arch"}})]})})}function Lr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"tempdir"}})]})})}Object.freeze({__proto__:null,EOL:Mr,platform:Hl,version:Cr,type:Tr,arch:Ar,tempdir:Lr});function Fl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function Ul(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function ql(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}function Bl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"show"}})]})})}function Vl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"hide"}})]})})}Object.freeze({__proto__:null,getName:Ul,getVersion:Fl,getTauriVersion:ql,show:Bl,hide:Vl});function Gl(t){return t===void 0&&(t=0),M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]})})}function Bi(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:Gl,relaunch:Bi});function Er(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T,U;return{c(){e=s("p"),e.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 Ns(){return L({__tauriModule:"Os",message:{cmd:"platform"}})}async function Ro(){return L({__tauriModule:"Os",message:{cmd:"version"}})}async function Io(){return L({__tauriModule:"Os",message:{cmd:"osType"}})}async function Ho(){return L({__tauriModule:"Os",message:{cmd:"arch"}})}async function jo(){return L({__tauriModule:"Os",message:{cmd:"tempdir"}})}var No={};Te(No,{getName:()=>Us,getTauriVersion:()=>qs,getVersion:()=>Fs,hide:()=>Vs,show:()=>Bs});async function Fs(){return L({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function Us(){return L({__tauriModule:"App",message:{cmd:"getAppName"}})}async function qs(){return L({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function Bs(){return L({__tauriModule:"App",message:{cmd:"show"}})}async function Vs(){return L({__tauriModule:"App",message:{cmd:"hide"}})}var Fo={};Te(Fo,{exit:()=>Gs,relaunch:()=>Fi});async function Gs(e=0){return L({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function Fi(){return L({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Uo(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P,M,N;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=v(),i=s("br"),o=v(),l=s("br"),u=v(),f=s("pre"),c=z("App name: "),p=s("code"),d=z(t[2]),k=z(` -App version: `),_=s("code"),y=z(t[0]),g=z(` -Tauri version: `),b=s("code"),E=z(t[1]),W=z(` -`),F=v(),R=s("br"),q=v(),O=s("div"),A=s("button"),A.textContent="Close application",L=v(),P=s("button"),P.textContent="Relaunch application",a(A,"class","btn"),a(P,"class","btn"),a(O,"class","flex flex-wrap gap-1 shadow-")},m(B,Y){m(B,e,Y),m(B,n,Y),m(B,i,Y),m(B,o,Y),m(B,l,Y),m(B,u,Y),m(B,f,Y),r(f,c),r(f,p),r(p,d),r(f,k),r(f,_),r(_,y),r(f,g),r(f,b),r(b,E),r(f,W),m(B,F,Y),m(B,R,Y),m(B,q,Y),m(B,O,Y),r(O,A),r(O,L),r(O,P),T||(U=[D(A,"click",t[3]),D(P,"click",t[4])],T=!0)},p(B,[Y]){Y&4&&Z(d,B[2]),Y&1&&Z(y,B[0]),Y&2&&Z(E,B[1])},i:J,o:J,d(B){B&&h(e),B&&h(n),B&&h(i),B&&h(o),B&&h(l),B&&h(u),B&&h(f),B&&h(F),B&&h(R),B&&h(q),B&&h(O),T=!1,ue(U)}}}function Sr(t,e,n){let i="0.0.0",o="0.0.0",l="Unknown";Ul().then(c=>{n(2,l=c)}),Fl().then(c=>{n(0,i=c)}),ql().then(c=>{n(1,o=c)});async function u(){await Gl()}async function f(){await Bi()}return[i,o,l,u,f]}class Or extends Te{constructor(e){super(),Ce(this,e,Sr,Er,be,{})}}function Jl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:Jl});function Dr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y;return{c(){e=s("p"),e.innerHTML=`This binary can be run from the terminal and takes the following arguments: + tests.`,n=h(),i=r("br"),l=h(),o=r("br"),u=h(),d=r("pre"),c=z("App name: "),f=r("code"),v=z(e[2]),k=z(` +App version: `),_=r("code"),y=z(e[0]),g=z(` +Tauri version: `),b=r("code"),A=z(e[1]),D=z(` +`),j=h(),O=r("br"),F=h(),S=r("div"),C=r("button"),C.textContent="Close application",T=h(),P=r("button"),P.textContent="Relaunch application",a(C,"class","btn"),a(P,"class","btn"),a(S,"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,v),s(d,k),s(d,_),s(_,y),s(d,g),s(d,b),s(b,A),s(d,D),m(U,j,J),m(U,O,J),m(U,F,J),m(U,S,J),s(S,C),s(S,T),s(S,P),M||(N=[E(C,"click",e[3]),E(P,"click",e[4])],M=!0)},p(U,[J]){J&4&&K(v,U[2]),J&1&&K(y,U[0]),J&2&&K(A,U[1])},i:V,o:V,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(j),U&&p(O),U&&p(F),U&&p(S),M=!1,se(N)}}}function qo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";Us().then(c=>{n(2,o=c)}),Fs().then(c=>{n(0,i=c)}),qs().then(c=>{n(1,l=c)});async function u(){await Gs()}async function d(){await Fi()}return[i,l,o,u,d]}class Bo extends we{constructor(t){super(),ye(this,t,qo,Uo,me,{})}}var Vo={};Te(Vo,{getMatches:()=>Js});async function Js(){return L({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function Go(e){let t,n,i,l,o,u,d,c,f,v,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=v(),i=s("br"),o=v(),l=s("div"),l.textContent="Note that the arguments are only parsed, not implemented.",u=v(),f=s("br"),c=v(),p=s("br"),d=v(),k=s("button"),k.textContent="Get matches",a(l,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,e,b),m(g,n,b),m(g,i,b),m(g,o,b),m(g,l,b),m(g,u,b),m(g,f,b),m(g,c,b),m(g,p,b),m(g,d,b),m(g,k,b),_||(y=D(k,"click",t[0]),_=!0)},p:J,i:J,o:J,d(g){g&&h(e),g&&h(n),g&&h(i),g&&h(o),g&&h(l),g&&h(u),g&&h(f),g&&h(c),g&&h(p),g&&h(d),g&&h(k),_=!1,y()}}}function zr(t,e,n){let{onMessage:i}=e;function o(){Jl().then(i).catch(i)}return t.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Wr extends Te{constructor(e){super(),Ce(this,e,zr,Dr,be,{onMessage:1})}}function Pr(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),u=s("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(o,"class","btn"),a(o,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(p,d){m(p,e,d),r(e,n),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[D(n,"click",t[0]),D(o,"click",t[1]),D(u,"click",t[2])],f=!0)},p:J,i:J,o:J,d(p){p&&h(e),f=!1,ue(c)}}}function Rr(t,e,n){let{onMessage:i}=e,o;ft(async()=>{o=await Qt("rust-event",i)}),ji(()=>{o&&o()});function l(){ti("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ti("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function f(){si("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,u,f,i]}class Ir extends Te{constructor(e){super(),Ce(this,e,Rr,Pr,be,{onMessage:3})}}function Vi(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return C(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,S({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]})})}function Xl(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return C(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,S({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]})})}function Nr(t,e){var n;return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,S({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Yl(t,e){var n;return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,S({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function jr(t,e){var n;return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,S({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}Object.freeze({__proto__:null,open:Vi,save:Xl,message:Nr,ask:Yl,confirm:jr});var Pt;function Hr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]})})}function Gi(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){var n;return C(this,function(i){switch(i.label){case 0:return[4,S({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function Ni(t,e,n){return M(this,void 0,void 0,function(){var i,o;return C(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:""},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),typeof e=="string"?i.contents=e!=null?e:"":o=e,[2,S({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:o}})]})})}function Fr(t,e,n){return M(this,void 0,void 0,function(){var i,o;return C(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:[]},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),e&&"dir"in e?o=e:typeof t=="string"&&(i.contents=e!=null?e:[]),[2,S({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o}})]})})}function Kl(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]})})}function Ur(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]})})}function qr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]})})}function Br(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]})})}function Vr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]})})}function Gr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]})})}function Jr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:e}})]})})}(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp",t[t.AppConfig=21]="AppConfig",t[t.AppData=22]="AppData",t[t.AppLocalData=23]="AppLocalData",t[t.AppCache=24]="AppCache",t[t.AppLog=25]="AppLog"})(Pt||(Pt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Pt},get Dir(){return Pt},readTextFile:Hr,readBinaryFile:Gi,writeTextFile:Ni,writeFile:Ni,writeBinaryFile:Fr,readDir:Kl,createDir:Ur,removeDir:qr,copyFile:Br,removeFile:Vr,renameFile:Gr,exists:Jr});function Xr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P;return{c(){e=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("br"),f=v(),c=s("div"),p=s("input"),d=v(),k=s("label"),k.textContent="Multiple",_=v(),y=s("div"),g=s("input"),b=v(),E=s("label"),E.textContent="Directory",W=v(),F=s("br"),R=v(),q=s("button"),q.textContent="Open dialog",O=v(),A=s("button"),A.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"class","input"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(e,"class","flex gap-2 children:grow"),a(p,"type","checkbox"),a(p,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(g,"type","checkbox"),a(g,"id","dialog-directory"),a(E,"for","dialog-directory"),a(q,"class","btn"),a(q,"id","open-dialog"),a(A,"class","btn"),a(A,"id","save-dialog")},m(T,U){m(T,e,U),r(e,n),G(n,t[0]),r(e,i),r(e,o),G(o,t[1]),m(T,l,U),m(T,u,U),m(T,f,U),m(T,c,U),r(c,p),p.checked=t[2],r(c,d),r(c,k),m(T,_,U),m(T,y,U),r(y,g),g.checked=t[3],r(y,b),r(y,E),m(T,W,U),m(T,F,U),m(T,R,U),m(T,q,U),m(T,O,U),m(T,A,U),L||(P=[D(n,"input",t[8]),D(o,"input",t[9]),D(p,"change",t[10]),D(g,"change",t[11]),D(q,"click",t[4]),D(A,"click",t[5])],L=!0)},p(T,[U]){U&1&&n.value!==T[0]&&G(n,T[0]),U&2&&o.value!==T[1]&&G(o,T[1]),U&4&&(p.checked=T[2]),U&8&&(g.checked=T[3])},i:J,o:J,d(T){T&&h(e),T&&h(l),T&&h(u),T&&h(f),T&&h(c),T&&h(_),T&&h(y),T&&h(W),T&&h(F),T&&h(R),T&&h(q),T&&h(O),T&&h(A),L=!1,ue(P)}}}function Yr(t,e){var n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function Kr(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l=null,u=null,f=!1,c=!1;function p(){Vi({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:f,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var E=b,W=E.match(/\S+\.\S+$/g);Gi(E).then(function(F){W&&(E.includes(".png")||E.includes(".jpg"))?Yr(new Uint8Array(F),function(R){var q="data:image/png;base64,"+R;o('')}):i(b)}).catch(i(b))}}).catch(i)}function d(){Xl({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){l=this.value,n(0,l)}function _(){u=this.value,n(1,u)}function y(){f=this.checked,n(2,f)}function g(){c=this.checked,n(3,c)}return t.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,o=b.insecureRenderHtml)},[l,u,f,c,p,d,i,o,k,_,y,g]}class xr extends Te{constructor(e){super(),Ce(this,e,Kr,Xr,be,{onMessage:6,insecureRenderHtml:7})}}function Yo(t,e,n){const i=t.slice();return i[9]=e[n],i}function Ko(t){let e,n=t[9][0]+"",i,o;return{c(){e=s("option"),i=z(n),e.__value=o=t[9][1],e.value=e.__value},m(l,u){m(l,e,u),r(e,i)},p:J,d(l){l&&h(e)}}}function Qr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q=t[2],O=[];for(let A=0;AisNaN(parseInt(_))).map(_=>[_,Pt[_]]);function c(){const _=l.match(/\S+\.\S+$/g),y={dir:xo()};(_?Gi(l,y):Kl(l,y)).then(function(b){if(_)if(l.includes(".png")||l.includes(".jpg"))Zr(new Uint8Array(b),function(E){const W="data:image/png;base64,"+E;o('')});else{const E=String.fromCharCode.apply(null,b);o(''),setTimeout(()=>{const W=document.getElementById("file-response");W.value=E,document.getElementById("file-save").addEventListener("click",function(){Ni(l,W.value,{dir:xo()}).catch(i)})})}else i(b)}).catch(i)}function p(){n(1,u.src=Ll(l),u)}function d(){l=this.value,n(0,l)}function k(_){$n[_?"unshift":"push"](()=>{u=_,n(1,u)})}return t.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,o=_.insecureRenderHtml)},[l,u,f,c,p,i,o,d,k]}class es extends Te{constructor(e){super(),Ce(this,e,$r,Qr,be,{onMessage:5,insecureRenderHtml:6})}}var Rt;(function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"})(Rt||(Rt={}));var Qn=function(){function t(e,n){this.type=e,this.payload=n}return t.form=function(e){var n={};for(var i in e){var o=e[i],l=void 0;l=typeof o=="string"?o:o instanceof Uint8Array||Array.isArray(o)?Array.from(o):typeof o.file=="string"?{file:o.file,mime:o.mime,fileName:o.fileName}:{file:Array.from(o.file),mime:o.mime,fileName:o.fileName},n[i]=l}return new t("Form",n)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))},t}(),xl=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},Ql=function(){function t(e){this.id=e}return t.prototype.drop=function(){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return M(this,void 0,void 0,function(){var n;return C(this,function(i){return(n=!e.responseType||e.responseType===Rt.JSON)&&(e.responseType=Rt.Text),[2,S({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(o){var l=new xl(o);if(n){try{l.data=JSON.parse(l.data)}catch(u){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(u,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},t.prototype.get=function(e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.request(se({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return M(this,void 0,void 0,function(){return C(this,function(o){return[2,this.request(se({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return M(this,void 0,void 0,function(){return C(this,function(o){return[2,this.request(se({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.request(se({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.request(se({method:"DELETE",url:e},n))]})})},t}();function ii(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new Ql(n)})]})})}var Wi=null;function ts(t,e){var n;return M(this,void 0,void 0,function(){return C(this,function(i){switch(i.label){case 0:return Wi!==null?[3,2]:[4,ii()];case 1:Wi=i.sent(),i.label=2;case 2:return[2,Wi.request(se({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:ii,fetch:ts,Body:Qn,Client:Ql,Response:xl,get ResponseType(){return Rt}});function Qo(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function Zo(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F=t[5],R=[];for(let L=0;Lje(R[L],1,1,()=>{R[L]=null});let O=!t[3]&&nl(),A=!t[3]&&t[8]&&il();return{c(){e=s("span"),n=s("span"),i=z(t[6]),o=v(),l=s("ul");for(let L=0;L{d[g]=null}),ri(),l=d[o],l?l.p(_,y):(l=d[o]=p[o](_),l.c()),We(l,1),l.m(e,u))},i(_){f||(We(l),f=!0)},o(_){je(l),f=!1},d(_){_&&h(e),c&&c.d(),d[o].d()}}}function nl(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function il(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function os(t){let e,n,i=t[5].length&&Zo(t);return{c(){i&&i.c(),e=oi()},m(o,l){i&&i.m(o,l),m(o,e,l),n=!0},p(o,[l]){o[5].length?i?(i.p(o,l),l&32&&We(i,1)):(i=Zo(o),i.c(),We(i,1),i.m(e.parentNode,e)):i&&(li(),je(i,1,1,()=>{i=null}),ri())},i(o){n||(We(i),n=!0)},o(o){je(i),n=!1},d(o){i&&i.d(o),o&&h(e)}}}const ls="...";function rs(t,e,n){let{json:i}=e,{depth:o=1/0}=e,{_lvl:l=0}=e,{_last:u=!0}=e;const f=b=>b===null?"null":typeof b;let c,p,d,k,_;const y=b=>{switch(f(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return t.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,o=b.depth),"_lvl"in b&&n(2,l=b._lvl),"_last"in b&&n(3,u=b._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,c=f(i)==="object"?Object.keys(i):[]),n(4,p=Array.isArray(i)),n(6,d=p?"[":"{"),n(7,k=p?"]":"}")),t.$$.dirty&6&&n(8,_=ot[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(A,"class","input"),a(P,"class","input"),a(O,"class","flex gap-2 children:grow"),a($,"type","checkbox"),a(Q,"class","btn"),a(Q,"type","button")},m(N,V){m(N,e,V),r(e,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,f),Dt(n,t[0]),r(e,c),r(e,p),r(e,d),r(e,k),G(k,t[1]),r(e,_),r(e,y),r(e,g),r(e,b),m(N,E,V),m(N,W,V),m(N,F,V),m(N,R,V),m(N,q,V),m(N,O,V),r(O,A),G(A,t[2]),r(O,L),r(O,P),G(P,t[3]),m(N,T,V),m(N,U,V),m(N,B,V),m(N,Y,V),r(Y,$),$.checked=t[5],r(Y,ge),m(N,te,V),m(N,oe,V),m(N,x,V),m(N,ye,V),m(N,I,V),m(N,Q,V),m(N,le,V),m(N,ae,V),m(N,ee,V),m(N,_e,V),m(N,ce,V),Yt(we,N,V),ne=!0,Ae||(Se=[D(n,"change",t[9]),D(k,"input",t[10]),D(e,"submit",Zn(t[6])),D(A,"input",t[11]),D(P,"input",t[12]),D($,"change",t[13]),D(Q,"click",t[7])],Ae=!0)},p(N,[V]){V&1&&Dt(n,N[0]),V&2&&G(k,N[1]),V&4&&A.value!==N[2]&&G(A,N[2]),V&8&&P.value!==N[3]&&G(P,N[3]),V&32&&($.checked=N[5]);const Ie={};V&16&&(Ie.json=N[4]),we.$set(Ie)},i(N){ne||(We(we.$$.fragment,N),ne=!0)},o(N){je(we.$$.fragment,N),ne=!1},d(N){N&&h(e),N&&h(E),N&&h(W),N&&h(F),N&&h(R),N&&h(q),N&&h(O),N&&h(T),N&&h(U),N&&h(B),N&&h(Y),N&&h(te),N&&h(oe),N&&h(x),N&&h(ye),N&&h(I),N&&h(Q),N&&h(le),N&&h(ae),N&&h(ee),N&&h(_e),N&&h(ce),Kt(we,N),Ae=!1,ue(Se)}}}function us(t,e,n){let i="GET",o="",{onMessage:l}=e;async function u(){const W=await ii().catch(q=>{throw l(q),q}),R={url:"http://localhost:3003",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?R.body=Qn.json(JSON.parse(o)):o!==""&&(R.body=Qn.text(o)),W.request(R).then(l).catch(l)}let f="baz",c="qux",p=null,d=!0;async function k(){const W=await ii().catch(F=>{throw l(F),F});n(4,p=await W.request({url:"http://localhost:3003",method:"POST",body:Qn.form({foo:f,bar:c}),headers:d?{"Content-Type":"multipart/form-data"}:void 0,responseType:Rt.Text}))}function _(){i=Pi(this),n(0,i)}function y(){o=this.value,n(1,o)}function g(){f=this.value,n(2,f)}function b(){c=this.value,n(3,c)}function E(){d=this.checked,n(5,d)}return t.$$set=W=>{"onMessage"in W&&n(8,l=W.onMessage)},[i,o,f,c,p,d,u,k,l,_,y,g,b,E]}class as extends Te{constructor(e){super(),Ce(this,e,us,ss,be,{onMessage:8})}}function cs(t){let e,n,i;return{c(){e=s("button"),e.textContent="Send test notification",a(e,"class","btn"),a(e,"id","notification")},m(o,l){m(o,e,l),n||(i=D(e,"click",fs),n=!0)},p:J,i:J,o:J,d(o){o&&h(e),n=!1,i()}}}function fs(){new Notification("Notification title",{body:"This is the notification body"})}function ds(t,e,n){let{onMessage:i}=e;return t.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class ps extends Te{constructor(e){super(),Ce(this,e,ds,cs,be,{onMessage:0})}}function ol(t,e,n){const i=t.slice();return i[67]=e[n],i}function ll(t,e,n){const i=t.slice();return i[70]=e[n],i}function rl(t){let e,n,i,o,l,u,f=Object.keys(t[1]),c=[];for(let p=0;pt[39].call(i))},m(p,d){m(p,e,d),m(p,n,d),m(p,i,d),r(i,o);for(let k=0;kt[57].call(qe)),a(Ze,"class","input"),a(Ze,"type","number"),a($e,"class","input"),a($e,"type","number"),a(Ue,"class","flex gap-2"),a(et,"class","input grow"),a(et,"id","title"),a(qt,"class","btn"),a(qt,"type","submit"),a(at,"class","flex gap-1"),a(tt,"class","input grow"),a(tt,"id","url"),a(Bt,"class","btn"),a(Bt,"id","open-url"),a(ct,"class","flex gap-1"),a(ut,"class","flex flex-col gap-1")},m(w,j){m(w,e,j),m(w,n,j),m(w,i,j),r(i,o),r(i,l),r(i,u),r(i,f),r(i,c),r(i,p),r(i,d),r(i,k),r(i,_),m(w,y,j),m(w,g,j),m(w,b,j),m(w,E,j),r(E,W),r(W,F),r(W,R),R.checked=t[3],r(E,q),r(E,O),r(O,A),r(O,L),L.checked=t[2],r(E,P),r(E,T),r(T,U),r(T,B),B.checked=t[4],r(E,Y),r(E,$),r($,ge),r($,te),te.checked=t[5],r(E,oe),r(E,x),r(x,ye),r(x,I),I.checked=t[6],m(w,Q,j),m(w,le,j),m(w,ae,j),m(w,ee,j),r(ee,_e),r(_e,ce),r(ce,we),r(ce,ne),G(ne,t[13]),r(_e,Ae),r(_e,Se),r(Se,N),r(Se,V),G(V,t[14]),r(ee,Ie),r(ee,Oe),r(Oe,Le),r(Le,fe),r(Le,he),G(he,t[7]),r(Oe,de),r(Oe,De),r(De,it),r(De,me),G(me,t[8]),r(ee,pe),r(ee,H),r(H,ie),r(ie,X),r(ie,ke),G(ke,t[9]),r(H,Zt),r(H,vt),r(vt,$t),r(vt,Ne),G(Ne,t[10]),r(ee,en),r(ee,Ve),r(Ve,_t),r(_t,tn),r(_t,K),G(K,t[11]),r(Ve,It),r(Ve,ot),r(ot,Nt),r(ot,Pe),G(Pe,t[12]),m(w,bt,j),m(w,gt,j),m(w,yt,j),m(w,ze,j),r(ze,He),r(He,Re),r(Re,lt),r(Re,jt),r(Re,rt),r(rt,Ht),r(rt,wt),r(Re,Ft),r(Re,kt),r(kt,Xi),r(kt,ui),r(He,Yi),r(He,Ge),r(Ge,on),r(Ge,Ki),r(Ge,ln),r(ln,xi),r(ln,ai),r(Ge,Qi),r(Ge,sn),r(sn,Zi),r(sn,ci),r(ze,$i),r(ze,Mt),r(Mt,Je),r(Je,an),r(Je,eo),r(Je,cn),r(cn,to),r(cn,fi),r(Je,no),r(Je,dn),r(dn,io),r(dn,di),r(Mt,oo),r(Mt,Xe),r(Xe,hn),r(Xe,lo),r(Xe,mn),r(mn,ro),r(mn,pi),r(Xe,so),r(Xe,_n),r(_n,uo),r(_n,hi),r(ze,ao),r(ze,Ct),r(Ct,Ye),r(Ye,gn),r(Ye,co),r(Ye,yn),r(yn,fo),r(yn,mi),r(Ye,po),r(Ye,kn),r(kn,ho),r(kn,vi),r(Ct,mo),r(Ct,Ke),r(Ke,Cn),r(Ke,vo),r(Ke,Tn),r(Tn,_o),r(Tn,_i),r(Ke,bo),r(Ke,Ln),r(Ln,go),r(Ln,bi),r(ze,yo),r(ze,Tt),r(Tt,xe),r(xe,Sn),r(xe,wo),r(xe,On),r(On,ko),r(On,gi),r(xe,Mo),r(xe,zn),r(zn,Co),r(zn,yi),r(Tt,To),r(Tt,Qe),r(Qe,Pn),r(Qe,Ao),r(Qe,Rn),r(Rn,Lo),r(Rn,wi),r(Qe,Eo),r(Qe,Nn),r(Nn,So),r(Nn,ki),m(w,Mi,j),m(w,Ci,j),m(w,Ti,j),m(w,Ut,j),m(w,Ai,j),m(w,Fe,j),r(Fe,Hn),r(Hn,At),At.checked=t[15],r(Hn,Oo),r(Fe,Do),r(Fe,Fn),r(Fn,Lt),Lt.checked=t[16],r(Fn,zo),r(Fe,Wo),r(Fe,Un),r(Un,Et),Et.checked=t[20],r(Un,Po),m(w,Li,j),m(w,Ue,j),r(Ue,qn),r(qn,Ro),r(qn,qe);for(let Me=0;Me=1,d,k,_,y=p&&rl(t),g=t[1][t[0]]&&ul(t);return{c(){e=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="New window",u=v(),f=s("br"),c=v(),y&&y.c(),d=v(),g&&g.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(l,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(b,E){m(b,e,E),r(e,n),r(n,i),G(i,t[21]),r(n,o),r(n,l),r(e,u),r(e,f),r(e,c),y&&y.m(e,null),r(e,d),g&&g.m(e,null),k||(_=[D(i,"input",t[38]),D(l,"click",t[35])],k=!0)},p(b,E){E[0]&2097152&&i.value!==b[21]&&G(i,b[21]),E[0]&2&&(p=Object.keys(b[1]).length>=1),p?y?y.p(b,E):(y=rl(b),y.c(),y.m(e,d)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,E):(g=ul(b),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),y&&y.d(),g&&g.d(),k=!1,ue(_)}}}function ms(t,e,n){let i=Be.label;const o={[Be.label]:Be},l=["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}=e,f,c="https://tauri.app",p=!0,d=!1,k=!0,_=!1,y=!1,g=null,b=null,E=null,W=null,F=null,R=null,q=null,O=null,A=1,L=new nt(q,O),P=new nt(q,O),T=new pt(g,b),U=new pt(g,b),B,Y,$=!1,ge=!0,te=null,oe=null,x="default",ye=!1,I="Awesome Tauri Example!";function Q(){Fi(c)}function le(){o[i].setTitle(I)}function ae(){o[i].hide(),setTimeout(o[i].show,2e3)}function ee(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function _e(){Vi({multiple:!1}).then(K=>{typeof K=="string"&&o[i].setIcon(K)})}function ce(){if(!f)return;const K=new Wt(f);n(1,o[f]=K,o),K.once("tauri://error",function(){u("Error creating new webview")})}function we(){o[i].innerSize().then(K=>{n(26,T=K),n(7,g=T.width),n(8,b=T.height)}),o[i].outerSize().then(K=>{n(27,U=K)})}function ne(){o[i].innerPosition().then(K=>{n(24,L=K)}),o[i].outerPosition().then(K=>{n(25,P=K),n(13,q=P.x),n(14,O=P.y)})}async function Ae(K){!K||(B&&B(),Y&&Y(),Y=await K.listen("tauri://move",ne),B=await K.listen("tauri://resize",we))}async function Se(){await o[i].minimize(),await o[i].requestUserAttention(xt.Critical),await new Promise(K=>setTimeout(K,3e3)),await o[i].requestUserAttention(null)}function N(){f=this.value,n(21,f)}function V(){i=Pi(this),n(0,i),n(1,o)}const Ie=()=>o[i].center();function Oe(){d=this.checked,n(3,d)}function Le(){p=this.checked,n(2,p)}function fe(){k=this.checked,n(4,k)}function he(){_=this.checked,n(5,_)}function de(){y=this.checked,n(6,y)}function De(){q=re(this.value),n(13,q)}function it(){O=re(this.value),n(14,O)}function me(){g=re(this.value),n(7,g)}function pe(){b=re(this.value),n(8,b)}function H(){E=re(this.value),n(9,E)}function ie(){W=re(this.value),n(10,W)}function X(){F=re(this.value),n(11,F)}function ke(){R=re(this.value),n(12,R)}function Zt(){$=this.checked,n(15,$)}function vt(){ge=this.checked,n(16,ge)}function $t(){ye=this.checked,n(20,ye)}function Ne(){x=Pi(this),n(19,x),n(29,l)}function en(){te=re(this.value),n(17,te)}function Ve(){oe=re(this.value),n(18,oe)}function _t(){I=this.value,n(28,I)}function tn(){c=this.value,n(22,c)}return t.$$set=K=>{"onMessage"in K&&n(37,u=K.onMessage)},t.$$.update=()=>{var K,It,ot,Nt,Pe,bt,gt,yt,ze,He,Re,lt,jt,rt,Ht,st,wt,Ft;t.$$.dirty[0]&3&&(o[i],ne(),we()),t.$$.dirty[0]&7&&((K=o[i])==null||K.setResizable(p)),t.$$.dirty[0]&11&&(d?(It=o[i])==null||It.maximize():(ot=o[i])==null||ot.unmaximize()),t.$$.dirty[0]&19&&((Nt=o[i])==null||Nt.setDecorations(k)),t.$$.dirty[0]&35&&((Pe=o[i])==null||Pe.setAlwaysOnTop(_)),t.$$.dirty[0]&67&&((bt=o[i])==null||bt.setFullscreen(y)),t.$$.dirty[0]&387&&g&&b&&((gt=o[i])==null||gt.setSize(new pt(g,b))),t.$$.dirty[0]&1539&&(E&&W?(yt=o[i])==null||yt.setMinSize(new ni(E,W)):(ze=o[i])==null||ze.setMinSize(null)),t.$$.dirty[0]&6147&&(F>800&&R>400?(He=o[i])==null||He.setMaxSize(new ni(F,R)):(Re=o[i])==null||Re.setMaxSize(null)),t.$$.dirty[0]&24579&&q!==null&&O!==null&&((lt=o[i])==null||lt.setPosition(new nt(q,O))),t.$$.dirty[0]&3&&((jt=o[i])==null||jt.scaleFactor().then(kt=>n(23,A=kt))),t.$$.dirty[0]&3&&Ae(o[i]),t.$$.dirty[0]&32771&&((rt=o[i])==null||rt.setCursorGrab($)),t.$$.dirty[0]&65539&&((Ht=o[i])==null||Ht.setCursorVisible(ge)),t.$$.dirty[0]&524291&&((st=o[i])==null||st.setCursorIcon(x)),t.$$.dirty[0]&393219&&te!==null&&oe!==null&&((wt=o[i])==null||wt.setCursorPosition(new nt(te,oe))),t.$$.dirty[0]&1048579&&((Ft=o[i])==null||Ft.setIgnoreCursorEvents(ye))},[i,o,p,d,k,_,y,g,b,E,W,F,R,q,O,$,ge,te,oe,x,ye,f,c,A,L,P,T,U,I,l,Q,le,ae,ee,_e,ce,Se,u,N,V,Ie,Oe,Le,fe,he,de,De,it,me,pe,H,ie,X,ke,Zt,vt,$t,Ne,en,Ve,_t,tn]}class vs extends Te{constructor(e){super(),Ce(this,e,ms,hs,be,{onMessage:37},null,[-1,-1,-1])}}function $l(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:mt(e)}})]})})}function _s(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:mt(e)}})]})})}function bs(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function er(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function tr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:$l,registerAll:_s,isRegistered:bs,unregister:er,unregisterAll:tr});function cl(t,e,n){const i=t.slice();return i[9]=e[n],i}function fl(t){let e,n=t[9]+"",i,o,l,u,f;function c(){return t[8](t[9])}return{c(){e=s("div"),i=z(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"class","btn"),a(l,"type","button"),a(e,"class","flex justify-between")},m(p,d){m(p,e,d),r(e,i),r(e,o),r(e,l),u||(f=D(l,"click",c),u=!0)},p(p,d){t=p,d&2&&n!==(n=t[9]+"")&&Z(i,n)},d(p){p&&h(e),u=!1,f()}}}function dl(t){let e,n,i,o,l;return{c(){e=s("br"),n=v(),i=s("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,f){m(u,e,f),m(u,n,f),m(u,i,f),o||(l=D(i,"click",t[5]),o=!0)},p:J,d(u){u&&h(e),u&&h(n),u&&h(i),o=!1,l()}}}function gs(t){let e,n,i,o,l,u,f,c,p,d,k,_=t[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=fl(cl(t,_,b));let g=t[1].length>1&&dl(t);return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Register",l=v(),u=s("br"),f=v(),c=s("div");for(let b=0;b1?g?g.p(b,E):(g=dl(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),b&&h(l),b&&h(u),b&&h(f),b&&h(c),ht(y,b),g&&g.d(),d=!1,ue(k)}}}function ys(t,e,n){let i,{onMessage:o}=e;const l=Al([]);Ml(t,l,_=>n(1,i=_));let u="CmdOrControl+X";function f(){const _=u;$l(_,()=>{o(`Shortcut ${_} triggered`)}).then(()=>{l.update(y=>[...y,_]),o(`Shortcut ${_} registered successfully`)}).catch(o)}function c(_){const y=_;er(y).then(()=>{l.update(g=>g.filter(b=>b!==y)),o(`Shortcut ${y} unregistered`)}).catch(o)}function p(){tr().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){u=this.value,n(0,u)}const k=_=>c(_);return t.$$set=_=>{"onMessage"in _&&n(6,o=_.onMessage)},[u,i,l,f,c,p,o,d,k]}class ws extends Te{constructor(e){super(),Ce(this,e,ys,gs,be,{onMessage:6})}}function pl(t){let e,n,i,o,l,u,f;return{c(){e=s("br"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(l,"class","btn")},m(c,p){m(c,e,p),m(c,n,p),m(c,i,p),G(i,t[4]),m(c,o,p),m(c,l,p),u||(f=[D(i,"input",t[14]),D(l,"click",t[8])],u=!0)},p(c,p){p&16&&i.value!==c[4]&&G(i,c[4])},d(c){c&&h(e),c&&h(n),c&&h(i),c&&h(o),c&&h(l),u=!1,ue(f)}}}function ks(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T=t[5]&&pl(t);return{c(){e=s("div"),n=s("div"),i=z(`Script: - `),o=s("input"),l=v(),u=s("div"),f=z(`Encoding: - `),c=s("input"),p=v(),d=s("div"),k=z(`Working directory: - `),_=s("input"),y=v(),g=s("div"),b=z(`Arguments: - `),E=s("input"),W=v(),F=s("div"),R=s("button"),R.textContent="Run",q=v(),O=s("button"),O.textContent="Kill",A=v(),T&&T.c(),a(o,"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(d,"class","flex items-center gap-1"),a(E,"class","grow input"),a(E,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(R,"class","btn"),a(O,"class","btn"),a(F,"class","flex children:grow gap-1"),a(e,"class","flex flex-col childre:grow gap-1")},m(U,B){m(U,e,B),r(e,n),r(n,i),r(n,o),G(o,t[0]),r(e,l),r(e,u),r(u,f),r(u,c),G(c,t[3]),r(e,p),r(e,d),r(d,k),r(d,_),G(_,t[1]),r(e,y),r(e,g),r(g,b),r(g,E),G(E,t[2]),r(e,W),r(e,F),r(F,R),r(F,q),r(F,O),r(e,A),T&&T.m(e,null),L||(P=[D(o,"input",t[10]),D(c,"input",t[11]),D(_,"input",t[12]),D(E,"input",t[13]),D(R,"click",t[6]),D(O,"click",t[7])],L=!0)},p(U,[B]){B&1&&o.value!==U[0]&&G(o,U[0]),B&8&&c.value!==U[3]&&G(c,U[3]),B&2&&_.value!==U[1]&&G(_,U[1]),B&4&&E.value!==U[2]&&G(E,U[2]),U[5]?T?T.p(U,B):(T=pl(U),T.c(),T.m(e,null)):T&&(T.d(1),T=null)},i:J,o:J,d(U){U&&h(e),T&&T.d(),L=!1,ue(P)}}}function Ms(t,e,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=e,f='echo "hello world"',c=null,p="SOMETHING=value ANOTHER=2",d="",k="",_;function y(){return p.split(" ").reduce((A,L)=>{let[P,T]=L.split("=");return{...A,[P]:T}},{})}function g(){n(5,_=null);const A=new Sl(o,[...l,f],{cwd:c||null,env:y(),encoding:d});A.on("close",L=>{u(`command finished with code ${L.code} and signal ${L.signal}`),n(5,_=null)}),A.on("error",L=>u(`command error: "${L}"`)),A.stdout.on("data",L=>u(`command stdout: "${L}"`)),A.stderr.on("data",L=>u(`command stderr: "${L}"`)),A.spawn().then(L=>{n(5,_=L)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function E(){_.write(k).catch(u)}function W(){f=this.value,n(0,f)}function F(){d=this.value,n(3,d)}function R(){c=this.value,n(1,c)}function q(){p=this.value,n(2,p)}function O(){k=this.value,n(4,k)}return t.$$set=A=>{"onMessage"in A&&n(9,u=A.onMessage)},[f,c,p,d,k,_,g,b,E,u,W,F,R,q,O]}class Cs extends Te{constructor(e){super(),Ce(this,e,Ms,ks,be,{onMessage:9})}}function Ji(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,Qt(ve.STATUS_UPDATE,function(n){t(n==null?void 0:n.payload)})]})})}function nr(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return C(this,function(n){return[2,new Promise(function(i,o){Ji(function(l){return l.error?(t(),o(l.error)):l.status==="DONE"?(t(),i()):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),si(ve.INSTALL_UPDATE).catch(function(l){throw t(),l})})]})})}function ir(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return C(this,function(n){return[2,new Promise(function(i,o){Wl(ve.UPDATE_AVAILABLE,function(l){var u;u=l==null?void 0:l.payload,t(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw t(),l}),Ji(function(l){return l.error?(t(),o(l.error)):l.status==="UPTODATE"?(t(),i({shouldUpdate:!1})):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),si(ve.CHECK_UPDATE).catch(function(l){throw t(),l})})]})})}Object.freeze({__proto__:null,onUpdaterEvent:Ji,installUpdate:nr,checkUpdate:ir});function Ts(t){let e;return{c(){e=s("button"),e.innerHTML='
',a(e,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,e,i)},p:J,d(n){n&&h(e)}}}function As(t){let e,n,i;return{c(){e=s("button"),e.textContent="Install update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[4]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function Ls(t){let e,n,i;return{c(){e=s("button"),e.textContent="Check update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[3]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function Es(t){let e;function n(l,u){return!l[0]&&!l[2]?Ls:!l[1]&&l[2]?As:Ts}let i=n(t),o=i(t);return{c(){e=s("div"),o.c(),a(e,"class","flex children:grow children:h10")},m(l,u){m(l,e,u),o.m(e,null)},p(l,[u]){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(e,null)))},i:J,o:J,d(l){l&&h(e),o.d()}}}function Ss(t,e,n){let{onMessage:i}=e,o;ft(async()=>{o=await Qt("tauri://update-status",i)}),ji(()=>{o&&o()});let l,u,f;async function c(){n(0,l=!0);try{const{shouldUpdate:d,manifest:k}=await ir();i(`Should update: ${d}`),i(k),n(2,f=d)}catch(d){i(d)}finally{n(0,l=!1)}}async function p(){n(1,u=!0);try{await nr(),i("Installation complete, restart required."),await Bi()}catch(d){i(d)}finally{n(1,u=!1)}}return t.$$set=d=>{"onMessage"in d&&n(5,i=d.onMessage)},[l,u,f,c,p,i]}class Os extends Te{constructor(e){super(),Ce(this,e,Ss,Es,be,{onMessage:5})}}function or(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function lr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:or,readText:lr});function Ds(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Write",l=v(),u=s("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(o,"class","btn"),a(o,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(e,"class","flex gap-1")},m(p,d){m(p,e,d),r(e,n),G(n,t[0]),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[D(n,"input",t[4]),D(o,"click",t[1]),D(u,"click",t[2])],f=!0)},p(p,[d]){d&1&&n.value!==p[0]&&G(n,p[0])},i:J,o:J,d(p){p&&h(e),f=!1,ue(c)}}}function zs(t,e,n){let{onMessage:i}=e,o="clipboard message";function l(){or(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){lr().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function f(){o=this.value,n(0,o)}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,l,u,i,f]}class Ws extends Te{constructor(e){super(),Ce(this,e,zs,Ds,be,{onMessage:3})}}function Ps(t){let e;return{c(){e=s("div"),e.innerHTML=`
Not available for Linux
- `,a(e,"class","flex flex-col gap-2")},m(n,i){m(n,e,i)},p:J,i:J,o:J,d(n){n&&h(e)}}}function Rs(t,e,n){let{onMessage:i}=e;const o=window.constraints={audio:!0,video:!0};function l(f){const c=document.querySelector("video"),p=f.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${p[0].label}`),window.stream=f,c.srcObject=f}function u(f){if(f.name==="ConstraintNotSatisfiedError"){const c=o.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else f.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: ${f.name}`,f)}return ft(async()=>{try{const f=await navigator.mediaDevices.getUserMedia(o);l(f)}catch(f){u(f)}}),ji(()=>{window.stream.getTracks().forEach(function(f){f.stop()})}),t.$$set=f=>{"onMessage"in f&&n(0,i=f.onMessage)},[i]}class Is extends Te{constructor(e){super(),Ce(this,e,Rs,Ps,be,{onMessage:0})}}function Ns(t){let e,n,i,o,l,u;return{c(){e=s("div"),n=s("button"),n.textContent="Show",i=v(),o=s("button"),o.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(o,"class","btn"),a(o,"id","hide")},m(f,c){m(f,e,c),r(e,n),r(e,i),r(e,o),l||(u=[D(n,"click",t[0]),D(o,"click",t[1])],l=!0)},p:J,i:J,o:J,d(f){f&&h(e),l=!1,ue(u)}}}function js(t,e,n){let{onMessage:i}=e;function o(){l().then(()=>{setTimeout(()=>{Bl().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function l(){return Vl().then(()=>i("Hide app")).catch(i)}return t.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[o,l,i]}class Hs extends Te{constructor(e){super(),Ce(this,e,js,Ns,be,{onMessage:2})}}function hl(t,e,n){const i=t.slice();return i[32]=e[n],i}function ml(t,e,n){const i=t.slice();return i[35]=e[n],i}function vl(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b;function E(A,L){return A[3]?Us:Fs}let W=E(t),F=W(t);function R(A,L){return A[2]?Bs:qs}let q=R(t),O=q(t);return{c(){e=s("div"),n=s("span"),n.textContent="Tauri API Validation",i=v(),o=s("span"),l=s("span"),F.c(),f=v(),c=s("span"),c.innerHTML='
',p=v(),d=s("span"),O.c(),_=v(),y=s("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(l,"title",u=t[3]?"Switch to Light mode":"Switch to Dark mode"),a(l,"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(d,"title",k=t[2]?"Restore":"Maximize"),a(d,"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(o,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(e,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(e,"data-tauri-drag-region","")},m(A,L){m(A,e,L),r(e,n),r(e,i),r(e,o),r(o,l),F.m(l,null),r(o,f),r(o,c),r(o,p),r(o,d),O.m(d,null),r(o,_),r(o,y),g||(b=[D(l,"click",t[12]),D(c,"click",t[9]),D(d,"click",t[10]),D(y,"click",t[11])],g=!0)},p(A,L){W!==(W=E(A))&&(F.d(1),F=W(A),F&&(F.c(),F.m(l,null))),L[0]&8&&u!==(u=A[3]?"Switch to Light mode":"Switch to Dark mode")&&a(l,"title",u),q!==(q=R(A))&&(O.d(1),O=q(A),O&&(O.c(),O.m(d,null))),L[0]&4&&k!==(k=A[2]?"Restore":"Maximize")&&a(d,"title",k)},d(A){A&&h(e),F.d(),O.d(),g=!1,ue(b)}}}function Fs(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-moon")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Us(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-sun")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function qs(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-maximize")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Bs(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-restore")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Vs(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Gs(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function _l(t){let e,n,i,o,l,u,f,c,p;function d(y,g){return y[3]?Xs:Js}let k=d(t),_=k(t);return{c(){e=s("a"),_.c(),n=v(),i=s("br"),o=v(),l=s("div"),u=v(),f=s("br"),a(e,"href","##"),a(e,"class","nv justify-between h-8"),a(l,"class","bg-white/5 h-2px")},m(y,g){m(y,e,g),_.m(e,null),m(y,n,g),m(y,i,g),m(y,o,g),m(y,l,g),m(y,u,g),m(y,f,g),c||(p=D(e,"click",t[12]),c=!0)},p(y,g){k!==(k=d(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(e,null)))},d(y){y&&h(e),_.d(),y&&h(n),y&&h(i),y&&h(o),y&&h(l),y&&h(u),y&&h(f),c=!1,p()}}}function Js(t){let e,n;return{c(){e=z(`Switch to Dark mode - `),n=s("div"),a(n,"class","i-ph-moon")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Xs(t){let e,n;return{c(){e=z(`Switch to Light mode - `),n=s("div"),a(n,"class","i-ph-sun")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Ys(t){let e,n,i,o,l,u=t[35].label+"",f,c,p,d;function k(){return t[20](t[35])}return{c(){e=s("a"),n=s("div"),o=v(),l=s("p"),f=z(u),a(n,"class",i=t[35].icon+" mr-2"),a(e,"href","##"),a(e,"class",c="nv "+(t[1]===t[35]?"nv_selected":""))},m(_,y){m(_,e,y),r(e,n),r(e,o),r(e,l),r(l,f),p||(d=D(e,"click",k),p=!0)},p(_,y){t=_,y[0]&2&&c!==(c="nv "+(t[1]===t[35]?"nv_selected":""))&&a(e,"class",c)},d(_){_&&h(e),p=!1,d()}}}function bl(t){let e,n=t[35]&&Ys(t);return{c(){n&&n.c(),e=oi()},m(i,o){n&&n.m(i,o),m(i,e,o)},p(i,o){i[35]&&n.p(i,o)},d(i){n&&n.d(i),i&&h(e)}}}function gl(t){let e,n=t[32].html+"",i;return{c(){e=new pr(!1),i=oi(),e.a=i},m(o,l){e.m(n,o,l),m(o,i,l)},p(o,l){l[0]&64&&n!==(n=o[32].html+"")&&e.p(n)},d(o){o&&h(i),o&&e.d()}}}function Ks(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T,U,B,Y=t[1].label+"",$,ge,te,oe,x,ye,I,Q,le,ae,ee,_e,ce,we,ne,Ae,Se,N,V=t[5]&&vl(t);function Ie(H,ie){return H[0]?Gs:Vs}let Oe=Ie(t),Le=Oe(t),fe=!t[5]&&_l(t),he=t[7],de=[];for(let H=0;H`,k=v(),_=s("a"),_.innerHTML=`GitHub - `,y=v(),g=s("a"),g.innerHTML=`Source - `,b=v(),E=s("br"),W=v(),F=s("div"),R=v(),q=s("br"),O=v(),A=s("div");for(let H=0;H',we=v(),ne=s("div");for(let H=0;H{Kt(X,1)}),ri()}De?(x=new De(it(H)),ei(x.$$.fragment),We(x.$$.fragment,1),Yt(x,oe,null)):x=null}if(ie[0]&64){me=H[6];let X;for(X=0;X{await confirm("Are you sure?")||I.preventDefault()}),Be.onFileDropEvent(I=>{W(`File drop: ${JSON.stringify(I.payload)}`)});const o=navigator.userAgent.toLowerCase(),l=o.includes("android")||o.includes("iphone"),u=[{label:"Welcome",component:Or,icon:"i-ph-hand-waving"},{label:"Communication",component:Ir,icon:"i-codicon-radio-tower"},!l&&{label:"CLI",component:Wr,icon:"i-codicon-terminal"},!l&&{label:"Dialog",component:xr,icon:"i-codicon-multiple-windows"},{label:"File system",component:es,icon:"i-codicon-files"},{label:"HTTP",component:as,icon:"i-ph-globe-hemisphere-west"},!l&&{label:"Notifications",component:ps,icon:"i-codicon-bell-dot"},!l&&{label:"App",component:Hs,icon:"i-codicon-hubot"},!l&&{label:"Window",component:vs,icon:"i-codicon-window"},!l&&{label:"Shortcuts",component:ws,icon:"i-codicon-record-keys"},{label:"Shell",component:Cs,icon:"i-codicon-terminal-bash"},!l&&{label:"Updater",component:Os,icon:"i-codicon-cloud-download"},!l&&{label:"Clipboard",component:Ws,icon:"i-codicon-clippy"},{label:"WebRTC",component:Is,icon:"i-ph-broadcast"}];let f=u[0];function c(I){n(1,f=I)}let p;ft(async()=>{const I=Gt();n(2,p=await I.isMaximized()),Qt("tauri://resize",async()=>{n(2,p=await I.isMaximized())})});function d(){Gt().minimize()}async function k(){const I=Gt();await I.isMaximized()?I.unmaximize():I.maximize()}let _=!1;async function y(){_||(_=await Yl("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Gt().close())}let g;ft(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),wl(g)});function b(){n(3,g=!g),wl(g)}let E=Al([]);Ml(t,E,I=>n(6,i=I));function W(I){E.update(Q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof I=="string"?I:JSON.stringify(I,null,1))+"
"},...Q])}function F(I){E.update(Q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+I+"
"},...Q])}function R(){E.update(()=>[])}let q,O,A;function L(I){A=I.clientY;const Q=window.getComputedStyle(q);O=parseInt(Q.height,10);const le=ee=>{const _e=ee.clientY-A,ce=O-_e;n(4,q.style.height=`${ce{document.removeEventListener("mouseup",ae),document.removeEventListener("mousemove",le)};document.addEventListener("mouseup",ae),document.addEventListener("mousemove",le)}let P;ft(async()=>{n(5,P=await Hl()==="win32")});let T=!1,U,B,Y=!1,$=0,ge=0;const te=(I,Q,le)=>Math.min(Math.max(Q,I),le);ft(()=>{n(18,U=document.querySelector("#sidebar")),B=document.querySelector("#sidebarToggle"),document.addEventListener("click",I=>{B.contains(I.target)?n(0,T=!T):T&&!U.contains(I.target)&&n(0,T=!1)}),document.addEventListener("touchstart",I=>{if(B.contains(I.target))return;const Q=I.touches[0].clientX;(0{if(Y){const Q=I.touches[0].clientX;ge=Q;const le=(Q-$)/10;U.style.setProperty("--translate-x",`-${te(0,T?0-le:18.75-le,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(Y){const I=(ge-$)/10;n(0,T=T?I>-(18.75/2):I>18.75/2)}Y=!1})});const oe=()=>Fi("https://tauri.app/"),x=I=>{c(I),n(0,T=!1)};function ye(I){$n[I?"unshift":"push"](()=>{q=I,n(4,q)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const I=document.querySelector("#sidebar");I&&xs(I,T)}},[T,f,p,g,q,P,i,u,c,d,k,y,b,E,W,F,R,L,U,oe,x,ye]}class Zs extends Te{constructor(e){super(),Ce(this,e,Qs,Ks,be,{},null,[-1,-1])}}new Zs({target:document.querySelector("#app")}); + 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"),v=h(),k=r("button"),k.textContent="Get matches",a(o,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,t,b),m(g,n,b),m(g,i,b),m(g,l,b),m(g,o,b),m(g,u,b),m(g,d,b),m(g,c,b),m(g,f,b),m(g,v,b),m(g,k,b),_||(y=E(k,"click",e[0]),_=!0)},p:V,i:V,o:V,d(g){g&&p(t),g&&p(n),g&&p(i),g&&p(l),g&&p(o),g&&p(u),g&&p(d),g&&p(c),g&&p(f),g&&p(v),g&&p(k),_=!1,y()}}}function Jo(e,t,n){let{onMessage:i}=t;function l(){Js().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class $o extends we{constructor(t){super(),ye(this,t,Jo,Go,me,{onMessage:1})}}function Xo(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,v){m(f,t,v),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[E(n,"click",e[0]),E(l,"click",e[1]),E(u,"click",e[2])],d=!0)},p:V,i:V,o:V,d(f){f&&p(t),d=!1,se(c)}}}function Yo(e,t,n){let{onMessage:i}=t,l;ct(async()=>{l=await Yt("rust-event",i)}),Wi(()=>{l&&l()});function o(){Zn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){Zn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){li("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class Ko extends we{constructor(t){super(),ye(this,t,Yo,Xo,me,{onMessage:3})}}var Qo={};Te(Qo,{ask:()=>Xs,confirm:()=>xo,message:()=>Zo,open:()=>Ui,save:()=>$s});async function Ui(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function $s(e={}){return typeof e=="object"&&Object.freeze(e),L({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Zo(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}async function Xs(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}async function xo(e,t){var n;let i=typeof t=="string"?{title:t}:t;return L({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(n=i==null?void 0:i.title)==null?void 0:n.toString(),type:i==null?void 0:i.type}})}var er={};Te(er,{BaseDirectory:()=>Xt,Dir:()=>Xt,copyFile:()=>sr,createDir:()=>ir,exists:()=>ar,readBinaryFile:()=>qi,readDir:()=>Ys,readTextFile:()=>tr,removeDir:()=>lr,removeFile:()=>or,renameFile:()=>rr,writeBinaryFile:()=>nr,writeFile:()=>Oi,writeTextFile:()=>Oi});var Xt=(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))(Xt||{});async function tr(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function qi(e,t={}){let n=await L({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Oi(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 nr(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 ir(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function lr(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function sr(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function or(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function rr(e,t,n={}){return L({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function ar(e,t={}){return L({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function ur(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,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"),v=h(),k=r("label"),k.textContent="Multiple",_=h(),y=r("div"),g=r("input"),b=h(),A=r("label"),A.textContent="Directory",D=h(),j=r("br"),O=h(),F=r("button"),F.textContent="Open dialog",S=h(),C=r("button"),C.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(g,"type","checkbox"),a(g,"id","dialog-directory"),a(A,"for","dialog-directory"),a(F,"class","btn"),a(F,"id","open-dialog"),a(C,"class","btn"),a(C,"id","save-dialog")},m(M,N){m(M,t,N),s(t,n),B(n,e[0]),s(t,i),s(t,l),B(l,e[1]),m(M,o,N),m(M,u,N),m(M,d,N),m(M,c,N),s(c,f),f.checked=e[2],s(c,v),s(c,k),m(M,_,N),m(M,y,N),s(y,g),g.checked=e[3],s(y,b),s(y,A),m(M,D,N),m(M,j,N),m(M,O,N),m(M,F,N),m(M,S,N),m(M,C,N),T||(P=[E(n,"input",e[8]),E(l,"input",e[9]),E(f,"change",e[10]),E(g,"change",e[11]),E(F,"click",e[4]),E(C,"click",e[5])],T=!0)},p(M,[N]){N&1&&n.value!==M[0]&&B(n,M[0]),N&2&&l.value!==M[1]&&B(l,M[1]),N&4&&(f.checked=M[2]),N&8&&(g.checked=M[3])},i:V,o:V,d(M){M&&p(t),M&&p(o),M&&p(u),M&&p(d),M&&p(c),M&&p(_),M&&p(y),M&&p(D),M&&p(j),M&&p(O),M&&p(F),M&&p(S),M&&p(C),T=!1,se(P)}}}function cr(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 dr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){Ui({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);qi(A).then(function(j){D&&(A.includes(".png")||A.includes(".jpg"))?cr(new Uint8Array(j),function(O){var F="data:image/png;base64,"+O;l('')}):i(b)}).catch(i(b))}}).catch(i)}function v(){$s({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 g(){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,v,i,l,k,_,y,g]}class fr extends we{constructor(t){super(),ye(this,t,dr,ur,me,{onMessage:6,insecureRenderHtml:7})}}function $l(e,t,n){const i=e.slice();return i[9]=t[n],i}function Xl(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:V,d(o){o&&p(t)}}}function pr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F=e[2],S=[];for(let C=0;CisNaN(parseInt(_))).map(_=>[_,Xt[_]]);function c(){const _=o.match(/\S+\.\S+$/g),y={dir:Yl()};(_?qi(o,y):Ys(o,y)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))mr(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(){Oi(o,D.value,{dir:Yl()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=Ls(o),u)}function v(){o=this.value,n(0,o)}function k(_){Kn[_?"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,v,k]}class _r extends we{constructor(t){super(),ye(this,t,hr,pr,me,{onMessage:5,insecureRenderHtml:6})}}var br={};Te(br,{Body:()=>tt,Client:()=>Qs,Response:()=>Ks,ResponseType:()=>Bi,fetch:()=>gr,getClient:()=>ei});var Bi=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Bi||{}),tt=class{constructor(e,t){this.type=e,this.payload=t}static form(e){let t={};for(let n in e){let i=e[n],l;typeof i=="string"?l=i:i instanceof Uint8Array||Array.isArray(i)?l=Array.from(i):typeof i.file=="string"?l={file:i.file,mime:i.mime,fileName:i.fileName}:l={file:Array.from(i.file),mime:i.mime,fileName:i.fileName},t[n]=l}return new tt("Form",t)}static json(e){return new tt("Json",e)}static text(e){return new tt("Text",e)}static bytes(e){return new tt("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(ze({method:"GET",url:e},t))}async post(e,t,n){return this.request(ze({method:"POST",url:e,body:t},n))}async put(e,t,n){return this.request(ze({method:"PUT",url:e,body:t},n))}async patch(e,t){return this.request(ze({method:"PATCH",url:e},t))}async delete(e,t){return this.request(ze({method:"DELETE",url:e},t))}};async function ei(e){return L({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new Qs(t))}var zi=null;async function gr(e,t){var n;return zi===null&&(zi=await ei()),zi.request(ze({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET"},t))}function Kl(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Ql(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j=e[5],O=[];for(let T=0;TIe(O[T],1,1,()=>{O[T]=null});let S=!e[3]&&ts(),C=!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{v[g]=null}),ii(),o=v[l],o?o.p(_,y):(o=v[l]=f[l](_),o.c()),De(o,1),o.m(t,u))},i(_){d||(De(o),d=!0)},o(_){Ie(o),d=!1},d(_){_&&p(t),c&&c.d(),v[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 wr(e){let t,n,i=e[5].length&&Ql(e);return{c(){i&&i.c(),t=ti()},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&&De(i,1)):(i=Ql(l),i.c(),De(i,1),i.m(t.parentNode,t)):i&&(ni(),Ie(i,1,1,()=>{i=null}),ii())},i(l){n||(De(i),n=!0)},o(l){Ie(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const kr="...";function Mr(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,v,k,_;const y=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{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,v=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(C,"class","input"),a(P,"class","input"),a(S,"class","flex gap-2 children:grow"),a(Q,"type","checkbox"),a(Y,"class","btn"),a(Y,"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),Dt(n,e[0]),s(t,c),s(t,f),s(t,v),s(t,k),B(k,e[1]),s(t,_),s(t,y),s(t,g),s(t,b),m(R,A,q),m(R,D,q),m(R,j,q),m(R,O,q),m(R,F,q),m(R,S,q),s(S,C),B(C,e[2]),s(S,T),s(S,P),B(P,e[3]),m(R,M,q),m(R,N,q),m(R,U,q),m(R,J,q),s(J,Q),Q.checked=e[5],s(J,he),m(R,x,q),m(R,ne,q),m(R,X,q),m(R,_e,q),m(R,W,q),m(R,Y,q),m(R,ie,q),m(R,oe,q),m(R,Z,q),m(R,pe,q),m(R,re,q),Jt(be,R,q),ee=!0,ke||(Ae=[E(n,"change",e[9]),E(k,"input",e[10]),E(t,"submit",Yn(e[6])),E(C,"input",e[11]),E(P,"input",e[12]),E(Q,"change",e[13]),E(Y,"click",e[7])],ke=!0)},p(R,[q]){q&1&&Dt(n,R[0]),q&2&&B(k,R[1]),q&4&&C.value!==R[2]&&B(C,R[2]),q&8&&P.value!==R[3]&&B(P,R[3]),q&32&&(Q.checked=R[5]);const We={};q&16&&(We.json=R[4]),be.$set(We)},i(R){ee||(De(be.$$.fragment,R),ee=!0)},o(R){Ie(be.$$.fragment,R),ee=!1},d(R){R&&p(t),R&&p(A),R&&p(D),R&&p(j),R&&p(O),R&&p(F),R&&p(S),R&&p(M),R&&p(N),R&&p(U),R&&p(J),R&&p(x),R&&p(ne),R&&p(X),R&&p(_e),R&&p(W),R&&p(Y),R&&p(ie),R&&p(oe),R&&p(Z),R&&p(pe),R&&p(re),$t(be,R),ke=!1,se(Ae)}}}function Tr(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await ei().catch(F=>{throw o(F),F}),O={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?O.body=tt.json(JSON.parse(l)):l!==""&&(O.body=tt.text(l)),D.request(O).then(o).catch(o)}let d="baz",c="qux",f=null,v=!0;async function k(){const D=await ei().catch(j=>{throw o(j),j});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:tt.form({foo:d,bar:c}),headers:v?{"Content-Type":"multipart/form-data"}:void 0,responseType:Bi.Text}))}function _(){i=Di(this),n(0,i)}function y(){l=this.value,n(1,l)}function g(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function A(){v=this.checked,n(5,v)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,v,u,k,o,_,y,g,b,A]}class Ar extends we{constructor(t){super(),ye(this,t,Tr,Cr,me,{onMessage:8})}}function Lr(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=E(t,"click",Sr),n=!0)},p:V,i:V,o:V,d(l){l&&p(t),n=!1,i()}}}function Sr(){new Notification("Notification title",{body:"This is the notification body"})}function Er(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class zr extends we{constructor(t){super(),ye(this,t,Er,Lr,me,{onMessage:0})}}function is(e,t,n){const i=e.slice();return i[67]=t[n],i}function ls(e,t,n){const i=e.slice();return i[70]=t[n],i}function ss(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[39].call(i))},m(f,v){m(f,t,v),m(f,n,v),m(f,i,v),s(i,l);for(let k=0;ke[57].call(Fe)),a(Ke,"class","input"),a(Ke,"type","number"),a(Qe,"class","input"),a(Qe,"type","number"),a(Ne,"class","flex gap-2"),a(Ze,"class","input grow"),a(Ze,"id","title"),a(Nt,"class","btn"),a(Nt,"type","submit"),a(at,"class","flex gap-1"),a(xe,"class","input grow"),a(xe,"id","url"),a(Ft,"class","btn"),a(Ft,"id","open-url"),a(ut,"class","flex gap-1"),a(rt,"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,v),s(i,k),s(i,_),m(w,y,I),m(w,g,I),m(w,b,I),m(w,A,I),s(A,D),s(D,j),s(D,O),O.checked=e[3],s(A,F),s(A,S),s(S,C),s(S,T),T.checked=e[2],s(A,P),s(A,M),s(M,N),s(M,U),U.checked=e[4],s(A,J),s(A,Q),s(Q,he),s(Q,x),x.checked=e[5],s(A,ne),s(A,X),s(X,_e),s(X,W),W.checked=e[6],m(w,Y,I),m(w,ie,I),m(w,oe,I),m(w,Z,I),s(Z,pe),s(pe,re),s(re,be),s(re,ee),B(ee,e[13]),s(pe,ke),s(pe,Ae),s(Ae,R),s(Ae,q),B(q,e[14]),s(Z,We),s(Z,Le),s(Le,Me),s(Me,ae),s(Me,de),B(de,e[7]),s(Le,ue),s(Le,Se),s(Se,nt),s(Se,fe),B(fe,e[8]),s(Z,ce),s(Z,H),s(H,te),s(te,G),s(te,ge),B(ge,e[9]),s(H,Kt),s(H,_t),s(_t,Qt),s(_t,Re),B(Re,e[10]),s(Z,Zt),s(Z,qe),s(qe,bt),s(bt,xt),s(bt,$),B($,e[11]),s(qe,Ot),s(qe,it),s(it,Wt),s(it,Pe),B(Pe,e[12]),m(w,gt,I),m(w,vt,I),m(w,yt,I),m(w,Ee,I),s(Ee,He),s(He,Oe),s(Oe,lt),s(Oe,Rt),s(Oe,st),s(st,It),s(st,wt),s(Oe,Ht),s(Oe,kt),s(kt,Gi),s(kt,si),s(He,Ji),s(He,Be),s(Be,tn),s(Be,$i),s(Be,nn),s(nn,Xi),s(nn,oi),s(Be,Yi),s(Be,sn),s(sn,Ki),s(sn,ri),s(Ee,Qi),s(Ee,Mt),s(Mt,Ve),s(Ve,rn),s(Ve,Zi),s(Ve,an),s(an,xi),s(an,ai),s(Ve,el),s(Ve,cn),s(cn,tl),s(cn,ui),s(Mt,nl),s(Mt,Ge),s(Ge,fn),s(Ge,il),s(Ge,pn),s(pn,ll),s(pn,ci),s(Ge,sl),s(Ge,hn),s(hn,ol),s(hn,di),s(Ee,rl),s(Ee,Ct),s(Ct,Je),s(Je,bn),s(Je,al),s(Je,gn),s(gn,ul),s(gn,fi),s(Je,cl),s(Je,yn),s(yn,dl),s(yn,pi),s(Ct,fl),s(Ct,$e),s($e,kn),s($e,pl),s($e,Mn),s(Mn,ml),s(Mn,mi),s($e,hl),s($e,Tn),s(Tn,_l),s(Tn,hi),s(Ee,bl),s(Ee,Tt),s(Tt,Xe),s(Xe,Ln),s(Xe,gl),s(Xe,Sn),s(Sn,vl),s(Sn,_i),s(Xe,yl),s(Xe,zn),s(zn,wl),s(zn,bi),s(Tt,kl),s(Tt,Ye),s(Ye,Pn),s(Ye,Ml),s(Ye,On),s(On,Cl),s(On,gi),s(Ye,Tl),s(Ye,Rn),s(Rn,Al),s(Rn,vi),m(w,yi,I),m(w,wi,I),m(w,ki,I),m(w,jt,I),m(w,Mi,I),m(w,je,I),s(je,Hn),s(Hn,At),At.checked=e[15],s(Hn,Ll),s(je,Sl),s(je,jn),s(jn,Lt),Lt.checked=e[16],s(jn,El),s(je,zl),s(je,Nn),s(Nn,St),St.checked=e[20],s(Nn,Dl),m(w,Ci,I),m(w,Ne,I),s(Ne,Fn),s(Fn,Pl),s(Fn,Fe);for(let ve=0;ve=1,v,k,_,y=f&&ss(e),g=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(),v=h(),g&&g.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[21]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),y&&y.m(t,null),s(t,v),g&&g.m(t,null),k||(_=[E(i,"input",e[38]),E(o,"click",e[35])],k=!0)},p(b,A){A[0]&2097152&&i.value!==b[21]&&B(i,b[21]),A[0]&2&&(f=Object.keys(b[1]).length>=1),f?y?y.p(b,A):(y=ss(b),y.c(),y.m(t,v)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,A):(g=rs(b),g.c(),g.m(t,null)):g&&(g.d(1),g=null)},i:V,o:V,d(b){b&&p(t),y&&y.d(),g&&g.d(),k=!1,se(_)}}}function Pr(e,t,n){let i=Ue.label;const l={[Ue.label]:Ue},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,v=!1,k=!0,_=!1,y=!1,g=null,b=null,A=null,D=null,j=null,O=null,F=null,S=null,C=1,T=new et(F,S),P=new et(F,S),M=new ft(g,b),N=new ft(g,b),U,J,Q=!1,he=!0,x=null,ne=null,X="default",_e=!1,W="Awesome Tauri Example!";function Y(){Ii(c)}function ie(){l[i].setTitle(W)}function oe(){l[i].hide(),setTimeout(l[i].show,2e3)}function Z(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function pe(){Ui({multiple:!1}).then($=>{typeof $=="string"&&l[i].setIcon($)})}function re(){if(!d)return;const $=new ht(d);n(1,l[d]=$,l),$.once("tauri://error",function(){u("Error creating new webview")})}function be(){l[i].innerSize().then($=>{n(26,M=$),n(7,g=M.width),n(8,b=M.height)}),l[i].outerSize().then($=>{n(27,N=$)})}function ee(){l[i].innerPosition().then($=>{n(24,T=$)}),l[i].outerPosition().then($=>{n(25,P=$),n(13,F=P.x),n(14,S=P.y)})}async function ke($){!$||(U&&U(),J&&J(),J=await $.listen("tauri://move",ee),U=await $.listen("tauri://resize",be))}async function Ae(){await l[i].minimize(),await l[i].requestUserAttention(ji.Critical),await new Promise($=>setTimeout($,3e3)),await l[i].requestUserAttention(null)}function R(){d=this.value,n(21,d)}function q(){i=Di(this),n(0,i),n(1,l)}const We=()=>l[i].center();function Le(){v=this.checked,n(3,v)}function Me(){f=this.checked,n(2,f)}function ae(){k=this.checked,n(4,k)}function de(){_=this.checked,n(5,_)}function ue(){y=this.checked,n(6,y)}function Se(){F=le(this.value),n(13,F)}function nt(){S=le(this.value),n(14,S)}function fe(){g=le(this.value),n(7,g)}function ce(){b=le(this.value),n(8,b)}function H(){A=le(this.value),n(9,A)}function te(){D=le(this.value),n(10,D)}function G(){j=le(this.value),n(11,j)}function ge(){O=le(this.value),n(12,O)}function Kt(){Q=this.checked,n(15,Q)}function _t(){he=this.checked,n(16,he)}function Qt(){_e=this.checked,n(20,_e)}function Re(){X=Di(this),n(19,X),n(29,o)}function Zt(){x=le(this.value),n(17,x)}function qe(){ne=le(this.value),n(18,ne)}function bt(){W=this.value,n(28,W)}function xt(){c=this.value,n(22,c)}return e.$$set=$=>{"onMessage"in $&&n(37,u=$.onMessage)},e.$$.update=()=>{var $,Ot,it,Wt,Pe,gt,vt,yt,Ee,He,Oe,lt,Rt,st,It,ot,wt,Ht;e.$$.dirty[0]&3&&(l[i],ee(),be()),e.$$.dirty[0]&7&&(($=l[i])==null||$.setResizable(f)),e.$$.dirty[0]&11&&(v?(Ot=l[i])==null||Ot.maximize():(it=l[i])==null||it.unmaximize()),e.$$.dirty[0]&19&&((Wt=l[i])==null||Wt.setDecorations(k)),e.$$.dirty[0]&35&&((Pe=l[i])==null||Pe.setAlwaysOnTop(_)),e.$$.dirty[0]&67&&((gt=l[i])==null||gt.setFullscreen(y)),e.$$.dirty[0]&387&&g&&b&&((vt=l[i])==null||vt.setSize(new ft(g,b))),e.$$.dirty[0]&1539&&(A&&D?(yt=l[i])==null||yt.setMinSize(new xn(A,D)):(Ee=l[i])==null||Ee.setMinSize(null)),e.$$.dirty[0]&6147&&(j>800&&O>400?(He=l[i])==null||He.setMaxSize(new xn(j,O)):(Oe=l[i])==null||Oe.setMaxSize(null)),e.$$.dirty[0]&24579&&F!==null&&S!==null&&((lt=l[i])==null||lt.setPosition(new et(F,S))),e.$$.dirty[0]&3&&((Rt=l[i])==null||Rt.scaleFactor().then(kt=>n(23,C=kt))),e.$$.dirty[0]&3&&ke(l[i]),e.$$.dirty[0]&32771&&((st=l[i])==null||st.setCursorGrab(Q)),e.$$.dirty[0]&65539&&((It=l[i])==null||It.setCursorVisible(he)),e.$$.dirty[0]&524291&&((ot=l[i])==null||ot.setCursorIcon(X)),e.$$.dirty[0]&393219&&x!==null&&ne!==null&&((wt=l[i])==null||wt.setCursorPosition(new et(x,ne))),e.$$.dirty[0]&1048579&&((Ht=l[i])==null||Ht.setIgnoreCursorEvents(_e))},[i,l,f,v,k,_,y,g,b,A,D,j,O,F,S,Q,he,x,ne,X,_e,d,c,C,T,P,M,N,W,o,Y,ie,oe,Z,pe,re,Ae,u,R,q,We,Le,Me,ae,de,ue,Se,nt,fe,ce,H,te,G,ge,Kt,_t,Qt,Re,Zt,qe,bt,xt]}class Or extends we{constructor(t){super(),ye(this,t,Pr,Dr,me,{onMessage:37},null,[-1,-1,-1])}}var Wr={};Te(Wr,{isRegistered:()=>Ir,register:()=>xs,registerAll:()=>Rr,unregister:()=>eo,unregisterAll:()=>to});async function xs(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:mt(t)}})}async function Rr(e,t){return L({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:mt(t)}})}async function Ir(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function eo(e){return L({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function to(){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,v){m(f,t,v),s(t,i),s(t,l),s(t,o),u||(d=E(o,"click",c),u=!0)},p(f,v){e=f,v&2&&n!==(n=e[9]+"")&&K(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=E(i,"click",e[5]),l=!0)},p:V,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Hr(e){let t,n,i,l,o,u,d,c,f,v,k,_=e[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=cs(us(e,_,b));let g=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?g?g.p(b,A):(g=ds(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:V,o:V,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),pt(y,b),g&&g.d(),v=!1,se(k)}}}function jr(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;xs(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(y=>[...y,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const y=_;eo(y).then(()=>{o.update(g=>g.filter(b=>b!==y)),l(`Shortcut ${y} unregistered`)}).catch(l)}function f(){to().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function v(){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,v,k]}class Nr extends we{constructor(t){super(),ye(this,t,jr,Hr,me,{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=[E(i,"input",e[14]),E(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,se(d)}}}function Fr(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P,M=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(),v=r("div"),k=z(`Working directory: + `),_=r("input"),y=h(),g=r("div"),b=z(`Arguments: + `),A=r("input"),D=h(),j=r("div"),O=r("button"),O.textContent="Run",F=h(),S=r("button"),S.textContent="Kill",C=h(),M&&M.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(v,"class","flex items-center gap-1"),a(A,"class","grow input"),a(A,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(O,"class","btn"),a(S,"class","btn"),a(j,"class","flex children:grow gap-1"),a(t,"class","flex flex-col childre:grow gap-1")},m(N,U){m(N,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,v),s(v,k),s(v,_),B(_,e[1]),s(t,y),s(t,g),s(g,b),s(g,A),B(A,e[2]),s(t,D),s(t,j),s(j,O),s(j,F),s(j,S),s(t,C),M&&M.m(t,null),T||(P=[E(l,"input",e[10]),E(c,"input",e[11]),E(_,"input",e[12]),E(A,"input",e[13]),E(O,"click",e[6]),E(S,"click",e[7])],T=!0)},p(N,[U]){U&1&&l.value!==N[0]&&B(l,N[0]),U&8&&c.value!==N[3]&&B(c,N[3]),U&2&&_.value!==N[1]&&B(_,N[1]),U&4&&A.value!==N[2]&&B(A,N[2]),N[5]?M?M.p(N,U):(M=fs(N),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i:V,o:V,d(N){N&&p(t),M&&M.d(),T=!1,se(P)}}}function Ur(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",v="",k="",_;function y(){return f.split(" ").reduce((C,T)=>{let[P,M]=T.split("=");return{...C,[P]:M}},{})}function g(){n(5,_=null);const C=new Ri(l,[...o,d],{cwd:c||null,env:y(),encoding:v});C.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,_=null)}),C.on("error",T=>u(`command error: "${T}"`)),C.stdout.on("data",T=>u(`command stdout: "${T}"`)),C.stderr.on("data",T=>u(`command stderr: "${T}"`)),C.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 j(){v=this.value,n(3,v)}function O(){c=this.value,n(1,c)}function F(){f=this.value,n(2,f)}function S(){k=this.value,n(4,k)}return e.$$set=C=>{"onMessage"in C&&n(9,u=C.onMessage)},[d,c,f,v,k,_,g,b,A,u,D,j,O,F,S]}class qr extends we{constructor(t){super(),ye(this,t,Ur,Fr,me,{onMessage:9})}}var Br={};Te(Br,{checkUpdate:()=>io,installUpdate:()=>no,onUpdaterEvent:()=>Vi});async function Vi(e){return Yt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function no(){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()}Vi(l).then(o=>{e=o}).catch(o=>{throw t(),o}),li("tauri://update-install").catch(o=>{throw t(),o})})}async function io(){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})}Os("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),Vi(o).then(u=>{e=u}).catch(u=>{throw t(),u}),li("tauri://update").catch(u=>{throw t(),u})})}function Vr(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:V,d(n){n&&p(t)}}}function Gr(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=E(t,"click",e[4]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function Jr(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=E(t,"click",e[3]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function $r(e){let t;function n(o,u){return!o[0]&&!o[2]?Jr:!o[1]&&o[2]?Gr:Vr}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:V,o:V,d(o){o&&p(t),l.d()}}}function Xr(e,t,n){let{onMessage:i}=t,l;ct(async()=>{l=await Yt("tauri://update-status",i)}),Wi(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:v,manifest:k}=await io();i(`Should update: ${v}`),i(k),n(2,d=v)}catch(v){i(v)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await no(),i("Installation complete, restart required."),await Fi()}catch(v){i(v)}finally{n(1,u=!1)}}return e.$$set=v=>{"onMessage"in v&&n(5,i=v.onMessage)},[o,u,d,c,f,i]}class Yr extends we{constructor(t){super(),ye(this,t,Xr,$r,me,{onMessage:5})}}var Kr={};Te(Kr,{readText:()=>so,writeText:()=>lo});async function lo(e){return L({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function so(){return L({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Qr(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,v){m(f,t,v),s(t,n),B(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[E(n,"input",e[4]),E(l,"click",e[1]),E(u,"click",e[2])],d=!0)},p(f,[v]){v&1&&n.value!==f[0]&&B(n,f[0])},i:V,o:V,d(f){f&&p(t),d=!1,se(c)}}}function Zr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){lo(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){so().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 xr extends we{constructor(t){super(),ye(this,t,Zr,Qr,me,{onMessage:3})}}function ea(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:V,i:V,o:V,d(n){n&&p(t)}}}function ta(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 ct(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Wi(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class na extends we{constructor(t){super(),ye(this,t,ta,ea,me,{onMessage:0})}}function ia(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=[E(n,"click",e[0]),E(l,"click",e[1])],o=!0)},p:V,i:V,o:V,d(d){d&&p(t),o=!1,se(u)}}}function la(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{Bs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Vs().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class sa extends we{constructor(t){super(),ye(this,t,la,ia,me,{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,v,k,_,y,g,b;function A(C,T){return C[3]?ra:oa}let D=A(e),j=D(e);function O(C,T){return C[2]?ua:aa}let F=O(e),S=F(e);return{c(){t=r("div"),n=r("span"),n.textContent="Tauri API Validation",i=h(),l=r("span"),o=r("span"),j.c(),d=h(),c=r("span"),c.innerHTML='
',f=h(),v=r("span"),S.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(v,"title",k=e[2]?"Restore":"Maximize"),a(v,"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(C,T){m(C,t,T),s(t,n),s(t,i),s(t,l),s(l,o),j.m(o,null),s(l,d),s(l,c),s(l,f),s(l,v),S.m(v,null),s(l,_),s(l,y),g||(b=[E(o,"click",e[12]),E(c,"click",e[9]),E(v,"click",e[10]),E(y,"click",e[11])],g=!0)},p(C,T){D!==(D=A(C))&&(j.d(1),j=D(C),j&&(j.c(),j.m(o,null))),T[0]&8&&u!==(u=C[3]?"Switch to Light mode":"Switch to Dark mode")&&a(o,"title",u),F!==(F=O(C))&&(S.d(1),S=F(C),S&&(S.c(),S.m(v,null))),T[0]&4&&k!==(k=C[2]?"Restore":"Maximize")&&a(v,"title",k)},d(C){C&&p(t),j.d(),S.d(),g=!1,se(b)}}}function oa(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 ra(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 aa(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 ua(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 ca(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 da(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 v(y,g){return y[3]?pa:fa}let k=v(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,g){m(y,t,g),_.m(t,null),m(y,n,g),m(y,i,g),m(y,l,g),m(y,o,g),m(y,u,g),m(y,d,g),c||(f=E(t,"click",e[12]),c=!0)},p(y,g){k!==(k=v(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 fa(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 pa(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 ma(e){let t,n,i,l,o,u=e[35].label+"",d,c,f,v;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||(v=E(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,v()}}}function bs(e){let t,n=e[35]&&ma(e);return{c(){n&&n.c(),t=ti()},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 mo(!1),i=ti(),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 ha(e){let t,n,i,l,o,u,d,c,f,v,k,_,y,g,b,A,D,j,O,F,S,C,T,P,M,N,U,J=e[1].label+"",Q,he,x,ne,X,_e,W,Y,ie,oe,Z,pe,re,be,ee,ke,Ae,R,q=e[5]&&hs(e);function We(H,te){return H[0]?da:ca}let Le=We(e),Me=Le(e),ae=!e[5]&&_s(e),de=e[7],ue=[];for(let H=0;H`,k=h(),_=r("a"),_.innerHTML=`GitHub + `,y=h(),g=r("a"),g.innerHTML=`Source + `,b=h(),A=r("br"),D=h(),j=r("div"),O=h(),F=r("br"),S=h(),C=r("div");for(let H=0;H',be=h(),ee=r("div");for(let H=0;H{$t(G,1)}),ii()}Se?(X=new Se(nt(H)),Qn(X.$$.fragment),De(X.$$.fragment,1),Jt(X,ne,null)):X=null}if(te[0]&64){fe=H[6];let G;for(G=0;G{await confirm("Are you sure?")||W.preventDefault()}),Ue.onFileDropEvent(W=>{D(`File drop: ${JSON.stringify(W.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:Bo,icon:"i-ph-hand-waving"},{label:"Communication",component:Ko,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:$o,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:fr,icon:"i-codicon-multiple-windows"},{label:"File system",component:_r,icon:"i-codicon-files"},{label:"HTTP",component:Ar,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:zr,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:sa,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Or,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:Nr,icon:"i-codicon-record-keys"},{label:"Shell",component:qr,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:Yr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:xr,icon:"i-codicon-clippy"},{label:"WebRTC",component:na,icon:"i-ph-broadcast"}];let d=u[0];function c(W){n(1,d=W)}let f;ct(async()=>{const W=Bt();n(2,f=await W.isMaximized()),Yt("tauri://resize",async()=>{n(2,f=await W.isMaximized())})});function v(){Bt().minimize()}async function k(){const W=Bt();await W.isMaximized()?W.unmaximize():W.maximize()}let _=!1;async function y(){_||(_=await Xs("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Bt().close())}let g;ct(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),ys(g)});function b(){n(3,g=!g),ys(g)}let A=Ts([]);ks(e,A,W=>n(6,i=W));function D(W){A.update(Y=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof W=="string"?W:JSON.stringify(W,null,1))+"
"},...Y])}function j(W){A.update(Y=>[{html:`
[${new Date().toLocaleTimeString()}]: `+W+"
"},...Y])}function O(){A.update(()=>[])}let F,S,C;function T(W){C=W.clientY;const Y=window.getComputedStyle(F);S=parseInt(Y.height,10);const ie=Z=>{const pe=Z.clientY-C,re=S-pe;n(4,F.style.height=`${re{document.removeEventListener("mouseup",oe),document.removeEventListener("mousemove",ie)};document.addEventListener("mouseup",oe),document.addEventListener("mousemove",ie)}let P;ct(async()=>{n(5,P=await Ns()==="win32")});let M=!1,N,U,J=!1,Q=0,he=0;const x=(W,Y,ie)=>Math.min(Math.max(Y,W),ie);ct(()=>{n(18,N=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",W=>{U.contains(W.target)?n(0,M=!M):M&&!N.contains(W.target)&&n(0,M=!1)}),document.addEventListener("touchstart",W=>{if(U.contains(W.target))return;const Y=W.touches[0].clientX;(0{if(J){const Y=W.touches[0].clientX;he=Y;const ie=(Y-Q)/10;N.style.setProperty("--translate-x",`-${x(0,M?0-ie:18.75-ie,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const W=(he-Q)/10;n(0,M=M?W>-(18.75/2):W>18.75/2)}J=!1})});const ne=()=>Ii("https://tauri.app/"),X=W=>{c(W),n(0,M=!1)};function _e(W){Kn[W?"unshift":"push"](()=>{F=W,n(4,F)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const W=document.querySelector("#sidebar");W&&_a(W,M)}},[M,d,f,g,F,P,i,u,c,v,k,y,b,A,D,j,O,T,N,ne,X,_e]}class ga extends we{constructor(t){super(),ye(this,t,ba,ha,me,{},null,[-1,-1])}}new ga({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 52d19ffff50..1a898090a52 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -91,15 +91,6 @@ dependencies = [ "log", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anyhow" version = "1.0.65" @@ -301,9 +292,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee685beed1fe2ab3cb9eb95d65727413b5e27f2b34014a3ea9c92053f8c230fc" +checksum = "6a621d5d6d6c8d086dbaf1fe659981da41a1b63c6bdbba30b4dbb592c6d3bd49" dependencies = [ "serde", "toml", @@ -339,7 +330,7 @@ checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", "fnv", - "uuid 1.1.2", + "uuid 1.2.1", ] [[package]] @@ -529,12 +520,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -1275,7 +1265,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.3", + "itoa 1.0.4", ] [[package]] @@ -1328,7 +1318,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.3", + "itoa 1.0.4", "pin-project-lite", "socket2", "tokio", @@ -1396,9 +1386,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.3" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" +checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c" dependencies = [ "bytemuck", "byteorder", @@ -1467,9 +1457,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "javascriptcore-rs" @@ -1578,9 +1568,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.133" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libdbus-sys" @@ -1843,13 +1833,23 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "notify-rust" -version = "4.5.8" +version = "4.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a995a3d2834cefa389218e7a35156e8ce544bc95f836900da01ee0b26a07e9d4" +checksum = "368e89ea58df747ce88be669ae44e79783c1d30bfd540ad0fc520b3f41f0b3b0" dependencies = [ "dbus", "mac-notification-sys", - "winrt-notification", + "tauri-winrt-notification", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", ] [[package]] @@ -1996,9 +1996,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.41" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", "cfg-if", @@ -2028,9 +2028,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.75" +version = "0.9.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" dependencies = [ "autocfg", "cc", @@ -2052,9 +2052,9 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.0.1" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c92f2b54f081d635c77e7120862d48db8e91f7f21cef23ab1b4fe9971c59f55" +checksum = "0dceb7e43f59c35ee1548045b2c72945a5a3bb6ce6d6f07cdc13dc8f6bc4930a" dependencies = [ "libc", "winapi", @@ -2066,6 +2066,12 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "pango" version = "0.15.10" @@ -2134,9 +2140,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" dependencies = [ "thiserror", "ucd-trie", @@ -2363,13 +2369,22 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-xml" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.21" @@ -2726,18 +2741,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -2746,11 +2761,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" dependencies = [ - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -2773,7 +2788,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -2879,9 +2894,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" @@ -2997,9 +3012,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" dependencies = [ "proc-macro2", "quote", @@ -3035,8 +3050,7 @@ dependencies = [ [[package]] name = "tao" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43336f5d1793543ba96e2a1e75f3a5c7dcd592743be06a0ab3a190f4fcb4b934" +source = "git+https://github.com/tauri-apps/tao?branch=dev#dd86a9ebec67bf103e79bdfd1a2377cbe832bc03" dependencies = [ "bitflags", "cairo-rs", @@ -3074,7 +3088,7 @@ dependencies = [ "scopeguard", "serde", "unicode-segmentation", - "uuid 1.1.2", + "uuid 1.2.1", "windows 0.39.0", "windows-implement", "x11-dl", @@ -3145,7 +3159,7 @@ dependencies = [ "time", "tokio", "url", - "uuid 1.1.2", + "uuid 1.2.1", "webkit2gtk", "webview2-com", "win7-notifications", @@ -3189,7 +3203,7 @@ dependencies = [ "tauri-utils", "thiserror", "time", - "uuid 1.1.2", + "uuid 1.2.1", "walkdir", ] @@ -3218,7 +3232,7 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", - "uuid 1.1.2", + "uuid 1.2.1", "webview2-com", "windows 0.39.0", ] @@ -3234,7 +3248,7 @@ dependencies = [ "raw-window-handle", "tauri-runtime", "tauri-utils", - "uuid 1.1.2", + "uuid 1.2.1", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -3270,6 +3284,17 @@ dependencies = [ "windows 0.39.0", ] +[[package]] +name = "tauri-winrt-notification" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c58de036c4d2e20717024de2a3c4bf56c301f07b21bc8ef9b57189fce06f1f3b" +dependencies = [ + "quick-xml", + "strum", + "windows 0.39.0", +] + [[package]] name = "tempfile" version = "3.3.0" @@ -3318,18 +3343,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -3347,11 +3372,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ - "itoa 1.0.3", + "itoa 1.0.4", "libc", "num_threads", "time-macros", @@ -3393,9 +3418,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -3403,7 +3428,6 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "socket2", "winapi", @@ -3450,9 +3474,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", @@ -3462,9 +3486,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", @@ -3473,9 +3497,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", "valuable", @@ -3494,12 +3518,12 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" dependencies = [ - "ansi_term", "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", @@ -3554,9 +3578,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -3609,9 +3633,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.1.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" dependencies = [ "getrandom 0.2.7", ] @@ -3757,9 +3781,9 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29952969fb5e10fe834a52eb29ad0814ccdfd8387159b0933edf1344a1c9cdcc" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" dependencies = [ "bitflags", "cairo-rs", @@ -3905,18 +3929,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "windows" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9f39345ae0c8ab072c0ac7fe8a8b411636aa34f89be19ddd0d9226544f13944" -dependencies = [ - "windows_i686_gnu 0.24.0", - "windows_i686_msvc 0.24.0", - "windows_x86_64_gnu 0.24.0", - "windows_x86_64_msvc 0.24.0", -] - [[package]] name = "windows" version = "0.32.0" @@ -4026,12 +4038,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" -[[package]] -name = "windows_i686_gnu" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0866510a3eca9aed73a077490bbbf03e5eaac4e1fd70849d89539e5830501fd" - [[package]] name = "windows_i686_gnu" version = "0.32.0" @@ -4056,12 +4062,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" -[[package]] -name = "windows_i686_msvc" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0ffed56b7e9369a29078d2ab3aaeceea48eb58999d2cff3aa2494a275b95c6" - [[package]] name = "windows_i686_msvc" version = "0.32.0" @@ -4086,12 +4086,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" -[[package]] -name = "windows_x86_64_gnu" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384a173630588044205a2993b6864a2f56e5a8c1e7668c07b93ec18cf4888dc4" - [[package]] name = "windows_x86_64_gnu" version = "0.32.0" @@ -4116,12 +4110,6 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" -[[package]] -name = "windows_x86_64_msvc" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd8f062d8ca5446358159d79a90be12c543b3a965c847c8f3eedf14b321d399" - [[package]] name = "windows_x86_64_msvc" version = "0.32.0" @@ -4164,22 +4152,10 @@ dependencies = [ "toml", ] -[[package]] -name = "winrt-notification" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "007a0353840b23e0c6dc73e5b962ff58ed7f6bc9ceff3ce7fe6fbad8d496edf4" -dependencies = [ - "strum", - "windows 0.24.0", - "xml-rs", -] - [[package]] name = "wry" version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5c1352b4266fdf92c63479d2f58ab4cd29dc4e78fbc1b62011ed1227926945" +source = "git+https://github.com/tauri-apps/wry?branch=dev#3183e9333831cc407d2f193995cfda366e7c38d5" dependencies = [ "base64", "block", @@ -4201,6 +4177,7 @@ dependencies = [ "serde", "serde_json", "sha2", + "soup2", "tao", "thiserror", "url", @@ -4249,9 +4226,9 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "zip" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" dependencies = [ "byteorder", "crc32fast", diff --git a/tooling/api/src/tauri.ts b/tooling/api/src/tauri.ts index 7c422405357..1b83728617c 100644 --- a/tooling/api/src/tauri.ts +++ b/tooling/api/src/tauri.ts @@ -132,7 +132,7 @@ function convertFileSrc(filePath: string, protocol = 'asset'): string { const path = encodeURIComponent(filePath) return navigator.userAgent.includes('Windows') ? `https://${protocol}.localhost/${path}` - : `${protocol}://${path}` + : `${protocol}://localhost/${path}` } export type { InvokeArgs }