mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 10:11:32 +03:00
41 lines
66 KiB
JavaScript
41 lines
66 KiB
JavaScript
var Io=Object.defineProperty,No=Object.defineProperties;var qo=Object.getOwnPropertyDescriptors;var Fi=Object.getOwnPropertySymbols;var Bo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable;var Ui=(e,t,n)=>t in e?Io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hi=(e,t)=>{for(var n in t||(t={}))Bo.call(t,n)&&Ui(e,n,t[n]);if(Fi)for(var n of Fi(t))Go.call(t,n)&&Ui(e,n,t[n]);return e},Ii=(e,t)=>No(e,qo(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 P,d as r,l as T,f as G,n as I,g as W,r as x,o as Ke,h as On,j as E,p as Xe,k as fe,m as Vo,q as Ni,u as Ye,v as qi,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 Ln(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 pe(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,t){return t===void 0&&(t="asset"),navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(e):"".concat(t,"://").concat(e)}Object.freeze({__proto__:null,transformCallback:Wt,invoke:pe,convertFileSrc:Zi});function z(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,pe("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 Qe=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 Qe,l.stderr=new Qe,l.program=n,l.args=typeof i=="string"?[i]:i,l.options=o!=null?o:{},l}return Ln(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}(Qe);function En(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,EventEmitter:Qe,open:En});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 Dn(){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:Dn});function Zo(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,A,C,j,F,U;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(),A=u("button"),A.textContent="Close application",C=v(),j=u("button"),j.textContent="Relaunch application",a(A,"class","button"),a(j,"class","button")},m(O,H){P(O,t,H),P(O,n,H),P(O,i,H),P(O,o,H),P(O,l,H),r(l,s),r(l,c),P(O,p,H),P(O,h,H),r(h,f),r(h,M),P(O,m,H),P(O,d,H),r(d,b),r(d,k),P(O,w,H),P(O,A,H),P(O,C,H),P(O,j,H),F||(U=[T(A,"click",e[3]),T(j,"click",e[4])],F=!0)},p(O,[H]){H&1&&G(c,O[0]),H&2&&G(M,O[1]),H&4&&G(k,O[2])},i:I,o:I,d(O){O&&W(t),O&&W(n),O&&W(i),O&&W(o),O&&W(l),O&&W(p),O&&W(h),O&&W(m),O&&W(d),O&&W(w),O&&W(A),O&&W(C),O&&W(j),F=!1,x(U)}}}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 Dn()}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){P(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,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})]})})}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 Rn(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(e,l)]})})}})]})})}function uo(e,t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,Rn(e,t,function(o){n(o),lo(e,o.id).catch(function(){})})]})})}function he(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,Rn(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 Ze(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:he,once:ao,emit:Ze});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){P(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;Ke(async()=>{o=await he("rust-event",i)}),On(()=>{o&&o()});function l(){pe("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function s(){pe("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Ze("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 jn(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:jn,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 Fn(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:Fn,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,A,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",A=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(U,O){P(U,t,O),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,A),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(U,[O]){O&1&&n.value!==U[0]&&E(n,U[0]),O&2&&o.value!==U[1]&&E(o,U[1]),O&4&&(c.checked=U[2]),O&8&&(m.checked=U[3])},i:I,o:I,d(U){U&&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(){jn({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,A=w.match(/\S+\.\S+$/g);Fn(w).then(function(C){A&&(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){P(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,A){P(w,t,A),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",Xe(e[3]))],m=!0)},p(w,[A]){if(A&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,A):(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}A&1&&l.value!==w[0]&&E(l,w[0])},i:I,o:I,d(w){w&&W(t),fe(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?Fn(l,d):fo(l,d)).then(function(k){if(m)if(l.includes(".png")||l.includes(".jpg"))kr(new Uint8Array(k),function(w){const A="data:image/png;base64,"+w;o('<img src="'+A+'"></img>')});else{const w=String.fromCharCode.apply(null,k);o('<textarea id="file-response"></textarea><button id="file-save">Save</button>'),setTimeout(()=>{const A=document.getElementById("file-response");A.value=w,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:l,contents:A.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 me;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(me||(me={}));var Un=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===me.JSON)&&(t.responseType=me.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 In=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 In!==null?[3,2]:[4,Hn()];case 1:In=i.sent(),i.label=2;case 2:return[2,In.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:Un,Client:_o,Response:vo,get ResponseType(){return me}});function Sr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,A;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&&Ni(()=>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){P(C,t,j),r(t,n),r(n,i),r(n,o),r(n,l),r(n,s),r(n,c),Ye(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||(A=[T(n,"change",e[5]),T(h,"input",e[6]),T(d,"input",e[7]),T(t,"submit",Xe(e[3]))],w=!0)},p(C,[j]){j&1&&Ye(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(A)}}}function Ar(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=Un.json(JSON.parse(l)):l!==""&&(b.body=Un.text(l)),M.request(b).then(s).catch(s)}function p(){i=qi(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 Pr extends K{constructor(t){super();X(this,t,Ar,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){P(o,t,l),n||(i=T(t,"click",Or),n=!0)},p:I,i:I,o:I,d(o){o&&W(t),n=!1,i()}}}function Or(){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 ve,xe=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 xe(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 Jt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function bo(){return window.__TAURI_METADATA__.__windows.map(function(e){return new Jt(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(ve||(ve={}));var _e,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,Rn(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 Ln(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===ve.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),Jt=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 Ln(t,e),t.getByLabel=function(n){return bo().some(function(i){return i.label===n})?new t(n,{skip:!0}):null},t}(Mo);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"}}}})]})})}"__TAURI_METADATA__"in window?_e=new Jt(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.`),_e=new Jt("main",{skip:!0}));Object.freeze({__proto__:null,WebviewWindow:Jt,WebviewWindowHandle:yo,WindowManager:Mo,getCurrent:Dr,getAll:bo,get appWindow(){return _e},LogicalSize:xe,PhysicalSize:Gt,LogicalPosition:go,PhysicalPosition:Vt,get UserAttentionType(){return ve},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){P(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 Ur(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,A,C,j,F,U,O,H,q,tt,ut,$,B,R,nt,D,Q,ge,be,Ot,we,$t,et,ft,Lt,ye,it,Me,Et,ke,ot,ze,pt,Dt,Te,rt,Ce,Rt,Se,lt,Ae,N,Ct,Nn,ht,qn,Pe,Bn,mt,Gn,jt,We,Vn,at,Jn,Oe,$n,ct,tn,st,Ft,vt,en,Kn,Kt,Xn,Le=e[20].width+"",nn,Yn,Xt,Qn,Ee=e[20].height+"",on,Zn,_t,rn,xn,Yt,ti,De=e[21].width+"",ln,ei,Qt,ni,Re=e[21].height+"",sn,ii,Ut,gt,un,oi,Zt,ri,je=e[20].toLogical(e[17]).width+"",an,li,xt,si,Fe=e[20].toLogical(e[17]).height+"",cn,ui,bt,dn,ai,te,ci,Ue=e[21].toLogical(e[17]).width+"",fn,di,ee,fi,He=e[21].toLogical(e[17]).height+"",pn,pi,Ht,wt,hn,hi,ne,mi,Ie=e[18].x+"",mn,vi,ie,_i,Ne=e[18].y+"",vn,gi,yt,_n,bi,oe,wi,qe=e[19].x+"",gn,yi,re,Mi,Be=e[19].y+"",bn,ki,It,Mt,wn,zi,le,Ti,Ge=e[18].toLogical(e[17]).x+"",yn,Ci,se,Si,Ve=e[18].toLogical(e[17]).y+"",Mn,Ai,kt,kn,Pi,ue,Wi,Je=e[19].toLogical(e[17]).x+"",zn,Oi,ae,Li,$e=e[19].toLogical(e[17]).y+"",Tn,Cn,zt,St,Ei,ce,Sn,Tt,At,Di,de,An,Pt,Pn,Nt,Wn,Ri,qt=Object.keys(e[1]),Z=[];for(let y=0;y<qt.length;y+=1)Z[y]=zo(ko(e,qt,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(),A=u("button"),A.textContent="Hide",C=v(),j=u("label"),F=u("input"),U=S(`
|
|
Transparent`),O=v(),H=u("label"),q=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"),ge=S(`
|
|
Fullscreen`),be=v(),Ot=u("button"),Ot.textContent="Change icon",we=v(),$t=u("div"),et=u("div"),ft=u("div"),Lt=u("div"),ye=S(`X
|
|
`),it=u("input"),Me=v(),Et=u("div"),ke=S(`Y
|
|
`),ot=u("input"),ze=v(),pt=u("div"),Dt=u("div"),Te=S(`Width
|
|
`),rt=u("input"),Ce=v(),Rt=u("div"),Se=S(`Height
|
|
`),lt=u("input"),Ae=v(),N=u("div"),Ct=u("div"),Nn=S(`Min width
|
|
`),ht=u("input"),qn=v(),Pe=u("div"),Bn=S(`Min height
|
|
`),mt=u("input"),Gn=v(),jt=u("div"),We=u("div"),Vn=S(`Max width
|
|
`),at=u("input"),Jn=v(),Oe=u("div"),$n=S(`Max height
|
|
`),ct=u("input"),tn=v(),st=u("div"),Ft=u("div"),vt=u("div"),en=u("div"),en.textContent="Inner Size",Kn=v(),Kt=u("span"),Xn=S("Width: "),nn=S(Le),Yn=v(),Xt=u("span"),Qn=S("Height: "),on=S(Ee),Zn=v(),_t=u("div"),rn=u("div"),rn.textContent="Outer Size",xn=v(),Yt=u("span"),ti=S("Width: "),ln=S(De),ei=v(),Qt=u("span"),ni=S("Height: "),sn=S(Re),ii=v(),Ut=u("div"),gt=u("div"),un=u("div"),un.textContent="Inner Logical Size",oi=v(),Zt=u("span"),ri=S("Width: "),an=S(je),li=v(),xt=u("span"),si=S("Height: "),cn=S(Fe),ui=v(),bt=u("div"),dn=u("div"),dn.textContent="Outer Logical Size",ai=v(),te=u("span"),ci=S("Width: "),fn=S(Ue),di=v(),ee=u("span"),fi=S("Height: "),pn=S(He),pi=v(),Ht=u("div"),wt=u("div"),hn=u("div"),hn.textContent="Inner Position",hi=v(),ne=u("span"),mi=S("x: "),mn=S(Ie),vi=v(),ie=u("span"),_i=S("y: "),vn=S(Ne),gi=v(),yt=u("div"),_n=u("div"),_n.textContent="Outer Position",bi=v(),oe=u("span"),wi=S("x: "),gn=S(qe),yi=v(),re=u("span"),Mi=S("y: "),bn=S(Be),ki=v(),It=u("div"),Mt=u("div"),wn=u("div"),wn.textContent="Inner Logical Position",zi=v(),le=u("span"),Ti=S("x: "),yn=S(Ge),Ci=v(),se=u("span"),Si=S("y: "),Mn=S(Ve),Ai=v(),kt=u("div"),kn=u("div"),kn.textContent="Outer Logical Position",Pi=v(),ue=u("span"),Wi=S("x: "),zn=S(Je),Oi=v(),ae=u("span"),Li=S("y: "),Tn=S($e),Cn=v(),zt=u("form"),St=u("input"),Ei=v(),ce=u("button"),ce.textContent="Set title",Sn=v(),Tt=u("form"),At=u("input"),Di=v(),de=u("button"),de.textContent="Open URL",An=v(),Pt=u("button"),Pt.textContent="Request attention",Pn=v(),Nt=u("button"),Nt.textContent="New window",a(n,"class","button"),e[0]===void 0&&Ni(()=>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(A,"title","Visible again after 2 seconds"),a(F,"type","checkbox"),a(q,"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(N,"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(Kt,"class","svelte-1tppwwz"),a(Xt,"class","svelte-1tppwwz"),a(vt,"class","grow window-property svelte-1tppwwz"),a(Yt,"class","svelte-1tppwwz"),a(Qt,"class","svelte-1tppwwz"),a(_t,"class","grow window-property svelte-1tppwwz"),a(Ft,"class","flex"),a(Zt,"class","svelte-1tppwwz"),a(xt,"class","svelte-1tppwwz"),a(gt,"class","grow window-property svelte-1tppwwz"),a(te,"class","svelte-1tppwwz"),a(ee,"class","svelte-1tppwwz"),a(bt,"class","grow window-property svelte-1tppwwz"),a(Ut,"class","flex"),a(ne,"class","svelte-1tppwwz"),a(ie,"class","svelte-1tppwwz"),a(wt,"class","grow window-property svelte-1tppwwz"),a(oe,"class","svelte-1tppwwz"),a(re,"class","svelte-1tppwwz"),a(yt,"class","grow window-property svelte-1tppwwz"),a(Ht,"class","flex"),a(le,"class","svelte-1tppwwz"),a(se,"class","svelte-1tppwwz"),a(Mt,"class","grow window-property svelte-1tppwwz"),a(ue,"class","svelte-1tppwwz"),a(ae,"class","svelte-1tppwwz"),a(kt,"class","grow window-property svelte-1tppwwz"),a(It,"class","flex"),a(St,"id","title"),a(ce,"class","button"),a(ce,"type","submit"),a(zt,"class","svelte-1tppwwz"),a(At,"id","url"),a(de,"class","button"),a(de,"id","open-url"),a(Tt,"class","svelte-1tppwwz"),a(Pt,"class","button"),a(Pt,"title","Minimizes the window, requests attention for 3s and then resets it"),a(Nt,"class","button")},m(y,L){P(y,t,L),r(t,n);for(let V=0;V<Z.length;V+=1)Z[V].m(n,null);Ye(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,A),r(o,C),r(o,j),r(j,F),F.checked=e[16],r(j,U),r(o,O),r(o,H),r(H,q),q.checked=e[4],r(H,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,ge),r(o,be),r(o,Ot),r(t,we),r(t,$t),r($t,et),r(et,ft),r(ft,Lt),r(Lt,ye),r(Lt,it),E(it,e[13]),r(ft,Me),r(ft,Et),r(Et,ke),r(Et,ot),E(ot,e[14]),r(et,ze),r(et,pt),r(pt,Dt),r(Dt,Te),r(Dt,rt),E(rt,e[7]),r(pt,Ce),r(pt,Rt),r(Rt,Se),r(Rt,lt),E(lt,e[8]),r(et,Ae),r(et,N),r(N,Ct),r(Ct,Nn),r(Ct,ht),E(ht,e[9]),r(N,qn),r(N,Pe),r(Pe,Bn),r(Pe,mt),E(mt,e[10]),r(et,Gn),r(et,jt),r(jt,We),r(We,Vn),r(We,at),E(at,e[11]),r(jt,Jn),r(jt,Oe),r(Oe,$n),r(Oe,ct),E(ct,e[12]),P(y,tn,L),P(y,st,L),r(st,Ft),r(Ft,vt),r(vt,en),r(vt,Kn),r(vt,Kt),r(Kt,Xn),r(Kt,nn),r(vt,Yn),r(vt,Xt),r(Xt,Qn),r(Xt,on),r(Ft,Zn),r(Ft,_t),r(_t,rn),r(_t,xn),r(_t,Yt),r(Yt,ti),r(Yt,ln),r(_t,ei),r(_t,Qt),r(Qt,ni),r(Qt,sn),r(st,ii),r(st,Ut),r(Ut,gt),r(gt,un),r(gt,oi),r(gt,Zt),r(Zt,ri),r(Zt,an),r(gt,li),r(gt,xt),r(xt,si),r(xt,cn),r(Ut,ui),r(Ut,bt),r(bt,dn),r(bt,ai),r(bt,te),r(te,ci),r(te,fn),r(bt,di),r(bt,ee),r(ee,fi),r(ee,pn),r(st,pi),r(st,Ht),r(Ht,wt),r(wt,hn),r(wt,hi),r(wt,ne),r(ne,mi),r(ne,mn),r(wt,vi),r(wt,ie),r(ie,_i),r(ie,vn),r(Ht,gi),r(Ht,yt),r(yt,_n),r(yt,bi),r(yt,oe),r(oe,wi),r(oe,gn),r(yt,yi),r(yt,re),r(re,Mi),r(re,bn),r(st,ki),r(st,It),r(It,Mt),r(Mt,wn),r(Mt,zi),r(Mt,le),r(le,Ti),r(le,yn),r(Mt,Ci),r(Mt,se),r(se,Si),r(se,Mn),r(It,Ai),r(It,kt),r(kt,kn),r(kt,Pi),r(kt,ue),r(ue,Wi),r(ue,zn),r(kt,Oi),r(kt,ae),r(ae,Li),r(ae,Tn),P(y,Cn,L),P(y,zt,L),r(zt,St),E(St,e[22]),r(zt,Ei),r(zt,ce),P(y,Sn,L),P(y,Tt,L),r(Tt,At),E(At,e[15]),r(Tt,Di),r(Tt,de),P(y,An,L),P(y,Pt,L),P(y,Pn,L),P(y,Nt,L),Wn||(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(A,"click",e[25]),T(F,"change",e[35]),T(q,"change",e[36]),T(B,"change",e[37]),T(Q,"change",e[38]),T(Ot,"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",Xe(e[24])),T(At,"input",e[48]),T(Tt,"submit",Xe(e[23])),T(Pt,"click",e[29]),T(Nt,"click",e[28])],Wn=!0)},p(y,L){if(L[0]&2){qt=Object.keys(y[1]);let V;for(V=0;V<qt.length;V+=1){const ji=ko(y,qt,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=qt.length}L[0]&3&&Ye(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&&(q.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&&Le!==(Le=y[20].width+"")&&G(nn,Le),L[0]&1048576&&Ee!==(Ee=y[20].height+"")&&G(on,Ee),L[0]&2097152&&De!==(De=y[21].width+"")&&G(ln,De),L[0]&2097152&&Re!==(Re=y[21].height+"")&&G(sn,Re),L[0]&1179648&&je!==(je=y[20].toLogical(y[17]).width+"")&&G(an,je),L[0]&1179648&&Fe!==(Fe=y[20].toLogical(y[17]).height+"")&&G(cn,Fe),L[0]&2228224&&Ue!==(Ue=y[21].toLogical(y[17]).width+"")&&G(fn,Ue),L[0]&2228224&&He!==(He=y[21].toLogical(y[17]).height+"")&&G(pn,He),L[0]&262144&&Ie!==(Ie=y[18].x+"")&&G(mn,Ie),L[0]&262144&&Ne!==(Ne=y[18].y+"")&&G(vn,Ne),L[0]&524288&&qe!==(qe=y[19].x+"")&&G(gn,qe),L[0]&524288&&Be!==(Be=y[19].y+"")&&G(bn,Be),L[0]&393216&&Ge!==(Ge=y[18].toLogical(y[17]).x+"")&&G(yn,Ge),L[0]&393216&&Ve!==(Ve=y[18].toLogical(y[17]).y+"")&&G(Mn,Ve),L[0]&655360&&Je!==(Je=y[19].toLogical(y[17]).x+"")&&G(zn,Je),L[0]&655360&&$e!==($e=y[19].toLogical(y[17]).y+"")&&G(Tn,$e),L[0]&4194304&&St.value!==y[22]&&E(St,y[22]),L[0]&32768&&At.value!==y[15]&&E(At,y[15])},i:I,o:I,d(y){y&&W(t),fe(Z,y),y&&W(tn),y&&W(st),y&&W(Cn),y&&W(zt),y&&W(Sn),y&&W(Tt),y&&W(An),y&&W(Pt),y&&W(Pn),y&&W(Nt),Wn=!1,x(Ri)}}}function Hr(e,t,n){let i=_e.label;const o={[i]:_e};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,A=null,C=null,j=100,F=100,U=1,O=new Vt(j,F),H=new Vt(j,F),q=new Gt(d,b),tt=new Gt(d,b),ut,$,B="Awesome Tauri Example!";function R(){En(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 ge(){jn({multiple:!1}).then(N=>{typeof N=="string"&&o[i].setIcon(N)})}function be(){const N=Math.random().toString().replace(".",""),Ct=new Jt(N);n(1,o[N]=Ct,o),Ct.once("tauri://error",function(){l("Error creating new webview")})}function Ot(){o[i].innerSize().then(N=>{n(20,q=N),n(7,d=q.width),n(8,b=q.height)}),o[i].outerSize().then(N=>{n(21,tt=N)})}function we(){o[i].innerPosition().then(N=>{n(18,O=N)}),o[i].outerPosition().then(N=>{n(19,H=N),n(13,j=H.x),n(14,F=H.y)})}async function $t(N){ut&&ut(),$&&$(),$=await N.listen("tauri://move",we),ut=await N.listen("tauri://resize",Ot)}async function et(){await o[i].minimize(),await o[i].requestUserAttention(ve.Critical),await new Promise(N=>setTimeout(N,3e3)),await o[i].requestUserAttention(null)}function ft(){i=qi(this),n(0,i),n(1,o)}function Lt(){c=this.checked,n(2,c)}function ye(){p=this.checked,n(3,p)}const it=()=>o[i].center();function Me(){h=this.checked,n(16,h)}function Et(){f=this.checked,n(4,f)}function ke(){M=this.checked,n(5,M)}function ot(){m=this.checked,n(6,m)}function ze(){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 Te(){b=J(this.value),n(8,b)}function rt(){k=J(this.value),n(9,k)}function Ce(){w=J(this.value),n(10,w)}function Rt(){A=J(this.value),n(11,A)}function Se(){C=J(this.value),n(12,C)}function lt(){B=this.value,n(22,B)}function Ae(){s=this.value,n(15,s)}return e.$$set=N=>{"onMessage"in N&&n(30,l=N.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 xe(k,w)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(A&&C?o[i].setMaxSize(new xe(A,C)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Vt(j,F)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(N=>n(17,U=N)),e.$$.dirty[0]&3&&$t(o[i])},[i,o,c,p,f,M,m,d,b,k,w,A,C,j,F,s,h,U,O,H,q,tt,B,R,nt,D,Q,ge,be,et,l,ft,Lt,ye,it,Me,Et,ke,ot,ze,pt,Dt,Te,rt,Ce,Rt,Se,lt,Ae]}class Ir extends K{constructor(t){super();X(this,t,Hr,Ur,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 Nr(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 qr(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:Nr,isRegistered:qr,unregister:Co,unregisterAll:So});function Ao(e,t,n){const i=e.slice();return i[9]=t[n],i}function Po(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){P(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){P(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]=Po(Ao(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){P(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 A=Ao(b,M,w);m[w]?m[w].p(A,k):(m[w]=Po(A),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),fe(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 Oo(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){P(s,t,c),E(t,e[3]),P(s,n,c),P(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]&&Oo(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(A,C){P(A,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(A,[C]){C&1&&i.value!==A[0]&&E(i,A[0]),A[4]?w?w.p(A,C):(w=Oo(A),w.c(),w.m(n,null)):w&&(w.d(1),w=null),C&2&&M.value!==A[1]&&E(M,A[1]),C&4&&d.value!==A[2]&&E(d,A[2])},i:I,o:I,d(A){A&&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,U)=>{let[O,H]=U.split("=");return Ii(Hi({},F),{[O]:H})},{})}function d(){n(4,M=null);const F=new to(o,[...l,c],{cwd:p||null,env:m()});F.on("close",U=>{s(`command finished with code ${U.code} and signal ${U.signal}`),n(4,M=null)}),F.on("error",U=>s(`command error: "${U}"`)),F.stdout.on("data",U=>s(`command stdout: "${U}"`)),F.stderr.on("data",U=>s(`command stderr: "${U}"`)),F.spawn().then(U=>{n(4,M=U)}).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 A(){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,A,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){he("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}),Ze("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}),he("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}),Ze("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){P(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;Ke(async()=>{o=await he("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 Dn()}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){P(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){P(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 Ke(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){P(d,t,b),E(t,e[0]),P(d,n,b),P(d,i,b),E(i,e[1]),P(d,o,b),P(d,l,b),P(d,s,b),P(d,c,b),P(d,p,b),P(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 Uo(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){P(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),P(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){P(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 Ho(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),P(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,A,C,j,F,U,O,H=e[2],q=[];for(let R=0;R<H.length;R+=1)q[R]=Uo(Fo(e,H,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]=Ho(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<q.length;R+=1)q[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",A=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){P(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<q.length;D+=1)q[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,A),r(k,C),r(b,j);for(let D=0;D<B.length;D+=1)B[D].m(b,null);F=!0,U||(O=[T(i,"click",e[8]),T(C,"click",e[7])],U=!0)},p(R,[nt]){if(nt&21){H=R[2];let D;for(D=0;D<H.length;D+=1){const Q=Fo(R,H,D);q[D]?q[D].p(Q,nt):(q[D]=Uo(Q),q[D].c(),q[D].m(h,null))}for(;D<q.length;D+=1)q[D].d(1);q.length=H.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]=Ho(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),fe(q,R),m&&Yi(m),fe(B,R),U=!1,x(O)}}}const cl="ctrl+b";function dl(e,t,n){let i;Ke(()=>{Ko(cl,()=>{pe("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:Pr},{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(){En("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});
|