mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 02:01:49 +03:00
40 lines
66 KiB
JavaScript
40 lines
66 KiB
JavaScript
var Io=Object.defineProperty,qo=Object.defineProperties;var No=Object.getOwnPropertyDescriptors;var Fi=Object.getOwnPropertySymbols;var Bo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;var Hi=(e,t,n)=>t in e?Io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ui=(e,t)=>{for(var n in t||(t={}))Bo.call(t,n)&&Hi(e,n,t[n]);if(Fi)for(var n of Fi(t))Go.call(t,n)&&Hi(e,n,t[n]);return e},Ii=(e,t)=>qo(e,No(t));import{S as K,i as X,s as Y,e as u,a as v,t as S,b as a,c as O,d as r,l as T,f as G,n as I,g as W,r as x,o as $e,h as On,j as E,p as Ke,k as de,m as Vo,q as qi,u as Xe,v as Ni,w as J,x as Bi,y as Gi,z as Vi,A as Ji,B as $i,C as Ki,D as Jo,E as Xi,F as Yi,G as $o,H as Ko,I as Xo}from"./vendor.js";const Yo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};Yo();/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Qi=function(e,t){return(Qi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])})(e,t)};function Wn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Qi(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var dt=function(){return(dt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function _(e,t,n,i){return new(n||(n=Promise))(function(o,l){function s(h){try{p(i.next(h))}catch(f){l(f)}}function c(h){try{p(i.throw(h))}catch(f){l(f)}}function p(h){var f;h.done?o(h.value):(f=h.value,f instanceof n?f:new n(function(M){M(f)})).then(s,c)}p((i=i.apply(e,t||[])).next())})}function g(e,t){var n,i,o,l,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(p){return function(h){return function(f){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&f[0]?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[2&f[0],o.value]),f[0]){case 0:case 1:o=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,i=f[1],f=[0];continue;case 7:f=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){s=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){s.label=f[1];break}if(f[0]===6&&s.label<o[1]){s.label=o[1],o=f;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(f);break}o[2]&&s.ops.pop(),s.trys.pop();continue}f=t.call(e,s)}catch(M){f=[6,M],i=0}finally{n=o=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([p,h])}}}function Wt(e,t){t===void 0&&(t=!1);var n=window.crypto.getRandomValues(new Uint32Array(1))[0],i="_".concat(n);return Object.defineProperty(window,i,{value:function(o){return t&&Reflect.deleteProperty(window,i),e==null?void 0:e(o)},writable:!1,configurable:!0}),n}function fe(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,new Promise(function(i,o){var l=Wt(function(c){i(c),Reflect.deleteProperty(window,s)},!0),s=Wt(function(c){o(c),Reflect.deleteProperty(window,l)},!0);window.__TAURI_IPC__(dt({cmd:e,callback:l,error:s},t))})]})})}function Zi(e){return navigator.userAgent.includes("Windows")?"https://asset.localhost/".concat(e):"asset://".concat(e)}Object.freeze({__proto__:null,transformCallback:Wt,invoke:fe,convertFileSrc:Zi});function z(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,fe("tauri",e)]})})}function Qo(e,t,n,i){return n===void 0&&(n=[]),_(this,void 0,void 0,function(){return g(this,function(o){return typeof n=="object"&&Object.freeze(n),[2,z({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:Wt(e)}})]})})}var An=function(){function e(){this.eventListeners=Object.create(null)}return e.prototype.addEventListener=function(t,n){t in this.eventListeners?this.eventListeners[t].push(n):this.eventListeners[t]=[n]},e.prototype._emit=function(t,n){if(t in this.eventListeners)for(var i=0,o=this.eventListeners[t];i<o.length;i++)(0,o[i])(n)},e.prototype.on=function(t,n){return this.addEventListener(t,n),this},e}(),xi=function(){function e(t){this.pid=t}return e.prototype.write=function(t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof t=="string"?t:Array.from(t)}})]})})},e.prototype.kill=function(){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]})})},e}(),to=function(e){function t(n,i,o){i===void 0&&(i=[]);var l=e.call(this)||this;return l.stdout=new An,l.stderr=new An,l.program=n,l.args=typeof i=="string"?[i]:i,l.options=o!=null?o:{},l}return Wn(t,e),t.sidecar=function(n,i,o){i===void 0&&(i=[]);var l=new t(n,i,o);return l.options.sidecar=!0,l},t.prototype.spawn=function(){return _(this,void 0,void 0,function(){var n=this;return g(this,function(i){return[2,Qo(function(o){switch(o.event){case"Error":n._emit("error",o.payload);break;case"Terminated":n._emit("close",o.payload);break;case"Stdout":n.stdout._emit("data",o.payload);break;case"Stderr":n.stderr._emit("data",o.payload)}},this.program,this.args,this.options).then(function(o){return new xi(o)})]})})},t.prototype.execute=function(){return _(this,void 0,void 0,function(){var n=this;return g(this,function(i){return[2,new Promise(function(o,l){n.on("error",l);var s=[],c=[];n.stdout.on("data",function(p){s.push(p)}),n.stderr.on("data",function(p){c.push(p)}),n.on("close",function(p){o({code:p.code,signal:p.signal,stdout:s.join(`
|
|
`),stderr:c.join(`
|
|
`)})}),n.spawn().catch(l)})]})})},t}(An);function Ln(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})]})})}Object.freeze({__proto__:null,Command:to,Child:xi,open:Ln});function eo(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function no(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function io(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}Object.freeze({__proto__:null,getName:no,getVersion:eo,getTauriVersion:io});function oo(e){return e===void 0&&(e=0),_(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})]})})}function En(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:oo,relaunch:En});function Zo(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P,C,j,F,H;return{c(){t=u("h1"),t.textContent="Welcome",n=v(),i=u("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",o=v(),l=u("p"),s=S("Current App version: "),c=S(e[0]),p=v(),h=u("p"),f=S("Current Tauri version: "),M=S(e[1]),m=v(),d=u("p"),b=S("Current App name: "),k=S(e[2]),w=v(),P=u("button"),P.textContent="Close application",C=v(),j=u("button"),j.textContent="Relaunch application",a(P,"class","button"),a(j,"class","button")},m(A,U){O(A,t,U),O(A,n,U),O(A,i,U),O(A,o,U),O(A,l,U),r(l,s),r(l,c),O(A,p,U),O(A,h,U),r(h,f),r(h,M),O(A,m,U),O(A,d,U),r(d,b),r(d,k),O(A,w,U),O(A,P,U),O(A,C,U),O(A,j,U),F||(H=[T(P,"click",e[3]),T(j,"click",e[4])],F=!0)},p(A,[U]){U&1&&G(c,A[0]),U&2&&G(M,A[1]),U&4&&G(k,A[2])},i:I,o:I,d(A){A&&W(t),A&&W(n),A&&W(i),A&&W(o),A&&W(l),A&&W(p),A&&W(h),A&&W(m),A&&W(d),A&&W(w),A&&W(P),A&&W(C),A&&W(j),F=!1,x(H)}}}function xo(e,t,n){let i=0,o=0,l="Unknown";no().then(p=>{n(2,l=p)}),eo().then(p=>{n(0,i=p)}),io().then(p=>{n(1,o=p)});async function s(){await oo()}async function c(){await En()}return[i,o,l,s,c]}class tr extends K{constructor(t){super();X(this,t,xo,Zo,Y,{})}}function ro(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:ro});function er(e){let t,n,i,o,l,s,c,p,h,f,M;return{c(){t=u("div"),n=S(`This binary can be run on the terminal and takes the following arguments:
|
|
`),i=u("ul"),i.innerHTML=`<li>--config PATH</li>
|
|
<li>--theme light|dark|system</li>
|
|
<li>--verbose</li>`,o=S(`
|
|
Additionally, it has a `),l=u("i"),l.textContent="update --background",s=S(` subcommand.
|
|
Note that the arguments are only parsed, not implemented.
|
|
`),c=u("br"),p=v(),h=u("button"),h.textContent="Get matches",a(h,"class","button"),a(h,"id","cli-matches")},m(m,d){O(m,t,d),r(t,n),r(t,i),r(t,o),r(t,l),r(t,s),r(t,c),r(t,p),r(t,h),f||(M=T(h,"click",e[0]),f=!0)},p:I,i:I,o:I,d(m){m&&W(t),f=!1,M()}}}function nr(e,t,n){let{onMessage:i}=t;function o(){ro().then(i).catch(i)}return e.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class ir extends K{constructor(t){super();X(this,t,nr,er,Y,{onMessage:1})}}function lo(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}function so(e,t,n){return _(this,void 0,void 0,function(){return g(this,function(i){switch(i.label){case 0:return[4,z({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function Dn(e,t,n){return _(this,void 0,void 0,function(){var i=this;return g(this,function(o){return[2,z({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:Wt(n)}}).then(function(l){return function(){return _(i,void 0,void 0,function(){return g(this,function(s){return[2,lo(l)]})})}})]})})}function uo(e,t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,Dn(e,t,function(o){n(o),lo(o.id).catch(function(){})})]})})}function pe(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,Dn(e,null,t)]})})}function ao(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,uo(e,null,t)]})})}function Ye(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,so(e,void 0,t)]})})}Object.freeze({__proto__:null,listen:pe,once:ao,emit:Ye});function or(e){let t,n,i,o,l,s,c,p;return{c(){t=u("div"),n=u("button"),n.textContent="Call Log API",i=v(),o=u("button"),o.textContent="Call Request (async) API",l=v(),s=u("button"),s.textContent="Send event to Rust",a(n,"class","button"),a(n,"id","log"),a(o,"class","button"),a(o,"id","request"),a(s,"class","button"),a(s,"id","event")},m(h,f){O(h,t,f),r(t,n),r(t,i),r(t,o),r(t,l),r(t,s),c||(p=[T(n,"click",e[0]),T(o,"click",e[1]),T(s,"click",e[2])],c=!0)},p:I,i:I,o:I,d(h){h&&W(t),c=!1,x(p)}}}function rr(e,t,n){let{onMessage:i}=t,o;$e(async()=>{o=await pe("rust-event",i)}),On(()=>{o&&o()});function l(){fe("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function s(){fe("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Ye("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[l,s,c,i]}class lr extends K{constructor(t){super();X(this,t,rr,or,Y,{onMessage:3})}}function Rn(e){return e===void 0&&(e={}),_(this,void 0,void 0,function(){return g(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})]})})}function co(e){return e===void 0&&(e={}),_(this,void 0,void 0,function(){return g(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})]})})}function sr(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e}})]})})}function ur(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Dialog",message:{cmd:"askDialog",title:t,message:e}})]})})}function ar(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:t,message:e}})]})})}Object.freeze({__proto__:null,open:Rn,save:co,message:sr,ask:ur,confirm:ar});var Bt;function cr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}}).then(function(i){return new TextDecoder().decode(new Uint8Array(i))})]})})}function jn(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){var n;return g(this,function(i){switch(i.label){case 0:return[4,z({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function dr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(new TextEncoder().encode(e.contents)),options:t}})]})})}function fr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(e.contents),options:t}})]})})}function fo(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})]})})}function pr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})]})})}function hr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})]})})}function mr(e,t,n){return n===void 0&&(n={}),_(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})]})})}function vr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})]})})}function _r(e,t,n){return n===void 0&&(n={}),_(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})]})})}(function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log"})(Bt||(Bt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Bt},get Dir(){return Bt},readTextFile:cr,readBinaryFile:jn,writeFile:dr,writeBinaryFile:fr,readDir:fo,createDir:pr,removeDir:hr,copyFile:mr,removeFile:vr,renameFile:_r});function gr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P,C,j,F;return{c(){t=u("div"),n=u("input"),i=v(),o=u("input"),l=v(),s=u("div"),c=u("input"),p=v(),h=u("label"),h.textContent="Multiple",f=v(),M=u("div"),m=u("input"),d=v(),b=u("label"),b.textContent="Directory",k=v(),w=u("button"),w.textContent="Open dialog",P=v(),C=u("button"),C.textContent="Open save dialog",a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(o,"class","svelte-1eg58yg"),a(c,"type","checkbox"),a(c,"id","dialog-multiple"),a(h,"for","dialog-multiple"),a(m,"type","checkbox"),a(m,"id","dialog-directory"),a(b,"for","dialog-directory"),a(w,"class","button"),a(w,"id","open-dialog"),a(C,"class","button"),a(C,"id","save-dialog")},m(H,A){O(H,t,A),r(t,n),E(n,e[0]),r(t,i),r(t,o),E(o,e[1]),r(t,l),r(t,s),r(s,c),c.checked=e[2],r(s,p),r(s,h),r(t,f),r(t,M),r(M,m),m.checked=e[3],r(M,d),r(M,b),r(t,k),r(t,w),r(t,P),r(t,C),j||(F=[T(n,"input",e[8]),T(o,"input",e[9]),T(c,"change",e[10]),T(m,"change",e[11]),T(w,"click",e[4]),T(C,"click",e[5])],j=!0)},p(H,[A]){A&1&&n.value!==H[0]&&E(n,H[0]),A&2&&o.value!==H[1]&&E(o,H[1]),A&4&&(c.checked=H[2]),A&8&&(m.checked=H[3])},i:I,o:I,d(H){H&&W(t),j=!1,x(F)}}}function br(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function wr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l=null,s=null,c=!1,p=!1;function h(){Rn({title:"My wonderful open dialog",defaultPath:l,filters:s?[{name:"Tauri Example",extensions:s.split(",").map(k=>k.trim())}]:[],multiple:c,directory:p}).then(function(k){if(Array.isArray(k))i(k);else{var w=k,P=w.match(/\S+\.\S+$/g);jn(w).then(function(C){P&&(w.includes(".png")||w.includes(".jpg"))?br(new Uint8Array(C),function(j){var F="data:image/png;base64,"+j;o('<img src="'+F+'"></img>')}):i(k)}).catch(i(k))}}).catch(i)}function f(){co({title:"My wonderful save dialog",defaultPath:l,filters:s?[{name:"Tauri Example",extensions:s.split(",").map(k=>k.trim())}]:[]}).then(i).catch(i)}function M(){l=this.value,n(0,l)}function m(){s=this.value,n(1,s)}function d(){c=this.checked,n(2,c)}function b(){p=this.checked,n(3,p)}return e.$$set=k=>{"onMessage"in k&&n(6,i=k.onMessage),"insecureRenderHtml"in k&&n(7,o=k.insecureRenderHtml)},[l,s,c,p,h,f,i,o,M,m,d,b]}class yr extends K{constructor(t){super();X(this,t,wr,gr,Y,{onMessage:6,insecureRenderHtml:7})}}function po(e,t,n){const i=e.slice();return i[9]=t[n],i}function ho(e){let t,n=e[9][0]+"",i,o;return{c(){t=u("option"),i=S(n),t.__value=o=e[9][1],t.value=t.__value},m(l,s){O(l,t,s),r(t,i)},p:I,d(l){l&&W(t)}}}function Mr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b=e[2],k=[];for(let w=0;w<b.length;w+=1)k[w]=ho(po(e,b,w));return{c(){t=u("form"),n=u("select"),i=u("option"),i.textContent="None";for(let w=0;w<k.length;w+=1)k[w].c();o=v(),l=u("input"),s=v(),c=u("button"),c.textContent="Read",p=v(),h=u("button"),h.textContent="Use as img src",f=v(),M=u("img"),i.__value="",i.value=i.__value,a(n,"class","button"),a(n,"id","dir"),a(l,"id","path-to-read"),a(l,"placeholder","Type the path to read..."),a(c,"class","button"),a(c,"id","read"),a(h,"class","button"),a(h,"type","button"),a(M,"alt","file")},m(w,P){O(w,t,P),r(t,n),r(n,i);for(let C=0;C<k.length;C+=1)k[C].m(n,null);r(t,o),r(t,l),E(l,e[0]),r(t,s),r(t,c),r(t,p),r(t,h),r(t,f),r(t,M),e[8](M),m||(d=[T(l,"input",e[7]),T(h,"click",e[4]),T(t,"submit",Ke(e[3]))],m=!0)},p(w,[P]){if(P&4){b=w[2];let C;for(C=0;C<b.length;C+=1){const j=po(w,b,C);k[C]?k[C].p(j,P):(k[C]=ho(j),k[C].c(),k[C].m(n,null))}for(;C<k.length;C+=1)k[C].d(1);k.length=b.length}P&1&&l.value!==w[0]&&E(l,w[0])},i:I,o:I,d(w){w&&W(t),de(k,w),e[8](null),m=!1,x(d)}}}function mo(){return document.getElementById("dir").value?parseInt(dir.value):null}function kr(e,t){const n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){const l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function zr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l="",s;const c=Object.keys(Bt).filter(m=>isNaN(parseInt(m))).map(m=>[m,Bt[m]]);function p(){const m=l.match(/\S+\.\S+$/g),d={dir:mo()};(m?jn(l,d):fo(l,d)).then(function(k){if(m)if(l.includes(".png")||l.includes(".jpg"))kr(new Uint8Array(k),function(w){const P="data:image/png;base64,"+w;o('<img src="'+P+'"></img>')});else{const w=String.fromCharCode.apply(null,k);o('<textarea id="file-response"></textarea><button id="file-save">Save</button>'),setTimeout(()=>{const P=document.getElementById("file-response");P.value=w,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:l,contents:P.value},{dir:mo()}).catch(i)})})}else i(k)}).catch(i)}function h(){n(1,s.src=Zi(l),s)}function f(){l=this.value,n(0,l)}function M(m){Vo[m?"unshift":"push"](()=>{s=m,n(1,s)})}return e.$$set=m=>{"onMessage"in m&&n(5,i=m.onMessage),"insecureRenderHtml"in m&&n(6,o=m.insecureRenderHtml)},[l,s,c,p,h,i,o,f,M]}class Tr extends K{constructor(t){super();X(this,t,zr,Mr,Y,{onMessage:5,insecureRenderHtml:6})}}var he;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(he||(he={}));var Fn=function(){function e(t,n){this.type=t,this.payload=n}return e.form=function(t){var n={};for(var i in t){var o=t[i];n[i]=typeof o=="string"?o:Array.from(o)}return new e("Form",n)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",Array.from(t))},e}(),vo=function(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},_o=function(){function e(t){this.id=t}return e.prototype.drop=function(){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},e.prototype.request=function(t){return _(this,void 0,void 0,function(){var n;return g(this,function(i){return(n=!t.responseType||t.responseType===he.JSON)&&(t.responseType=he.Text),[2,z({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(function(o){var l=new vo(o);if(n){try{l.data=JSON.parse(l.data)}catch(s){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(s,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},e.prototype.get=function(t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,this.request(dt({method:"GET",url:t},n))]})})},e.prototype.post=function(t,n,i){return _(this,void 0,void 0,function(){return g(this,function(o){return[2,this.request(dt({method:"POST",url:t,body:n},i))]})})},e.prototype.put=function(t,n,i){return _(this,void 0,void 0,function(){return g(this,function(o){return[2,this.request(dt({method:"PUT",url:t,body:n},i))]})})},e.prototype.patch=function(t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,this.request(dt({method:"PATCH",url:t},n))]})})},e.prototype.delete=function(t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,this.request(dt({method:"DELETE",url:t},n))]})})},e}();function Hn(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(function(n){return new _o(n)})]})})}var Un=null;function Cr(e,t){var n;return _(this,void 0,void 0,function(){return g(this,function(i){switch(i.label){case 0:return Un!==null?[3,2]:[4,Hn()];case 1:Un=i.sent(),i.label=2;case 2:return[2,Un.request(dt({url:e,method:(n=t==null?void 0:t.method)!==null&&n!==void 0?n:"GET"},t))]}})})}Object.freeze({__proto__:null,getClient:Hn,fetch:Cr,Body:Fn,Client:_o,Response:vo,get ResponseType(){return he}});function Sr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P;return{c(){t=u("form"),n=u("select"),i=u("option"),i.textContent="GET",o=u("option"),o.textContent="POST",l=u("option"),l.textContent="PUT",s=u("option"),s.textContent="PATCH",c=u("option"),c.textContent="DELETE",p=v(),h=u("input"),f=v(),M=u("br"),m=v(),d=u("textarea"),b=v(),k=u("button"),k.textContent="Make request",i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,s.__value="PATCH",s.value=s.__value,c.__value="DELETE",c.value=c.__value,a(n,"class","button"),a(n,"id","request-method"),e[0]===void 0&&qi(()=>e[5].call(n)),a(h,"id","request-url"),a(h,"placeholder","Type the request URL..."),a(d,"id","request-body"),a(d,"placeholder","Request body"),a(d,"rows","5"),a(d,"class","svelte-1xfmj7b"),a(k,"class","button"),a(k,"id","make-request")},m(C,j){O(C,t,j),r(t,n),r(n,i),r(n,o),r(n,l),r(n,s),r(n,c),Xe(n,e[0]),r(t,p),r(t,h),E(h,e[1]),r(t,f),r(t,M),r(t,m),r(t,d),E(d,e[2]),r(t,b),r(t,k),w||(P=[T(n,"change",e[5]),T(h,"input",e[6]),T(d,"input",e[7]),T(t,"submit",Ke(e[3]))],w=!0)},p(C,[j]){j&1&&Xe(n,C[0]),j&2&&h.value!==C[1]&&E(h,C[1]),j&4&&E(d,C[2])},i:I,o:I,d(C){C&&W(t),w=!1,x(P)}}}function Pr(e,t,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",l="",{onMessage:s}=t;async function c(){const M=await Hn().catch(k=>{throw s(k),k}),b={url:o||""||"",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?b.body=Fn.json(JSON.parse(l)):l!==""&&(b.body=Fn.text(l)),M.request(b).then(s).catch(s)}function p(){i=Ni(this),n(0,i)}function h(){o=this.value,n(1,o)}function f(){l=this.value,n(2,l)}return e.$$set=M=>{"onMessage"in M&&n(4,s=M.onMessage)},[i,o,l,c,s,p,h,f]}class Or extends K{constructor(t){super();X(this,t,Pr,Sr,Y,{onMessage:4})}}function Wr(e){let t,n,i;return{c(){t=u("button"),t.textContent="Send test notification",a(t,"class","button"),a(t,"id","notification")},m(o,l){O(o,t,l),n||(i=T(t,"click",Ar),n=!0)},p:I,i:I,o:I,d(o){o&&W(t),n=!1,i()}}}function Ar(){new Notification("Notification title",{body:"This is the notification body"})}function Lr(e,t,n){let{onMessage:i}=t;return e.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class Er extends K{constructor(t){super();X(this,t,Lr,Wr,Y,{onMessage:0})}}var me,Qe=function(e,t){this.type="Logical",this.width=e,this.height=t},Gt=function(){function e(t,n){this.type="Physical",this.width=t,this.height=n}return e.prototype.toLogical=function(t){return new Qe(this.width/t,this.height/t)},e}(),go=function(e,t){this.type="Logical",this.x=e,this.y=t},Vt=function(){function e(t,n){this.type="Physical",this.x=t,this.y=n}return e.prototype.toLogical=function(t){return new go(this.x/t,this.y/t)},e}();function Dr(){return new ve(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function bo(){return window.__TAURI_METADATA__.__windows.map(function(e){return new ve(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(me||(me={}));var wo=["tauri://created","tauri://error"],yo=function(){function e(t){this.label=t,this.listeners=Object.create(null)}return e.prototype.listen=function(t,n){return _(this,void 0,void 0,function(){var i=this;return g(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Dn(t,this.label,n)]})})},e.prototype.once=function(t,n){return _(this,void 0,void 0,function(){var i=this;return g(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,uo(t,this.label,n)]})})},e.prototype.emit=function(t,n){return _(this,void 0,void 0,function(){var i,o;return g(this,function(l){if(wo.includes(t)){for(i=0,o=this.listeners[t]||[];i<o.length;i++)(0,o[i])({event:t,id:-1,windowLabel:this.label,payload:n});return[2,Promise.resolve()]}return[2,so(t,this.label,n)]})})},e.prototype._handleTauriEvent=function(t,n){return!!wo.includes(t)&&(t in this.listeners?this.listeners[t].push(n):this.listeners[t]=[n],!0)},e}(),Mo=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Wn(t,e),t.prototype.scaleFactor=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})]})})},t.prototype.innerPosition=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new Vt(o,l)})]})})},t.prototype.outerPosition=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new Vt(o,l)})]})})},t.prototype.innerSize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new Gt(o,l)})]})})},t.prototype.outerSize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new Gt(o,l)})]})})},t.prototype.isFullscreen=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})]})})},t.prototype.isMaximized=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})]})})},t.prototype.isDecorated=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})]})})},t.prototype.isResizable=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})]})})},t.prototype.isVisible=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})]})})},t.prototype.center=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})]})})},t.prototype.requestUserAttention=function(n){return _(this,void 0,void 0,function(){var i;return g(this,function(o){return i=null,n&&(i=n===me.Critical?{type:"Critical"}:{type:"Informational"}),[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:i}}}})]})})},t.prototype.setResizable=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:n}}}})]})})},t.prototype.setTitle=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:n}}}})]})})},t.prototype.maximize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})]})})},t.prototype.unmaximize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})]})})},t.prototype.toggleMaximize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})]})})},t.prototype.minimize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})]})})},t.prototype.unminimize=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})]})})},t.prototype.show=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})]})})},t.prototype.hide=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})]})})},t.prototype.close=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})]})})},t.prototype.setDecorations=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:n}}}})]})})},t.prototype.setAlwaysOnTop=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:n}}}})]})})},t.prototype.setSize=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:n.type,data:{width:n.width,height:n.height}}}}}})]})})},t.prototype.setMinSize=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},t.prototype.setMaxSize=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},t.prototype.setPosition=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:n.type,data:{x:n.x,y:n.y}}}}}})]})})},t.prototype.setFullscreen=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:n}}}})]})})},t.prototype.setFocus=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})]})})},t.prototype.setIcon=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof n=="string"?n:Array.from(n)}}}}})]})})},t.prototype.setSkipTaskbar=function(n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:n}}}})]})})},t.prototype.startDragging=function(){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})]})})},t}(yo),ve=function(e){function t(n,i){i===void 0&&(i={});var o=e.call(this,n)||this;return(i==null?void 0:i.skip)||z({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:dt({label:n},i)}}}).then(function(){return _(o,void 0,void 0,function(){return g(this,function(l){return[2,this.emit("tauri://created")]})})}).catch(function(l){return _(o,void 0,void 0,function(){return g(this,function(s){return[2,this.emit("tauri://error",l)]})})}),o}return Wn(t,e),t.getByLabel=function(n){return bo().some(function(i){return i.label===n})?new t(n,{skip:!0}):null},t}(Mo),In=new ve(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0});function Rr(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}})]})})}function jr(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}})]})})}function Fr(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}})]})})}Object.freeze({__proto__:null,WebviewWindow:ve,WebviewWindowHandle:yo,WindowManager:Mo,getCurrent:Dr,getAll:bo,appWindow:In,LogicalSize:Qe,PhysicalSize:Gt,LogicalPosition:go,PhysicalPosition:Vt,get UserAttentionType(){return me},currentMonitor:Rr,primaryMonitor:jr,availableMonitors:Fr});function ko(e,t,n){const i=e.slice();return i[54]=t[n],i}function zo(e){let t,n=e[54]+"",i,o;return{c(){t=u("option"),i=S(n),t.__value=o=e[54],t.value=t.__value},m(l,s){O(l,t,s),r(t,i)},p(l,s){s[0]&2&&n!==(n=l[54]+"")&&G(i,n),s[0]&2&&o!==(o=l[54])&&(t.__value=o,t.value=t.__value)},d(l){l&&W(t)}}}function Hr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P,C,j,F,H,A,U,N,tt,ut,$,B,R,nt,D,Q,_e,ge,At,be,Jt,et,ft,Lt,we,it,ye,Et,Me,ot,ke,pt,Dt,ze,rt,Te,Rt,Ce,lt,Se,q,Ct,qn,ht,Nn,Pe,Bn,mt,Gn,jt,Oe,Vn,at,Jn,We,$n,ct,Ze,st,Ft,vt,xe,Kn,$t,Xn,Ae=e[20].width+"",tn,Yn,Kt,Qn,Le=e[20].height+"",en,Zn,_t,nn,xn,Xt,ti,Ee=e[21].width+"",on,ei,Yt,ni,De=e[21].height+"",rn,ii,Ht,gt,ln,oi,Qt,ri,Re=e[20].toLogical(e[17]).width+"",sn,li,Zt,si,je=e[20].toLogical(e[17]).height+"",un,ui,bt,an,ai,xt,ci,Fe=e[21].toLogical(e[17]).width+"",cn,di,te,fi,He=e[21].toLogical(e[17]).height+"",dn,pi,Ut,wt,fn,hi,ee,mi,Ue=e[18].x+"",pn,vi,ne,_i,Ie=e[18].y+"",hn,gi,yt,mn,bi,ie,wi,qe=e[19].x+"",vn,yi,oe,Mi,Ne=e[19].y+"",_n,ki,It,Mt,gn,zi,re,Ti,Be=e[18].toLogical(e[17]).x+"",bn,Ci,le,Si,Ge=e[18].toLogical(e[17]).y+"",wn,Pi,kt,yn,Oi,se,Wi,Ve=e[19].toLogical(e[17]).x+"",Mn,Ai,ue,Li,Je=e[19].toLogical(e[17]).y+"",kn,zn,zt,St,Ei,ae,Tn,Tt,Pt,Di,ce,Cn,Ot,Sn,qt,Pn,Ri,Nt=Object.keys(e[1]),Z=[];for(let y=0;y<Nt.length;y+=1)Z[y]=zo(ko(e,Nt,y));return{c(){t=u("div"),n=u("select");for(let y=0;y<Z.length;y+=1)Z[y].c();i=v(),o=u("div"),l=u("label"),s=u("input"),c=S(`
|
|
Resizable`),p=v(),h=u("label"),f=u("input"),M=S(`
|
|
Maximize`),m=v(),d=u("button"),d.textContent="Center",b=v(),k=u("button"),k.textContent="Minimize",w=v(),P=u("button"),P.textContent="Hide",C=v(),j=u("label"),F=u("input"),H=S(`
|
|
Transparent`),A=v(),U=u("label"),N=u("input"),tt=S(`
|
|
Has decorations`),ut=v(),$=u("label"),B=u("input"),R=S(`
|
|
Always on top`),nt=v(),D=u("label"),Q=u("input"),_e=S(`
|
|
Fullscreen`),ge=v(),At=u("button"),At.textContent="Change icon",be=v(),Jt=u("div"),et=u("div"),ft=u("div"),Lt=u("div"),we=S(`X
|
|
`),it=u("input"),ye=v(),Et=u("div"),Me=S(`Y
|
|
`),ot=u("input"),ke=v(),pt=u("div"),Dt=u("div"),ze=S(`Width
|
|
`),rt=u("input"),Te=v(),Rt=u("div"),Ce=S(`Height
|
|
`),lt=u("input"),Se=v(),q=u("div"),Ct=u("div"),qn=S(`Min width
|
|
`),ht=u("input"),Nn=v(),Pe=u("div"),Bn=S(`Min height
|
|
`),mt=u("input"),Gn=v(),jt=u("div"),Oe=u("div"),Vn=S(`Max width
|
|
`),at=u("input"),Jn=v(),We=u("div"),$n=S(`Max height
|
|
`),ct=u("input"),Ze=v(),st=u("div"),Ft=u("div"),vt=u("div"),xe=u("div"),xe.textContent="Inner Size",Kn=v(),$t=u("span"),Xn=S("Width: "),tn=S(Ae),Yn=v(),Kt=u("span"),Qn=S("Height: "),en=S(Le),Zn=v(),_t=u("div"),nn=u("div"),nn.textContent="Outer Size",xn=v(),Xt=u("span"),ti=S("Width: "),on=S(Ee),ei=v(),Yt=u("span"),ni=S("Height: "),rn=S(De),ii=v(),Ht=u("div"),gt=u("div"),ln=u("div"),ln.textContent="Inner Logical Size",oi=v(),Qt=u("span"),ri=S("Width: "),sn=S(Re),li=v(),Zt=u("span"),si=S("Height: "),un=S(je),ui=v(),bt=u("div"),an=u("div"),an.textContent="Outer Logical Size",ai=v(),xt=u("span"),ci=S("Width: "),cn=S(Fe),di=v(),te=u("span"),fi=S("Height: "),dn=S(He),pi=v(),Ut=u("div"),wt=u("div"),fn=u("div"),fn.textContent="Inner Position",hi=v(),ee=u("span"),mi=S("x: "),pn=S(Ue),vi=v(),ne=u("span"),_i=S("y: "),hn=S(Ie),gi=v(),yt=u("div"),mn=u("div"),mn.textContent="Outer Position",bi=v(),ie=u("span"),wi=S("x: "),vn=S(qe),yi=v(),oe=u("span"),Mi=S("y: "),_n=S(Ne),ki=v(),It=u("div"),Mt=u("div"),gn=u("div"),gn.textContent="Inner Logical Position",zi=v(),re=u("span"),Ti=S("x: "),bn=S(Be),Ci=v(),le=u("span"),Si=S("y: "),wn=S(Ge),Pi=v(),kt=u("div"),yn=u("div"),yn.textContent="Outer Logical Position",Oi=v(),se=u("span"),Wi=S("x: "),Mn=S(Ve),Ai=v(),ue=u("span"),Li=S("y: "),kn=S(Je),zn=v(),zt=u("form"),St=u("input"),Ei=v(),ae=u("button"),ae.textContent="Set title",Tn=v(),Tt=u("form"),Pt=u("input"),Di=v(),ce=u("button"),ce.textContent="Open URL",Cn=v(),Ot=u("button"),Ot.textContent="Request attention",Sn=v(),qt=u("button"),qt.textContent="New window",a(n,"class","button"),e[0]===void 0&&qi(()=>e[31].call(n)),a(s,"type","checkbox"),a(f,"type","checkbox"),a(d,"title","Unminimizes after 2 seconds"),a(k,"title","Unminimizes after 2 seconds"),a(P,"title","Visible again after 2 seconds"),a(F,"type","checkbox"),a(N,"type","checkbox"),a(B,"type","checkbox"),a(Q,"type","checkbox"),a(it,"type","number"),a(it,"min","0"),a(it,"class","svelte-1tppwwz"),a(ot,"type","number"),a(ot,"min","0"),a(ot,"class","svelte-1tppwwz"),a(ft,"class","flex col grow svelte-1tppwwz"),a(rt,"type","number"),a(rt,"min","400"),a(rt,"class","svelte-1tppwwz"),a(lt,"type","number"),a(lt,"min","400"),a(lt,"class","svelte-1tppwwz"),a(pt,"class","flex col grow svelte-1tppwwz"),a(ht,"type","number"),a(ht,"class","svelte-1tppwwz"),a(mt,"type","number"),a(mt,"class","svelte-1tppwwz"),a(q,"class","flex col grow svelte-1tppwwz"),a(at,"type","number"),a(at,"min","400"),a(at,"class","svelte-1tppwwz"),a(ct,"type","number"),a(ct,"min","400"),a(ct,"class","svelte-1tppwwz"),a(jt,"class","flex col grow svelte-1tppwwz"),a(et,"class","window-controls flex flex-row svelte-1tppwwz"),a(t,"class","flex col"),a($t,"class","svelte-1tppwwz"),a(Kt,"class","svelte-1tppwwz"),a(vt,"class","grow window-property svelte-1tppwwz"),a(Xt,"class","svelte-1tppwwz"),a(Yt,"class","svelte-1tppwwz"),a(_t,"class","grow window-property svelte-1tppwwz"),a(Ft,"class","flex"),a(Qt,"class","svelte-1tppwwz"),a(Zt,"class","svelte-1tppwwz"),a(gt,"class","grow window-property svelte-1tppwwz"),a(xt,"class","svelte-1tppwwz"),a(te,"class","svelte-1tppwwz"),a(bt,"class","grow window-property svelte-1tppwwz"),a(Ht,"class","flex"),a(ee,"class","svelte-1tppwwz"),a(ne,"class","svelte-1tppwwz"),a(wt,"class","grow window-property svelte-1tppwwz"),a(ie,"class","svelte-1tppwwz"),a(oe,"class","svelte-1tppwwz"),a(yt,"class","grow window-property svelte-1tppwwz"),a(Ut,"class","flex"),a(re,"class","svelte-1tppwwz"),a(le,"class","svelte-1tppwwz"),a(Mt,"class","grow window-property svelte-1tppwwz"),a(se,"class","svelte-1tppwwz"),a(ue,"class","svelte-1tppwwz"),a(kt,"class","grow window-property svelte-1tppwwz"),a(It,"class","flex"),a(St,"id","title"),a(ae,"class","button"),a(ae,"type","submit"),a(zt,"class","svelte-1tppwwz"),a(Pt,"id","url"),a(ce,"class","button"),a(ce,"id","open-url"),a(Tt,"class","svelte-1tppwwz"),a(Ot,"class","button"),a(Ot,"title","Minimizes the window, requests attention for 3s and then resets it"),a(qt,"class","button")},m(y,L){O(y,t,L),r(t,n);for(let V=0;V<Z.length;V+=1)Z[V].m(n,null);Xe(n,e[0]),r(t,i),r(t,o),r(o,l),r(l,s),s.checked=e[2],r(l,c),r(o,p),r(o,h),r(h,f),f.checked=e[3],r(h,M),r(o,m),r(o,d),r(o,b),r(o,k),r(o,w),r(o,P),r(o,C),r(o,j),r(j,F),F.checked=e[16],r(j,H),r(o,A),r(o,U),r(U,N),N.checked=e[4],r(U,tt),r(o,ut),r(o,$),r($,B),B.checked=e[5],r($,R),r(o,nt),r(o,D),r(D,Q),Q.checked=e[6],r(D,_e),r(o,ge),r(o,At),r(t,be),r(t,Jt),r(Jt,et),r(et,ft),r(ft,Lt),r(Lt,we),r(Lt,it),E(it,e[13]),r(ft,ye),r(ft,Et),r(Et,Me),r(Et,ot),E(ot,e[14]),r(et,ke),r(et,pt),r(pt,Dt),r(Dt,ze),r(Dt,rt),E(rt,e[7]),r(pt,Te),r(pt,Rt),r(Rt,Ce),r(Rt,lt),E(lt,e[8]),r(et,Se),r(et,q),r(q,Ct),r(Ct,qn),r(Ct,ht),E(ht,e[9]),r(q,Nn),r(q,Pe),r(Pe,Bn),r(Pe,mt),E(mt,e[10]),r(et,Gn),r(et,jt),r(jt,Oe),r(Oe,Vn),r(Oe,at),E(at,e[11]),r(jt,Jn),r(jt,We),r(We,$n),r(We,ct),E(ct,e[12]),O(y,Ze,L),O(y,st,L),r(st,Ft),r(Ft,vt),r(vt,xe),r(vt,Kn),r(vt,$t),r($t,Xn),r($t,tn),r(vt,Yn),r(vt,Kt),r(Kt,Qn),r(Kt,en),r(Ft,Zn),r(Ft,_t),r(_t,nn),r(_t,xn),r(_t,Xt),r(Xt,ti),r(Xt,on),r(_t,ei),r(_t,Yt),r(Yt,ni),r(Yt,rn),r(st,ii),r(st,Ht),r(Ht,gt),r(gt,ln),r(gt,oi),r(gt,Qt),r(Qt,ri),r(Qt,sn),r(gt,li),r(gt,Zt),r(Zt,si),r(Zt,un),r(Ht,ui),r(Ht,bt),r(bt,an),r(bt,ai),r(bt,xt),r(xt,ci),r(xt,cn),r(bt,di),r(bt,te),r(te,fi),r(te,dn),r(st,pi),r(st,Ut),r(Ut,wt),r(wt,fn),r(wt,hi),r(wt,ee),r(ee,mi),r(ee,pn),r(wt,vi),r(wt,ne),r(ne,_i),r(ne,hn),r(Ut,gi),r(Ut,yt),r(yt,mn),r(yt,bi),r(yt,ie),r(ie,wi),r(ie,vn),r(yt,yi),r(yt,oe),r(oe,Mi),r(oe,_n),r(st,ki),r(st,It),r(It,Mt),r(Mt,gn),r(Mt,zi),r(Mt,re),r(re,Ti),r(re,bn),r(Mt,Ci),r(Mt,le),r(le,Si),r(le,wn),r(It,Pi),r(It,kt),r(kt,yn),r(kt,Oi),r(kt,se),r(se,Wi),r(se,Mn),r(kt,Ai),r(kt,ue),r(ue,Li),r(ue,kn),O(y,zn,L),O(y,zt,L),r(zt,St),E(St,e[22]),r(zt,Ei),r(zt,ae),O(y,Tn,L),O(y,Tt,L),r(Tt,Pt),E(Pt,e[15]),r(Tt,Di),r(Tt,ce),O(y,Cn,L),O(y,Ot,L),O(y,Sn,L),O(y,qt,L),Pn||(Ri=[T(n,"change",e[31]),T(s,"change",e[32]),T(f,"change",e[33]),T(d,"click",e[34]),T(k,"click",e[26]),T(P,"click",e[25]),T(F,"change",e[35]),T(N,"change",e[36]),T(B,"change",e[37]),T(Q,"change",e[38]),T(At,"click",e[27]),T(it,"input",e[39]),T(ot,"input",e[40]),T(rt,"input",e[41]),T(lt,"input",e[42]),T(ht,"input",e[43]),T(mt,"input",e[44]),T(at,"input",e[45]),T(ct,"input",e[46]),T(St,"input",e[47]),T(zt,"submit",Ke(e[24])),T(Pt,"input",e[48]),T(Tt,"submit",Ke(e[23])),T(Ot,"click",e[29]),T(qt,"click",e[28])],Pn=!0)},p(y,L){if(L[0]&2){Nt=Object.keys(y[1]);let V;for(V=0;V<Nt.length;V+=1){const ji=ko(y,Nt,V);Z[V]?Z[V].p(ji,L):(Z[V]=zo(ji),Z[V].c(),Z[V].m(n,null))}for(;V<Z.length;V+=1)Z[V].d(1);Z.length=Nt.length}L[0]&3&&Xe(n,y[0]),L[0]&4&&(s.checked=y[2]),L[0]&8&&(f.checked=y[3]),L[0]&65536&&(F.checked=y[16]),L[0]&16&&(N.checked=y[4]),L[0]&32&&(B.checked=y[5]),L[0]&64&&(Q.checked=y[6]),L[0]&8192&&J(it.value)!==y[13]&&E(it,y[13]),L[0]&16384&&J(ot.value)!==y[14]&&E(ot,y[14]),L[0]&128&&J(rt.value)!==y[7]&&E(rt,y[7]),L[0]&256&&J(lt.value)!==y[8]&&E(lt,y[8]),L[0]&512&&J(ht.value)!==y[9]&&E(ht,y[9]),L[0]&1024&&J(mt.value)!==y[10]&&E(mt,y[10]),L[0]&2048&&J(at.value)!==y[11]&&E(at,y[11]),L[0]&4096&&J(ct.value)!==y[12]&&E(ct,y[12]),L[0]&1048576&&Ae!==(Ae=y[20].width+"")&&G(tn,Ae),L[0]&1048576&&Le!==(Le=y[20].height+"")&&G(en,Le),L[0]&2097152&&Ee!==(Ee=y[21].width+"")&&G(on,Ee),L[0]&2097152&&De!==(De=y[21].height+"")&&G(rn,De),L[0]&1179648&&Re!==(Re=y[20].toLogical(y[17]).width+"")&&G(sn,Re),L[0]&1179648&&je!==(je=y[20].toLogical(y[17]).height+"")&&G(un,je),L[0]&2228224&&Fe!==(Fe=y[21].toLogical(y[17]).width+"")&&G(cn,Fe),L[0]&2228224&&He!==(He=y[21].toLogical(y[17]).height+"")&&G(dn,He),L[0]&262144&&Ue!==(Ue=y[18].x+"")&&G(pn,Ue),L[0]&262144&&Ie!==(Ie=y[18].y+"")&&G(hn,Ie),L[0]&524288&&qe!==(qe=y[19].x+"")&&G(vn,qe),L[0]&524288&&Ne!==(Ne=y[19].y+"")&&G(_n,Ne),L[0]&393216&&Be!==(Be=y[18].toLogical(y[17]).x+"")&&G(bn,Be),L[0]&393216&&Ge!==(Ge=y[18].toLogical(y[17]).y+"")&&G(wn,Ge),L[0]&655360&&Ve!==(Ve=y[19].toLogical(y[17]).x+"")&&G(Mn,Ve),L[0]&655360&&Je!==(Je=y[19].toLogical(y[17]).y+"")&&G(kn,Je),L[0]&4194304&&St.value!==y[22]&&E(St,y[22]),L[0]&32768&&Pt.value!==y[15]&&E(Pt,y[15])},i:I,o:I,d(y){y&&W(t),de(Z,y),y&&W(Ze),y&&W(st),y&&W(zn),y&&W(zt),y&&W(Tn),y&&W(Tt),y&&W(Cn),y&&W(Ot),y&&W(Sn),y&&W(qt),Pn=!1,x(Ri)}}}function Ur(e,t,n){let i=In.label;const o={[i]:In};let{onMessage:l}=t,s="https://tauri.studio",c=!0,p=!1,h=!1,f=!0,M=!1,m=!1,d=900,b=700,k=600,w=600,P=null,C=null,j=100,F=100,H=1,A=new Vt(j,F),U=new Vt(j,F),N=new Gt(d,b),tt=new Gt(d,b),ut,$,B="Awesome Tauri Example!";function R(){Ln(s)}function nt(){o[i].setTitle(B)}function D(){o[i].hide(),setTimeout(o[i].show,2e3)}function Q(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function _e(){Rn({multiple:!1}).then(q=>{typeof q=="string"&&o[i].setIcon(q)})}function ge(){const q=Math.random().toString().replace(".",""),Ct=new ve(q);n(1,o[q]=Ct,o),Ct.once("tauri://error",function(){l("Error creating new webview")})}function At(){o[i].innerSize().then(q=>{n(20,N=q),n(7,d=N.width),n(8,b=N.height)}),o[i].outerSize().then(q=>{n(21,tt=q)})}function be(){o[i].innerPosition().then(q=>{n(18,A=q)}),o[i].outerPosition().then(q=>{n(19,U=q),n(13,j=U.x),n(14,F=U.y)})}async function Jt(q){ut&&ut(),$&&$(),$=await q.listen("tauri://move",be),ut=await q.listen("tauri://resize",At)}async function et(){await o[i].minimize(),await o[i].requestUserAttention(me.Critical),await new Promise(q=>setTimeout(q,3e3)),await o[i].requestUserAttention(null)}function ft(){i=Ni(this),n(0,i),n(1,o)}function Lt(){c=this.checked,n(2,c)}function we(){p=this.checked,n(3,p)}const it=()=>o[i].center();function ye(){h=this.checked,n(16,h)}function Et(){f=this.checked,n(4,f)}function Me(){M=this.checked,n(5,M)}function ot(){m=this.checked,n(6,m)}function ke(){j=J(this.value),n(13,j)}function pt(){F=J(this.value),n(14,F)}function Dt(){d=J(this.value),n(7,d)}function ze(){b=J(this.value),n(8,b)}function rt(){k=J(this.value),n(9,k)}function Te(){w=J(this.value),n(10,w)}function Rt(){P=J(this.value),n(11,P)}function Ce(){C=J(this.value),n(12,C)}function lt(){B=this.value,n(22,B)}function Se(){s=this.value,n(15,s)}return e.$$set=q=>{"onMessage"in q&&n(30,l=q.onMessage)},e.$$.update=()=>{e.$$.dirty[0]&7&&o[i].setResizable(c),e.$$.dirty[0]&11&&(p?o[i].maximize():o[i].unmaximize()),e.$$.dirty[0]&19&&o[i].setDecorations(f),e.$$.dirty[0]&35&&o[i].setAlwaysOnTop(M),e.$$.dirty[0]&67&&o[i].setFullscreen(m),e.$$.dirty[0]&387&&o[i].setSize(new Gt(d,b)),e.$$.dirty[0]&1539&&(k&&w?o[i].setMinSize(new Qe(k,w)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(P&&C?o[i].setMaxSize(new Qe(P,C)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Vt(j,F)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(q=>n(17,H=q)),e.$$.dirty[0]&3&&Jt(o[i])},[i,o,c,p,f,M,m,d,b,k,w,P,C,j,F,s,h,H,A,U,N,tt,B,R,nt,D,Q,_e,ge,et,l,ft,Lt,we,it,ye,Et,Me,ot,ke,pt,Dt,ze,rt,Te,Rt,Ce,lt,Se]}class Ir extends K{constructor(t){super();X(this,t,Ur,Hr,Y,{onMessage:30},[-1,-1])}}function To(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:Wt(t)}})]})})}function qr(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:Wt(t)}})]})})}function Nr(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]})})}function Co(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]})})}function So(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:To,registerAll:qr,isRegistered:Nr,unregister:Co,unregisterAll:So});function Po(e,t,n){const i=e.slice();return i[9]=t[n],i}function Oo(e){let t,n=e[9]+"",i,o,l,s,c;function p(){return e[8](e[9])}return{c(){t=u("div"),i=S(n),o=v(),l=u("button"),l.textContent="Unregister",a(l,"type","button")},m(h,f){O(h,t,f),r(t,i),r(t,o),r(t,l),s||(c=T(l,"click",p),s=!0)},p(h,f){e=h,f&2&&n!==(n=e[9]+"")&&G(i,n)},d(h){h&&W(t),s=!1,c()}}}function Wo(e){let t,n,i;return{c(){t=u("button"),t.textContent="Unregister all",a(t,"type","button")},m(o,l){O(o,t,l),n||(i=T(t,"click",e[5]),n=!0)},p:I,d(o){o&&W(t),n=!1,i()}}}function Br(e){let t,n,i,o,l,s,c,p,h,f,M=e[1],m=[];for(let b=0;b<M.length;b+=1)m[b]=Oo(Po(e,M,b));let d=e[1].length&&Wo(e);return{c(){t=u("div"),n=u("div"),i=u("input"),o=v(),l=u("button"),l.textContent="Register",s=v(),c=u("div");for(let b=0;b<m.length;b+=1)m[b].c();p=v(),d&&d.c(),a(i,"placeholder","Type a shortcut with '+' as separator..."),a(l,"type","button")},m(b,k){O(b,t,k),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(t,s),r(t,c);for(let w=0;w<m.length;w+=1)m[w].m(c,null);r(c,p),d&&d.m(c,null),h||(f=[T(i,"input",e[7]),T(l,"click",e[3])],h=!0)},p(b,[k]){if(k&1&&i.value!==b[0]&&E(i,b[0]),k&18){M=b[1];let w;for(w=0;w<M.length;w+=1){const P=Po(b,M,w);m[w]?m[w].p(P,k):(m[w]=Oo(P),m[w].c(),m[w].m(c,p))}for(;w<m.length;w+=1)m[w].d(1);m.length=M.length}b[1].length?d?d.p(b,k):(d=Wo(b),d.c(),d.m(c,null)):d&&(d.d(1),d=null)},i:I,o:I,d(b){b&&W(t),de(m,b),d&&d.d(),h=!1,x(f)}}}function Gr(e,t,n){let i,{onMessage:o}=t;const l=Gi([]);Bi(e,l,m=>n(1,i=m));let s="CmdOrControl+X";function c(){const m=s;To(m,()=>{o(`Shortcut ${m} triggered`)}).then(()=>{l.update(d=>[...d,m]),o(`Shortcut ${m} registered successfully`)}).catch(o)}function p(m){const d=m;Co(d).then(()=>{l.update(b=>b.filter(k=>k!==d)),o(`Shortcut ${d} unregistered`)}).catch(o)}function h(){So().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function f(){s=this.value,n(0,s)}const M=m=>p(m);return e.$$set=m=>{"onMessage"in m&&n(6,o=m.onMessage)},[s,i,l,c,p,h,o,f,M]}class Vr extends K{constructor(t){super();X(this,t,Gr,Br,Y,{onMessage:6})}}function Ao(e){let t,n,i,o,l;return{c(){t=u("input"),n=v(),i=u("button"),i.textContent="Write",a(t,"placeholder","write to stdin"),a(i,"class","button")},m(s,c){O(s,t,c),E(t,e[3]),O(s,n,c),O(s,i,c),o||(l=[T(t,"input",e[10]),T(i,"click",e[7])],o=!0)},p(s,c){c&8&&t.value!==s[3]&&E(t,s[3])},d(s){s&&W(t),s&&W(n),s&&W(i),o=!1,x(l)}}}function Jr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w=e[4]&&Ao(e);return{c(){t=u("div"),n=u("div"),i=u("input"),o=v(),l=u("button"),l.textContent="Run",s=v(),c=u("button"),c.textContent="Kill",p=v(),w&&w.c(),h=v(),f=u("div"),M=u("input"),m=v(),d=u("input"),a(l,"class","button"),a(c,"class","button"),a(M,"placeholder","Working directory"),a(d,"class","env-vars svelte-1g38c1n"),a(d,"placeholder","Environment variables")},m(P,C){O(P,t,C),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(n,s),r(n,c),r(n,p),w&&w.m(n,null),r(t,h),r(t,f),r(f,M),E(M,e[1]),r(f,m),r(f,d),E(d,e[2]),b||(k=[T(i,"input",e[9]),T(l,"click",e[5]),T(c,"click",e[6]),T(M,"input",e[11]),T(d,"input",e[12])],b=!0)},p(P,[C]){C&1&&i.value!==P[0]&&E(i,P[0]),P[4]?w?w.p(P,C):(w=Ao(P),w.c(),w.m(n,null)):w&&(w.d(1),w=null),C&2&&M.value!==P[1]&&E(M,P[1]),C&4&&d.value!==P[2]&&E(d,P[2])},i:I,o:I,d(P){P&&W(t),w&&w.d(),b=!1,x(k)}}}function $r(e,t,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:s}=t,c='echo "hello world"',p=null,h="SOMETHING=value ANOTHER=2",f="",M;function m(){return h.split(" ").reduce((F,H)=>{let[A,U]=H.split("=");return Ii(Ui({},F),{[A]:U})},{})}function d(){n(4,M=null);const F=new to(o,[...l,c],{cwd:p||null,env:m()});F.on("close",H=>{s(`command finished with code ${H.code} and signal ${H.signal}`),n(4,M=null)}),F.on("error",H=>s(`command error: "${H}"`)),F.stdout.on("data",H=>s(`command stdout: "${H}"`)),F.stderr.on("data",H=>s(`command stderr: "${H}"`)),F.spawn().then(H=>{n(4,M=H)}).catch(s)}function b(){M.kill().then(()=>s("killed child process")).catch(s)}function k(){M.write(f).catch(s)}function w(){c=this.value,n(0,c)}function P(){f=this.value,n(3,f)}function C(){p=this.value,n(1,p)}function j(){h=this.value,n(2,h)}return e.$$set=F=>{"onMessage"in F&&n(8,s=F.onMessage)},[c,p,h,f,M,d,b,k,s,w,P,C,j]}class Kr extends K{constructor(t){super();X(this,t,$r,Jr,Y,{onMessage:8})}}function Lo(){return _(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return g(this,function(n){return[2,new Promise(function(i,o){pe("tauri://update-status",function(l){var s;(s=l==null?void 0:l.payload).error?(e(),o(s.error)):s.status==="DONE"&&(e(),i())}).then(function(l){t=l}).catch(function(l){throw e(),l}),Ye("tauri://update-install").catch(function(l){throw e(),l})})]})})}function Eo(){return _(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return g(this,function(n){return[2,new Promise(function(i,o){ao("tauri://update-available",function(l){var s;s=l==null?void 0:l.payload,e(),i({manifest:s,shouldUpdate:!0})}).catch(function(l){throw e(),l}),pe("tauri://update-status",function(l){var s;(s=l==null?void 0:l.payload).error?(e(),o(s.error)):s.status==="UPTODATE"&&(e(),i({shouldUpdate:!1}))}).then(function(l){t=l}).catch(function(l){throw e(),l}),Ye("tauri://update").catch(function(l){throw e(),l})})]})})}Object.freeze({__proto__:null,installUpdate:Lo,checkUpdate:Eo});function Xr(e){let t,n,i,o,l,s;return{c(){t=u("div"),n=u("button"),n.textContent="Check update",i=v(),o=u("button"),o.textContent="Install update",a(n,"class","button"),a(n,"id","check_update"),a(o,"class","button hidden"),a(o,"id","start_update")},m(c,p){O(c,t,p),r(t,n),r(t,i),r(t,o),l||(s=[T(n,"click",e[0]),T(o,"click",e[1])],l=!0)},p:I,i:I,o:I,d(c){c&&W(t),l=!1,x(s)}}}function Yr(e,t,n){let{onMessage:i}=t,o;$e(async()=>{o=await pe("tauri://update-status",i)}),On(()=>{o&&o()});async function l(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:p}=await Eo();i(`Should update: ${c}`),i(p),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function s(){try{document.getElementById("start_update").classList.add("hidden"),await Lo(),i("Installation complete, restart required."),await En()}catch(c){i(c)}}return e.$$set=c=>{"onMessage"in c&&n(2,i=c.onMessage)},[l,s,i]}class Qr extends K{constructor(t){super();X(this,t,Yr,Xr,Y,{onMessage:2})}}function Do(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})]})})}function Ro(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:Do,readText:Ro});function Zr(e){let t,n,i,o,l,s,c,p,h;return{c(){t=u("div"),n=u("div"),i=u("input"),o=v(),l=u("button"),l.textContent="Write",s=v(),c=u("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(l,"type","button"),a(c,"type","button")},m(f,M){O(f,t,M),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(t,s),r(t,c),p||(h=[T(i,"input",e[4]),T(l,"click",e[1]),T(c,"click",e[2])],p=!0)},p(f,[M]){M&1&&i.value!==f[0]&&E(i,f[0])},i:I,o:I,d(f){f&&W(t),p=!1,x(h)}}}function xr(e,t,n){let{onMessage:i}=t,o="clipboard message";function l(){Do(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function s(){Ro().then(p=>{i(`Clipboard contents: ${p}`)}).catch(i)}function c(){o=this.value,n(0,o)}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[o,l,s,i,c]}class tl extends K{constructor(t){super();X(this,t,xr,Zr,Y,{onMessage:3})}}function el(e){let t;return{c(){t=u("div"),t.innerHTML=`<div class="alert"><p>Not available for Linux</p></div>
|
|
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`},m(n,i){O(n,t,i)},p:I,i:I,o:I,d(n){n&&W(t)}}}function nl(e,t,n){let{onMessage:i}=t;const o=window.constraints={audio:!0,video:!0};function l(c){const p=document.querySelector("video"),h=c.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${h[0].label}`),window.stream=c,p.srcObject=c}function s(c){if(c.name==="ConstraintNotSatisfiedError"){const p=o.video;i(`The resolution ${p.width.exact}x${p.height.exact} px is not supported by your device.`)}else c.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: ${c.name}`,c)}return $e(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(o);l(c)}catch(c){s(c)}}),On(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class il extends K{constructor(t){super();X(this,t,nl,el,Y,{onMessage:0})}}function ol(e){let t,n,i,o,l,s,c,p,h,f,M,m;return{c(){t=u("input"),n=v(),i=u("input"),o=v(),l=u("button"),l.textContent="Post it.",s=v(),c=u("p"),c.textContent="Result:",p=v(),h=u("pre"),f=S(e[2]),a(l,"type","button")},m(d,b){O(d,t,b),E(t,e[0]),O(d,n,b),O(d,i,b),E(i,e[1]),O(d,o,b),O(d,l,b),O(d,s,b),O(d,c,b),O(d,p,b),O(d,h,b),r(h,f),M||(m=[T(t,"input",e[4]),T(i,"input",e[5]),T(l,"click",e[3])],M=!0)},p(d,[b]){b&1&&t.value!==d[0]&&E(t,d[0]),b&2&&i.value!==d[1]&&E(i,d[1]),b&4&&G(f,d[2])},i:I,o:I,d(d){d&&W(t),d&&W(n),d&&W(i),d&&W(o),d&&W(l),d&&W(s),d&&W(c),d&&W(p),d&&W(h),M=!1,x(m)}}}function rl(e,t,n){let i="baz",o="qux",l=null;async function s(){let h=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const M=await(await fetch(h,{method:"POST",body:JSON.stringify({foo:i,bar:o})})).json();n(2,l=JSON.stringify(M))}function c(){i=this.value,n(0,i)}function p(){o=this.value,n(1,o)}return[i,o,l,s,c,p]}class ll extends K{constructor(t){super();X(this,t,rl,ol,Y,{})}}function jo(e,t,n){const i=e.slice();return i[10]=t[n],i}function Fo(e,t,n){const i=e.slice();return i[13]=t[n],i}function Ho(e){let t,n=e[13].label+"",i,o,l,s,c;function p(){return e[9](e[13])}return{c(){t=u("p"),i=S(n),o=v(),a(t,"class",l="nv noselect "+(e[0]===e[13]?"nv_selected":""))},m(h,f){O(h,t,f),r(t,i),r(t,o),s||(c=T(t,"click",p),s=!0)},p(h,f){e=h,f&1&&l!==(l="nv noselect "+(e[0]===e[13]?"nv_selected":""))&&a(t,"class",l)},d(h){h&&W(t),s=!1,c()}}}function sl(e){let t,n=e[10].html+"",i;return{c(){i=Vi(),t=new Xo(i)},m(o,l){t.m(n,o,l),O(o,i,l)},p(o,l){l&2&&n!==(n=o[10].html+"")&&t.p(n)},d(o){o&&W(i),o&&t.d()}}}function ul(e){let t,n=e[10].text+"",i;return{c(){t=u("p"),i=S(n)},m(o,l){O(o,t,l),r(t,i)},p(o,l){l&2&&n!==(n=o[10].text+"")&&G(i,n)},d(o){o&&W(t)}}}function Uo(e){let t;function n(l,s){return l[10].text?ul:sl}let i=n(e),o=i(e);return{c(){o.c(),t=Vi()},m(l,s){o.m(l,s),O(l,t,s)},p(l,s){i===(i=n(l))&&o?o.p(l,s):(o.d(1),o=i(l),o&&(o.c(),o.m(t.parentNode,t)))},d(l){o.d(l),l&&W(t)}}}function al(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P,C,j,F,H,A,U=e[2],N=[];for(let R=0;R<U.length;R+=1)N[R]=Ho(Fo(e,U,R));var tt=e[0].component;function ut(R){return{props:{onMessage:R[5],insecureRenderHtml:R[6]}}}tt&&(m=new tt(ut(e)));let $=e[1],B=[];for(let R=0;R<$.length;R+=1)B[R]=Uo(jo(e,$,R));return{c(){t=u("main"),n=u("div"),i=u("img"),l=v(),s=u("div"),s.innerHTML=`<a class="dark-link" target="_blank" href="https://tauri.studio/en/docs/get-started/intro">Documentation</a>
|
|
<a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri">Github</a>
|
|
<a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri/tree/dev/tauri/examples/api">Source</a>`,c=v(),p=u("div"),h=u("div");for(let R=0;R<N.length;R+=1)N[R].c();f=v(),M=u("div"),m&&Ji(m.$$.fragment),d=v(),b=u("div"),k=u("p"),w=u("strong"),w.textContent="Tauri Console",P=v(),C=u("span"),C.textContent="clear",j=v();for(let R=0;R<B.length;R+=1)B[R].c();a(i,"class","logo"),i.src!==(o="tauri logo.png")&&a(i,"src",o),a(i,"height","60"),a(i,"alt","logo"),a(n,"class","flex row noselect just-around container svelte-1fam3xt"),a(n,"data-tauri-drag-region",""),a(h,"class","view-container svelte-1fam3xt"),a(M,"class","content"),a(p,"class","flex row"),a(C,"class","nv"),a(k,"class","flex row just-around"),a(b,"id","response"),a(b,"class","svelte-1fam3xt")},m(R,nt){O(R,t,nt),r(t,n),r(n,i),r(n,l),r(n,s),r(t,c),r(t,p),r(p,h);for(let D=0;D<N.length;D+=1)N[D].m(h,null);r(p,f),r(p,M),m&&$i(m,M,null),r(t,d),r(t,b),r(b,k),r(k,w),r(k,P),r(k,C),r(b,j);for(let D=0;D<B.length;D+=1)B[D].m(b,null);F=!0,H||(A=[T(i,"click",e[8]),T(C,"click",e[7])],H=!0)},p(R,[nt]){if(nt&21){U=R[2];let D;for(D=0;D<U.length;D+=1){const Q=Fo(R,U,D);N[D]?N[D].p(Q,nt):(N[D]=Ho(Q),N[D].c(),N[D].m(h,null))}for(;D<N.length;D+=1)N[D].d(1);N.length=U.length}if(tt!==(tt=R[0].component)){if(m){$o();const D=m;Ki(D.$$.fragment,1,0,()=>{Yi(D,1)}),Jo()}tt?(m=new tt(ut(R)),Ji(m.$$.fragment),Xi(m.$$.fragment,1),$i(m,M,null)):m=null}if(nt&2){$=R[1];let D;for(D=0;D<$.length;D+=1){const Q=jo(R,$,D);B[D]?B[D].p(Q,nt):(B[D]=Uo(Q),B[D].c(),B[D].m(b,null))}for(;D<B.length;D+=1)B[D].d(1);B.length=$.length}},i(R){F||(m&&Xi(m.$$.fragment,R),F=!0)},o(R){m&&Ki(m.$$.fragment,R),F=!1},d(R){R&&W(t),de(N,R),m&&Yi(m),de(B,R),H=!1,x(A)}}}const cl="ctrl+b";function dl(e,t,n){let i;$e(()=>{Ko(cl,()=>{fe("menu_toggle")})});const o=[{label:"Welcome",component:tr},{label:"Messages",component:lr},{label:"CLI",component:ir},{label:"Dialog",component:yr},{label:"File system",component:Tr},{label:"HTTP",component:Or},{label:"HTTP Form",component:ll},{label:"Notifications",component:Er},{label:"Window",component:Ir},{label:"Shortcuts",component:Vr},{label:"Shell",component:Kr},{label:"Updater",component:Qr},{label:"Clipboard",component:tl},{label:"WebRTC",component:il}];let l=o[0],s=Gi([]);Bi(e,s,d=>n(1,i=d));function c(d){n(0,l=d)}function p(d){s.update(b=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof d=="string"?d:JSON.stringify(d))},...b])}function h(d){s.update(b=>[{html:d},...b])}function f(){s.update(()=>[])}function M(){Ln("https://tauri.studio/")}return[l,i,o,s,c,p,h,f,M,d=>c(d)]}class fl extends K{constructor(t){super();X(this,t,dl,al,Y,{})}}new fl({target:document.body});
|