tauri/examples/api/dist/assets/index.js

40 lines
66 KiB
JavaScript
Raw Normal View History

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=
`),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,functi
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)
<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});