From a6b52e44f22844009e273fb0250368d7a463f095 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Tue, 8 Aug 2023 22:43:19 +0300 Subject: [PATCH] fix(tauri-utils): include `\n` in `io::read_line`, closes #6388 (#6519) Co-authored-by: Lucas Nogueira fix(tauri-utils): include `\n` in `io::read_line`, closes #6388 --- .changes/tauri-utils-read-line.md | 5 ++ core/tauri-utils/src/io.rs | 6 +- core/tauri/src/api/process/command.rs | 2 +- examples/api/dist/assets/index.js | 89 ++++++++++++++------------- examples/api/src/views/Shell.svelte | 33 ++++++++-- 5 files changed, 82 insertions(+), 53 deletions(-) create mode 100644 .changes/tauri-utils-read-line.md diff --git a/.changes/tauri-utils-read-line.md b/.changes/tauri-utils-read-line.md new file mode 100644 index 00000000000..cc6195d9a30 --- /dev/null +++ b/.changes/tauri-utils-read-line.md @@ -0,0 +1,5 @@ +--- +'tauri-utils': 'patch:bug' +--- + +Fix `io::read_line` not including the new line character `\n`. diff --git a/core/tauri-utils/src/io.rs b/core/tauri-utils/src/io.rs index 85d1e6da840..9dc699fa6b5 100644 --- a/core/tauri-utils/src/io.rs +++ b/core/tauri-utils/src/io.rs @@ -6,7 +6,7 @@ use std::io::BufRead; -/// Read a line breaking in both \n and \r. +/// Read all bytes until a newline (the `0xA` byte) or a carriage return (`\r`) is reached, and append them to the provided buffer. /// /// Adapted from . pub fn read_line(r: &mut R, buf: &mut Vec) -> std::io::Result { @@ -16,6 +16,7 @@ pub fn read_line(r: &mut R, buf: &mut Vec) -> std::io:: let available = match r.fill_buf() { Ok(n) => n, Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => continue, + Err(e) => return Err(e), }; match memchr::memchr(b'\n', available) { @@ -40,9 +41,6 @@ pub fn read_line(r: &mut R, buf: &mut Vec) -> std::io:: r.consume(used); read += used; if done || used == 0 { - if buf.ends_with(&[b'\n']) { - buf.pop(); - } return Ok(read); } } diff --git a/core/tauri/src/api/process/command.rs b/core/tauri/src/api/process/command.rs index fe4911e1a35..6b3fd73dbae 100644 --- a/core/tauri/src/api/process/command.rs +++ b/core/tauri/src/api/process/command.rs @@ -468,7 +468,7 @@ mod test { assert_eq!(payload.code, Some(1)); } CommandEvent::Stderr(line) => { - assert_eq!(line, "cat: test/api/: Is a directory".to_string()); + assert_eq!(line, "cat: test/api/: Is a directory\n".to_string()); } _ => {} } diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 19c036dd653..15e9a21a158 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,50 +1,51 @@ -const wo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};wo();function G(){}function Os(e){return e()}function is(){return Object.create(null)}function oe(e){e.forEach(Os)}function ko(e){return typeof e=="function"}function pe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ti;function Mo(e,t){return ti||(ti=document.createElement("a")),ti.href=t,e===ti.href}function Co(e){return Object.keys(e).length===0}function To(e,...t){if(e==null)return G;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Rs(e,t,n){e.$$.on_destroy.push(To(t,n))}function s(e,t){e.appendChild(t)}function h(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function yt(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function ai(e){return function(t){return t.preventDefault(),e.call(this,t)}}function r(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function se(e){return e===""?null:+e}function So(e){return Array.from(e.childNodes)}function Q(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function q(e,t){e.value=t==null?"":t}function It(e,t){for(let n=0;n{si.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function ui(e){e&&e.c()}function Zt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Ft(()=>{const c=o.map(Os).filter(ko);u?u.push(...c):oe(c),e.$$.on_mount=[]}),d.forEach(Ft)}function xt(e,t){const n=e.$$;n.fragment!==null&&(oe(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Po(e,t){e.$$.dirty[0]===-1&&(Yt.push(e),Eo(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const y=v.length?v[0]:_;return f.ctx&&l(f.ctx[k],f.ctx[k]=y)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](y),g&&Po(e,k)),_}):[],f.update(),g=!0,oe(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=So(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&Te(e.$$.fragment),Zt(e,t.target,t.anchor,t.customElement),Is()}Kt(c)}class ye{$destroy(){xt(this,1),this.$destroy=G}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(t){this.$$set&&!Co(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Nt=[];function Fs(e,t=G){let n;const i=new Set;function l(d){if(pe(e,d)&&(e=d,n)){const c=!Nt.length;for(const f of i)f[1](),Nt.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 Do=Object.defineProperty,ke=(e,t)=>{for(var n in t)Do(e,n,{get:t[n],enumerable:!0})},Oo={};ke(Oo,{convertFileSrc:()=>Hs,invoke:()=>ci,transformCallback:()=>vt});function Ro(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function vt(e,t=!1){let n=Ro(),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 ci(e,t={}){return new Promise((n,i)=>{let l=vt(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=vt(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function Hs(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function T(e){return ci("tauri",e)}var No={};ke(No,{Child:()=>js,Command:()=>$i,EventEmitter:()=>oi,open:()=>Ki});async function Io(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),T({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:vt(e)}})}var oi=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)}},js=class{constructor(e){this.pid=e}async write(e){return T({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return T({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},$i=class extends oi{constructor(e,t=[],n){super(),this.stdout=new oi,this.stderr=new oi,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new $i(e,t,n);return i.options.sidecar=!0,i}async spawn(){return Io(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 js(e))}async execute(){return new Promise((e,t)=>{this.on("error",t);let n=[],i=[];this.stdout.on("data",l=>{n.push(l)}),this.stderr.on("data",l=>{i.push(l)}),this.on("close",l=>{e({code:l.code,signal:l.signal,stdout:n.join(` +const Co=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerpolicy&&(o.referrerPolicy=l.referrerpolicy),l.crossorigin==="use-credentials"?o.credentials="include":l.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}};Co();function J(){}function Is(e){return e()}function is(){return Object.create(null)}function re(e){e.forEach(Is)}function To(e){return typeof e=="function"}function me(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ti;function Ao(e,t){return ti||(ti=document.createElement("a")),ti.href=t,e===ti.href}function So(e){return Object.keys(e).length===0}function Lo(e,...t){if(e==null)return J;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Fs(e,t,n){e.$$.on_destroy.push(Lo(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 rt(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function ai(e){return function(t){return t.preventDefault(),e.call(this,t)}}function r(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ae(e){return e===""?null:+e}function Eo(e){return Array.from(e.childNodes)}function $(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function q(e,t){e.value=t==null?"":t}function It(e,t){for(let n=0;n{si.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function ui(e){e&&e.c()}function $t(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Ft(()=>{const c=o.map(Is).filter(To);u?u.push(...c):re(c),e.$$.on_mount=[]}),d.forEach(Ft)}function xt(e,t){const n=e.$$;n.fragment!==null&&(re(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ro(e,t){e.$$.dirty[0]===-1&&(Yt.push(e),Do(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const v=g.length?g[0]:_;return f.ctx&&l(f.ctx[M],f.ctx[M]=v)&&(!f.skip_bound&&f.bound[M]&&f.bound[M](v),y&&Ro(e,M)),_}):[],f.update(),y=!0,re(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const M=Eo(t.target);f.fragment&&f.fragment.l(M),M.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&Te(e.$$.fragment),$t(e,t.target,t.anchor,t.customElement),js()}Qt(c)}class ye{$destroy(){xt(this,1),this.$destroy=J}$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&&!So(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Nt=[];function Us(e,t=J){let n;const i=new Set;function l(d){if(me(e,d)&&(e=d,n)){const c=!Nt.length;for(const f of i)f[1](),Nt.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 No=Object.defineProperty,ke=(e,t)=>{for(var n in t)No(e,n,{get:t[n],enumerable:!0})},Io={};ke(Io,{convertFileSrc:()=>qs,invoke:()=>ci,transformCallback:()=>vt});function Fo(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function vt(e,t=!1){let n=Fo(),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 ci(e,t={}){return new Promise((n,i)=>{let l=vt(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=vt(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function qs(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function T(e){return ci("tauri",e)}var Ho={};ke(Ho,{Child:()=>Bs,Command:()=>Ki,EventEmitter:()=>oi,open:()=>Qi});async function jo(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),T({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:vt(e)}})}var oi=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)}},Bs=class{constructor(e){this.pid=e}async write(e){return T({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return T({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Ki=class extends oi{constructor(e,t=[],n){super(),this.stdout=new oi,this.stderr=new oi,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static sidecar(e,t=[],n){let i=new Ki(e,t,n);return i.options.sidecar=!0,i}async spawn(){return jo(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 Bs(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 Ki(e,t){return T({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Fo={};ke(Fo,{TauriEvent:()=>Gs,emit:()=>_i,listen:()=>tn,once:()=>Vs});async function Us(e,t){return T({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function qs(e,t,n){await T({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Qi(e,t,n){return T({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:vt(n)}}).then(i=>async()=>Us(e,i))}async function Bs(e,t,n){return Qi(e,t,i=>{n(i),Us(e,i.id).catch(()=>{})})}var Gs=(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))(Gs||{});async function tn(e,t){return Qi(e,null,t)}async function Vs(e,t){return Bs(e,null,t)}async function _i(e,t){return qs(e,void 0,t)}var Ho={};ke(Ho,{CloseRequestedEvent:()=>$s,LogicalPosition:()=>Js,LogicalSize:()=>di,PhysicalPosition:()=>ot,PhysicalSize:()=>gt,UserAttentionType:()=>Zi,WebviewWindow:()=>wt,WebviewWindowHandle:()=>Xs,WindowManager:()=>Ys,appWindow:()=>Ve,availableMonitors:()=>qo,currentMonitor:()=>jo,getAll:()=>Ji,getCurrent:()=>$t,primaryMonitor:()=>Uo});var di=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},gt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new di(this.width/e,this.height/e)}},Js=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},ot=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Js(this.x/e,this.y/e)}},Zi=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(Zi||{});function $t(){return new wt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Ji(){return window.__TAURI_METADATA__.__windows.map(e=>new wt(e.label,{skip:!0}))}var ss=["tauri://created","tauri://error"],Xs=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)}):Qi(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)}):Bs(e,this.label,t)}async emit(e,t){if(ss.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return qs(e,this.label,t)}_handleTauriEvent(e,t){return ss.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Ys=class extends Xs{async scaleFactor(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new ot(e,t))}async outerPosition(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new ot(e,t))}async innerSize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new gt(e,t))}async outerSize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new gt(e,t))}async isFullscreen(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isFocused(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFocused"}}}})}async isDecorated(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isMaximizable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximizable"}}}})}async isMinimizable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimizable"}}}})}async isClosable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isClosable"}}}})}async isVisible(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return T({__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"}),T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setMaximizable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaximizable",payload:e}}}})}async setMinimizable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinimizable",payload:e}}}})}async setClosable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setClosable",payload:e}}}})}async setTitle(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return T({__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 T({__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 T({__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 T({__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 T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return T({__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 T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return T({__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 T({__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 T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",t=>{t.payload=Qs(t.payload),e(t)})}async onMoved(e){return this.listen("tauri://move",t=>{t.payload=Ks(t.payload),e(t)})}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new $s(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),n=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),n=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),i=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},$s=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}},wt=class extends Ys{constructor(e,t={}){super(e),t!=null&&t.skip||T({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Ji().some(t=>t.label===e)?new wt(e,{skip:!0}):null}static async getFocusedWindow(){for(let e of Ji())if(await e.isFocused())return e;return null}},Ve;"__TAURI_METADATA__"in window?Ve=new wt(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.`),Ve=new wt("main",{skip:!0}));function xi(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:Ks(e.position),size:Qs(e.size)}}function Ks(e){return new ot(e.x,e.y)}function Qs(e){return new gt(e.width,e.height)}async function jo(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(xi)}async function Uo(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(xi)}async function qo(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(xi))}function Bo(){return navigator.appVersion.includes("Win")}var Go={};ke(Go,{EOL:()=>Vo,arch:()=>Yo,locale:()=>Ko,platform:()=>Zs,tempdir:()=>$o,type:()=>Xo,version:()=>Jo});var Vo=Bo()?`\r +`)})}),this.spawn().catch(t)})}};async function Qi(e,t){return T({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var Uo={};ke(Uo,{TauriEvent:()=>Xs,emit:()=>_i,listen:()=>tn,once:()=>Ys});async function Gs(e,t){return T({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Vs(e,t,n){await T({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Zi(e,t,n){return T({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:vt(n)}}).then(i=>async()=>Gs(e,i))}async function Js(e,t,n){return Zi(e,t,i=>{n(i),Gs(e,i.id).catch(()=>{})})}var Xs=(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))(Xs||{});async function tn(e,t){return Zi(e,null,t)}async function Ys(e,t){return Js(e,null,t)}async function _i(e,t){return Vs(e,void 0,t)}var qo={};ke(qo,{CloseRequestedEvent:()=>$s,LogicalPosition:()=>Ks,LogicalSize:()=>di,PhysicalPosition:()=>ot,PhysicalSize:()=>yt,UserAttentionType:()=>$i,WebviewWindow:()=>wt,WebviewWindowHandle:()=>Qs,WindowManager:()=>Zs,appWindow:()=>Ve,availableMonitors:()=>Vo,currentMonitor:()=>Bo,getAll:()=>Ji,getCurrent:()=>Kt,primaryMonitor:()=>Go});var di=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},yt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new di(this.width/e,this.height/e)}},Ks=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},ot=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Ks(this.x/e,this.y/e)}},$i=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))($i||{});function Kt(){return new wt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Ji(){return window.__TAURI_METADATA__.__windows.map(e=>new wt(e.label,{skip:!0}))}var ss=["tauri://created","tauri://error"],Qs=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)}):Zi(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)}):Js(e,this.label,t)}async emit(e,t){if(ss.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return Vs(e,this.label,t)}_handleTauriEvent(e,t){return ss.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Zs=class extends Qs{async scaleFactor(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new ot(e,t))}async outerPosition(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new ot(e,t))}async innerSize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new yt(e,t))}async outerSize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new yt(e,t))}async isFullscreen(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isFocused(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFocused"}}}})}async isDecorated(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isMaximizable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximizable"}}}})}async isMinimizable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimizable"}}}})}async isClosable(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isClosable"}}}})}async isVisible(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return T({__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"}),T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setMaximizable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaximizable",payload:e}}}})}async setMinimizable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinimizable",payload:e}}}})}async setClosable(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setClosable",payload:e}}}})}async setTitle(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return T({__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 T({__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 T({__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 T({__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 T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return T({__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 T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return T({__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 T({__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 T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",t=>{t.payload=eo(t.payload),e(t)})}async onMoved(e){return this.listen("tauri://move",t=>{t.payload=xs(t.payload),e(t)})}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new $s(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),n=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),n=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),i=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{t(),n(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},$s=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}},wt=class extends Zs{constructor(e,t={}){super(e),t!=null&&t.skip||T({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Ji().some(t=>t.label===e)?new wt(e,{skip:!0}):null}static async getFocusedWindow(){for(let e of Ji())if(await e.isFocused())return e;return null}},Ve;"__TAURI_METADATA__"in window?Ve=new wt(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.`),Ve=new wt("main",{skip:!0}));function xi(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:xs(e.position),size:eo(e.size)}}function xs(e){return new ot(e.x,e.y)}function eo(e){return new yt(e.width,e.height)}async function Bo(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(xi)}async function Go(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(xi)}async function Vo(){return T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(xi))}function Jo(){return navigator.appVersion.includes("Win")}var Xo={};ke(Xo,{EOL:()=>Yo,arch:()=>Zo,locale:()=>xo,platform:()=>to,tempdir:()=>$o,type:()=>Qo,version:()=>Ko});var Yo=Jo()?`\r `:` -`;async function Zs(){return T({__tauriModule:"Os",message:{cmd:"platform"}})}async function Jo(){return T({__tauriModule:"Os",message:{cmd:"version"}})}async function Xo(){return T({__tauriModule:"Os",message:{cmd:"osType"}})}async function Yo(){return T({__tauriModule:"Os",message:{cmd:"arch"}})}async function $o(){return T({__tauriModule:"Os",message:{cmd:"tempdir"}})}async function Ko(){return T({__tauriModule:"Os",message:{cmd:"locale"}})}var Qo={};ke(Qo,{getName:()=>eo,getTauriVersion:()=>to,getVersion:()=>xs,hide:()=>io,show:()=>no});async function xs(){return T({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function eo(){return T({__tauriModule:"App",message:{cmd:"getAppName"}})}async function to(){return T({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function no(){return T({__tauriModule:"App",message:{cmd:"show"}})}async function io(){return T({__tauriModule:"App",message:{cmd:"hide"}})}var Zo={};ke(Zo,{exit:()=>lo,relaunch:()=>el});async function lo(e=0){return T({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function el(){return T({__tauriModule:"Process",message:{cmd:"relaunch"}})}function xo(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b,S,D,N,O,j,W,C,A,E,M,H;return{c(){t=a("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +`;async function to(){return T({__tauriModule:"Os",message:{cmd:"platform"}})}async function Ko(){return T({__tauriModule:"Os",message:{cmd:"version"}})}async function Qo(){return T({__tauriModule:"Os",message:{cmd:"osType"}})}async function Zo(){return T({__tauriModule:"Os",message:{cmd:"arch"}})}async function $o(){return T({__tauriModule:"Os",message:{cmd:"tempdir"}})}async function xo(){return T({__tauriModule:"Os",message:{cmd:"locale"}})}var ea={};ke(ea,{getName:()=>io,getTauriVersion:()=>lo,getVersion:()=>no,hide:()=>oo,show:()=>so});async function no(){return T({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function io(){return T({__tauriModule:"App",message:{cmd:"getAppName"}})}async function lo(){return T({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function so(){return T({__tauriModule:"App",message:{cmd:"show"}})}async function oo(){return T({__tauriModule:"App",message:{cmd:"hide"}})}var ta={};ke(ta,{exit:()=>ao,relaunch:()=>el});async function ao(e=0){return T({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function el(){return T({__tauriModule:"Process",message:{cmd:"relaunch"}})}function na(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b,A,D,N,O,U,P,C,S,z,k,j;return{c(){t=a("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=m(),i=a("br"),l=m(),o=a("br"),u=m(),d=a("pre"),c=z("App name: "),f=a("code"),g=z(e[2]),k=z(` -App version: `),_=a("code"),v=z(e[0]),y=z(` -Tauri version: `),b=a("code"),S=z(e[1]),D=z(` -`),N=m(),O=a("br"),j=m(),W=a("div"),C=a("button"),C.textContent="Close application",A=m(),E=a("button"),E.textContent="Relaunch application",r(C,"class","btn"),r(E,"class","btn"),r(W,"class","flex flex-wrap gap-1 shadow-")},m(U,J){h(U,t,J),h(U,n,J),h(U,i,J),h(U,l,J),h(U,o,J),h(U,u,J),h(U,d,J),s(d,c),s(d,f),s(f,g),s(d,k),s(d,_),s(_,v),s(d,y),s(d,b),s(b,S),s(d,D),h(U,N,J),h(U,O,J),h(U,j,J),h(U,W,J),s(W,C),s(W,A),s(W,E),M||(H=[L(C,"click",e[3]),L(E,"click",e[4])],M=!0)},p(U,[J]){J&4&&Q(g,U[2]),J&1&&Q(v,U[0]),J&2&&Q(S,U[1])},i:G,o:G,d(U){U&&p(t),U&&p(n),U&&p(i),U&&p(l),U&&p(o),U&&p(u),U&&p(d),U&&p(N),U&&p(O),U&&p(j),U&&p(W),M=!1,oe(H)}}}function ea(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";eo().then(c=>{n(2,o=c)}),xs().then(c=>{n(0,i=c)}),to().then(c=>{n(1,l=c)});async function u(){await lo()}async function d(){await el()}return[i,l,o,u,d]}class ta extends ye{constructor(t){super(),ge(this,t,ea,xo,pe,{})}}var na={};ke(na,{getMatches:()=>so});async function so(){return T({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function ia(e){let t,n,i,l,o,u,d,c,f,g,k,_,v;return{c(){t=a("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments: + tests.`,n=h(),i=a("br"),l=h(),o=a("br"),u=h(),d=a("pre"),c=E("App name: "),f=a("code"),y=E(e[2]),M=E(` +App version: `),_=a("code"),g=E(e[0]),v=E(` +Tauri version: `),b=a("code"),A=E(e[1]),D=E(` +`),N=h(),O=a("br"),U=h(),P=a("div"),C=a("button"),C.textContent="Close application",S=h(),z=a("button"),z.textContent="Relaunch application",r(C,"class","btn"),r(z,"class","btn"),r(P,"class","flex flex-wrap gap-1 shadow-")},m(I,X){m(I,t,X),m(I,n,X),m(I,i,X),m(I,l,X),m(I,o,X),m(I,u,X),m(I,d,X),s(d,c),s(d,f),s(f,y),s(d,M),s(d,_),s(_,g),s(d,v),s(d,b),s(b,A),s(d,D),m(I,N,X),m(I,O,X),m(I,U,X),m(I,P,X),s(P,C),s(P,S),s(P,z),k||(j=[L(C,"click",e[3]),L(z,"click",e[4])],k=!0)},p(I,[X]){X&4&&$(y,I[2]),X&1&&$(g,I[0]),X&2&&$(A,I[1])},i:J,o:J,d(I){I&&p(t),I&&p(n),I&&p(i),I&&p(l),I&&p(o),I&&p(u),I&&p(d),I&&p(N),I&&p(O),I&&p(U),I&&p(P),k=!1,re(j)}}}function ia(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";io().then(c=>{n(2,o=c)}),no().then(c=>{n(0,i=c)}),lo().then(c=>{n(1,l=c)});async function u(){await ao()}async function d(){await el()}return[i,l,o,u,d]}class la extends ye{constructor(t){super(),ge(this,t,ia,na,me,{})}}var sa={};ke(sa,{getMatches:()=>ro});async function ro(){return T({__tauriModule:"Cli",message:{cmd:"cliMatches"}})}function oa(e){let t,n,i,l,o,u,d,c,f,y,M,_,g;return{c(){t=a("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=m(),i=a("br"),l=m(),o=a("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=m(),d=a("br"),c=m(),f=a("br"),g=m(),k=a("button"),k.textContent="Get matches",r(o,"class","note"),r(k,"class","btn"),r(k,"id","cli-matches")},m(y,b){h(y,t,b),h(y,n,b),h(y,i,b),h(y,l,b),h(y,o,b),h(y,u,b),h(y,d,b),h(y,c,b),h(y,f,b),h(y,g,b),h(y,k,b),_||(v=L(k,"click",e[0]),_=!0)},p:G,i:G,o:G,d(y){y&&p(t),y&&p(n),y&&p(i),y&&p(l),y&&p(o),y&&p(u),y&&p(d),y&&p(c),y&&p(f),y&&p(g),y&&p(k),_=!1,v()}}}function la(e,t,n){let{onMessage:i}=t;function l(){so().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class sa extends ye{constructor(t){super(),ge(this,t,la,ia,pe,{onMessage:1})}}function oa(e){let t,n,i,l,o,u,d,c;return{c(){t=a("div"),n=a("button"),n.textContent="Call Log API",i=m(),l=a("button"),l.textContent="Call Request (async) API",o=m(),u=a("button"),u.textContent="Send event to Rust",r(n,"class","btn"),r(n,"id","log"),r(l,"class","btn"),r(l,"id","request"),r(u,"class","btn"),r(u,"id","event")},m(f,g){h(f,t,g),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[L(n,"click",e[0]),L(l,"click",e[1]),L(u,"click",e[2])],d=!0)},p:G,i:G,o:G,d(f){f&&p(t),d=!1,oe(c)}}}function aa(e,t,n){let{onMessage:i}=t,l;_t(async()=>{l=await tn("rust-event",i)}),Yi(()=>{l&&l()});function o(){ci("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ci("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){_i("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class ra extends ye{constructor(t){super(),ge(this,t,aa,oa,pe,{onMessage:3})}}var ua={};ke(ua,{ask:()=>ao,confirm:()=>da,message:()=>ca,open:()=>tl,save:()=>oo});async function tl(e={}){return typeof e=="object"&&Object.freeze(e),T({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function oo(e={}){return typeof e=="object"&&Object.freeze(e),T({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function ca(e,t){var i,l;let n=typeof t=="string"?{title:t}:t;return T({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabel:(l=n==null?void 0:n.okLabel)==null?void 0:l.toString()}})}async function ao(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return T({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Yes",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"No"]}})}async function da(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return T({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Ok",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"Cancel"]}})}var fa={};ke(fa,{BaseDirectory:()=>en,Dir:()=>en,copyFile:()=>ba,createDir:()=>ha,exists:()=>va,readBinaryFile:()=>nl,readDir:()=>ro,readTextFile:()=>pa,removeDir:()=>_a,removeFile:()=>ga,renameFile:()=>ya,writeBinaryFile:()=>ma,writeFile:()=>Xi,writeTextFile:()=>Xi});var en=(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))(en||{});async function pa(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function nl(e,t={}){let n=await T({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Xi(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,T({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function ma(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:[]),T({__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 ro(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function ha(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function _a(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function ba(e,t,n={}){return T({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function ga(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function ya(e,t,n={}){return T({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function va(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function wa(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b,S,D,N,O,j,W,C,A,E;return{c(){t=a("div"),n=a("input"),i=m(),l=a("input"),o=m(),u=a("br"),d=m(),c=a("div"),f=a("input"),g=m(),k=a("label"),k.textContent="Multiple",_=m(),v=a("div"),y=a("input"),b=m(),S=a("label"),S.textContent="Directory",D=m(),N=a("br"),O=m(),j=a("button"),j.textContent="Open dialog",W=m(),C=a("button"),C.textContent="Open save dialog",r(n,"class","input"),r(n,"id","dialog-default-path"),r(n,"placeholder","Default path"),r(l,"class","input"),r(l,"id","dialog-filter"),r(l,"placeholder","Extensions filter, comma-separated"),r(t,"class","flex gap-2 children:grow"),r(f,"type","checkbox"),r(f,"id","dialog-multiple"),r(k,"for","dialog-multiple"),r(y,"type","checkbox"),r(y,"id","dialog-directory"),r(S,"for","dialog-directory"),r(j,"class","btn"),r(j,"id","open-dialog"),r(C,"class","btn"),r(C,"id","save-dialog")},m(M,H){h(M,t,H),s(t,n),q(n,e[0]),s(t,i),s(t,l),q(l,e[1]),h(M,o,H),h(M,u,H),h(M,d,H),h(M,c,H),s(c,f),f.checked=e[2],s(c,g),s(c,k),h(M,_,H),h(M,v,H),s(v,y),y.checked=e[3],s(v,b),s(v,S),h(M,D,H),h(M,N,H),h(M,O,H),h(M,j,H),h(M,W,H),h(M,C,H),A||(E=[L(n,"input",e[8]),L(l,"input",e[9]),L(f,"change",e[10]),L(y,"change",e[11]),L(j,"click",e[4]),L(C,"click",e[5])],A=!0)},p(M,[H]){H&1&&n.value!==M[0]&&q(n,M[0]),H&2&&l.value!==M[1]&&q(l,M[1]),H&4&&(f.checked=M[2]),H&8&&(y.checked=M[3])},i:G,o:G,d(M){M&&p(t),M&&p(o),M&&p(u),M&&p(d),M&&p(c),M&&p(_),M&&p(v),M&&p(D),M&&p(N),M&&p(O),M&&p(j),M&&p(W),M&&p(C),A=!1,oe(E)}}}function ka(e,t){const n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){const o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function Ma(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){tl({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{const S=b,D=S.match(/\S+\.\S+$/g);nl(S).then(function(N){D&&(S.includes(".png")||S.includes(".jpg"))?ka(new Uint8Array(N),function(O){const j="data:image/png;base64,"+O;l('')}):i(b)}).catch(i(b))}}).catch(i)}function g(){oo({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 v(){d=this.checked,n(2,d)}function y(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,g,i,l,k,_,v,y]}class Ca extends ye{constructor(t){super(),ge(this,t,Ma,wa,pe,{onMessage:6,insecureRenderHtml:7})}}function os(e,t,n){const i=e.slice();return i[9]=t[n],i}function as(e){let t,n=e[9][0]+"",i;return{c(){t=a("option"),i=z(n),t.__value=e[9][1],t.value=t.__value},m(l,o){h(l,t,o),s(t,i)},p:G,d(l){l&&p(t)}}}function Ta(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b,S,D,N,O,j=e[2],W=[];for(let C=0;CisNaN(parseInt(_))).map(_=>[_,en[_]]);function c(){const _=o.match(/\S+\.\S+$/g),v={dir:rs()};(_?nl(o,v):ro(o,v)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))Aa(new Uint8Array(b),function(S){const D="data:image/png;base64,"+S;l('')});else{const S=String.fromCharCode.apply(null,b);l(''),setTimeout(()=>{const D=document.getElementById("file-response");D.value=S,document.getElementById("file-save").addEventListener("click",function(){Xi(o,D.value,{dir:rs()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=Hs(o),u)}function g(){o=this.value,n(0,o)}function k(_){ri[_?"unshift":"push"](()=>{u=_,n(1,u)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,l=_.insecureRenderHtml)},[o,u,d,c,f,i,l,g,k]}class La extends ye{constructor(t){super(),ge(this,t,Sa,Ta,pe,{onMessage:5,insecureRenderHtml:6})}}var za={};ke(za,{Body:()=>at,Client:()=>co,Response:()=>uo,ResponseType:()=>il,fetch:()=>Wa,getClient:()=>fi});var il=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(il||{});async function Ea(e){let t={},n=async(i,l)=>{if(l!==null){let o;typeof l=="string"?o=l:l instanceof Uint8Array||Array.isArray(l)?o=Array.from(l):l instanceof File?o={file:Array.from(new Uint8Array(await l.arrayBuffer())),mime:l.type,fileName:l.name}:typeof l.file=="string"?o={file:l.file,mime:l.mime,fileName:l.fileName}:o={file:Array.from(l.file),mime:l.mime,fileName:l.fileName},t[String(i)]=o}};if(e instanceof FormData)for(let[i,l]of e)await n(i,l);else for(let[i,l]of Object.entries(e))await n(i,l);return t}var at=class{constructor(e,t){this.type=e,this.payload=t}static form(e){return new at("Form",e)}static json(e){return new at("Json",e)}static text(e){return new at("Text",e)}static bytes(e){return new at("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},uo=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}},co=class{constructor(e){this.id=e}async drop(){return T({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){var n;let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),((n=e.body)==null?void 0:n.type)==="Form"&&(e.body.payload=await Ea(e.body.payload)),T({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(i=>{let l=new uo(i);if(t){try{l.data=JSON.parse(l.data)}catch(o){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error(`Failed to parse response \`${l.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 l}return l})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,n){return this.request({method:"POST",url:e,body:t,...n})}async put(e,t,n){return this.request({method:"PUT",url:e,body:t,...n})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function fi(e){return T({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new co(t))}var Bi=null;async function Wa(e,t){var n;return Bi===null&&(Bi=await fi()),Bi.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function us(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function cs(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b,S,D,N=e[5],O=[];for(let A=0;AHe(O[A],1,1,()=>{O[A]=null});let W=!e[3]&&ms(),C=!e[3]&&e[8]&&hs();return{c(){t=a("span"),n=a("span"),i=z(e[6]),l=m(),o=a("ul");for(let A=0;A{g[y]=null}),hi(),o=g[l],o?o.p(_,v):(o=g[l]=f[l](_),o.c()),Te(o,1),o.m(t,u))},i(_){d||(Te(o),d=!0)},o(_){He(o),d=!1},d(_){_&&p(t),c&&c.d(),g[l].d()}}}function ms(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function hs(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function Oa(e){let t,n,i=e[5].length&&cs(e);return{c(){i&&i.c(),t=pi()},m(l,o){i&&i.m(l,o),h(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&Te(i,1)):(i=cs(l),i.c(),Te(i,1),i.m(t.parentNode,t)):i&&(mi(),He(i,1,1,()=>{i=null}),hi())},i(l){n||(Te(i),n=!0)},o(l){He(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const Ra="...";function Na(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=b=>b===null?"null":typeof b;let c,f,g,k,_;const v=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},y=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,g=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),r(k,"class","input h-auto w-100%"),r(k,"id","request-body"),r(k,"placeholder","Request body"),r(k,"rows","5"),r(b,"class","btn"),r(b,"id","make-request"),r(C,"class","input"),r(E,"class","input"),r(W,"class","flex gap-2 children:grow"),r(x,"type","checkbox"),r(X,"class","btn"),r(X,"type","button")},m(P,V){h(P,t,V),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),It(n,e[0]),s(t,c),s(t,f),s(t,g),s(t,k),q(k,e[1]),s(t,_),s(t,v),s(t,y),s(t,b),h(P,S,V),h(P,D,V),h(P,N,V),h(P,O,V),h(P,j,V),h(P,W,V),s(W,C),q(C,e[2]),s(W,A),s(W,E),q(E,e[3]),h(P,M,V),h(P,H,V),h(P,U,V),h(P,J,V),s(J,x),x.checked=e[5],s(J,me),h(P,te,V),h(P,Y,V),h(P,de,V),h(P,Z,V),h(P,I,V),h(P,X,V),h(P,$,V),h(P,ae,V),h(P,ne,V),h(P,he,V),h(P,_e,V),Zt(fe,P,V),re=!0,Ae||(Se=[L(n,"change",e[9]),L(k,"input",e[10]),L(t,"submit",ai(e[6])),L(C,"input",e[11]),L(E,"input",e[12]),L(x,"change",e[13]),L(X,"click",e[7])],Ae=!0)},p(P,[V]){V&1&&It(n,P[0]),V&2&&q(k,P[1]),V&4&&C.value!==P[2]&&q(C,P[2]),V&8&&E.value!==P[3]&&q(E,P[3]),V&32&&(x.checked=P[5]);const Le={};V&16&&(Le.json=P[4]),fe.$set(Le)},i(P){re||(Te(fe.$$.fragment,P),re=!0)},o(P){He(fe.$$.fragment,P),re=!1},d(P){P&&p(t),P&&p(S),P&&p(D),P&&p(N),P&&p(O),P&&p(j),P&&p(W),P&&p(M),P&&p(H),P&&p(U),P&&p(J),P&&p(te),P&&p(Y),P&&p(de),P&&p(Z),P&&p(I),P&&p(X),P&&p($),P&&p(ae),P&&p(ne),P&&p(he),P&&p(_e),xt(fe,P),Ae=!1,oe(Se)}}}function Fa(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await fi().catch(j=>{throw o(j),j}),O={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?O.body=at.json(JSON.parse(l)):l!==""&&(O.body=at.text(l)),D.request(O).then(o).catch(o)}let d="baz",c="qux",f=null,g=!0;async function k(){const D=await fi().catch(N=>{throw o(N),N});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:at.form({foo:d,bar:c}),headers:g?{"Content-Type":"multipart/form-data"}:void 0,responseType:il.Text}))}function _(){i=Gi(this),n(0,i)}function v(){l=this.value,n(1,l)}function y(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function S(){g=this.checked,n(5,g)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,g,u,k,o,_,v,y,b,S]}class Ha extends ye{constructor(t){super(),ge(this,t,Fa,Ia,pe,{onMessage:8})}}var ja={};ke(ja,{isPermissionGranted:()=>Ua,requestPermission:()=>qa,sendNotification:()=>po});async function Ua(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):T({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function qa(){return window.Notification.requestPermission()}function po(e){typeof e=="string"?new window.Notification(e):new window.Notification(e.title,e)}function Ba(e){let t,n,i;return{c(){t=a("button"),t.textContent="Send test notification",r(t,"class","btn"),r(t,"id","notification")},m(l,o){h(l,t,o),n||(i=L(t,"click",e[0]),n=!0)},p:G,i:G,o:G,d(l){l&&p(t),n=!1,i()}}}function Ga(e,t,n){let{onMessage:i}=t;async function l(){po({title:"Notification title",body:"This is the notification body",sound:"default"})}function o(){Notification.permission==="default"?Notification.requestPermission().then(function(u){u==="granted"?l():i("Permission is "+u)}).catch(i):Notification.permission==="granted"?l():i("Permission is denied")}return e.$$set=u=>{"onMessage"in u&&n(1,i=u.onMessage)},[o,i]}class Va extends ye{constructor(t){super(),ge(this,t,Ga,Ba,pe,{onMessage:1})}}function _s(e,t,n){const i=e.slice();return i[75]=t[n],i}function bs(e,t,n){const i=e.slice();return i[78]=t[n],i}function gs(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[43].call(i))},m(f,g){h(f,t,g),h(f,n,g),h(f,i,g),s(i,l);for(let k=0;ke[65].call(Ge)),r(nt,"class","input"),r(nt,"type","number"),r(it,"class","input"),r(it,"type","number"),r(Be,"class","flex gap-2"),r(lt,"class","input grow"),r(lt,"id","title"),r(Jt,"class","btn"),r(Jt,"type","submit"),r(mt,"class","flex gap-1"),r(st,"class","input grow"),r(st,"id","url"),r(Xt,"class","btn"),r(Xt,"id","open-url"),r(ht,"class","flex gap-1"),r(pt,"class","flex flex-col gap-1")},m(w,R){h(w,t,R),h(w,n,R),h(w,i,R),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,g),s(i,k),s(i,_),h(w,v,R),h(w,y,R),h(w,b,R),h(w,S,R),s(S,D),s(D,N),s(D,O),O.checked=e[6],s(S,j),s(S,W),s(W,C),s(W,A),A.checked=e[2],s(S,E),s(S,M),s(M,H),s(M,U),U.checked=e[3],s(S,J),s(S,x),s(x,me),s(x,te),te.checked=e[4],s(S,Y),s(S,de),s(de,Z),s(de,I),I.checked=e[5],s(S,X),s(S,$),s($,ae),s($,ne),ne.checked=e[7],s(S,he),s(S,_e),s(_e,fe),s(_e,re),re.checked=e[8],s(S,Ae),s(S,Se),s(Se,P),s(Se,V),V.checked=e[9],s(S,Le),s(S,ve),s(ve,ue),s(ve,we),we.checked=e[10],h(w,ie,R),h(w,ze,R),h(w,Je,R),h(w,le,R),s(le,ee),s(ee,F),s(F,ce),s(F,B),q(B,e[17]),s(ee,Ie),s(ee,kt),s(kt,nn),s(kt,Pe),q(Pe,e[18]),s(le,ln),s(le,Xe),s(Xe,Mt),s(Mt,sn),s(Mt,De),q(De,e[11]),s(Xe,on),s(Xe,Ct),s(Ct,an),s(Ct,Oe),q(Oe,e[12]),s(le,rn),s(le,Ye),s(Ye,Tt),s(Tt,un),s(Tt,Fe),q(Fe,e[13]),s(Ye,K),s(Ye,rt),s(rt,Ht),s(rt,Re),q(Re,e[14]),s(le,jt),s(le,je),s(je,ut),s(ut,Ut),s(ut,Ee),q(Ee,e[15]),s(je,qt),s(je,ct),s(ct,Bt),s(ct,We),q(We,e[16]),h(w,At,R),h(w,St,R),h(w,Lt,R),h(w,Ce,R),s(Ce,Ue),s(Ue,Ne),s(Ne,dt),s(Ne,Gt),s(Ne,ft),s(ft,cn),s(ft,bi),s(Ne,sl),s(Ne,fn),s(fn,ol),s(fn,gi),s(Ue,al),s(Ue,$e),s($e,mn),s($e,rl),s($e,hn),s(hn,ul),s(hn,yi),s($e,cl),s($e,bn),s(bn,dl),s(bn,vi),s(Ce,fl),s(Ce,zt),s(zt,Ke),s(Ke,yn),s(Ke,pl),s(Ke,vn),s(vn,ml),s(vn,wi),s(Ke,hl),s(Ke,kn),s(kn,_l),s(kn,ki),s(zt,bl),s(zt,Qe),s(Qe,Cn),s(Qe,gl),s(Qe,Tn),s(Tn,yl),s(Tn,Mi),s(Qe,vl),s(Qe,Sn),s(Sn,wl),s(Sn,Ci),s(Ce,kl),s(Ce,Et),s(Et,Ze),s(Ze,zn),s(Ze,Ml),s(Ze,En),s(En,Cl),s(En,Ti),s(Ze,Tl),s(Ze,Pn),s(Pn,Al),s(Pn,Ai),s(Et,Sl),s(Et,xe),s(xe,On),s(xe,Ll),s(xe,Rn),s(Rn,zl),s(Rn,Si),s(xe,El),s(xe,In),s(In,Wl),s(In,Li),s(Ce,Pl),s(Ce,Wt),s(Wt,et),s(et,Hn),s(et,Dl),s(et,jn),s(jn,Ol),s(jn,zi),s(et,Rl),s(et,qn),s(qn,Nl),s(qn,Ei),s(Wt,Il),s(Wt,tt),s(tt,Gn),s(tt,Fl),s(tt,Vn),s(Vn,Hl),s(Vn,Wi),s(tt,jl),s(tt,Xn),s(Xn,Ul),s(Xn,Pi),h(w,Di,R),h(w,Oi,R),h(w,Ri,R),h(w,Vt,R),h(w,Ni,R),h(w,qe,R),s(qe,$n),s($n,Pt),Pt.checked=e[19],s($n,ql),s(qe,Bl),s(qe,Kn),s(Kn,Dt),Dt.checked=e[20],s(Kn,Gl),s(qe,Vl),s(qe,Qn),s(Qn,Ot),Ot.checked=e[24],s(Qn,Jl),h(w,Ii,R),h(w,Be,R),s(Be,Zn),s(Zn,Xl),s(Zn,Ge);for(let be=0;be=1,g,k,_,v=f&&gs(e),y=e[1][e[0]]&&vs(e);return{c(){t=a("div"),n=a("div"),i=a("input"),l=m(),o=a("button"),o.textContent="New window",u=m(),d=a("br"),c=m(),v&&v.c(),g=m(),y&&y.c(),r(i,"class","input grow"),r(i,"type","text"),r(i,"placeholder","New Window label.."),r(o,"class","btn"),r(n,"class","flex gap-1"),r(t,"class","flex flex-col children:grow gap-2")},m(b,S){h(b,t,S),s(t,n),s(n,i),q(i,e[25]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),v&&v.m(t,null),s(t,g),y&&y.m(t,null),k||(_=[L(i,"input",e[42]),L(o,"click",e[39])],k=!0)},p(b,S){S[0]&33554432&&i.value!==b[25]&&q(i,b[25]),S[0]&2&&(f=Object.keys(b[1]).length>=1),f?v?v.p(b,S):(v=gs(b),v.c(),v.m(t,g)):v&&(v.d(1),v=null),b[1][b[0]]?y?y.p(b,S):(y=vs(b),y.c(),y.m(t,null)):y&&(y.d(1),y=null)},i:G,o:G,d(b){b&&p(t),v&&v.d(),y&&y.d(),k=!1,oe(_)}}}function Xa(e,t,n){let i=Ve.label;const l={[Ve.label]:Ve},o=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=t,d,c="https://tauri.app",f=!0,g=!0,k=!0,_=!0,v=!1,y=!0,b=!1,S=!0,D=!1,N=null,O=null,j=null,W=null,C=null,A=null,E=null,M=null,H=1,U=new ot(E,M),J=new ot(E,M),x=new gt(N,O),me=new gt(N,O),te,Y,de=!1,Z=!0,I=null,X=null,$="default",ae=!1,ne="Awesome Tauri Example!";function he(){Ki(c)}function _e(){l[i].setTitle(ne)}function fe(){l[i].hide(),setTimeout(l[i].show,2e3)}function re(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function Ae(){tl({multiple:!1}).then(K=>{typeof K=="string"&&l[i].setIcon(K)})}function Se(){if(!d)return;const K=new wt(d);n(1,l[d]=K,l),K.once("tauri://error",function(){u("Error creating new webview")})}function P(){l[i].innerSize().then(K=>{n(30,x=K),n(11,N=x.width),n(12,O=x.height)}),l[i].outerSize().then(K=>{n(31,me=K)})}function V(){l[i].innerPosition().then(K=>{n(28,U=K)}),l[i].outerPosition().then(K=>{n(29,J=K),n(17,E=J.x),n(18,M=J.y)})}async function Le(K){!K||(te&&te(),Y&&Y(),Y=await K.listen("tauri://move",V),te=await K.listen("tauri://resize",P))}async function ve(){await l[i].minimize(),await l[i].requestUserAttention(Zi.Critical),await new Promise(K=>setTimeout(K,3e3)),await l[i].requestUserAttention(null)}function ue(){d=this.value,n(25,d)}function we(){i=Gi(this),n(0,i),n(1,l)}const ie=()=>l[i].center();function ze(){v=this.checked,n(6,v)}function Je(){f=this.checked,n(2,f)}function le(){g=this.checked,n(3,g)}function ee(){k=this.checked,n(4,k)}function F(){_=this.checked,n(5,_)}function ce(){y=this.checked,n(7,y)}function B(){b=this.checked,n(8,b)}function Ie(){S=this.checked,n(9,S)}function kt(){D=this.checked,n(10,D)}function nn(){E=se(this.value),n(17,E)}function Pe(){M=se(this.value),n(18,M)}function ln(){N=se(this.value),n(11,N)}function Xe(){O=se(this.value),n(12,O)}function Mt(){j=se(this.value),n(13,j)}function sn(){W=se(this.value),n(14,W)}function De(){C=se(this.value),n(15,C)}function on(){A=se(this.value),n(16,A)}function Ct(){de=this.checked,n(19,de)}function an(){Z=this.checked,n(20,Z)}function Oe(){ae=this.checked,n(24,ae)}function rn(){$=Gi(this),n(23,$),n(33,o)}function Ye(){I=se(this.value),n(21,I)}function Tt(){X=se(this.value),n(22,X)}function un(){ne=this.value,n(32,ne)}function Fe(){c=this.value,n(26,c)}return e.$$set=K=>{"onMessage"in K&&n(41,u=K.onMessage)},e.$$.update=()=>{var K,rt,Ht,Re,jt,je,ut,Ut,Ee,qt,ct,Bt,We,At,St,Lt,Ce,Ue,Ne,dt,Gt,ft;e.$$.dirty[0]&3&&(l[i],V(),P()),e.$$.dirty[0]&7&&((K=l[i])==null||K.setResizable(f)),e.$$.dirty[0]&11&&((rt=l[i])==null||rt.setMaximizable(g)),e.$$.dirty[0]&19&&((Ht=l[i])==null||Ht.setMinimizable(k)),e.$$.dirty[0]&35&&((Re=l[i])==null||Re.setClosable(_)),e.$$.dirty[0]&67&&(v?(jt=l[i])==null||jt.maximize():(je=l[i])==null||je.unmaximize()),e.$$.dirty[0]&131&&((ut=l[i])==null||ut.setDecorations(y)),e.$$.dirty[0]&259&&((Ut=l[i])==null||Ut.setAlwaysOnTop(b)),e.$$.dirty[0]&515&&((Ee=l[i])==null||Ee.setContentProtected(S)),e.$$.dirty[0]&1027&&((qt=l[i])==null||qt.setFullscreen(D)),e.$$.dirty[0]&6147&&N&&O&&((ct=l[i])==null||ct.setSize(new gt(N,O))),e.$$.dirty[0]&24579&&(j&&W?(Bt=l[i])==null||Bt.setMinSize(new di(j,W)):(We=l[i])==null||We.setMinSize(null)),e.$$.dirty[0]&98307&&(C>800&&A>400?(At=l[i])==null||At.setMaxSize(new di(C,A)):(St=l[i])==null||St.setMaxSize(null)),e.$$.dirty[0]&393219&&E!==null&&M!==null&&((Lt=l[i])==null||Lt.setPosition(new ot(E,M))),e.$$.dirty[0]&3&&((Ce=l[i])==null||Ce.scaleFactor().then(cn=>n(27,H=cn))),e.$$.dirty[0]&3&&Le(l[i]),e.$$.dirty[0]&524291&&((Ue=l[i])==null||Ue.setCursorGrab(de)),e.$$.dirty[0]&1048579&&((Ne=l[i])==null||Ne.setCursorVisible(Z)),e.$$.dirty[0]&8388611&&((dt=l[i])==null||dt.setCursorIcon($)),e.$$.dirty[0]&6291459&&I!==null&&X!==null&&((Gt=l[i])==null||Gt.setCursorPosition(new ot(I,X))),e.$$.dirty[0]&16777219&&((ft=l[i])==null||ft.setIgnoreCursorEvents(ae))},[i,l,f,g,k,_,v,y,b,S,D,N,O,j,W,C,A,E,M,de,Z,I,X,$,ae,d,c,H,U,J,x,me,ne,o,he,_e,fe,re,Ae,Se,ve,u,ue,we,ie,ze,Je,le,ee,F,ce,B,Ie,kt,nn,Pe,ln,Xe,Mt,sn,De,on,Ct,an,Oe,rn,Ye,Tt,un,Fe]}class Ya extends ye{constructor(t){super(),ge(this,t,Xa,Ja,pe,{onMessage:41},null,[-1,-1,-1])}}var $a={};ke($a,{isRegistered:()=>Qa,register:()=>mo,registerAll:()=>Ka,unregister:()=>ho,unregisterAll:()=>_o});async function mo(e,t){return T({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:vt(t)}})}async function Ka(e,t){return T({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:vt(t)}})}async function Qa(e){return T({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function ho(e){return T({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function _o(){return T({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function ks(e,t,n){const i=e.slice();return i[9]=t[n],i}function Ms(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=a("div"),i=z(n),l=m(),o=a("button"),o.textContent="Unregister",r(o,"class","btn"),r(o,"type","button"),r(t,"class","flex justify-between")},m(f,g){h(f,t,g),s(t,i),s(t,l),s(t,o),u||(d=L(o,"click",c),u=!0)},p(f,g){e=f,g&2&&n!==(n=e[9]+"")&&Q(i,n)},d(f){f&&p(t),u=!1,d()}}}function Cs(e){let t,n,i,l,o;return{c(){t=a("br"),n=m(),i=a("button"),i.textContent="Unregister all",r(i,"class","btn"),r(i,"type","button")},m(u,d){h(u,t,d),h(u,n,d),h(u,i,d),l||(o=L(i,"click",e[5]),l=!0)},p:G,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function Za(e){let t,n,i,l,o,u,d,c,f,g,k,_=e[1],v=[];for(let b=0;b<_.length;b+=1)v[b]=Ms(ks(e,_,b));let y=e[1].length>1&&Cs(e);return{c(){t=a("div"),n=a("input"),i=m(),l=a("button"),l.textContent="Register",o=m(),u=a("br"),d=m(),c=a("div");for(let b=0;b1?y?y.p(b,S):(y=Cs(b),y.c(),y.m(c,null)):y&&(y.d(1),y=null)},i:G,o:G,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),yt(v,b),y&&y.d(),g=!1,oe(k)}}}function xa(e,t,n){let i,{onMessage:l}=t;const o=Fs([]);Rs(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;mo(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(v=>[...v,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const v=_;ho(v).then(()=>{o.update(y=>y.filter(b=>b!==v)),l(`Shortcut ${v} unregistered`)}).catch(l)}function f(){_o().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function g(){u=this.value,n(0,u)}const k=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,g,k]}class er extends ye{constructor(t){super(),ge(this,t,xa,Za,pe,{onMessage:6})}}function Ts(e){let t,n,i,l,o,u,d;return{c(){t=a("br"),n=m(),i=a("input"),l=m(),o=a("button"),o.textContent="Write",r(i,"class","input"),r(i,"placeholder","write to stdin"),r(o,"class","btn")},m(c,f){h(c,t,f),h(c,n,f),h(c,i,f),q(i,e[4]),h(c,l,f),h(c,o,f),u||(d=[L(i,"input",e[14]),L(o,"click",e[8])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&q(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,oe(d)}}}function tr(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b,S,D,N,O,j,W,C,A,E,M=e[5]&&Ts(e);return{c(){t=a("div"),n=a("div"),i=z(`Script: - `),l=a("input"),o=m(),u=a("div"),d=z(`Encoding: - `),c=a("input"),f=m(),g=a("div"),k=z(`Working directory: - `),_=a("input"),v=m(),y=a("div"),b=z(`Arguments: - `),S=a("input"),D=m(),N=a("div"),O=a("button"),O.textContent="Run",j=m(),W=a("button"),W.textContent="Kill",C=m(),M&&M.c(),r(l,"class","grow input"),r(n,"class","flex items-center gap-1"),r(c,"class","grow input"),r(u,"class","flex items-center gap-1"),r(_,"class","grow input"),r(_,"placeholder","Working directory"),r(g,"class","flex items-center gap-1"),r(S,"class","grow input"),r(S,"placeholder","Environment variables"),r(y,"class","flex items-center gap-1"),r(O,"class","btn"),r(W,"class","btn"),r(N,"class","flex children:grow gap-1"),r(t,"class","flex flex-col childre:grow gap-1")},m(H,U){h(H,t,U),s(t,n),s(n,i),s(n,l),q(l,e[0]),s(t,o),s(t,u),s(u,d),s(u,c),q(c,e[3]),s(t,f),s(t,g),s(g,k),s(g,_),q(_,e[1]),s(t,v),s(t,y),s(y,b),s(y,S),q(S,e[2]),s(t,D),s(t,N),s(N,O),s(N,j),s(N,W),s(t,C),M&&M.m(t,null),A||(E=[L(l,"input",e[10]),L(c,"input",e[11]),L(_,"input",e[12]),L(S,"input",e[13]),L(O,"click",e[6]),L(W,"click",e[7])],A=!0)},p(H,[U]){U&1&&l.value!==H[0]&&q(l,H[0]),U&8&&c.value!==H[3]&&q(c,H[3]),U&2&&_.value!==H[1]&&q(_,H[1]),U&4&&S.value!==H[2]&&q(S,H[2]),H[5]?M?M.p(H,U):(M=Ts(H),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i:G,o:G,d(H){H&&p(t),M&&M.d(),A=!1,oe(E)}}}function nr(e,t,n){const i=navigator.userAgent.includes("Windows");let l=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:u}=t,d='echo "hello world"',c=null,f="SOMETHING=value ANOTHER=2",g="",k="",_;function v(){return f.split(" ").reduce((C,A)=>{let[E,M]=A.split("=");return{...C,[E]:M}},{})}function y(){n(5,_=null);const C=new $i(l,[...o,d],{cwd:c||null,env:v(),encoding:g});C.on("close",A=>{u(`command finished with code ${A.code} and signal ${A.signal}`),n(5,_=null)}),C.on("error",A=>u(`command error: "${A}"`)),C.stdout.on("data",A=>u(`command stdout: "${A}"`)),C.stderr.on("data",A=>u(`command stderr: "${A}"`)),C.spawn().then(A=>{n(5,_=A)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function S(){_.write(k).catch(u)}function D(){d=this.value,n(0,d)}function N(){g=this.value,n(3,g)}function O(){c=this.value,n(1,c)}function j(){f=this.value,n(2,f)}function W(){k=this.value,n(4,k)}return e.$$set=C=>{"onMessage"in C&&n(9,u=C.onMessage)},[d,c,f,g,k,_,y,b,S,u,D,N,O,j,W]}class ir extends ye{constructor(t){super(),ge(this,t,nr,tr,pe,{onMessage:9})}}var lr={};ke(lr,{checkUpdate:()=>go,installUpdate:()=>bo,onUpdaterEvent:()=>ll});async function ll(e){return tn("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function bo(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error){t(),i(o.error);return}o.status==="DONE"&&(t(),n())}ll(l).then(o=>{e=o}).catch(o=>{throw t(),o}),_i("tauri://update-install").catch(o=>{throw t(),o})})}async function go(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error){t(),i(u.error);return}u.status==="UPTODATE"&&(t(),n({shouldUpdate:!1}))}Vs("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),ll(o).then(u=>{e=u}).catch(u=>{throw t(),u}),_i("tauri://update").catch(u=>{throw t(),u})})}function sr(e){let t;return{c(){t=a("button"),t.innerHTML='
',r(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){h(n,t,i)},p:G,d(n){n&&p(t)}}}function or(e){let t,n,i;return{c(){t=a("button"),t.textContent="Install update",r(t,"class","btn")},m(l,o){h(l,t,o),n||(i=L(t,"click",e[4]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function ar(e){let t,n,i;return{c(){t=a("button"),t.textContent="Check update",r(t,"class","btn")},m(l,o){h(l,t,o),n||(i=L(t,"click",e[3]),n=!0)},p:G,d(l){l&&p(t),n=!1,i()}}}function rr(e){let t;function n(o,u){return!o[0]&&!o[2]?ar:!o[1]&&o[2]?or:sr}let i=n(e),l=i(e);return{c(){t=a("div"),l.c(),r(t,"class","flex children:grow children:h10")},m(o,u){h(o,t,u),l.m(t,null)},p(o,[u]){i===(i=n(o))&&l?l.p(o,u):(l.d(1),l=i(o),l&&(l.c(),l.m(t,null)))},i:G,o:G,d(o){o&&p(t),l.d()}}}function ur(e,t,n){let{onMessage:i}=t,l;_t(async()=>{l=await tn("tauri://update-status",i)}),Yi(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:g,manifest:k}=await go();i(`Should update: ${g}`),i(k),n(2,d=g)}catch(g){i(g)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await bo(),i("Installation complete, restart required."),await el()}catch(g){i(g)}finally{n(1,u=!1)}}return e.$$set=g=>{"onMessage"in g&&n(5,i=g.onMessage)},[o,u,d,c,f,i]}class cr extends ye{constructor(t){super(),ge(this,t,ur,rr,pe,{onMessage:5})}}var dr={};ke(dr,{readText:()=>vo,writeText:()=>yo});async function yo(e){return T({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function vo(){return T({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function fr(e){let t,n,i,l,o,u,d,c;return{c(){t=a("div"),n=a("input"),i=m(),l=a("button"),l.textContent="Write",o=m(),u=a("button"),u.textContent="Read",r(n,"class","grow input"),r(n,"placeholder","Text to write to the clipboard"),r(l,"class","btn"),r(l,"type","button"),r(u,"class","btn"),r(u,"type","button"),r(t,"class","flex gap-1")},m(f,g){h(f,t,g),s(t,n),q(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[L(n,"input",e[4]),L(l,"click",e[1]),L(u,"click",e[2])],d=!0)},p(f,[g]){g&1&&n.value!==f[0]&&q(n,f[0])},i:G,o:G,d(f){f&&p(t),d=!1,oe(c)}}}function pr(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){yo(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){vo().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 mr extends ye{constructor(t){super(),ge(this,t,pr,fr,pe,{onMessage:3})}}function hr(e){let t;return{c(){t=a("div"),t.innerHTML=`
Not available for Linux
- `,r(t,"class","flex flex-col gap-2")},m(n,i){h(n,t,i)},p:G,i:G,o:G,d(n){n&&p(t)}}}function _r(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 _t(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Yi(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class br extends ye{constructor(t){super(),ge(this,t,_r,hr,pe,{onMessage:0})}}function gr(e){let t,n,i,l,o,u;return{c(){t=a("div"),n=a("button"),n.textContent="Show",i=m(),l=a("button"),l.textContent="Hide",r(n,"class","btn"),r(n,"id","show"),r(n,"title","Hides and shows the app after 2 seconds"),r(l,"class","btn"),r(l,"id","hide")},m(d,c){h(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[L(n,"click",e[0]),L(l,"click",e[1])],o=!0)},p:G,i:G,o:G,d(d){d&&p(t),o=!1,oe(u)}}}function yr(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{no().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return io().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class vr extends ye{constructor(t){super(),ge(this,t,yr,gr,pe,{onMessage:2})}}function As(e,t,n){const i=e.slice();return i[32]=t[n],i}function Ss(e,t,n){const i=e.slice();return i[35]=t[n],i}function Ls(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b;function S(C,A){return C[3]?kr:wr}let D=S(e),N=D(e);function O(C,A){return C[2]?Cr:Mr}let j=O(e),W=j(e);return{c(){t=a("div"),n=a("span"),n.textContent="Tauri API Validation",i=m(),l=a("span"),o=a("span"),N.c(),d=m(),c=a("span"),c.innerHTML='
',f=m(),g=a("span"),W.c(),_=m(),v=a("span"),v.innerHTML='
',r(n,"class","lt-sm:pl-10 text-darkPrimaryText"),r(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),r(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(c,"title","Minimize"),r(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(g,"title",k=e[2]?"Restore":"Maximize"),r(g,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(v,"title","Close"),r(v,"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 "),r(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),r(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),r(t,"data-tauri-drag-region","")},m(C,A){h(C,t,A),s(t,n),s(t,i),s(t,l),s(l,o),N.m(o,null),s(l,d),s(l,c),s(l,f),s(l,g),W.m(g,null),s(l,_),s(l,v),y||(b=[L(o,"click",e[12]),L(c,"click",e[9]),L(g,"click",e[10]),L(v,"click",e[11])],y=!0)},p(C,A){D!==(D=S(C))&&(N.d(1),N=D(C),N&&(N.c(),N.m(o,null))),A[0]&8&&u!==(u=C[3]?"Switch to Light mode":"Switch to Dark mode")&&r(o,"title",u),j!==(j=O(C))&&(W.d(1),W=j(C),W&&(W.c(),W.m(g,null))),A[0]&4&&k!==(k=C[2]?"Restore":"Maximize")&&r(g,"title",k)},d(C){C&&p(t),N.d(),W.d(),y=!1,oe(b)}}}function wr(e){let t;return{c(){t=a("div"),r(t,"class","i-ph-moon")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function kr(e){let t;return{c(){t=a("div"),r(t,"class","i-ph-sun")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function Mr(e){let t;return{c(){t=a("div"),r(t,"class","i-codicon-chrome-maximize")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function Cr(e){let t;return{c(){t=a("div"),r(t,"class","i-codicon-chrome-restore")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function Tr(e){let t;return{c(){t=a("span"),r(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function Ar(e){let t;return{c(){t=a("span"),r(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){h(n,t,i)},d(n){n&&p(t)}}}function zs(e){let t,n,i,l,o,u,d,c,f;function g(v,y){return v[3]?Lr:Sr}let k=g(e),_=k(e);return{c(){t=a("a"),_.c(),n=m(),i=a("br"),l=m(),o=a("div"),u=m(),d=a("br"),r(t,"href","##"),r(t,"class","nv justify-between h-8"),r(o,"class","bg-white/5 h-2px")},m(v,y){h(v,t,y),_.m(t,null),h(v,n,y),h(v,i,y),h(v,l,y),h(v,o,y),h(v,u,y),h(v,d,y),c||(f=L(t,"click",e[12]),c=!0)},p(v,y){k!==(k=g(v))&&(_.d(1),_=k(v),_&&(_.c(),_.m(t,null)))},d(v){v&&p(t),_.d(),v&&p(n),v&&p(i),v&&p(l),v&&p(o),v&&p(u),v&&p(d),c=!1,f()}}}function Sr(e){let t,n;return{c(){t=z(`Switch to Dark mode - `),n=a("div"),r(n,"class","i-ph-moon")},m(i,l){h(i,t,l),h(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function Lr(e){let t,n;return{c(){t=z(`Switch to Light mode - `),n=a("div"),r(n,"class","i-ph-sun")},m(i,l){h(i,t,l),h(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function zr(e){let t,n,i,l,o=e[35].label+"",u,d,c,f;function g(){return e[20](e[35])}return{c(){t=a("a"),n=a("div"),i=m(),l=a("p"),u=z(o),r(n,"class",e[35].icon+" mr-2"),r(t,"href","##"),r(t,"class",d="nv "+(e[1]===e[35]?"nv_selected":""))},m(k,_){h(k,t,_),s(t,n),s(t,i),s(t,l),s(l,u),c||(f=L(t,"click",g),c=!0)},p(k,_){e=k,_[0]&2&&d!==(d="nv "+(e[1]===e[35]?"nv_selected":""))&&r(t,"class",d)},d(k){k&&p(t),c=!1,f()}}}function Es(e){let t,n=e[35]&&zr(e);return{c(){n&&n.c(),t=pi()},m(i,l){n&&n.m(i,l),h(i,t,l)},p(i,l){i[35]&&n.p(i,l)},d(i){n&&n.d(i),i&&p(t)}}}function Ws(e){let t,n=e[32].html+"",i;return{c(){t=new Lo(!1),i=pi(),t.a=i},m(l,o){t.m(n,l,o),h(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 Er(e){let t,n,i,l,o,u,d,c,f,g,k,_,v,y,b,S,D,N,O,j,W,C,A,E,M,H,U=e[1].label+"",J,x,me,te,Y,de,Z,I,X,$,ae,ne,he,_e,fe,re,Ae,Se,P=e[5]&&Ls(e);function V(F,ce){return F[0]?Ar:Tr}let Le=V(e),ve=Le(e),ue=!e[5]&&zs(e),we=e[7],ie=[];for(let F=0;F`,k=m(),_=a("a"),_.innerHTML=`GitHub - `,v=m(),y=a("a"),y.innerHTML=`Source - `,b=m(),S=a("br"),D=m(),N=a("div"),O=m(),j=a("br"),W=m(),C=a("div");for(let F=0;F',_e=m(),fe=a("div");for(let F=0;F{xt(B,1)}),hi()}ze?(Y=new ze(Je(F)),ui(Y.$$.fragment),Te(Y.$$.fragment,1),Zt(Y,te,null)):Y=null}if(ce[0]&64){le=F[6];let B;for(B=0;B{await confirm("Are you sure?")||I.preventDefault()}),Ve.onFileDropEvent(I=>{D(`File drop: ${JSON.stringify(I.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:ta,icon:"i-ph-hand-waving"},{label:"Communication",component:ra,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:sa,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:Ca,icon:"i-codicon-multiple-windows"},{label:"File system",component:La,icon:"i-codicon-files"},{label:"HTTP",component:Ha,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:Va,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:vr,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Ya,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:er,icon:"i-codicon-record-keys"},{label:"Shell",component:ir,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:cr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:mr,icon:"i-codicon-clippy"},{label:"WebRTC",component:br,icon:"i-ph-broadcast"}];let d=u[0];function c(I){n(1,d=I)}let f;_t(async()=>{const I=$t();n(2,f=await I.isMaximized()),tn("tauri://resize",async()=>{n(2,f=await I.isMaximized())})});function g(){$t().minimize()}async function k(){const I=$t();await I.isMaximized()?I.unmaximize():I.maximize()}let _=!1;async function v(){_||(_=await ao("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&$t().close())}let y;_t(()=>{n(3,y=localStorage&&localStorage.getItem("theme")=="dark"),Ds(y)});function b(){n(3,y=!y),Ds(y)}let S=Fs([]);Rs(e,S,I=>n(6,i=I));function D(I){S.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof I=="string"?I:JSON.stringify(I,null,1))+"
"},...X])}function N(I){S.update(X=>[{html:`
[${new Date().toLocaleTimeString()}]: `+I+"
"},...X])}function O(){S.update(()=>[])}let j,W,C;function A(I){C=I.clientY;const X=window.getComputedStyle(j);W=parseInt(X.height,10);const $=ne=>{const he=ne.clientY-C,_e=W-he;n(4,j.style.height=`${_e{document.removeEventListener("mouseup",ae),document.removeEventListener("mousemove",$)};document.addEventListener("mouseup",ae),document.addEventListener("mousemove",$)}let E;_t(async()=>{n(5,E=await Zs()==="win32")});let M=!1,H,U,J=!1,x=0,me=0;const te=(I,X,$)=>Math.min(Math.max(X,I),$);_t(()=>{n(18,H=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",I=>{U.contains(I.target)?n(0,M=!M):M&&!H.contains(I.target)&&n(0,M=!1)}),document.addEventListener("touchstart",I=>{if(U.contains(I.target))return;const X=I.touches[0].clientX;(0{if(J){const X=I.touches[0].clientX;me=X;const $=(X-x)/10;H.style.setProperty("--translate-x",`-${te(0,M?0-$:18.75-$,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const I=(me-x)/10;n(0,M=M?I>-(18.75/2):I>18.75/2)}J=!1})});const Y=()=>Ki("https://tauri.app/"),de=I=>{c(I),n(0,M=!1)};function Z(I){ri[I?"unshift":"push"](()=>{j=I,n(4,j)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const I=document.querySelector("#sidebar");I&&Wr(I,M)}},[M,d,f,y,j,E,i,u,c,g,k,v,b,S,D,N,O,A,H,Y,de,Z]}class Dr extends ye{constructor(t){super(),ge(this,t,Pr,Er,pe,{},null,[-1,-1])}}new Dr({target:document.querySelector("#app")}); + Additionally, it has a update --background subcommand.`,n=h(),i=a("br"),l=h(),o=a("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=a("br"),c=h(),f=a("br"),y=h(),M=a("button"),M.textContent="Get matches",r(o,"class","note"),r(M,"class","btn"),r(M,"id","cli-matches")},m(v,b){m(v,t,b),m(v,n,b),m(v,i,b),m(v,l,b),m(v,o,b),m(v,u,b),m(v,d,b),m(v,c,b),m(v,f,b),m(v,y,b),m(v,M,b),_||(g=L(M,"click",e[0]),_=!0)},p:J,i:J,o:J,d(v){v&&p(t),v&&p(n),v&&p(i),v&&p(l),v&&p(o),v&&p(u),v&&p(d),v&&p(c),v&&p(f),v&&p(y),v&&p(M),_=!1,g()}}}function aa(e,t,n){let{onMessage:i}=t;function l(){ro().then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class ra extends ye{constructor(t){super(),ge(this,t,aa,oa,me,{onMessage:1})}}function ua(e){let t,n,i,l,o,u,d,c;return{c(){t=a("div"),n=a("button"),n.textContent="Call Log API",i=h(),l=a("button"),l.textContent="Call Request (async) API",o=h(),u=a("button"),u.textContent="Send event to Rust",r(n,"class","btn"),r(n,"id","log"),r(l,"class","btn"),r(l,"id","request"),r(u,"class","btn"),r(u,"id","event")},m(f,y){m(f,t,y),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[L(n,"click",e[0]),L(l,"click",e[1]),L(u,"click",e[2])],d=!0)},p:J,i:J,o:J,d(f){f&&p(t),d=!1,re(c)}}}function ca(e,t,n){let{onMessage:i}=t,l;bt(async()=>{l=await tn("rust-event",i)}),Yi(()=>{l&&l()});function o(){ci("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ci("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){_i("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class da extends ye{constructor(t){super(),ge(this,t,ca,ua,me,{onMessage:3})}}var fa={};ke(fa,{ask:()=>co,confirm:()=>ma,message:()=>pa,open:()=>tl,save:()=>uo});async function tl(e={}){return typeof e=="object"&&Object.freeze(e),T({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function uo(e={}){return typeof e=="object"&&Object.freeze(e),T({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function pa(e,t){var i,l;let n=typeof t=="string"?{title:t}:t;return T({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabel:(l=n==null?void 0:n.okLabel)==null?void 0:l.toString()}})}async function co(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return T({__tauriModule:"Dialog",message:{cmd:"askDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Yes",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"No"]}})}async function ma(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return T({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:e.toString(),title:(i=n==null?void 0:n.title)==null?void 0:i.toString(),type:n==null?void 0:n.type,buttonLabels:[(o=(l=n==null?void 0:n.okLabel)==null?void 0:l.toString())!=null?o:"Ok",(d=(u=n==null?void 0:n.cancelLabel)==null?void 0:u.toString())!=null?d:"Cancel"]}})}var ha={};ke(ha,{BaseDirectory:()=>en,Dir:()=>en,copyFile:()=>va,createDir:()=>ga,exists:()=>Ma,readBinaryFile:()=>nl,readDir:()=>fo,readTextFile:()=>_a,removeDir:()=>ya,removeFile:()=>wa,renameFile:()=>ka,writeBinaryFile:()=>ba,writeFile:()=>Xi,writeTextFile:()=>Xi});var en=(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))(en||{});async function _a(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})}async function nl(e,t={}){let n=await T({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}});return Uint8Array.from(n)}async function Xi(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,T({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:l}})}async function ba(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:[]),T({__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 fo(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})}async function ga(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})}async function ya(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})}async function va(e,t,n={}){return T({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})}async function wa(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})}async function ka(e,t,n={}){return T({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})}async function Ma(e,t={}){return T({__tauriModule:"Fs",message:{cmd:"exists",path:e,options:t}})}function Ca(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b,A,D,N,O,U,P,C,S,z;return{c(){t=a("div"),n=a("input"),i=h(),l=a("input"),o=h(),u=a("br"),d=h(),c=a("div"),f=a("input"),y=h(),M=a("label"),M.textContent="Multiple",_=h(),g=a("div"),v=a("input"),b=h(),A=a("label"),A.textContent="Directory",D=h(),N=a("br"),O=h(),U=a("button"),U.textContent="Open dialog",P=h(),C=a("button"),C.textContent="Open save dialog",r(n,"class","input"),r(n,"id","dialog-default-path"),r(n,"placeholder","Default path"),r(l,"class","input"),r(l,"id","dialog-filter"),r(l,"placeholder","Extensions filter, comma-separated"),r(t,"class","flex gap-2 children:grow"),r(f,"type","checkbox"),r(f,"id","dialog-multiple"),r(M,"for","dialog-multiple"),r(v,"type","checkbox"),r(v,"id","dialog-directory"),r(A,"for","dialog-directory"),r(U,"class","btn"),r(U,"id","open-dialog"),r(C,"class","btn"),r(C,"id","save-dialog")},m(k,j){m(k,t,j),s(t,n),q(n,e[0]),s(t,i),s(t,l),q(l,e[1]),m(k,o,j),m(k,u,j),m(k,d,j),m(k,c,j),s(c,f),f.checked=e[2],s(c,y),s(c,M),m(k,_,j),m(k,g,j),s(g,v),v.checked=e[3],s(g,b),s(g,A),m(k,D,j),m(k,N,j),m(k,O,j),m(k,U,j),m(k,P,j),m(k,C,j),S||(z=[L(n,"input",e[8]),L(l,"input",e[9]),L(f,"change",e[10]),L(v,"change",e[11]),L(U,"click",e[4]),L(C,"click",e[5])],S=!0)},p(k,[j]){j&1&&n.value!==k[0]&&q(n,k[0]),j&2&&l.value!==k[1]&&q(l,k[1]),j&4&&(f.checked=k[2]),j&8&&(v.checked=k[3])},i:J,o:J,d(k){k&&p(t),k&&p(o),k&&p(u),k&&p(d),k&&p(c),k&&p(_),k&&p(g),k&&p(D),k&&p(N),k&&p(O),k&&p(U),k&&p(P),k&&p(C),S=!1,re(z)}}}function Ta(e,t){const n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(l){const o=l.target.result;t(o.substr(o.indexOf(",")+1))},i.readAsDataURL(n)}function Aa(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o=null,u=null,d=!1,c=!1;function f(){tl({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{const A=b,D=A.match(/\S+\.\S+$/g);nl(A).then(function(N){D&&(A.includes(".png")||A.includes(".jpg"))?Ta(new Uint8Array(N),function(O){const U="data:image/png;base64,"+O;l('')}):i(b)}).catch(i(b))}}).catch(i)}function y(){uo({title:"My wonderful save dialog",defaultPath:o,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function M(){o=this.value,n(0,o)}function _(){u=this.value,n(1,u)}function g(){d=this.checked,n(2,d)}function v(){c=this.checked,n(3,c)}return e.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,l=b.insecureRenderHtml)},[o,u,d,c,f,y,i,l,M,_,g,v]}class Sa extends ye{constructor(t){super(),ge(this,t,Aa,Ca,me,{onMessage:6,insecureRenderHtml:7})}}function os(e,t,n){const i=e.slice();return i[9]=t[n],i}function as(e){let t,n=e[9][0]+"",i;return{c(){t=a("option"),i=E(n),t.__value=e[9][1],t.value=t.__value},m(l,o){m(l,t,o),s(t,i)},p:J,d(l){l&&p(t)}}}function La(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b,A,D,N,O,U=e[2],P=[];for(let C=0;CisNaN(parseInt(_))).map(_=>[_,en[_]]);function c(){const _=o.match(/\S+\.\S+$/g),g={dir:rs()};(_?nl(o,g):fo(o,g)).then(function(b){if(_)if(o.includes(".png")||o.includes(".jpg"))za(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(){Xi(o,D.value,{dir:rs()}).catch(i)})})}else i(b)}).catch(i)}function f(){n(1,u.src=qs(o),u)}function y(){o=this.value,n(0,o)}function M(_){ri[_?"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,y,M]}class Wa extends ye{constructor(t){super(),ge(this,t,Ea,La,me,{onMessage:5,insecureRenderHtml:6})}}var Pa={};ke(Pa,{Body:()=>at,Client:()=>mo,Response:()=>po,ResponseType:()=>il,fetch:()=>Oa,getClient:()=>fi});var il=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(il||{});async function Da(e){let t={},n=async(i,l)=>{if(l!==null){let o;typeof l=="string"?o=l:l instanceof Uint8Array||Array.isArray(l)?o=Array.from(l):l instanceof File?o={file:Array.from(new Uint8Array(await l.arrayBuffer())),mime:l.type,fileName:l.name}:typeof l.file=="string"?o={file:l.file,mime:l.mime,fileName:l.fileName}:o={file:Array.from(l.file),mime:l.mime,fileName:l.fileName},t[String(i)]=o}};if(e instanceof FormData)for(let[i,l]of e)await n(i,l);else for(let[i,l]of Object.entries(e))await n(i,l);return t}var at=class{constructor(e,t){this.type=e,this.payload=t}static form(e){return new at("Form",e)}static json(e){return new at("Json",e)}static text(e){return new at("Text",e)}static bytes(e){return new at("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},po=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}},mo=class{constructor(e){this.id=e}async drop(){return T({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){var n;let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),((n=e.body)==null?void 0:n.type)==="Form"&&(e.body.payload=await Da(e.body.payload)),T({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(i=>{let l=new po(i);if(t){try{l.data=JSON.parse(l.data)}catch(o){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error(`Failed to parse response \`${l.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 l}return l})}async get(e,t){return this.request({method:"GET",url:e,...t})}async post(e,t,n){return this.request({method:"POST",url:e,body:t,...n})}async put(e,t,n){return this.request({method:"PUT",url:e,body:t,...n})}async patch(e,t){return this.request({method:"PATCH",url:e,...t})}async delete(e,t){return this.request({method:"DELETE",url:e,...t})}};async function fi(e){return T({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new mo(t))}var Bi=null;async function Oa(e,t){var n;return Bi===null&&(Bi=await fi()),Bi.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function us(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function cs(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b,A,D,N=e[5],O=[];for(let S=0;SHe(O[S],1,1,()=>{O[S]=null});let P=!e[3]&&ms(),C=!e[3]&&e[8]&&hs();return{c(){t=a("span"),n=a("span"),i=E(e[6]),l=h(),o=a("ul");for(let S=0;S{y[v]=null}),hi(),o=y[l],o?o.p(_,g):(o=y[l]=f[l](_),o.c()),Te(o,1),o.m(t,u))},i(_){d||(Te(o),d=!0)},o(_){He(o),d=!1},d(_){_&&p(t),c&&c.d(),y[l].d()}}}function ms(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function hs(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Ia(e){let t,n,i=e[5].length&&cs(e);return{c(){i&&i.c(),t=pi()},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&&Te(i,1)):(i=cs(l),i.c(),Te(i,1),i.m(t.parentNode,t)):i&&(mi(),He(i,1,1,()=>{i=null}),hi())},i(l){n||(Te(i),n=!0)},o(l){He(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const Fa="...";function Ha(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,y,M,_;const g=b=>{switch(d(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},v=()=>{n(8,_=!_)};return e.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,l=b.depth),"_lvl"in b&&n(2,o=b._lvl),"_last"in b&&n(3,u=b._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,y=f?"[":"{"),n(7,M=f?"]":"}")),e.$$.dirty&6&&n(8,_=le[9].call(n)),r(M,"class","input h-auto w-100%"),r(M,"id","request-body"),r(M,"placeholder","Request body"),r(M,"rows","5"),r(b,"class","btn"),r(b,"id","make-request"),r(C,"class","input"),r(z,"class","input"),r(P,"class","flex gap-2 children:grow"),r(K,"type","checkbox"),r(Q,"class","btn"),r(Q,"type","button")},m(W,Y){m(W,t,Y),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),It(n,e[0]),s(t,c),s(t,f),s(t,y),s(t,M),q(M,e[1]),s(t,_),s(t,g),s(t,v),s(t,b),m(W,A,Y),m(W,D,Y),m(W,N,Y),m(W,O,Y),m(W,U,Y),m(W,P,Y),s(P,C),q(C,e[2]),s(P,S),s(P,z),q(z,e[3]),m(W,k,Y),m(W,j,Y),m(W,I,Y),m(W,X,Y),s(X,K),K.checked=e[5],s(X,V),m(W,Z,Y),m(W,B,Y),m(W,ie,Y),m(W,te,Y),m(W,F,Y),m(W,Q,Y),m(W,x,Y),m(W,ue,Y),m(W,le,Y),m(W,he,Y),m(W,_e,Y),$t(pe,W,Y),ce=!0,Ae||(Se=[L(n,"change",e[9]),L(M,"input",e[10]),L(t,"submit",ai(e[6])),L(C,"input",e[11]),L(z,"input",e[12]),L(K,"change",e[13]),L(Q,"click",e[7])],Ae=!0)},p(W,[Y]){Y&1&&It(n,W[0]),Y&2&&q(M,W[1]),Y&4&&C.value!==W[2]&&q(C,W[2]),Y&8&&z.value!==W[3]&&q(z,W[3]),Y&32&&(K.checked=W[5]);const Le={};Y&16&&(Le.json=W[4]),pe.$set(Le)},i(W){ce||(Te(pe.$$.fragment,W),ce=!0)},o(W){He(pe.$$.fragment,W),ce=!1},d(W){W&&p(t),W&&p(A),W&&p(D),W&&p(N),W&&p(O),W&&p(U),W&&p(P),W&&p(k),W&&p(j),W&&p(I),W&&p(X),W&&p(Z),W&&p(B),W&&p(ie),W&&p(te),W&&p(F),W&&p(Q),W&&p(x),W&&p(ue),W&&p(le),W&&p(he),W&&p(_e),xt(pe,W),Ae=!1,re(Se)}}}function Ua(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await fi().catch(U=>{throw o(U),U}),O={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?O.body=at.json(JSON.parse(l)):l!==""&&(O.body=at.text(l)),D.request(O).then(o).catch(o)}let d="baz",c="qux",f=null,y=!0;async function M(){const D=await fi().catch(N=>{throw o(N),N});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:at.form({foo:d,bar:c}),headers:y?{"Content-Type":"multipart/form-data"}:void 0,responseType:il.Text}))}function _(){i=Gi(this),n(0,i)}function g(){l=this.value,n(1,l)}function v(){d=this.value,n(2,d)}function b(){c=this.value,n(3,c)}function A(){y=this.checked,n(5,y)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,y,u,M,o,_,g,v,b,A]}class qa extends ye{constructor(t){super(),ge(this,t,Ua,ja,me,{onMessage:8})}}var Ba={};ke(Ba,{isPermissionGranted:()=>Ga,requestPermission:()=>Va,sendNotification:()=>_o});async function Ga(){return window.Notification.permission!=="default"?Promise.resolve(window.Notification.permission==="granted"):T({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function Va(){return window.Notification.requestPermission()}function _o(e){typeof e=="string"?new window.Notification(e):new window.Notification(e.title,e)}function Ja(e){let t,n,i;return{c(){t=a("button"),t.textContent="Send test notification",r(t,"class","btn"),r(t,"id","notification")},m(l,o){m(l,t,o),n||(i=L(t,"click",e[0]),n=!0)},p:J,i:J,o:J,d(l){l&&p(t),n=!1,i()}}}function Xa(e,t,n){let{onMessage:i}=t;async function l(){_o({title:"Notification title",body:"This is the notification body",sound:"default"})}function o(){Notification.permission==="default"?Notification.requestPermission().then(function(u){u==="granted"?l():i("Permission is "+u)}).catch(i):Notification.permission==="granted"?l():i("Permission is denied")}return e.$$set=u=>{"onMessage"in u&&n(1,i=u.onMessage)},[o,i]}class Ya extends ye{constructor(t){super(),ge(this,t,Xa,Ja,me,{onMessage:1})}}function _s(e,t,n){const i=e.slice();return i[75]=t[n],i}function bs(e,t,n){const i=e.slice();return i[78]=t[n],i}function gs(e){let t,n,i,l,o,u,d=Object.keys(e[1]),c=[];for(let f=0;fe[43].call(i))},m(f,y){m(f,t,y),m(f,n,y),m(f,i,y),s(i,l);for(let M=0;Me[65].call(Ge)),r(nt,"class","input"),r(nt,"type","number"),r(it,"class","input"),r(it,"type","number"),r(Be,"class","flex gap-2"),r(lt,"class","input grow"),r(lt,"id","title"),r(Jt,"class","btn"),r(Jt,"type","submit"),r(ht,"class","flex gap-1"),r(st,"class","input grow"),r(st,"id","url"),r(Xt,"class","btn"),r(Xt,"id","open-url"),r(_t,"class","flex gap-1"),r(mt,"class","flex flex-col gap-1")},m(w,R){m(w,t,R),m(w,n,R),m(w,i,R),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,y),s(i,M),s(i,_),m(w,g,R),m(w,v,R),m(w,b,R),m(w,A,R),s(A,D),s(D,N),s(D,O),O.checked=e[6],s(A,U),s(A,P),s(P,C),s(P,S),S.checked=e[2],s(A,z),s(A,k),s(k,j),s(k,I),I.checked=e[3],s(A,X),s(A,K),s(K,V),s(K,Z),Z.checked=e[4],s(A,B),s(A,ie),s(ie,te),s(ie,F),F.checked=e[5],s(A,Q),s(A,x),s(x,ue),s(x,le),le.checked=e[7],s(A,he),s(A,_e),s(_e,pe),s(_e,ce),ce.checked=e[8],s(A,Ae),s(A,Se),s(Se,W),s(Se,Y),Y.checked=e[9],s(A,Le),s(A,ve),s(ve,de),s(ve,we),we.checked=e[10],m(w,se,R),m(w,ze,R),m(w,Je,R),m(w,oe,R),s(oe,ne),s(ne,H),s(H,fe),s(H,G),q(G,e[17]),s(ne,Ie),s(ne,kt),s(kt,nn),s(kt,Pe),q(Pe,e[18]),s(oe,ln),s(oe,Xe),s(Xe,Mt),s(Mt,sn),s(Mt,De),q(De,e[11]),s(Xe,on),s(Xe,Ct),s(Ct,an),s(Ct,Oe),q(Oe,e[12]),s(oe,rn),s(oe,Ye),s(Ye,Tt),s(Tt,un),s(Tt,Fe),q(Fe,e[13]),s(Ye,ee),s(Ye,ut),s(ut,Ht),s(ut,Re),q(Re,e[14]),s(oe,jt),s(oe,je),s(je,ct),s(ct,Ut),s(ct,Ee),q(Ee,e[15]),s(je,qt),s(je,dt),s(dt,Bt),s(dt,We),q(We,e[16]),m(w,At,R),m(w,St,R),m(w,Lt,R),m(w,Ce,R),s(Ce,Ue),s(Ue,Ne),s(Ne,ft),s(Ne,Gt),s(Ne,pt),s(pt,cn),s(pt,bi),s(Ne,sl),s(Ne,fn),s(fn,ol),s(fn,gi),s(Ue,al),s(Ue,Ke),s(Ke,mn),s(Ke,rl),s(Ke,hn),s(hn,ul),s(hn,yi),s(Ke,cl),s(Ke,bn),s(bn,dl),s(bn,vi),s(Ce,fl),s(Ce,zt),s(zt,Qe),s(Qe,yn),s(Qe,pl),s(Qe,vn),s(vn,ml),s(vn,wi),s(Qe,hl),s(Qe,kn),s(kn,_l),s(kn,ki),s(zt,bl),s(zt,Ze),s(Ze,Cn),s(Ze,gl),s(Ze,Tn),s(Tn,yl),s(Tn,Mi),s(Ze,vl),s(Ze,Sn),s(Sn,wl),s(Sn,Ci),s(Ce,kl),s(Ce,Et),s(Et,$e),s($e,zn),s($e,Ml),s($e,En),s(En,Cl),s(En,Ti),s($e,Tl),s($e,Pn),s(Pn,Al),s(Pn,Ai),s(Et,Sl),s(Et,xe),s(xe,On),s(xe,Ll),s(xe,Rn),s(Rn,zl),s(Rn,Si),s(xe,El),s(xe,In),s(In,Wl),s(In,Li),s(Ce,Pl),s(Ce,Wt),s(Wt,et),s(et,Hn),s(et,Dl),s(et,jn),s(jn,Ol),s(jn,zi),s(et,Rl),s(et,qn),s(qn,Nl),s(qn,Ei),s(Wt,Il),s(Wt,tt),s(tt,Gn),s(tt,Fl),s(tt,Vn),s(Vn,Hl),s(Vn,Wi),s(tt,jl),s(tt,Xn),s(Xn,Ul),s(Xn,Pi),m(w,Di,R),m(w,Oi,R),m(w,Ri,R),m(w,Vt,R),m(w,Ni,R),m(w,qe,R),s(qe,Kn),s(Kn,Pt),Pt.checked=e[19],s(Kn,ql),s(qe,Bl),s(qe,Qn),s(Qn,Dt),Dt.checked=e[20],s(Qn,Gl),s(qe,Vl),s(qe,Zn),s(Zn,Ot),Ot.checked=e[24],s(Zn,Jl),m(w,Ii,R),m(w,Be,R),s(Be,$n),s($n,Xl),s($n,Ge);for(let be=0;be=1,y,M,_,g=f&&gs(e),v=e[1][e[0]]&&vs(e);return{c(){t=a("div"),n=a("div"),i=a("input"),l=h(),o=a("button"),o.textContent="New window",u=h(),d=a("br"),c=h(),g&&g.c(),y=h(),v&&v.c(),r(i,"class","input grow"),r(i,"type","text"),r(i,"placeholder","New Window label.."),r(o,"class","btn"),r(n,"class","flex gap-1"),r(t,"class","flex flex-col children:grow gap-2")},m(b,A){m(b,t,A),s(t,n),s(n,i),q(i,e[25]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),g&&g.m(t,null),s(t,y),v&&v.m(t,null),M||(_=[L(i,"input",e[42]),L(o,"click",e[39])],M=!0)},p(b,A){A[0]&33554432&&i.value!==b[25]&&q(i,b[25]),A[0]&2&&(f=Object.keys(b[1]).length>=1),f?g?g.p(b,A):(g=gs(b),g.c(),g.m(t,y)):g&&(g.d(1),g=null),b[1][b[0]]?v?v.p(b,A):(v=vs(b),v.c(),v.m(t,null)):v&&(v.d(1),v=null)},i:J,o:J,d(b){b&&p(t),g&&g.d(),v&&v.d(),M=!1,re(_)}}}function Qa(e,t,n){let i=Ve.label;const l={[Ve.label]:Ve},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,y=!0,M=!0,_=!0,g=!1,v=!0,b=!1,A=!0,D=!1,N=null,O=null,U=null,P=null,C=null,S=null,z=null,k=null,j=1,I=new ot(z,k),X=new ot(z,k),K=new yt(N,O),V=new yt(N,O),Z,B,ie=!1,te=!0,F=null,Q=null,x="default",ue=!1,le="Awesome Tauri Example!";function he(){Qi(c)}function _e(){l[i].setTitle(le)}function pe(){l[i].hide(),setTimeout(l[i].show,2e3)}function ce(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function Ae(){tl({multiple:!1}).then(ee=>{typeof ee=="string"&&l[i].setIcon(ee)})}function Se(){if(!d)return;const ee=new wt(d);n(1,l[d]=ee,l),ee.once("tauri://error",function(){u("Error creating new webview")})}function W(){l[i].innerSize().then(ee=>{n(30,K=ee),n(11,N=K.width),n(12,O=K.height)}),l[i].outerSize().then(ee=>{n(31,V=ee)})}function Y(){l[i].innerPosition().then(ee=>{n(28,I=ee)}),l[i].outerPosition().then(ee=>{n(29,X=ee),n(17,z=X.x),n(18,k=X.y)})}async function Le(ee){!ee||(Z&&Z(),B&&B(),B=await ee.listen("tauri://move",Y),Z=await ee.listen("tauri://resize",W))}async function ve(){await l[i].minimize(),await l[i].requestUserAttention($i.Critical),await new Promise(ee=>setTimeout(ee,3e3)),await l[i].requestUserAttention(null)}function de(){d=this.value,n(25,d)}function we(){i=Gi(this),n(0,i),n(1,l)}const se=()=>l[i].center();function ze(){g=this.checked,n(6,g)}function Je(){f=this.checked,n(2,f)}function oe(){y=this.checked,n(3,y)}function ne(){M=this.checked,n(4,M)}function H(){_=this.checked,n(5,_)}function fe(){v=this.checked,n(7,v)}function G(){b=this.checked,n(8,b)}function Ie(){A=this.checked,n(9,A)}function kt(){D=this.checked,n(10,D)}function nn(){z=ae(this.value),n(17,z)}function Pe(){k=ae(this.value),n(18,k)}function ln(){N=ae(this.value),n(11,N)}function Xe(){O=ae(this.value),n(12,O)}function Mt(){U=ae(this.value),n(13,U)}function sn(){P=ae(this.value),n(14,P)}function De(){C=ae(this.value),n(15,C)}function on(){S=ae(this.value),n(16,S)}function Ct(){ie=this.checked,n(19,ie)}function an(){te=this.checked,n(20,te)}function Oe(){ue=this.checked,n(24,ue)}function rn(){x=Gi(this),n(23,x),n(33,o)}function Ye(){F=ae(this.value),n(21,F)}function Tt(){Q=ae(this.value),n(22,Q)}function un(){le=this.value,n(32,le)}function Fe(){c=this.value,n(26,c)}return e.$$set=ee=>{"onMessage"in ee&&n(41,u=ee.onMessage)},e.$$.update=()=>{var ee,ut,Ht,Re,jt,je,ct,Ut,Ee,qt,dt,Bt,We,At,St,Lt,Ce,Ue,Ne,ft,Gt,pt;e.$$.dirty[0]&3&&(l[i],Y(),W()),e.$$.dirty[0]&7&&((ee=l[i])==null||ee.setResizable(f)),e.$$.dirty[0]&11&&((ut=l[i])==null||ut.setMaximizable(y)),e.$$.dirty[0]&19&&((Ht=l[i])==null||Ht.setMinimizable(M)),e.$$.dirty[0]&35&&((Re=l[i])==null||Re.setClosable(_)),e.$$.dirty[0]&67&&(g?(jt=l[i])==null||jt.maximize():(je=l[i])==null||je.unmaximize()),e.$$.dirty[0]&131&&((ct=l[i])==null||ct.setDecorations(v)),e.$$.dirty[0]&259&&((Ut=l[i])==null||Ut.setAlwaysOnTop(b)),e.$$.dirty[0]&515&&((Ee=l[i])==null||Ee.setContentProtected(A)),e.$$.dirty[0]&1027&&((qt=l[i])==null||qt.setFullscreen(D)),e.$$.dirty[0]&6147&&N&&O&&((dt=l[i])==null||dt.setSize(new yt(N,O))),e.$$.dirty[0]&24579&&(U&&P?(Bt=l[i])==null||Bt.setMinSize(new di(U,P)):(We=l[i])==null||We.setMinSize(null)),e.$$.dirty[0]&98307&&(C>800&&S>400?(At=l[i])==null||At.setMaxSize(new di(C,S)):(St=l[i])==null||St.setMaxSize(null)),e.$$.dirty[0]&393219&&z!==null&&k!==null&&((Lt=l[i])==null||Lt.setPosition(new ot(z,k))),e.$$.dirty[0]&3&&((Ce=l[i])==null||Ce.scaleFactor().then(cn=>n(27,j=cn))),e.$$.dirty[0]&3&&Le(l[i]),e.$$.dirty[0]&524291&&((Ue=l[i])==null||Ue.setCursorGrab(ie)),e.$$.dirty[0]&1048579&&((Ne=l[i])==null||Ne.setCursorVisible(te)),e.$$.dirty[0]&8388611&&((ft=l[i])==null||ft.setCursorIcon(x)),e.$$.dirty[0]&6291459&&F!==null&&Q!==null&&((Gt=l[i])==null||Gt.setCursorPosition(new ot(F,Q))),e.$$.dirty[0]&16777219&&((pt=l[i])==null||pt.setIgnoreCursorEvents(ue))},[i,l,f,y,M,_,g,v,b,A,D,N,O,U,P,C,S,z,k,ie,te,F,Q,x,ue,d,c,j,I,X,K,V,le,o,he,_e,pe,ce,Ae,Se,ve,u,de,we,se,ze,Je,oe,ne,H,fe,G,Ie,kt,nn,Pe,ln,Xe,Mt,sn,De,on,Ct,an,Oe,rn,Ye,Tt,un,Fe]}class Za extends ye{constructor(t){super(),ge(this,t,Qa,Ka,me,{onMessage:41},null,[-1,-1,-1])}}var $a={};ke($a,{isRegistered:()=>er,register:()=>bo,registerAll:()=>xa,unregister:()=>go,unregisterAll:()=>yo});async function bo(e,t){return T({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:vt(t)}})}async function xa(e,t){return T({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:vt(t)}})}async function er(e){return T({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function go(e){return T({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function yo(){return T({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function ks(e,t,n){const i=e.slice();return i[9]=t[n],i}function Ms(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=a("div"),i=E(n),l=h(),o=a("button"),o.textContent="Unregister",r(o,"class","btn"),r(o,"type","button"),r(t,"class","flex justify-between")},m(f,y){m(f,t,y),s(t,i),s(t,l),s(t,o),u||(d=L(o,"click",c),u=!0)},p(f,y){e=f,y&2&&n!==(n=e[9]+"")&&$(i,n)},d(f){f&&p(t),u=!1,d()}}}function Cs(e){let t,n,i,l,o;return{c(){t=a("br"),n=h(),i=a("button"),i.textContent="Unregister all",r(i,"class","btn"),r(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=L(i,"click",e[5]),l=!0)},p:J,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function tr(e){let t,n,i,l,o,u,d,c,f,y,M,_=e[1],g=[];for(let b=0;b<_.length;b+=1)g[b]=Ms(ks(e,_,b));let v=e[1].length>1&&Cs(e);return{c(){t=a("div"),n=a("input"),i=h(),l=a("button"),l.textContent="Register",o=h(),u=a("br"),d=h(),c=a("div");for(let b=0;b1?v?v.p(b,A):(v=Cs(b),v.c(),v.m(c,null)):v&&(v.d(1),v=null)},i:J,o:J,d(b){b&&p(t),b&&p(o),b&&p(u),b&&p(d),b&&p(c),rt(g,b),v&&v.d(),y=!1,re(M)}}}function nr(e,t,n){let i,{onMessage:l}=t;const o=Us([]);Fs(e,o,_=>n(1,i=_));let u="CmdOrControl+X";function d(){const _=u;bo(_,()=>{l(`Shortcut ${_} triggered`)}).then(()=>{o.update(g=>[...g,_]),l(`Shortcut ${_} registered successfully`)}).catch(l)}function c(_){const g=_;go(g).then(()=>{o.update(v=>v.filter(b=>b!==g)),l(`Shortcut ${g} unregistered`)}).catch(l)}function f(){yo().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function y(){u=this.value,n(0,u)}const M=_=>c(_);return e.$$set=_=>{"onMessage"in _&&n(6,l=_.onMessage)},[u,i,o,d,c,f,l,y,M]}class ir extends ye{constructor(t){super(),ge(this,t,nr,tr,me,{onMessage:6})}}function Ts(e,t,n){const i=e.slice();return i[20]=t[n],i}function As(e){let t,n,i;return{c(){t=a("button"),t.textContent="Kill",r(t,"class","btn")},m(l,o){m(l,t,o),n||(i=L(t,"click",e[8]),n=!0)},p:J,d(l){l&&p(t),n=!1,i()}}}function Ss(e){let t,n,i,l,o,u,d;return{c(){t=a("br"),n=h(),i=a("input"),l=h(),o=a("button"),o.textContent="Write",r(i,"class","input"),r(i,"placeholder","write to stdin"),r(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),q(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[L(i,"input",e[15]),L(o,"click",e[9])],u=!0)},p(c,f){f&16&&i.value!==c[4]&&q(i,c[4])},d(c){c&&p(t),c&&p(n),c&&p(i),c&&p(l),c&&p(o),u=!1,re(d)}}}function Ls(e){let t,n=e[20]+"",i;return{c(){t=a("p"),i=E(n)},m(l,o){m(l,t,o),s(t,i)},p(l,o){o&64&&n!==(n=l[20]+"")&&$(i,n)},d(l){l&&p(t)}}}function lr(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b,A,D,N,O,U,P,C,S,z,k,j=e[5]&&As(e),I=e[5]&&Ss(e),X=e[6],K=[];for(let V=0;V{let[k,j]=z.split("=");return{...S,[k]:j}},{})}function b(){n(5,_=null),n(6,g=[]);const S=new Ki(l,[...o,d],{cwd:c||null,env:v(),encoding:y||null});S.on("close",k=>{u(`command finished with code ${k.code} and signal ${k.signal}`),n(5,_=null)}),S.on("error",k=>u(`command error: "${k}"`));function z(k,j){u(`command ${j}: "${k}"`),k.endsWith(` +`)&&(k=k.substring(0,k.length-1));const I=g[g.length-1];I&&I.endsWith("\r")?n(6,g=[...g.slice(0,g.length-1),k]):n(6,g=[...g,k])}S.stdout.on("data",k=>z(k,"stdout")),S.stderr.on("data",k=>z(k,"stderr")),S.spawn().then(k=>{n(5,_=k)}).catch(u)}function A(){_.kill().then(()=>u("killed child process")).catch(u)}function D(){_.write(M).catch(u)}function N(){d=this.value,n(0,d)}function O(){y=this.value,n(3,y)}function U(){c=this.value,n(1,c)}function P(){f=this.value,n(2,f)}function C(){M=this.value,n(4,M)}return e.$$set=S=>{"onMessage"in S&&n(10,u=S.onMessage)},[d,c,f,y,M,_,g,b,A,D,u,N,O,U,P,C]}class or extends ye{constructor(t){super(),ge(this,t,sr,lr,me,{onMessage:10})}}var ar={};ke(ar,{checkUpdate:()=>wo,installUpdate:()=>vo,onUpdaterEvent:()=>ll});async function ll(e){return tn("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function vo(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(o){if(o.error){t(),i(o.error);return}o.status==="DONE"&&(t(),n())}ll(l).then(o=>{e=o}).catch(o=>{throw t(),o}),_i("tauri://update-install").catch(o=>{throw t(),o})})}async function wo(){let e;function t(){e&&e(),e=void 0}return new Promise((n,i)=>{function l(u){t(),n({manifest:u,shouldUpdate:!0})}function o(u){if(u.error){t(),i(u.error);return}u.status==="UPTODATE"&&(t(),n({shouldUpdate:!1}))}Ys("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),ll(o).then(u=>{e=u}).catch(u=>{throw t(),u}),_i("tauri://update").catch(u=>{throw t(),u})})}function rr(e){let t;return{c(){t=a("button"),t.innerHTML='
',r(t,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,t,i)},p:J,d(n){n&&p(t)}}}function ur(e){let t,n,i;return{c(){t=a("button"),t.textContent="Install update",r(t,"class","btn")},m(l,o){m(l,t,o),n||(i=L(t,"click",e[4]),n=!0)},p:J,d(l){l&&p(t),n=!1,i()}}}function cr(e){let t,n,i;return{c(){t=a("button"),t.textContent="Check update",r(t,"class","btn")},m(l,o){m(l,t,o),n||(i=L(t,"click",e[3]),n=!0)},p:J,d(l){l&&p(t),n=!1,i()}}}function dr(e){let t;function n(o,u){return!o[0]&&!o[2]?cr:!o[1]&&o[2]?ur:rr}let i=n(e),l=i(e);return{c(){t=a("div"),l.c(),r(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:J,o:J,d(o){o&&p(t),l.d()}}}function fr(e,t,n){let{onMessage:i}=t,l;bt(async()=>{l=await tn("tauri://update-status",i)}),Yi(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:y,manifest:M}=await wo();i(`Should update: ${y}`),i(M),n(2,d=y)}catch(y){i(y)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await vo(),i("Installation complete, restart required."),await el()}catch(y){i(y)}finally{n(1,u=!1)}}return e.$$set=y=>{"onMessage"in y&&n(5,i=y.onMessage)},[o,u,d,c,f,i]}class pr extends ye{constructor(t){super(),ge(this,t,fr,dr,me,{onMessage:5})}}var mr={};ke(mr,{readText:()=>Mo,writeText:()=>ko});async function ko(e){return T({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function Mo(){return T({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function hr(e){let t,n,i,l,o,u,d,c;return{c(){t=a("div"),n=a("input"),i=h(),l=a("button"),l.textContent="Write",o=h(),u=a("button"),u.textContent="Read",r(n,"class","grow input"),r(n,"placeholder","Text to write to the clipboard"),r(l,"class","btn"),r(l,"type","button"),r(u,"class","btn"),r(u,"type","button"),r(t,"class","flex gap-1")},m(f,y){m(f,t,y),s(t,n),q(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[L(n,"input",e[4]),L(l,"click",e[1]),L(u,"click",e[2])],d=!0)},p(f,[y]){y&1&&n.value!==f[0]&&q(n,f[0])},i:J,o:J,d(f){f&&p(t),d=!1,re(c)}}}function _r(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){ko(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Mo().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 br extends ye{constructor(t){super(),ge(this,t,_r,hr,me,{onMessage:3})}}function gr(e){let t;return{c(){t=a("div"),t.innerHTML=`
Not available for Linux
+ `,r(t,"class","flex flex-col gap-2")},m(n,i){m(n,t,i)},p:J,i:J,o:J,d(n){n&&p(t)}}}function yr(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 bt(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Yi(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class vr extends ye{constructor(t){super(),ge(this,t,yr,gr,me,{onMessage:0})}}function wr(e){let t,n,i,l,o,u;return{c(){t=a("div"),n=a("button"),n.textContent="Show",i=h(),l=a("button"),l.textContent="Hide",r(n,"class","btn"),r(n,"id","show"),r(n,"title","Hides and shows the app after 2 seconds"),r(l,"class","btn"),r(l,"id","hide")},m(d,c){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[L(n,"click",e[0]),L(l,"click",e[1])],o=!0)},p:J,i:J,o:J,d(d){d&&p(t),o=!1,re(u)}}}function kr(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{so().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return oo().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class Mr extends ye{constructor(t){super(),ge(this,t,kr,wr,me,{onMessage:2})}}function zs(e,t,n){const i=e.slice();return i[32]=t[n],i}function Es(e,t,n){const i=e.slice();return i[35]=t[n],i}function Ws(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b;function A(C,S){return C[3]?Tr:Cr}let D=A(e),N=D(e);function O(C,S){return C[2]?Sr:Ar}let U=O(e),P=U(e);return{c(){t=a("div"),n=a("span"),n.textContent="Tauri API Validation",i=h(),l=a("span"),o=a("span"),N.c(),d=h(),c=a("span"),c.innerHTML='
',f=h(),y=a("span"),P.c(),_=h(),g=a("span"),g.innerHTML='
',r(n,"class","lt-sm:pl-10 text-darkPrimaryText"),r(o,"title",u=e[3]?"Switch to Light mode":"Switch to Dark mode"),r(o,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(c,"title","Minimize"),r(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(y,"title",M=e[2]?"Restore":"Maximize"),r(y,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(g,"title","Close"),r(g,"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 "),r(l,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),r(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),r(t,"data-tauri-drag-region","")},m(C,S){m(C,t,S),s(t,n),s(t,i),s(t,l),s(l,o),N.m(o,null),s(l,d),s(l,c),s(l,f),s(l,y),P.m(y,null),s(l,_),s(l,g),v||(b=[L(o,"click",e[12]),L(c,"click",e[9]),L(y,"click",e[10]),L(g,"click",e[11])],v=!0)},p(C,S){D!==(D=A(C))&&(N.d(1),N=D(C),N&&(N.c(),N.m(o,null))),S[0]&8&&u!==(u=C[3]?"Switch to Light mode":"Switch to Dark mode")&&r(o,"title",u),U!==(U=O(C))&&(P.d(1),P=U(C),P&&(P.c(),P.m(y,null))),S[0]&4&&M!==(M=C[2]?"Restore":"Maximize")&&r(y,"title",M)},d(C){C&&p(t),N.d(),P.d(),v=!1,re(b)}}}function Cr(e){let t;return{c(){t=a("div"),r(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Tr(e){let t;return{c(){t=a("div"),r(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Ar(e){let t;return{c(){t=a("div"),r(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Sr(e){let t;return{c(){t=a("div"),r(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Lr(e){let t;return{c(){t=a("span"),r(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function zr(e){let t;return{c(){t=a("span"),r(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Ps(e){let t,n,i,l,o,u,d,c,f;function y(g,v){return g[3]?Wr:Er}let M=y(e),_=M(e);return{c(){t=a("a"),_.c(),n=h(),i=a("br"),l=h(),o=a("div"),u=h(),d=a("br"),r(t,"href","##"),r(t,"class","nv justify-between h-8"),r(o,"class","bg-white/5 h-2px")},m(g,v){m(g,t,v),_.m(t,null),m(g,n,v),m(g,i,v),m(g,l,v),m(g,o,v),m(g,u,v),m(g,d,v),c||(f=L(t,"click",e[12]),c=!0)},p(g,v){M!==(M=y(g))&&(_.d(1),_=M(g),_&&(_.c(),_.m(t,null)))},d(g){g&&p(t),_.d(),g&&p(n),g&&p(i),g&&p(l),g&&p(o),g&&p(u),g&&p(d),c=!1,f()}}}function Er(e){let t,n;return{c(){t=E(`Switch to Dark mode + `),n=a("div"),r(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 Wr(e){let t,n;return{c(){t=E(`Switch to Light mode + `),n=a("div"),r(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 Pr(e){let t,n,i,l,o=e[35].label+"",u,d,c,f;function y(){return e[20](e[35])}return{c(){t=a("a"),n=a("div"),i=h(),l=a("p"),u=E(o),r(n,"class",e[35].icon+" mr-2"),r(t,"href","##"),r(t,"class",d="nv "+(e[1]===e[35]?"nv_selected":""))},m(M,_){m(M,t,_),s(t,n),s(t,i),s(t,l),s(l,u),c||(f=L(t,"click",y),c=!0)},p(M,_){e=M,_[0]&2&&d!==(d="nv "+(e[1]===e[35]?"nv_selected":""))&&r(t,"class",d)},d(M){M&&p(t),c=!1,f()}}}function Ds(e){let t,n=e[35]&&Pr(e);return{c(){n&&n.c(),t=pi()},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 Os(e){let t,n=e[32].html+"",i;return{c(){t=new Wo(!1),i=pi(),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 Dr(e){let t,n,i,l,o,u,d,c,f,y,M,_,g,v,b,A,D,N,O,U,P,C,S,z,k,j,I=e[1].label+"",X,K,V,Z,B,ie,te,F,Q,x,ue,le,he,_e,pe,ce,Ae,Se,W=e[5]&&Ws(e);function Y(H,fe){return H[0]?zr:Lr}let Le=Y(e),ve=Le(e),de=!e[5]&&Ps(e),we=e[7],se=[];for(let H=0;H`,M=h(),_=a("a"),_.innerHTML=`GitHub + `,g=h(),v=a("a"),v.innerHTML=`Source + `,b=h(),A=a("br"),D=h(),N=a("div"),O=h(),U=a("br"),P=h(),C=a("div");for(let H=0;H',_e=h(),pe=a("div");for(let H=0;H{xt(G,1)}),hi()}ze?(B=new ze(Je(H)),ui(B.$$.fragment),Te(B.$$.fragment,1),$t(B,Z,null)):B=null}if(fe[0]&64){oe=H[6];let G;for(G=0;G{await confirm("Are you sure?")||F.preventDefault()}),Ve.onFileDropEvent(F=>{D(`File drop: ${JSON.stringify(F.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:la,icon:"i-ph-hand-waving"},{label:"Communication",component:da,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:ra,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:Sa,icon:"i-codicon-multiple-windows"},{label:"File system",component:Wa,icon:"i-codicon-files"},{label:"HTTP",component:qa,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:Ya,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:Mr,icon:"i-codicon-hubot"},!o&&{label:"Window",component:Za,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:ir,icon:"i-codicon-record-keys"},{label:"Shell",component:or,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:pr,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:br,icon:"i-codicon-clippy"},{label:"WebRTC",component:vr,icon:"i-ph-broadcast"}];let d=u[0];function c(F){n(1,d=F)}let f;bt(async()=>{const F=Kt();n(2,f=await F.isMaximized()),tn("tauri://resize",async()=>{n(2,f=await F.isMaximized())})});function y(){Kt().minimize()}async function M(){const F=Kt();await F.isMaximized()?F.unmaximize():F.maximize()}let _=!1;async function g(){_||(_=await co("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Kt().close())}let v;bt(()=>{n(3,v=localStorage&&localStorage.getItem("theme")=="dark"),Ns(v)});function b(){n(3,v=!v),Ns(v)}let A=Us([]);Fs(e,A,F=>n(6,i=F));function D(F){A.update(Q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof F=="string"?F:JSON.stringify(F,null,1))+"
"},...Q])}function N(F){A.update(Q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+F+"
"},...Q])}function O(){A.update(()=>[])}let U,P,C;function S(F){C=F.clientY;const Q=window.getComputedStyle(U);P=parseInt(Q.height,10);const x=le=>{const he=le.clientY-C,_e=P-he;n(4,U.style.height=`${_e{document.removeEventListener("mouseup",ue),document.removeEventListener("mousemove",x)};document.addEventListener("mouseup",ue),document.addEventListener("mousemove",x)}let z;bt(async()=>{n(5,z=await to()==="win32")});let k=!1,j,I,X=!1,K=0,V=0;const Z=(F,Q,x)=>Math.min(Math.max(Q,F),x);bt(()=>{n(18,j=document.querySelector("#sidebar")),I=document.querySelector("#sidebarToggle"),document.addEventListener("click",F=>{I.contains(F.target)?n(0,k=!k):k&&!j.contains(F.target)&&n(0,k=!1)}),document.addEventListener("touchstart",F=>{if(I.contains(F.target))return;const Q=F.touches[0].clientX;(0{if(X){const Q=F.touches[0].clientX;V=Q;const x=(Q-K)/10;j.style.setProperty("--translate-x",`-${Z(0,k?0-x:18.75-x,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(X){const F=(V-K)/10;n(0,k=k?F>-(18.75/2):F>18.75/2)}X=!1})});const B=()=>Qi("https://tauri.app/"),ie=F=>{c(F),n(0,k=!1)};function te(F){ri[F?"unshift":"push"](()=>{U=F,n(4,U)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const F=document.querySelector("#sidebar");F&&Or(F,k)}},[k,d,f,v,U,z,i,u,c,y,M,g,b,A,D,N,O,S,j,B,ie,te]}class Nr extends ye{constructor(t){super(),ge(this,t,Rr,Dr,me,{},null,[-1,-1])}}new Nr({target:document.querySelector("#app")}); diff --git a/examples/api/src/views/Shell.svelte b/examples/api/src/views/Shell.svelte index 197d87e3924..125cf6c3445 100644 --- a/examples/api/src/views/Shell.svelte +++ b/examples/api/src/views/Shell.svelte @@ -13,6 +13,7 @@ let encoding = '' let stdin = '' let child + let output = [] function _getEnv() { return env.split(' ').reduce((env, clause) => { @@ -26,10 +27,11 @@ function spawn() { child = null + output = [] const command = new Command(cmd, [...args, script], { cwd: cwd || null, env: _getEnv(), - encoding, + encoding: encoding || null }) command.on('close', (data) => { @@ -40,8 +42,23 @@ }) command.on('error', (error) => onMessage(`command error: "${error}"`)) - command.stdout.on('data', (line) => onMessage(`command stdout: "${line}"`)) - command.stderr.on('data', (line) => onMessage(`command stderr: "${line}"`)) + function onOutput(line, kind) { + onMessage(`command ${kind}: "${line}"`) + + if (line.endsWith('\n')) { + line = line.substring(0, line.length - 1) + } + + const last = output[output.length - 1] + if (last && last.endsWith('\r')) { + output = [...output.slice(0, output.length - 1), line] + } else { + output = [...output, line] + } + } + + command.stdout.on('data', (line) => onOutput(line, 'stdout')) + command.stderr.on('data', (line) => onOutput(line, 'stderr')) command .spawn() @@ -90,11 +107,19 @@
- + {#if child} + + {/if}
{#if child}
{/if} + +
+ {#each output as l} +

{l}

+ {/each} +