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

40 lines
69 KiB
JavaScript
Raw Normal View History

var Eo=Object.defineProperty,Oo=Object.defineProperties;var Wo=Object.getOwnPropertyDescriptors;var ji=Object.getOwnPropertySymbols;var Ao=Object.prototype.hasOwnProperty,Ro=Object.prototype.propertyIsEnumerable;var Ii=(e,t,n)=>t in e?Eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qi=(e,t)=>{for(var n in t||(t={}))Ao.call(t,n)&&Ii(e,n,t[n]);if(ji)for(var n of ji(t))Ro.call(t,n)&&Ii(e,n,t[n]);return e},Ni=(e,t)=>Oo(e,Wo(t));import{S as X,i as Y,s as Q,e as c,a as g,t as S,b as d,c as z,d as l,l as T,f as $,n as q,g as E,r as tt,o as Je,h as En,j as A,p as Ve,k as de,m as Do,q as Fi,u as ft,v as Ke,w as Gi,x as V,y as Bi,z as $i,A as Ji,B as Vi,C as Ki,D as Xi,E as Ho,F as Yi,G as Qi,H as Uo,I as jo,J as Io}from"./vendor.js";const qo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const u of r.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&o(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerpolicy&&(r.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?r.credentials="include":i.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}};qo();/*! *****************************************************************************
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 Zi=function(e,t){return(Zi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])})(e,t)};function On(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}Zi(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Lt=function(){return(Lt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function k(e,t,n,o){return new(n||(n=Promise))(function(i,r){function u(f){try{p(o.next(f))}catch(s){r(s)}}function a(f){try{p(o.throw(f))}catch(s){r(s)}}function p(f){var s;f.done?i(f.value):(s=f.value,s instanceof n?s:new n(function(v){v(s)})).then(u,a)}p((o=o.apply(e,t||[])).next())})}function M(e,t){var n,o,i,r,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(p){return function(f){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,o=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(i=u.trys,!((i=i.length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){u=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(s[0]===6&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(e,u)}catch(v){s=[6,v],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([p,f])}}}var B=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Xe={},pt={},xi=B&&B.__assign||function(){return(xi=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},No=B&&B.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function u(f){try{p(o.next(f))}catch(s){r(s)}}function a(f){try{p(o.throw(f))}catch(s){r(s)}}function p(f){var s;f.done?i(f.value):(s=f.value,s instanceof n?s:new n(function(v){v(s)})).then(u,a)}p((o=o.apply(e,t||[])).next())})},Fo=B&&B.__generator||function(e,t){var n,o,i,r,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(p){return function(f){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,o=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(i=u.trys,!((i=i.length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){u=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(s[0]===6&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(e,u)}catch(v){s=[6,v],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([p,f])}}};function Wn(e,t){t===void 0&&(t=!1);var n=window.crypto.getRandomValues(new Uint32Array(1))[0],o="_".concat(n);return Object.defineProperty(window,o,{value:function(i){return t&&Reflect.deleteProperty(window,o),e==null?voi
`),stderr:a.join(`
`)})}),n.spawn().catch(r)})]})})},t}(An);function eo(e,t){return k(this,void 0,void 0,function(){return M(this,function(n){return[2,L({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})]})})}function no(e,t){t===void 0&&(t=!1);var n=window.crypto.getRandomValues(new Uint32Array(1))[0],o="_".concat(n);return Object.defineProperty(window,o,{value:function(i){return t&&Reflect.deleteProperty(window,o),e==null?void 0:e(i)},writable:!1,configurable:!0}),n}function Rn(e,t){return t===void 0&&(t={}),k(this,void 0,void 0,function(){return M(this,function(n){return[2,new Promise(function(o,i){var r=no(function(a){o(a),Reflect.deleteProperty(window,u)},!0),u=no(function(a){i(a),Reflect.deleteProperty(window,r)},!0);window.__TAURI_IPC__(Lt({cmd:e,callback:r,error:u},t))})]})})}function Xo(e){return navigator.userAgent.includes("Windows")?"https://asset.localhost/".concat(e):"asset://".concat(e)}function Yo(){return k(this,void 0,void 0,function(){return M(this,function(e){return[2,L({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function Qo(){return k(this,void 0,void 0,function(){return M(this,function(e){return[2,L({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function Zo(){return k(this,void 0,void 0,function(){return M(this,function(e){return[2,L({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}function xo(e){return e===void 0&&(e=0),k(this,void 0,void 0,function(){return M(this,function(t){return[2,L({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})]})})}function io(){return k(this,void 0,void 0,function(){return M(this,function(e){return[2,L({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}function tr(e){let t,n,o,i,r,u,a,p,f,s,v,m,h,_,w,b,P,C,H,U,j;return{c(){t=c("h1"),t.textContent="Welcome",n=g(),o=c("p"),o.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.",i=g(),r=c("p"),u=S("Current App version: "),a=S(e[0]),p=g(),f=c("p"),s=S("Current Tauri version: "),v=S(e[1]),m=g(),h=c("p"),_=S("Current App name: "),w=S(e[2]),b=g(),P=c("button"),P.textContent="Close application",C=g(),H=c("button"),H.textContent="Relaunch application",d(P,"class","button"),d(H,"class","button")},m(O,I){z(O,t,I),z(O,n,I),z(O,o,I),z(O,i,I),z(O,r,I),l(r,u),l(r,a),z(O,p,I),z(O,f,I),l(f,s),l(f,v),z(O,m,I),z(O,h,I),l(h,_),l(h,w),z(O,b,I),z(O,P,I),z(O,C,I),z(O,H,I),U||(j=[T(P,"click",e[3]),T(H,"click",e[4])],U=!0)},p(O,[I]){I&1&&$(a,O[0]),I&2&&$(v,O[1]),I&4&&$(w,O[2])},i:q,o:q,d(O){O&&E(t),O&&E(n),O&&E(o),O&&E(i),O&&E(r),O&&E(p),O&&E(f),O&&E(m),O&&E(h),O&&E(b),O&&E(P),O&&E(C),O&&E(H),U=!1,tt(j)}}}function er(e,t,n){let o=0,i=0,r="Unknown";Qo().then(p=>{n(2,r=p)}),Yo().then(p=>{n(0,o=p)}),Zo().then(p=>{n(1,i=p)});async function u(){await xo()}async function a(){await io()}return[o,i,r,u,a]}class nr extends X{constructor(t){super();Y(this,t,er,tr,Q,{})}}function ir(){return k(this,void 0,void 0,function(){return M(this,function(e){return[2,L({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}function or(e){let t,n,o,i,r,u,a,p,f,s,v;return{c(){t=c("div"),n=S(`This binary can be run on the terminal and takes the following arguments:
`),o=c("ul"),o.innerHTML=`<li>--config PATH</li>
<li>--theme light|dark|system</li>
<li>--verbose</li>`,i=S(`
Additionally, it has a `),r=c("i"),r.textContent="update --background",u=S(` subcommand.
Note that the arguments are only parsed, not implemented.
`),a=c("br"),p=g(),f=c("button"),f.textContent="Get matches",d(f,"class","button"),d(f,"id","cli-matches")},m(m,h){z(m,t,h),l(t,n),l(t,o),l(t,i),l(t,r),l(t,u),l(t,a),l(t,p),l(t,f),s||(v=T(f,"click",e[0]),s=!0)},p:q,i:q,o:q,d(m){m&&E(t),s=!1,v()}}}function rr(e,t,n){let{onMessage:o}=t;function i(){ir().then(o).catch(o)}return e.$$set=r=>{"onMessage"in r&&n(1,o=r.onMessage)},[i,o]}class lr extends X{constructor(t){super();Y(this,t,rr,or,Q,{onMessage:1})}}var zt={},fe=B&&B.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function u(f){try{p(o.next(f))}catch(s){r(s)}}function a(f){try{p(o.throw(f))}catch(s){r(s)}}function p(f){var s;f.done?i(f.value):(s=f.value,s instanceof n?s:new n(function(v){v(s)})).then(u,a)}p((o=o.apply(e,t||[])).next())})},pe=B&&B.__generator||function(e,t){var n,o,i,r,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(p){return function(f){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,o=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(i=u.trys,!((i=i.length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){u=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){u.label=s[1];break}if(s[0]===6&&u.label<i[1]){u.label=i[1],i=s;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(s);break}i[2]&&u.ops.pop(),u.trys.pop();continue}s=t.call(e,u)}catch(v){s=[6,v],o=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([p,f])}}};zt.__esModule=!0;var oo=zt.once=zt.listen=zt.emit=void 0,Dn=Xe,ur=pt;function ro(e){return fe(this,void 0,void 0,function(){return pe(this,function(t){return[2,(0,Dn.invokeTauriCommand)({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}var lo=zt.emit=function(e,t,n){return fe(this,void 0,void 0,function(){return pe(this,function(o){switch(o.label){case 0:return[4,(0,Dn.invokeTauriCommand)({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return o.sent(),[2]}})})};function uo(e,t,n){return fe(this,void 0,void 0,function(){var o=this;return pe(this,function(i){return[2,(0,Dn.invokeTauriCommand)({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:(0,ur.transformCallback)(n)}}).then(function(r){return function(){return fe(o,void 0,void 0,function(){return pe(this,function(u){return[2,ro(r)]})})}})]})})}var so=zt.listen=uo;oo=zt.once=function(e,t,n){return fe(this,void 0,void 0,function(){return pe(this,function(o){return[2,uo(e,t,function(i){n(i),ro(i.id).catch(function(){})})]})})};function ao(e,t){return k(this,void 0,void 0,function(){return M(this,function(n){return[2,so(e,null,t)]})})}function sr(e,t){return k(this,void 0,void 0,function(){return M(this,function(n){return[2,lo(e,void 0,t)]})})}function ar(e){let t,n,o,i,r,u,a,p;return{c(){t=c("div"),n=c("button"),n.textContent="Call Log API",o=g(),i=c("button"),i.textContent="Call Request (async) API",r=g(),u=c("button"),u.textContent="Send event to Rust",d(n,"class","button"),d(n,"id","log"),d(i,"class","button"),d(i,"id","request"),d(u,"class","button"),d(u,"id","event")},m(f,s){z(f,t,s),l(t,n),l(t,o),l(t,i),l(t,r),l(t,u),a||(p=[T(n,"click",e[0]),T(i,"click",e[1]),T(u,"click",e[2])],a=!0)},p:q,i:q,o:q,d(f){f&&E(t),a=!1,tt(p)}}}function cr(e,t,n){let{onMessage:o}=t,i;Je(async()=>{i=await ao("rust-event",o)}),En(()=>{i&&i()});function r(){Rn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){Rn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(o).catch(o)}function a(){sr("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in
Resizable`),p=g(),f=c("label"),s=c("input"),v=S(`
Maximize`),m=g(),h=c("button"),h.textContent="Center",_=g(),w=c("button"),w.textContent="Minimize",b=g(),P=c("button"),P.textContent="Hide",C=g(),H=c("label"),U=c("input"),j=S(`
Transparent`),O=g(),I=c("label"),F=c("input"),et=S(`
Has decorations`),at=g(),K=c("label"),G=c("input"),D=S(`
Always on top`),it=g(),R=c("label"),Z=c("input"),ve=S(`
Fullscreen`),ge=g(),Rt=c("button"),Rt.textContent="Change icon",_e=g(),Jt=c("div"),nt=c("div"),ht=c("div"),Dt=c("div"),be=S(`X
`),ot=c("input"),ye=g(),Ht=c("div"),we=S(`Y
`),rt=c("input"),ke=g(),mt=c("div"),Ut=c("div"),Me=S(`Width
`),lt=c("input"),Te=g(),jt=c("div"),Ce=S(`Height
`),ut=c("input"),Se=g(),N=c("div"),Et=c("div"),Fn=S(`Min width
`),vt=c("input"),Gn=g(),Pe=c("div"),Bn=S(`Min height
`),gt=c("input"),$n=g(),It=c("div"),Le=c("div"),Jn=S(`Max width
`),ct=c("input"),Vn=g(),ze=c("div"),Kn=S(`Max height
`),dt=c("input"),xe=g(),st=c("div"),qt=c("div"),_t=c("div"),tn=c("div"),tn.textContent="Inner Size",Xn=g(),Vt=c("span"),Yn=S("Width: "),en=S(Ee),Qn=g(),Kt=c("span"),Zn=S("Height: "),nn=S(Oe),xn=g(),bt=c("div"),on=c("div"),on.textContent="Outer Size",ti=g(),Xt=c("span"),ei=S("Width: "),rn=S(We),ni=g(),Yt=c("span"),ii=S("Height: "),ln=S(Ae),oi=g(),Nt=c("div"),yt=c("div"),un=c("div"),un.textContent="Inner Logical Size",ri=g(),Qt=c("span"),li=S("Width: "),sn=S(Re),ui=g(),Zt=c("span"),si=S("Height: "),an=S(De),ai=g(),wt=c("div"),cn=c("div"),cn.textContent="Outer Logical Size",ci=g(),xt=c("span"),di=S("Width: "),dn=S(He),fi=g(),te=c("span"),pi=S("Height: "),fn=S(Ue),hi=g(),Ft=c("div"),kt=c("div"),pn=c("div"),pn.textContent="Inner Position",mi=g(),ee=c("span"),vi=S("x: "),hn=S(je),gi=g(),ne=c("span"),_i=S("y: "),mn=S(Ie),bi=g(),Mt=c("div"),vn=c("div"),vn.textContent="Outer Position",yi=g(),ie=c("span"),wi=S("x: "),gn=S(qe),ki=g(),oe=c("span"),Mi=S("y: "),_n=S(Ne),Ti=g(),Gt=c("div"),Tt=c("div"),bn=c("div"),bn.textContent="Inner Logical Position",Ci=g(),re=c("span"),Si=S("x: "),yn=S(Fe),Pi=g(),le=c("span"),Li=S("y: "),wn=S(Ge),zi=g(),Ct=c("div"),kn=c("div"),kn.textContent="Outer Logical Position",Ei=g(),ue=c("span"),Oi=S("x: "),Mn=S(Be),Wi=g(),se=c("span"),Ai=S("y: "),Tn=S($e),Cn=g(),St=c("form"),Ot=c("input"),Ri=g(),ae=c("button"),ae.textContent="Set title",Sn=g(),Pt=c("form"),Wt=c("input"),Di=g(),ce=c("button"),ce.textContent="Open URL",Pn=g(),At=c("button"),At.textContent="Request attention",Ln=g(),Bt=c("button"),Bt.textContent="New window",d(n,"class","button"),e[0]===void 0&&Fi(()=>e[31].call(n)),d(u,"type","checkbox"),d(s,"type","checkbox"),d(h,"title","Unminimizes after 2 seconds"),d(w,"title","Unminimizes after 2 seconds"),d(P,"title","Visible again after 2 seconds"),d(U,"type","checkbox"),d(F,"type","checkbox"),d(G,"type","checkbox"),d(Z,"type","checkbox"),d(ot,"type","number"),d(ot,"min","0"),d(ot,"class","svelte-12ggtr4"),d(rt,"type","number"),d(rt,"min","0"),d(rt,"class","svelte-12ggtr4"),d(ht,"class","flex col grow svelte-12ggtr4"),d(lt,"type","number"),d(lt,"min","400"),d(lt,"class","svelte-12ggtr4"),d(ut,"type","number"),d(ut,"min","400"),d(ut,"class","svelte-12ggtr4"),d(mt,"class","flex col grow svelte-12ggtr4"),d(vt,"type","number"),d(vt,"class","svelte-12ggtr4"),d(gt,"type","number"),d(gt,"class","svelte-12ggtr4"),d(N,"class","flex col grow svelte-12ggtr4"),d(ct,"type","number"),d(ct,"min","400"),d(ct,"class","svelte-12ggtr4"),d(dt,"type","number"),d(dt,"min","400"),d(dt,"class","svelte-12ggtr4"),d(It,"class","flex col grow svelte-12ggtr4"),d(nt,"class","window-controls flex flex-row svelte-12ggtr4"),d(t,"class","flex col"),d(Vt,"class","svelte-12ggtr4"),d(Kt,"class","svelte-12ggtr4"),d(_t,"class","grow window-property svelte-12ggtr4"),d(Xt,"class","svelte-12ggtr4"),d(Yt,"class","svelte-12ggtr4"),d(bt,"class","grow window-property svelte-12ggtr4"),d(qt,"class","flex"),d(Qt,"class","svelte-12ggtr4"),d(Zt,"class","svelte-12ggtr4"),d(yt,"class","grow window-property svelte-12ggtr4"),d(xt,"class","svelte-12ggtr4"),d(te,"class","svelte-12ggtr4"),d(wt,"class","grow window-property svelte-12ggtr4"),d(Nt,"class","flex"),d(ee,"class","svelte-12ggtr4"),d(ne,"class","svelte-12ggtr4"),d(kt,"class","grow window-property svelte-12ggtr4"),d(ie,"class","svelte-12ggtr4"),d(oe,"class","svelte-12ggtr4"),d(Mt,"class","grow window-property svelte-12ggtr4"),d(Ft,"class","flex"),d(re,"class","svelte-12ggtr4"),d(le,"class","svelte-12ggtr4"),d(Tt,"class","grow window-property svelte-12ggtr4"),d(ue,"class","svelte-12ggtr4"),d(se,"class","svelte-12ggtr4"),d(Ct,"class","grow window-property svelte-12ggtr4"),d(Gt,"class","flex"),d(Ot,"id","title"),d(ae,"class","button"),d(ae,"type","submit"),ft(St,"margin-top","24px"),d(Wt,"id","url"),d(ce,"class","button"),d(ce,"id","open-url"),ft(Pt,"margin-top","24px"),d(At,"class","button"),d(At,"title","Minimizes the window, requests attention for 3s and then resets it"),d(Bt,"class","button")},m(y,W){z(y,t,W),l(t,n);for(let J=0;J<x.length;J+=1)x[J].m(n,null);Ke(n,e[0]),l(t,o),l(t,i),l(i,r),
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`},m(n,o){z(n,t,o)},p:q,i:q,o:q,d(n){n&&E(t)}}}function al(e,t,n){let{onMessage:o}=t;const i=window.constraints={audio:!0,video:!0};function r(a){const p=document.querySelector("video"),f=a.getVideoTracks();o("Got stream with constraints:",i),o(`Using video device: ${f[0].label}`),window.stream=a,p.srcObject=a}function u(a){if(a.name==="ConstraintNotSatisfiedError"){const p=i.video;o(`The resolution ${p.width.exact}x${p.height.exact} px is not supported by your device.`)}else a.name==="PermissionDeniedError"&&o("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.");o(`getUserMedia error: ${a.name}`,a)}return Je(async()=>{try{const a=await navigator.mediaDevices.getUserMedia(i);r(a)}catch(a){u(a)}}),En(()=>{window.stream.getTracks().forEach(function(a){a.stop()})}),e.$$set=a=>{"onMessage"in a&&n(0,o=a.onMessage)},[o]}class cl extends X{constructor(t){super();Y(this,t,al,sl,Q,{onMessage:0})}}function dl(e){let t,n,o,i,r,u,a,p,f,s,v,m;return{c(){t=c("input"),n=g(),o=c("input"),i=g(),r=c("button"),r.textContent="Post it.",u=g(),a=c("p"),a.textContent="Result:",p=g(),f=c("pre"),s=S(e[2]),d(r,"type","button")},m(h,_){z(h,t,_),A(t,e[0]),z(h,n,_),z(h,o,_),A(o,e[1]),z(h,i,_),z(h,r,_),z(h,u,_),z(h,a,_),z(h,p,_),z(h,f,_),l(f,s),v||(m=[T(t,"input",e[4]),T(o,"input",e[5]),T(r,"click",e[3])],v=!0)},p(h,[_]){_&1&&t.value!==h[0]&&A(t,h[0]),_&2&&o.value!==h[1]&&A(o,h[1]),_&4&&$(s,h[2])},i:q,o:q,d(h){h&&E(t),h&&E(n),h&&E(o),h&&E(i),h&&E(r),h&&E(u),h&&E(a),h&&E(p),h&&E(f),v=!1,tt(m)}}}function fl(e,t,n){let o="baz",i="qux",r=null;async function u(){let f=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const v=await(await fetch(f,{method:"POST",body:JSON.stringify({foo:o,bar:i})})).json();n(2,r=JSON.stringify(v))}function a(){o=this.value,n(0,o)}function p(){i=this.value,n(1,i)}return[o,i,r,u,a,p]}class pl extends X{constructor(t){super();Y(this,t,fl,dl,Q,{})}}function So(e,t,n){const o=e.slice();return o[10]=t[n],o}function Po(e,t,n){const o=e.slice();return o[13]=t[n],o}function Lo(e){let t,n=e[13].label+"",o,i,r,u,a;function p(){return e[9](e[13])}return{c(){t=c("p"),o=S(n),i=g(),d(t,"class",r="nv noselect "+(e[0]===e[13]?"nv_selected":""))},m(f,s){z(f,t,s),l(t,o),l(t,i),u||(a=T(t,"click",p),u=!0)},p(f,s){e=f,s&1&&r!==(r="nv noselect "+(e[0]===e[13]?"nv_selected":""))&&d(t,"class",r)},d(f){f&&E(t),u=!1,a()}}}function hl(e){let t,n=e[10].html+"",o;return{c(){o=Ji(),t=new Io(o)},m(i,r){t.m(n,i,r),z(i,o,r)},p(i,r){r&2&&n!==(n=i[10].html+"")&&t.p(n)},d(i){i&&E(o),i&&t.d()}}}function ml(e){let t,n=e[10].text+"",o;return{c(){t=c("p"),o=S(n)},m(i,r){z(i,t,r),l(t,o)},p(i,r){r&2&&n!==(n=i[10].text+"")&&$(o,n)},d(i){i&&E(t)}}}function zo(e){let t;function n(r,u){return r[10].text?ml:hl}let o=n(e),i=o(e);return{c(){i.c(),t=Ji()},m(r,u){i.m(r,u),z(r,t,u)},p(r,u){o===(o=n(r))&&i?i.p(r,u):(i.d(1),i=o(r),i&&(i.c(),i.m(t.parentNode,t)))},d(r){i.d(r),r&&E(t)}}}function vl(e){let t,n,o,i,r,u,a,p,f,s,v,m,h,_,w,b,P,C,H,U,j,O,I=e[2],F=[];for(let D=0;D<I.length;D+=1)F[D]=Lo(Po(e,I,D));var et=e[0].component;function at(D){return{props:{onMessage:D[5],insecureRenderHtml:D[6]}}}et&&(m=new et(at(e)));let K=e[1],G=[];for(let D=0;D<K.length;D+=1)G[D]=zo(So(e,K,D));return{c(){t=c("main"),n=c("div"),o=c("img"),r=g(),u=c("div"),u.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>`,a=g(),p=c("div"),f=c("div");for(let D=0;D<F.length;D+=1)F[D].c();s=g(),v=c("div"),m&&Vi(m.$$.fragment),h=g(),_=c("div"),w=c("p"),b=c("strong"),b.textContent="Tauri Console",P=g(),C=c("span"),C.textContent="clear",H=g();for(let D=0;D<G.length;D+=1)G[D].c();d(o,"class","logo"),o.src!==(i="tauri logo.png")&&d(o,"src",i),d(o,"height","60"),d(o,"alt","logo"),d(n,"class","flex row noselect just-around"),d(n,"style","margin=1em;"),d(n,"data-tauri-drag-region",""),ft(f,"width","15em"),ft(f,"margin-left","0.5em"),d(v,"class","content"),d(p,"class","flex row"),d(C,"class","nv"),d(w,"class","flex row just-around"),d(_,"id","response"),ft(_,"white-space","pre-line")},m(D,it){z(D,t,it),l(t,n),l(n,o),l(n,r),l(n,u),l(t,a),l(t,p),l(p,f);for(let R=0;R<F.length;R+=1)F[R].m(f,null);l(p,s),l(p,v),m&&Ki(m,v,null),l(t,h),l(t,_),l(_,w),l(w,b),l(w,P),l(w,C),l(_,H);for(let R=0;R<G.length;R+=1)G[R].m(_,null);U=!0,j||(O=[T(o,"click",e[8]),T(C,"click",e[7])],j=!0)},p(D,[it]){if(it&21){I=D[2];let R;for(R=0;R<I.length;R+=1){const Z=Po(D,I,R);F[R]?F[R].p(Z,it):(F[R]=Lo(Z),F[R].c(),F[R].m(f,null))}for(;R<F.length;R+=1)F[R].d(1);F.length=I.length}if(et!==(et=D[0].component)){if(m){Uo();const R=m;Xi(R.$$.fragment,1,0,()=>{Qi(R,1)}),Ho()}et?(m=new et(at(D)),Vi(m.$$.fragment),Yi(m.$$.fragment,1),Ki(m,v,null)):m=null}if(it&2){K=D[1];let R;for(R=0;R<K.length;R+=1){const Z=So(D,K,R);G[R]?G[R].p(Z,it):(G[R]=zo(Z),G[R].c(),G[R].m(_,null))}for(;R<G.length;R+=1)G[R].d(1);G.length=K.length}},i(D){U||(m&&Yi(m.$$.fragment,D),U=!0)},o(D){m&&Xi(m.$$.fragment,D),U=!1},d(D){D&&E(t),de(F,D),m&&Qi(m),de(G,D),j=!1,tt(O)}}}const gl="ctrl+b";function _l(e,t,n){let o;Je(()=>{jo(gl,()=>{Rn("menu_toggle")})});const i=[{label:"Welcome",component:nr},{label:"Messages",component:dr},{label:"CLI",component:lr},{label:"Dialog",component:gr},{label:"File system",component:wr},{label:"HTTP",component:Pr},{label:"HTTP Form",component:pl},{label:"Notifications",component:Or},{label:"Window",component:jr},{label:"Shortcuts",component:Br},{label:"Shell",component:Vr},{label:"Updater",component:nl},{label:"Clipboard",component:ul},{label:"WebRTC",component:cl}];let r=i[0],u=$i([]);Bi(e,u,h=>n(1,o=h));function a(h){n(0,r=h)}function p(h){u.update(_=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof h=="string"?h:JSON.stringify(h))},..._])}function f(h){u.update(_=>[{html:h},..._])}function s(){u.update(()=>[])}function v(){eo("https://tauri.studio/")}return[r,o,i,u,a,p,f,s,v,h=>a(h)]}class bl extends X{constructor(t){super();Y(this,t,_l,vl,Q,{})}}new bl({target:document.body});