mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-23 02:32:28 +03:00
6c408b736c
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio> Co-authored-by: Lucas Nogueira <lucas@tauri.app>
51 lines
90 KiB
JavaScript
51 lines
90 KiB
JavaScript
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;n<e.length;n+=1)e[n]&&e[n].d(t)}function a(e){return document.createElement(e)}function Ao(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function z(e){return document.createTextNode(e)}function m(){return z(" ")}function pi(){return z("")}function L(e,t,n,i){return e.addEventListener(t,n,i),()=>e.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<e.options.length;n+=1){const i=e.options[n];if(i.__value===t){i.selected=!0;return}}e.selectedIndex=-1}function Gi(e){const t=e.querySelector(":checked")||e.options[0];return t&&t.__value}function ni(e,t,n){e.classList[n?"add":"remove"](t)}class Lo{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Ao(n.nodeName):this.e=a(n.nodeName),this.t=n,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)h(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(p)}}let Qt;function Kt(e){Qt=e}function Ns(){if(!Qt)throw new Error("Function called outside component initialization");return Qt}function _t(e){Ns().$$.on_mount.push(e)}function Yi(e){Ns().$$.on_destroy.push(e)}const Yt=[],ri=[],li=[],ls=[],zo=Promise.resolve();let Vi=!1;function Eo(){Vi||(Vi=!0,zo.then(Is))}function Ft(e){li.push(e)}const qi=new Set;let ii=0;function Is(){const e=Qt;do{for(;ii<Yt.length;){const t=Yt[ii];ii++,Kt(t),Wo(t.$$)}for(Kt(null),Yt.length=0,ii=0;ri.length;)ri.pop()();for(let t=0;t<li.length;t+=1){const n=li[t];qi.has(n)||(qi.add(n),n())}li.length=0}while(Yt.length);for(;ls.length;)ls.pop()();Vi=!1,qi.clear(),Kt(e)}function Wo(e){if(e.fragment!==null){e.update(),oe(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Ft)}}const si=new Set;let bt;function mi(){bt={r:0,c:[],p:bt}}function hi(){bt.r||oe(bt.c),bt=bt.p}function Te(e,t){e&&e.i&&(si.delete(e),e.i(t))}function He(e,t,n,i){if(e&&e.o){if(si.has(e))return;si.add(e),bt.c.push(()=>{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<<t%31}function ge(e,t,n,i,l,o,u,d=[-1]){const c=Qt;Kt(e);const f=e.$$={fragment:null,ctx:null,props:o,update:G,not_equal:l,bound:is(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:is(),dirty:d,skip_bound:!1,root:t.target||c.$$.root};u&&u(f.root);let g=!1;if(f.ctx=n?n(e,t.props||{},(k,_,...v)=>{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<Nt.length;f+=2)Nt[f][0](Nt[f+1]);Nt.length=0}}}function o(d){l(d(e))}function u(d,c=G){const f=[d,c];return i.add(f),i.size===1&&(n=t(l)||G),d(e),()=>{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(`
|
|
`),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
|
|
`:`
|
|
`;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 <code>@tauri-apps/api</code> 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:
|
|
<code class="code-block flex flex-wrap my-2"><pre> --config <PATH>
|
|
--theme <light|dark|system>
|
|
--verbose</pre></code>
|
|
Additionally, it has a <code>update --background</code> 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('<img src="'+j+'"></img>')}):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;C<j.length;C+=1)W[C]=as(os(e,j,C));return{c(){t=a("form"),n=a("div"),i=a("select"),l=a("option"),l.textContent="None";for(let C=0;C<W.length;C+=1)W[C].c();o=m(),u=a("input"),d=m(),c=a("br"),f=m(),g=a("div"),k=a("button"),k.textContent="Read",_=m(),v=a("button"),v.textContent="Use as img src",y=m(),b=a("br"),S=m(),D=a("img"),l.__value="",l.value=l.__value,r(i,"class","input"),r(i,"id","dir"),r(u,"class","input grow"),r(u,"id","path-to-read"),r(u,"placeholder","Type the path to read..."),r(n,"class","flex gap-1"),r(k,"class","btn"),r(k,"id","read"),r(v,"class","btn"),r(v,"type","button"),r(t,"class","flex flex-col"),r(D,"alt","")},m(C,A){h(C,t,A),s(t,n),s(n,i),s(i,l);for(let E=0;E<W.length;E+=1)W[E].m(i,null);s(n,o),s(n,u),q(u,e[0]),s(t,d),s(t,c),s(t,f),s(t,g),s(g,k),s(g,_),s(g,v),h(C,y,A),h(C,b,A),h(C,S,A),h(C,D,A),e[8](D),N||(O=[L(u,"input",e[7]),L(v,"click",e[4]),L(t,"submit",ai(e[3]))],N=!0)},p(C,[A]){if(A&4){j=C[2];let E;for(E=0;E<j.length;E+=1){const M=os(C,j,E);W[E]?W[E].p(M,A):(W[E]=as(M),W[E].c(),W[E].m(i,null))}for(;E<W.length;E+=1)W[E].d(1);W.length=j.length}A&1&&u.value!==C[0]&&q(u,C[0])},i:G,o:G,d(C){C&&p(t),yt(W,C),C&&p(y),C&&p(b),C&&p(S),C&&p(D),e[8](null),N=!1,oe(O)}}}function rs(){return document.getElementById("dir").value?parseInt(dir.value):null}function Aa(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 Sa(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:l}=t,o="",u;const d=Object.keys(en).filter(_=>isNaN(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('<img src="'+D+'"></img>')});else{const S=String.fromCharCode.apply(null,b);l('<textarea id="file-response"></textarea><button id="file-save">Save</button>'),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;A<N.length;A+=1)O[A]=ps(us(e,N,A));const j=A=>He(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<O.length;A+=1)O[A].c();u=m(),d=a("span"),c=z(e[7]),W&&W.c(),f=m(),g=a("span"),k=z(e[6]),_=z(Ra),v=z(e[7]),C&&C.c(),y=pi(),r(n,"class","bracket svelte-gbh3pt"),r(n,"tabindex","0"),r(o,"class","svelte-gbh3pt"),r(d,"class","bracket svelte-gbh3pt"),r(d,"tabindex","0"),r(t,"class","svelte-gbh3pt"),ni(t,"hidden",e[8]),r(g,"class","bracket svelte-gbh3pt"),r(g,"tabindex","0"),ni(g,"hidden",!e[8])},m(A,E){h(A,t,E),s(t,n),s(n,i),s(t,l),s(t,o);for(let M=0;M<O.length;M+=1)O[M].m(o,null);s(t,u),s(t,d),s(d,c),W&&W.m(t,null),h(A,f,E),h(A,g,E),s(g,k),s(g,_),s(g,v),C&&C.m(A,E),h(A,y,E),b=!0,S||(D=[L(n,"click",e[11]),L(d,"click",e[11]),L(g,"click",e[11])],S=!0)},p(A,E){if((!b||E&64)&&Q(i,A[6]),E&1591){N=A[5];let M;for(M=0;M<N.length;M+=1){const H=us(A,N,M);O[M]?(O[M].p(H,E),Te(O[M],1)):(O[M]=ps(H),O[M].c(),Te(O[M],1),O[M].m(o,null))}for(mi(),M=N.length;M<O.length;M+=1)j(M);hi()}(!b||E&128)&&Q(c,A[7]),A[3]?W&&(W.d(1),W=null):W||(W=ms(),W.c(),W.m(t,null)),E&256&&ni(t,"hidden",A[8]),(!b||E&64)&&Q(k,A[6]),(!b||E&128)&&Q(v,A[7]),E&256&&ni(g,"hidden",!A[8]),!A[3]&&A[8]?C||(C=hs(),C.c(),C.m(y.parentNode,y)):C&&(C.d(1),C=null)},i(A){if(!b){for(let E=0;E<N.length;E+=1)Te(O[E]);b=!0}},o(A){O=O.filter(Boolean);for(let E=0;E<O.length;E+=1)He(O[E]);b=!1},d(A){A&&p(t),yt(O,A),W&&W.d(),A&&p(f),A&&p(g),C&&C.d(A),A&&p(y),S=!1,oe(D)}}}function ds(e){let t,n,i=e[12]+"",l,o;return{c(){t=a("span"),n=z('"'),l=z(i),o=z('":'),r(t,"class","key")},m(u,d){h(u,t,d),s(t,n),s(t,l),s(t,o)},p(u,d){d&32&&i!==(i=u[12]+"")&&Q(l,i)},d(u){u&&p(t)}}}function Pa(e){let t,n=e[10](e[0][e[12]])+"",i,l,o=e[14]<e[5].length-1&&fs();return{c(){t=a("span"),i=z(n),o&&o.c(),r(t,"class",l="val "+e[9](e[0][e[12]])+" svelte-gbh3pt")},m(u,d){h(u,t,d),s(t,i),o&&o.m(t,null)},p(u,d){d&33&&n!==(n=u[10](u[0][u[12]])+"")&&Q(i,n),u[14]<u[5].length-1?o||(o=fs(),o.c(),o.m(t,null)):o&&(o.d(1),o=null),d&33&&l!==(l="val "+u[9](u[0][u[12]])+" svelte-gbh3pt")&&r(t,"class",l)},i:G,o:G,d(u){u&&p(t),o&&o.d()}}}function Da(e){let t,n;return t=new fo({props:{json:e[0][e[12]],depth:e[1],_lvl:e[2]+1,_last:e[14]===e[5].length-1}}),{c(){ui(t.$$.fragment)},m(i,l){Zt(t,i,l),n=!0},p(i,l){const o={};l&33&&(o.json=i[0][i[12]]),l&2&&(o.depth=i[1]),l&4&&(o._lvl=i[2]+1),l&32&&(o._last=i[14]===i[5].length-1),t.$set(o)},i(i){n||(Te(t.$$.fragment,i),n=!0)},o(i){He(t.$$.fragment,i),n=!1},d(i){xt(t,i)}}}function fs(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 ps(e){let t,n,i,l,o,u,d,c=!e[4]&&ds(e);const f=[Da,Pa],g=[];function k(_,v){return v&33&&(i=null),i==null&&(i=_[9](_[0][_[12]])==="object"),i?0:1}return l=k(e,-1),o=g[l]=f[l](e),{c(){t=a("li"),c&&c.c(),n=m(),o.c(),u=m()},m(_,v){h(_,t,v),c&&c.m(t,null),s(t,n),g[l].m(t,null),s(t,u),d=!0},p(_,v){_[4]?c&&(c.d(1),c=null):c?c.p(_,v):(c=ds(_),c.c(),c.m(t,n));let y=l;l=k(_,v),l===y?g[l].p(_,v):(mi(),He(g[y],1,1,()=>{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,_=l<o)},[i,l,o,u,f,c,g,k,_,d,v,y]}class fo extends ye{constructor(t){super(),ge(this,t,Na,Oa,pe,{json:0,depth:1,_lvl:2,_last:3})}}function Ia(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,J,x,me,te,Y,de,Z,I,X,$,ae,ne,he,_e,fe,re,Ae,Se;return fe=new fo({props:{json:e[4]}}),{c(){t=a("form"),n=a("select"),i=a("option"),i.textContent="GET",l=a("option"),l.textContent="POST",o=a("option"),o.textContent="PUT",u=a("option"),u.textContent="PATCH",d=a("option"),d.textContent="DELETE",c=m(),f=a("br"),g=m(),k=a("textarea"),_=m(),v=a("br"),y=m(),b=a("button"),b.textContent="Make request",S=m(),D=a("br"),N=m(),O=a("h3"),O.textContent="HTTP Form",j=m(),W=a("div"),C=a("input"),A=m(),E=a("input"),M=m(),H=a("br"),U=m(),J=a("label"),x=a("input"),me=z(`
|
|
Multipart`),te=m(),Y=a("br"),de=m(),Z=a("br"),I=m(),X=a("button"),X.textContent="Post it",$=m(),ae=a("br"),ne=m(),he=a("br"),_e=m(),ui(fe.$$.fragment),i.__value="GET",i.value=i.__value,l.__value="POST",l.value=l.__value,o.__value="PUT",o.value=o.__value,u.__value="PATCH",u.value=u.__value,d.__value="DELETE",d.value=d.__value,r(n,"class","input"),r(n,"id","request-method"),e[0]===void 0&&Ft(()=>e[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;f<d.length;f+=1)c[f]=ys(bs(e,d,f));return{c(){t=a("span"),t.textContent="Selected window:",n=m(),i=a("select"),l=a("option"),l.textContent="Choose a window...";for(let f=0;f<c.length;f+=1)c[f].c();r(t,"class","font-700 text-sm"),l.__value="",l.value=l.__value,l.disabled=!0,l.selected=!0,r(i,"class","input"),e[0]===void 0&&Ft(()=>e[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;k<c.length;k+=1)c[k].m(i,null);It(i,e[0]),o||(u=L(i,"change",e[43]),o=!0)},p(f,g){if(g[0]&2){d=Object.keys(f[1]);let k;for(k=0;k<d.length;k+=1){const _=bs(f,d,k);c[k]?c[k].p(_,g):(c[k]=ys(_),c[k].c(),c[k].m(i,null))}for(;k<c.length;k+=1)c[k].d(1);c.length=d.length}g[0]&3&&It(i,f[0])},d(f){f&&p(t),f&&p(n),f&&p(i),yt(c,f),o=!1,u()}}}function ys(e){let t,n=e[78]+"",i,l;return{c(){t=a("option"),i=z(n),t.__value=l=e[78],t.value=t.__value},m(o,u){h(o,t,u),s(t,i)},p(o,u){u[0]&2&&n!==(n=o[78]+"")&&Q(i,n),u[0]&2&&l!==(l=o[78])&&(t.__value=l,t.value=t.__value)},d(o){o&&p(t)}}}function vs(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,J,x,me,te,Y,de,Z,I,X,$,ae,ne,he,_e,fe,re,Ae,Se,P,V,Le,ve,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,K,rt,Ht,Re,jt,je,ut,Ut,Ee,qt,ct,Bt,We,At,St,Lt,Ce,Ue,Ne,dt,Gt,ft,cn,dn=e[30].width+"",bi,sl,fn,ol,pn=e[30].height+"",gi,al,$e,mn,rl,hn,ul,_n=e[31].width+"",yi,cl,bn,dl,gn=e[31].height+"",vi,fl,zt,Ke,yn,pl,vn,ml,wn=e[30].toLogical(e[27]).width+"",wi,hl,kn,_l,Mn=e[30].toLogical(e[27]).height+"",ki,bl,Qe,Cn,gl,Tn,yl,An=e[31].toLogical(e[27]).width+"",Mi,vl,Sn,wl,Ln=e[31].toLogical(e[27]).height+"",Ci,kl,Et,Ze,zn,Ml,En,Cl,Wn=e[28].x+"",Ti,Tl,Pn,Al,Dn=e[28].y+"",Ai,Sl,xe,On,Ll,Rn,zl,Nn=e[29].x+"",Si,El,In,Wl,Fn=e[29].y+"",Li,Pl,Wt,et,Hn,Dl,jn,Ol,Un=e[28].toLogical(e[27]).x+"",zi,Rl,qn,Nl,Bn=e[28].toLogical(e[27]).y+"",Ei,Il,tt,Gn,Fl,Vn,Hl,Jn=e[29].toLogical(e[27]).x+"",Wi,jl,Xn,Ul,Yn=e[29].toLogical(e[27]).y+"",Pi,Di,Oi,Ri,Vt,Ni,qe,$n,Pt,ql,Bl,Kn,Dt,Gl,Vl,Qn,Ot,Jl,Ii,Be,Zn,Xl,Ge,Yl,xn,$l,nt,Kl,ei,Ql,it,Fi,Hi,ji,pt,mt,lt,Zl,Jt,xl,ht,st,es,Xt,Ui,ts,Rt=e[33],Me=[];for(let w=0;w<Rt.length;w+=1)Me[w]=ws(_s(e,Rt,w));return{c(){t=a("br"),n=m(),i=a("div"),l=a("button"),l.textContent="Center",o=m(),u=a("button"),u.textContent="Minimize",d=m(),c=a("button"),c.textContent="Hide",f=m(),g=a("button"),g.textContent="Change icon",k=m(),_=a("button"),_.textContent="Request attention",v=m(),y=a("br"),b=m(),S=a("div"),D=a("label"),N=z(`Maximized
|
|
`),O=a("input"),j=m(),W=a("label"),C=z(`Resizable
|
|
`),A=a("input"),E=m(),M=a("label"),H=z(`Maximizable
|
|
`),U=a("input"),J=m(),x=a("label"),me=z(`Minimizable
|
|
`),te=a("input"),Y=m(),de=a("label"),Z=z(`Closable
|
|
`),I=a("input"),X=m(),$=a("label"),ae=z(`Has decorations
|
|
`),ne=a("input"),he=m(),_e=a("label"),fe=z(`Always on top
|
|
`),re=a("input"),Ae=m(),Se=a("label"),P=z(`Content protected
|
|
`),V=a("input"),Le=m(),ve=a("label"),ue=z(`Fullscreen
|
|
`),we=a("input"),ie=m(),ze=a("br"),Je=m(),le=a("div"),ee=a("div"),F=a("div"),ce=z(`X
|
|
`),B=a("input"),Ie=m(),kt=a("div"),nn=z(`Y
|
|
`),Pe=a("input"),ln=m(),Xe=a("div"),Mt=a("div"),sn=z(`Width
|
|
`),De=a("input"),on=m(),Ct=a("div"),an=z(`Height
|
|
`),Oe=a("input"),rn=m(),Ye=a("div"),Tt=a("div"),un=z(`Min width
|
|
`),Fe=a("input"),K=m(),rt=a("div"),Ht=z(`Min height
|
|
`),Re=a("input"),jt=m(),je=a("div"),ut=a("div"),Ut=z(`Max width
|
|
`),Ee=a("input"),qt=m(),ct=a("div"),Bt=z(`Max height
|
|
`),We=a("input"),At=m(),St=a("br"),Lt=m(),Ce=a("div"),Ue=a("div"),Ne=a("div"),dt=a("div"),dt.textContent="Inner Size",Gt=m(),ft=a("span"),cn=z("Width: "),bi=z(dn),sl=m(),fn=a("span"),ol=z("Height: "),gi=z(pn),al=m(),$e=a("div"),mn=a("div"),mn.textContent="Outer Size",rl=m(),hn=a("span"),ul=z("Width: "),yi=z(_n),cl=m(),bn=a("span"),dl=z("Height: "),vi=z(gn),fl=m(),zt=a("div"),Ke=a("div"),yn=a("div"),yn.textContent="Inner Logical Size",pl=m(),vn=a("span"),ml=z("Width: "),wi=z(wn),hl=m(),kn=a("span"),_l=z("Height: "),ki=z(Mn),bl=m(),Qe=a("div"),Cn=a("div"),Cn.textContent="Outer Logical Size",gl=m(),Tn=a("span"),yl=z("Width: "),Mi=z(An),vl=m(),Sn=a("span"),wl=z("Height: "),Ci=z(Ln),kl=m(),Et=a("div"),Ze=a("div"),zn=a("div"),zn.textContent="Inner Position",Ml=m(),En=a("span"),Cl=z("x: "),Ti=z(Wn),Tl=m(),Pn=a("span"),Al=z("y: "),Ai=z(Dn),Sl=m(),xe=a("div"),On=a("div"),On.textContent="Outer Position",Ll=m(),Rn=a("span"),zl=z("x: "),Si=z(Nn),El=m(),In=a("span"),Wl=z("y: "),Li=z(Fn),Pl=m(),Wt=a("div"),et=a("div"),Hn=a("div"),Hn.textContent="Inner Logical Position",Dl=m(),jn=a("span"),Ol=z("x: "),zi=z(Un),Rl=m(),qn=a("span"),Nl=z("y: "),Ei=z(Bn),Il=m(),tt=a("div"),Gn=a("div"),Gn.textContent="Outer Logical Position",Fl=m(),Vn=a("span"),Hl=z("x: "),Wi=z(Jn),jl=m(),Xn=a("span"),Ul=z("y: "),Pi=z(Yn),Di=m(),Oi=a("br"),Ri=m(),Vt=a("h4"),Vt.textContent="Cursor",Ni=m(),qe=a("div"),$n=a("label"),Pt=a("input"),ql=z(`
|
|
Grab`),Bl=m(),Kn=a("label"),Dt=a("input"),Gl=z(`
|
|
Visible`),Vl=m(),Qn=a("label"),Ot=a("input"),Jl=z(`
|
|
Ignore events`),Ii=m(),Be=a("div"),Zn=a("label"),Xl=z(`Icon
|
|
`),Ge=a("select");for(let w=0;w<Me.length;w+=1)Me[w].c();Yl=m(),xn=a("label"),$l=z(`X position
|
|
`),nt=a("input"),Kl=m(),ei=a("label"),Ql=z(`Y position
|
|
`),it=a("input"),Fi=m(),Hi=a("br"),ji=m(),pt=a("div"),mt=a("form"),lt=a("input"),Zl=m(),Jt=a("button"),Jt.textContent="Set title",xl=m(),ht=a("form"),st=a("input"),es=m(),Xt=a("button"),Xt.textContent="Open URL",r(l,"class","btn"),r(l,"title","Unminimizes after 2 seconds"),r(u,"class","btn"),r(u,"title","Unminimizes after 2 seconds"),r(c,"class","btn"),r(c,"title","Visible again after 2 seconds"),r(g,"class","btn"),r(_,"class","btn"),r(_,"title","Minimizes the window, requests attention for 3s and then resets it"),r(i,"class","flex flex-wrap gap-2"),r(O,"type","checkbox"),r(A,"type","checkbox"),r(U,"type","checkbox"),r(te,"type","checkbox"),r(I,"type","checkbox"),r(ne,"type","checkbox"),r(re,"type","checkbox"),r(V,"type","checkbox"),r(we,"type","checkbox"),r(S,"class","flex flex-wrap gap-2"),r(B,"class","input"),r(B,"type","number"),r(B,"min","0"),r(Pe,"class","input"),r(Pe,"type","number"),r(Pe,"min","0"),r(ee,"class","flex children:grow flex-col"),r(De,"class","input"),r(De,"type","number"),r(De,"min","400"),r(Oe,"class","input"),r(Oe,"type","number"),r(Oe,"min","400"),r(Xe,"class","flex children:grow flex-col"),r(Fe,"class","input"),r(Fe,"type","number"),r(Re,"class","input"),r(Re,"type","number"),r(Ye,"class","flex children:grow flex-col"),r(Ee,"class","input"),r(Ee,"type","number"),r(Ee,"min","800"),r(We,"class","input"),r(We,"type","number"),r(We,"min","400"),r(je,"class","flex children:grow flex-col"),r(le,"class","flex flex-row gap-2 flex-wrap"),r(dt,"class","text-accent dark:text-darkAccent font-700"),r(Ne,"class","grow"),r(mn,"class","text-accent dark:text-darkAccent font-700"),r($e,"class","grow"),r(Ue,"class","flex"),r(yn,"class","text-accent dark:text-darkAccent font-700"),r(Ke,"class","grow"),r(Cn,"class","text-accent dark:text-darkAccent font-700"),r(Qe,"class","grow"),r(zt,"class","flex"),r(zn,"class","text-accent dark:text-darkAccent font-700"),r(Ze,"class","grow"),r(On,"class","text-accent dark:text-darkAccent font-700"),r(xe,"class","grow"),r(Et,"class","flex"),r(Hn,"class","text-accent dark:text-darkAccent font-700"),r(et,"class","grow"),r(Gn,"class","text-accent dark:text-darkAccent font-700"),r(tt,"class","grow"),r(Wt,"class","flex"),r(Vt,"class","mb-2"),r(Pt,"type","checkbox"),r(Dt,"type","checkbox"),r(Ot,"type","checkbox"),r(qe,"class","flex gap-2"),r(Ge,"class","input"),e[23]===void 0&&Ft(()=>e[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<Me.length;be+=1)Me[be].m(Ge,null);It(Ge,e[23]),s(Be,Yl),s(Be,xn),s(xn,$l),s(xn,nt),q(nt,e[21]),s(Be,Kl),s(Be,ei),s(ei,Ql),s(ei,it),q(it,e[22]),h(w,Fi,R),h(w,Hi,R),h(w,ji,R),h(w,pt,R),s(pt,mt),s(mt,lt),q(lt,e[32]),s(mt,Zl),s(mt,Jt),s(pt,xl),s(pt,ht),s(ht,st),q(st,e[26]),s(ht,es),s(ht,Xt),Ui||(ts=[L(l,"click",e[44]),L(u,"click",e[37]),L(c,"click",e[36]),L(g,"click",e[38]),L(_,"click",e[40]),L(O,"change",e[45]),L(A,"change",e[46]),L(U,"change",e[47]),L(te,"change",e[48]),L(I,"change",e[49]),L(ne,"change",e[50]),L(re,"change",e[51]),L(V,"change",e[52]),L(we,"change",e[53]),L(B,"input",e[54]),L(Pe,"input",e[55]),L(De,"input",e[56]),L(Oe,"input",e[57]),L(Fe,"input",e[58]),L(Re,"input",e[59]),L(Ee,"input",e[60]),L(We,"input",e[61]),L(Pt,"change",e[62]),L(Dt,"change",e[63]),L(Ot,"change",e[64]),L(Ge,"change",e[65]),L(nt,"input",e[66]),L(it,"input",e[67]),L(lt,"input",e[68]),L(mt,"submit",ai(e[35])),L(st,"input",e[69]),L(ht,"submit",ai(e[34]))],Ui=!0)},p(w,R){if(R[0]&64&&(O.checked=w[6]),R[0]&4&&(A.checked=w[2]),R[0]&8&&(U.checked=w[3]),R[0]&16&&(te.checked=w[4]),R[0]&32&&(I.checked=w[5]),R[0]&128&&(ne.checked=w[7]),R[0]&256&&(re.checked=w[8]),R[0]&512&&(V.checked=w[9]),R[0]&1024&&(we.checked=w[10]),R[0]&131072&&se(B.value)!==w[17]&&q(B,w[17]),R[0]&262144&&se(Pe.value)!==w[18]&&q(Pe,w[18]),R[0]&2048&&se(De.value)!==w[11]&&q(De,w[11]),R[0]&4096&&se(Oe.value)!==w[12]&&q(Oe,w[12]),R[0]&8192&&se(Fe.value)!==w[13]&&q(Fe,w[13]),R[0]&16384&&se(Re.value)!==w[14]&&q(Re,w[14]),R[0]&32768&&se(Ee.value)!==w[15]&&q(Ee,w[15]),R[0]&65536&&se(We.value)!==w[16]&&q(We,w[16]),R[0]&1073741824&&dn!==(dn=w[30].width+"")&&Q(bi,dn),R[0]&1073741824&&pn!==(pn=w[30].height+"")&&Q(gi,pn),R[1]&1&&_n!==(_n=w[31].width+"")&&Q(yi,_n),R[1]&1&&gn!==(gn=w[31].height+"")&&Q(vi,gn),R[0]&1207959552&&wn!==(wn=w[30].toLogical(w[27]).width+"")&&Q(wi,wn),R[0]&1207959552&&Mn!==(Mn=w[30].toLogical(w[27]).height+"")&&Q(ki,Mn),R[0]&134217728|R[1]&1&&An!==(An=w[31].toLogical(w[27]).width+"")&&Q(Mi,An),R[0]&134217728|R[1]&1&&Ln!==(Ln=w[31].toLogical(w[27]).height+"")&&Q(Ci,Ln),R[0]&268435456&&Wn!==(Wn=w[28].x+"")&&Q(Ti,Wn),R[0]&268435456&&Dn!==(Dn=w[28].y+"")&&Q(Ai,Dn),R[0]&536870912&&Nn!==(Nn=w[29].x+"")&&Q(Si,Nn),R[0]&536870912&&Fn!==(Fn=w[29].y+"")&&Q(Li,Fn),R[0]&402653184&&Un!==(Un=w[28].toLogical(w[27]).x+"")&&Q(zi,Un),R[0]&402653184&&Bn!==(Bn=w[28].toLogical(w[27]).y+"")&&Q(Ei,Bn),R[0]&671088640&&Jn!==(Jn=w[29].toLogical(w[27]).x+"")&&Q(Wi,Jn),R[0]&671088640&&Yn!==(Yn=w[29].toLogical(w[27]).y+"")&&Q(Pi,Yn),R[0]&524288&&(Pt.checked=w[19]),R[0]&1048576&&(Dt.checked=w[20]),R[0]&16777216&&(Ot.checked=w[24]),R[1]&4){Rt=w[33];let be;for(be=0;be<Rt.length;be+=1){const ns=_s(w,Rt,be);Me[be]?Me[be].p(ns,R):(Me[be]=ws(ns),Me[be].c(),Me[be].m(Ge,null))}for(;be<Me.length;be+=1)Me[be].d(1);Me.length=Rt.length}R[0]&8388608|R[1]&4&&It(Ge,w[23]),R[0]&2097152&&se(nt.value)!==w[21]&&q(nt,w[21]),R[0]&4194304&&se(it.value)!==w[22]&&q(it,w[22]),R[1]&2&<.value!==w[32]&&q(lt,w[32]),R[0]&67108864&&st.value!==w[26]&&q(st,w[26])},d(w){w&&p(t),w&&p(n),w&&p(i),w&&p(v),w&&p(y),w&&p(b),w&&p(S),w&&p(ie),w&&p(ze),w&&p(Je),w&&p(le),w&&p(At),w&&p(St),w&&p(Lt),w&&p(Ce),w&&p(Di),w&&p(Oi),w&&p(Ri),w&&p(Vt),w&&p(Ni),w&&p(qe),w&&p(Ii),w&&p(Be),yt(Me,w),w&&p(Fi),w&&p(Hi),w&&p(ji),w&&p(pt),Ui=!1,oe(ts)}}}function ws(e){let t,n=e[75]+"",i;return{c(){t=a("option"),i=z(n),t.__value=e[75],t.value=t.__value},m(l,o){h(l,t,o),s(t,i)},p:G,d(l){l&&p(t)}}}function Ja(e){let t,n,i,l,o,u,d,c,f=Object.keys(e[1]).length>=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;b<v.length;b+=1)v[b].c();f=m(),y&&y.c(),r(n,"class","input grow"),r(n,"placeholder","Type a shortcut with '+' as separator..."),r(l,"class","btn"),r(l,"type","button"),r(t,"class","flex gap-1"),r(c,"class","flex flex-col gap-1")},m(b,S){h(b,t,S),s(t,n),q(n,e[0]),s(t,i),s(t,l),h(b,o,S),h(b,u,S),h(b,d,S),h(b,c,S);for(let D=0;D<v.length;D+=1)v[D].m(c,null);s(c,f),y&&y.m(c,null),g||(k=[L(n,"input",e[7]),L(l,"click",e[3])],g=!0)},p(b,[S]){if(S&1&&n.value!==b[0]&&q(n,b[0]),S&18){_=b[1];let D;for(D=0;D<_.length;D+=1){const N=ks(b,_,D);v[D]?v[D].p(N,S):(v[D]=Ms(N),v[D].c(),v[D].m(c,f))}for(;D<v.length;D+=1)v[D].d(1);v.length=_.length}b[1].length>1?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='<div class="spinner animate-spin svelte-4xesec"></div>',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=`<div class="note-red grow">Not available for Linux</div>
|
|
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`,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='<div class="i-codicon-chrome-minimize"></div>',f=m(),g=a("span"),W.c(),_=m(),v=a("span"),v.innerHTML='<div class="i-codicon-chrome-close"></div>',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<we.length;F+=1)ie[F]=Es(Ss(e,we,F));var ze=e[1].component;function Je(F){return{props:{onMessage:F[14],insecureRenderHtml:F[15]}}}ze&&(Y=new ze(Je(e)));let le=e[6],ee=[];for(let F=0;F<le.length;F+=1)ee[F]=Ws(As(e,le,F));return{c(){P&&P.c(),t=m(),n=a("div"),ve.c(),i=m(),l=a("div"),o=a("aside"),u=a("img"),c=m(),ue&&ue.c(),f=m(),g=a("a"),g.innerHTML=`Documentation
|
|
<span class="i-codicon-link-external"></span>`,k=m(),_=a("a"),_.innerHTML=`GitHub
|
|
<span class="i-codicon-link-external"></span>`,v=m(),y=a("a"),y.innerHTML=`Source
|
|
<span class="i-codicon-link-external"></span>`,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<ie.length;F+=1)ie[F].c();A=m(),E=a("main"),M=a("div"),H=a("h1"),J=z(U),x=m(),me=a("div"),te=a("div"),Y&&ui(Y.$$.fragment),de=m(),Z=a("div"),I=a("div"),X=m(),$=a("div"),ae=a("p"),ae.textContent="Console",ne=m(),he=a("div"),he.innerHTML='<div class="i-codicon-clear-all"></div>',_e=m(),fe=a("div");for(let F=0;F<ee.length;F+=1)ee[F].c();r(n,"id","sidebarToggle"),r(n,"class","z-2000 display-none lt-sm:flex justify-center items-center absolute top-2 left-2 w-8 h-8 rd-8 bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"),r(u,"class","self-center p-7 cursor-pointer"),Mo(u.src,d="tauri_logo.png")||r(u,"src",d),r(u,"alt","Tauri logo"),r(g,"class","nv justify-between h-8"),r(g,"target","_blank"),r(g,"href","https://tauri.app/v1/guides/"),r(_,"class","nv justify-between h-8"),r(_,"target","_blank"),r(_,"href","https://github.com/tauri-apps/tauri"),r(y,"class","nv justify-between h-8"),r(y,"target","_blank"),r(y,"href","https://github.com/tauri-apps/tauri/tree/dev/examples/api"),r(N,"class","bg-white/5 h-2px"),r(C,"class","flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"),r(o,"id","sidebar"),r(o,"class","lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 bg-darkPrimaryLighter transition-colors-250 overflow-hidden grid select-none px-2"),r(te,"class","mr-2"),r(me,"class","overflow-y-auto"),r(M,"class","px-5 overflow-hidden grid grid-rows-[auto_1fr]"),r(I,"class","bg-black/20 h-2px cursor-ns-resize"),r(ae,"class","font-semibold"),r(he,"class","cursor-pointer h-85% rd-1 p-1 flex justify-center items-center hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25 "),r($,"class","flex justify-between items-center px-2"),r(fe,"class","px-2 overflow-y-auto all:font-mono code-block all:text-xs"),r(Z,"id","console"),r(Z,"class","select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"),r(E,"class","flex-1 bg-primary dark:bg-darkPrimary transition-transform transition-colors-250 grid grid-rows-[2fr_auto]"),r(l,"class","flex h-screen w-screen overflow-hidden children-pt8 children-pb-2 text-primaryText dark:text-darkPrimaryText")},m(F,ce){P&&P.m(F,ce),h(F,t,ce),h(F,n,ce),ve.m(n,null),h(F,i,ce),h(F,l,ce),s(l,o),s(o,u),s(o,c),ue&&ue.m(o,null),s(o,f),s(o,g),s(o,k),s(o,_),s(o,v),s(o,y),s(o,b),s(o,S),s(o,D),s(o,N),s(o,O),s(o,j),s(o,W),s(o,C);for(let B=0;B<ie.length;B+=1)ie[B].m(C,null);s(l,A),s(l,E),s(E,M),s(M,H),s(H,J),s(M,x),s(M,me),s(me,te),Y&&Zt(Y,te,null),s(E,de),s(E,Z),s(Z,I),s(Z,X),s(Z,$),s($,ae),s($,ne),s($,he),s(Z,_e),s(Z,fe);for(let B=0;B<ee.length;B+=1)ee[B].m(fe,null);e[21](Z),re=!0,Ae||(Se=[L(u,"click",e[19]),L(I,"mousedown",e[17]),L(he,"click",e[16])],Ae=!0)},p(F,ce){if(F[5]?P?P.p(F,ce):(P=Ls(F),P.c(),P.m(t.parentNode,t)):P&&(P.d(1),P=null),Le!==(Le=V(F))&&(ve.d(1),ve=Le(F),ve&&(ve.c(),ve.m(n,null))),F[5]?ue&&(ue.d(1),ue=null):ue?ue.p(F,ce):(ue=zs(F),ue.c(),ue.m(o,f)),ce[0]&387){we=F[7];let B;for(B=0;B<we.length;B+=1){const Ie=Ss(F,we,B);ie[B]?ie[B].p(Ie,ce):(ie[B]=Es(Ie),ie[B].c(),ie[B].m(C,null))}for(;B<ie.length;B+=1)ie[B].d(1);ie.length=we.length}if((!re||ce[0]&2)&&U!==(U=F[1].label+"")&&Q(J,U),ze!==(ze=F[1].component)){if(Y){mi();const B=Y;He(B.$$.fragment,1,0,()=>{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<le.length;B+=1){const Ie=As(F,le,B);ee[B]?ee[B].p(Ie,ce):(ee[B]=Ws(Ie),ee[B].c(),ee[B].m(fe,null))}for(;B<ee.length;B+=1)ee[B].d(1);ee.length=le.length}},i(F){re||(Y&&Te(Y.$$.fragment,F),re=!0)},o(F){Y&&He(Y.$$.fragment,F),re=!1},d(F){P&&P.d(F),F&&p(t),F&&p(n),ve.d(),F&&p(i),F&&p(l),ue&&ue.d(),yt(ie,F),Y&&xt(Y),yt(ee,F),e[21](null),Ae=!1,oe(Se)}}}let Ps=50;function Ds(e){const t=document.querySelector("html");e?t.classList.add("dark"):t.classList.remove("dark"),localStorage&&localStorage.setItem("theme",e?"dark":"")}function Wr(e,t){e.style.setProperty("--translate-x",`${t?"0":"-18.75"}rem`)}function Pr(e,t,n){let i;Ve.label!=="main"&&Ve.onCloseRequested(async I=>{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:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+(typeof I=="string"?I:JSON.stringify(I,null,1))+"</pre>"},...X])}function N(I){S.update(X=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+I+"</pre>"},...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<Ps?Ps:_e}px`,j)},ae=()=>{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<X&&X<20&&!M||M)&&(J=!0,x=X)}),document.addEventListener("touchmove",I=>{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")});
|