diff --git a/.changes/unlisten-fix.md b/.changes/unlisten-fix.md new file mode 100644 index 000000000..2cc72fb72 --- /dev/null +++ b/.changes/unlisten-fix.md @@ -0,0 +1,6 @@ +--- +"tauri": patch +"api": patch +--- + +Fixes a regression on the `unlisten` command. diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js index de098dbdd..e32d05401 100644 --- a/core/tauri/scripts/bundle.js +++ b/core/tauri/scripts/bundle.js @@ -1 +1 @@ -function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset";return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(e):"".concat(t,"://").concat(e)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(){return(w=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return v.apply(this,arguments)},message:function(e){return b.apply(this,arguments)},ask:function(e,t){return R.apply(this,arguments)},confirm:function(e,t){return k.apply(this,arguments)}});function T(e){return G.apply(this,arguments)}function G(){return(G=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t,r){return M.apply(this,arguments)}function M(){return(M=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t,r){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",T(e));case 1:case"end":return t.stop()}}),t)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e,t,r){return C.apply(this,arguments)}function C(){return(C=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,r,(function(e){n(e),T(e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e,t){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t){return L.apply(this,arguments)}function L(){return(L=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e,t){return W.apply(this,arguments)}function W(){return(W=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",P(t,void 0,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var F,I=Object.freeze({__proto__:null,listen:S,once:z,emit:E});function N(){return(N=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}}).then((function(e){return(new TextDecoder).decode(new Uint8Array(e))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return(U=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(){return(B=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return(J=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!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"}(F||(F={}));var Q=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return N.apply(this,arguments)},readBinaryFile:function(e){return U.apply(this,arguments)},writeFile:function(e){return H.apply(this,arguments)},writeBinaryFile:function(e){return q.apply(this,arguments)},readDir:function(e){return B.apply(this,arguments)},createDir:function(e){return V.apply(this,arguments)},removeDir:function(e){return J.apply(this,arguments)},copyFile:function(e,t){return K.apply(this,arguments)},removeFile:function(e){return Y.apply(this,arguments)},renameFile:function(e,t){return $.apply(this,arguments)}});function X(){return(X=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z(){return(Z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(){return(te=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ne,ae=Object.freeze({__proto__:null,register:function(e,t){return X.apply(this,arguments)},registerAll:function(e,t){return Z.apply(this,arguments)},isRegistered:function(e){return ee.apply(this,arguments)},unregister:function(e){return te.apply(this,arguments)},unregisterAll:function(){return re.apply(this,arguments)}});function oe(e,t){return null!=e?e:t()}function ie(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),ce=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ne.JSON)&&(t.responseType=ne.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new se(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function pe(e){return le.apply(this,arguments)}function le(){return(le=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new ce(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fe=null;function he(){return(he=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==fe){e.next=4;break}return e.next=3,pe();case 3:fe=e.sent;case 4:return e.abrupt("return",fe.request(_objectSpread({url:t,method:oe(ie([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me=Object.freeze({__proto__:null,getClient:pe,fetch:function(e,t){return he.apply(this,arguments)},Body:ue,Client:ce,Response:se,get ResponseType(){return ne}});function de(){return(de=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(){return(ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return ye.apply(this,arguments)},isPermissionGranted:function(){return de.apply(this,arguments)}});function _e(){return navigator.appVersion.includes("Win")}function we(){return(we=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return(ve=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var We=_e()?"\\":"/",Fe=_e()?";":":";function Ie(){return(Ie=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(){return(Ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $e=Object.freeze({__proto__:null,exit:function(){return Ke.apply(this,arguments)},relaunch:function(){return Ye.apply(this,arguments)}});function Qe(e,t){return null!=e?e:t()}function Xe(e,t){return Ze.apply(this,arguments)}function Ze(){return(Ze=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var et=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),tt=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),rt=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=Qe(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new et}},{key:"__init3",value:function(){this.stderr=new et}},{key:"spawn",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Xe((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new tt(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(et);function nt(){return(nt=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var at=Object.freeze({__proto__:null,Command:rt,Child:tt,EventEmitter:et,open:function(e,t){return nt.apply(this,arguments)}});function ot(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),ct([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return dt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(wt);function bt(){return(bt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rt(){return(Rt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return(kt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?yt=new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),yt=new vt("main",{skip:!0}));var xt=Object.freeze({__proto__:null,WebviewWindow:vt,WebviewWindowHandle:_t,WindowManager:wt,getCurrent:function(){return new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:dt,get appWindow(){return yt},LogicalSize:lt,PhysicalSize:ft,LogicalPosition:ht,PhysicalPosition:mt,get UserAttentionType(){return pt},currentMonitor:function(){return bt.apply(this,arguments)},primaryMonitor:function(){return Rt.apply(this,arguments)},availableMonitors:function(){return kt.apply(this,arguments)}}),Tt=_e()?"\r\n":"\n";function Gt(){return(Gt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pt(){return(Pt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(){return(Ot=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jt=Object.freeze({__proto__:null,EOL:Tt,platform:function(){return Gt.apply(this,arguments)},version:function(){return Pt.apply(this,arguments)},type:function(){return Mt.apply(this,arguments)},arch:function(){return Ot.apply(this,arguments)},tempdir:function(){return At.apply(this,arguments)}}),Ct=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=x,e.event=I,e.fs=Q,e.globalShortcut=ae,e.http=me,e.invoke=Ct,e.notification=ge,e.os=jt,e.path=Je,e.process=$e,e.shell=at,e.tauri=u,e.updater=st,e.window=xt,Object.defineProperty(e,"__esModule",{value:!0})})); +function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset";return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(e):"".concat(t,"://").concat(e)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(){return(w=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return v.apply(this,arguments)},message:function(e){return b.apply(this,arguments)},ask:function(e,t){return R.apply(this,arguments)},confirm:function(e,t){return k.apply(this,arguments)}});function T(e,t){return G.apply(this,arguments)}function G(){return(G=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t,r){return M.apply(this,arguments)}function M(){return(M=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t,r){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",T(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e,t,r){return C.apply(this,arguments)}function C(){return(C=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,r,(function(e){n(e),T(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e,t){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t){return L.apply(this,arguments)}function L(){return(L=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e,t){return W.apply(this,arguments)}function W(){return(W=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",P(t,void 0,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var F,I=Object.freeze({__proto__:null,listen:S,once:z,emit:E});function N(){return(N=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}}).then((function(e){return(new TextDecoder).decode(new Uint8Array(e))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return(U=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(){return(B=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return(J=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!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"}(F||(F={}));var Q=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return N.apply(this,arguments)},readBinaryFile:function(e){return U.apply(this,arguments)},writeFile:function(e){return H.apply(this,arguments)},writeBinaryFile:function(e){return q.apply(this,arguments)},readDir:function(e){return B.apply(this,arguments)},createDir:function(e){return V.apply(this,arguments)},removeDir:function(e){return J.apply(this,arguments)},copyFile:function(e,t){return K.apply(this,arguments)},removeFile:function(e){return Y.apply(this,arguments)},renameFile:function(e,t){return $.apply(this,arguments)}});function X(){return(X=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z(){return(Z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(){return(te=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ne,ae=Object.freeze({__proto__:null,register:function(e,t){return X.apply(this,arguments)},registerAll:function(e,t){return Z.apply(this,arguments)},isRegistered:function(e){return ee.apply(this,arguments)},unregister:function(e){return te.apply(this,arguments)},unregisterAll:function(){return re.apply(this,arguments)}});function oe(e,t){return null!=e?e:t()}function ie(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),ce=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ne.JSON)&&(t.responseType=ne.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new se(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function pe(e){return le.apply(this,arguments)}function le(){return(le=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new ce(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fe=null;function he(){return(he=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==fe){e.next=4;break}return e.next=3,pe();case 3:fe=e.sent;case 4:return e.abrupt("return",fe.request(_objectSpread({url:t,method:oe(ie([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me=Object.freeze({__proto__:null,getClient:pe,fetch:function(e,t){return he.apply(this,arguments)},Body:ue,Client:ce,Response:se,get ResponseType(){return ne}});function de(){return(de=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(){return(ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return ye.apply(this,arguments)},isPermissionGranted:function(){return de.apply(this,arguments)}});function _e(){return navigator.appVersion.includes("Win")}function we(){return(we=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return(ve=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var We=_e()?"\\":"/",Fe=_e()?";":":";function Ie(){return(Ie=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(){return(Ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $e=Object.freeze({__proto__:null,exit:function(){return Ke.apply(this,arguments)},relaunch:function(){return Ye.apply(this,arguments)}});function Qe(e,t){return null!=e?e:t()}function Xe(e,t){return Ze.apply(this,arguments)}function Ze(){return(Ze=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var et=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),tt=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),rt=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=Qe(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new et}},{key:"__init3",value:function(){this.stderr=new et}},{key:"spawn",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Xe((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new tt(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(et);function nt(){return(nt=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var at=Object.freeze({__proto__:null,Command:rt,Child:tt,EventEmitter:et,open:function(e,t){return nt.apply(this,arguments)}});function ot(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),ct([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return dt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(wt);function bt(){return(bt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rt(){return(Rt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return(kt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?yt=new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),yt=new vt("main",{skip:!0}));var xt=Object.freeze({__proto__:null,WebviewWindow:vt,WebviewWindowHandle:_t,WindowManager:wt,getCurrent:function(){return new vt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:dt,get appWindow(){return yt},LogicalSize:lt,PhysicalSize:ft,LogicalPosition:ht,PhysicalPosition:mt,get UserAttentionType(){return pt},currentMonitor:function(){return bt.apply(this,arguments)},primaryMonitor:function(){return Rt.apply(this,arguments)},availableMonitors:function(){return kt.apply(this,arguments)}}),Tt=_e()?"\r\n":"\n";function Gt(){return(Gt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pt(){return(Pt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(){return(Ot=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jt=Object.freeze({__proto__:null,EOL:Tt,platform:function(){return Gt.apply(this,arguments)},version:function(){return Pt.apply(this,arguments)},type:function(){return Mt.apply(this,arguments)},arch:function(){return Ot.apply(this,arguments)},tempdir:function(){return At.apply(this,arguments)}}),Ct=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=x,e.event=I,e.fs=Q,e.globalShortcut=ae,e.http=me,e.invoke=Ct,e.notification=ge,e.os=jt,e.path=Je,e.process=$e,e.shell=at,e.tauri=u,e.updater=st,e.window=xt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/src/endpoints/event.rs b/core/tauri/src/endpoints/event.rs index fdbf2d8ba..b1adea0ab 100644 --- a/core/tauri/src/endpoints/event.rs +++ b/core/tauri/src/endpoints/event.rs @@ -63,7 +63,7 @@ pub enum Cmd { }, /// Unlisten to an event. #[serde(rename_all = "camelCase")] - Unlisten { event_id: u64 }, + Unlisten { event: EventId, event_id: u64 }, /// Emit an event to the webview associated with the given window. /// If the window_label is omitted, the event will be triggered on all listeners. #[serde(rename_all = "camelCase")] @@ -103,11 +103,16 @@ impl Cmd { Ok(event_id) } - fn unlisten(context: InvokeContext, event_id: u64) -> super::Result<()> { + fn unlisten( + context: InvokeContext, + event: EventId, + event_id: u64, + ) -> super::Result<()> { context .window .eval(&unlisten_js( context.window.manager().event_listeners_object_name(), + event.0, event_id, )) .map_err(crate::error::into_anyhow)?; diff --git a/core/tauri/src/event.rs b/core/tauri/src/event.rs index d7214c5ee..220ed7f57 100644 --- a/core/tauri/src/event.rs +++ b/core/tauri/src/event.rs @@ -300,17 +300,21 @@ mod test { } } -pub fn unlisten_js(listeners_object_name: String, event_id: u64) -> String { +pub fn unlisten_js(listeners_object_name: String, event_name: String, event_id: u64) -> String { format!( " - for (var event in (window['{listeners}'] || {{}})) {{ - var listeners = (window['{listeners}'] || {{}})[event] + (function () {{ + const listeners = (window['{listeners}'] || {{}})['{event_name}'] if (listeners) {{ - window['{listeners}'][event] = window['{listeners}'][event].filter(function (e) {{ return e.id !== {event_id} }}) + const index = window['{listeners}']['{event_name}'].findIndex(e => e.id === {event_id}) + if (index > -1) {{ + window['{listeners}']['{event_name}'].splice(index, 1) + }} }} - }} + }})() ", listeners = listeners_object_name, + event_name = event_name, event_id = event_id, ) } diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index e97cd6f2a..2d1dbdb0e 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,4 +1,4 @@ -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();/*! ***************************************************************************** +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 @@ -11,29 +11,30 @@ 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;n0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){s=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]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]{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: +`)})}),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=`
  • --config PATH
  • --theme light|dark|system
  • --verbose
  • `,o=S(` Additionally, it has a `),l=u("i"),l.textContent="update --background",s=S(` subcommand. Note that the arguments are only parsed, not implemented. - `),c=u("br"),p=v(),h=u("button"),h.textContent="Get matches",a(h,"class","button"),a(h,"id","cli-matches")},m(m,d){O(m,t,d),r(t,n),r(t,i),r(t,o),r(t,l),r(t,s),r(t,c),r(t,p),r(t,h),f||(M=T(h,"click",e[0]),f=!0)},p:I,i:I,o:I,d(m){m&&W(t),f=!1,M()}}}function nr(e,t,n){let{onMessage:i}=t;function o(){ro().then(i).catch(i)}return e.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class ir extends K{constructor(t){super();X(this,t,nr,er,Y,{onMessage:1})}}function lo(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}function so(e,t,n){return _(this,void 0,void 0,function(){return g(this,function(i){switch(i.label){case 0:return[4,z({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function Dn(e,t,n){return _(this,void 0,void 0,function(){var i=this;return g(this,function(o){return[2,z({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:Wt(n)}}).then(function(l){return function(){return _(i,void 0,void 0,function(){return g(this,function(s){return[2,lo(l)]})})}})]})})}function uo(e,t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,Dn(e,t,function(o){n(o),lo(o.id).catch(function(){})})]})})}function pe(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,Dn(e,null,t)]})})}function ao(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,uo(e,null,t)]})})}function Ye(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,so(e,void 0,t)]})})}Object.freeze({__proto__:null,listen:pe,once:ao,emit:Ye});function or(e){let t,n,i,o,l,s,c,p;return{c(){t=u("div"),n=u("button"),n.textContent="Call Log API",i=v(),o=u("button"),o.textContent="Call Request (async) API",l=v(),s=u("button"),s.textContent="Send event to Rust",a(n,"class","button"),a(n,"id","log"),a(o,"class","button"),a(o,"id","request"),a(s,"class","button"),a(s,"id","event")},m(h,f){O(h,t,f),r(t,n),r(t,i),r(t,o),r(t,l),r(t,s),c||(p=[T(n,"click",e[0]),T(o,"click",e[1]),T(s,"click",e[2])],c=!0)},p:I,i:I,o:I,d(h){h&&W(t),c=!1,x(p)}}}function rr(e,t,n){let{onMessage:i}=t,o;$e(async()=>{o=await pe("rust-event",i)}),On(()=>{o&&o()});function l(){fe("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function s(){fe("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Ye("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[l,s,c,i]}class lr extends K{constructor(t){super();X(this,t,rr,or,Y,{onMessage:3})}}function Rn(e){return e===void 0&&(e={}),_(this,void 0,void 0,function(){return g(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})]})})}function co(e){return e===void 0&&(e={}),_(this,void 0,void 0,function(){return g(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})]})})}function sr(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e}})]})})}function ur(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Dialog",message:{cmd:"askDialog",title:t,message:e}})]})})}function ar(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:t,message:e}})]})})}Object.freeze({__proto__:null,open:Rn,save:co,message:sr,ask:ur,confirm:ar});var Bt;function cr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}}).then(function(i){return new TextDecoder().decode(new Uint8Array(i))})]})})}function jn(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){var n;return g(this,function(i){switch(i.label){case 0:return[4,z({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function dr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(new TextEncoder().encode(e.contents)),options:t}})]})})}function fr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,z({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(e.contents),options:t}})]})})}function fo(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})]})})}function pr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})]})})}function hr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})]})})}function mr(e,t,n){return n===void 0&&(n={}),_(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})]})})}function vr(e,t){return t===void 0&&(t={}),_(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})]})})}function _r(e,t,n){return n===void 0&&(n={}),_(this,void 0,void 0,function(){return g(this,function(i){return[2,z({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})]})})}(function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log"})(Bt||(Bt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Bt},get Dir(){return Bt},readTextFile:cr,readBinaryFile:jn,writeFile:dr,writeBinaryFile:fr,readDir:fo,createDir:pr,removeDir:hr,copyFile:mr,removeFile:vr,renameFile:_r});function gr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P,C,j,F;return{c(){t=u("div"),n=u("input"),i=v(),o=u("input"),l=v(),s=u("div"),c=u("input"),p=v(),h=u("label"),h.textContent="Multiple",f=v(),M=u("div"),m=u("input"),d=v(),b=u("label"),b.textContent="Directory",k=v(),w=u("button"),w.textContent="Open dialog",P=v(),C=u("button"),C.textContent="Open save dialog",a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(o,"class","svelte-1eg58yg"),a(c,"type","checkbox"),a(c,"id","dialog-multiple"),a(h,"for","dialog-multiple"),a(m,"type","checkbox"),a(m,"id","dialog-directory"),a(b,"for","dialog-directory"),a(w,"class","button"),a(w,"id","open-dialog"),a(C,"class","button"),a(C,"id","save-dialog")},m(H,A){O(H,t,A),r(t,n),E(n,e[0]),r(t,i),r(t,o),E(o,e[1]),r(t,l),r(t,s),r(s,c),c.checked=e[2],r(s,p),r(s,h),r(t,f),r(t,M),r(M,m),m.checked=e[3],r(M,d),r(M,b),r(t,k),r(t,w),r(t,P),r(t,C),j||(F=[T(n,"input",e[8]),T(o,"input",e[9]),T(c,"change",e[10]),T(m,"change",e[11]),T(w,"click",e[4]),T(C,"click",e[5])],j=!0)},p(H,[A]){A&1&&n.value!==H[0]&&E(n,H[0]),A&2&&o.value!==H[1]&&E(o,H[1]),A&4&&(c.checked=H[2]),A&8&&(m.checked=H[3])},i:I,o:I,d(H){H&&W(t),j=!1,x(F)}}}function br(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function wr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l=null,s=null,c=!1,p=!1;function h(){Rn({title:"My wonderful open dialog",defaultPath:l,filters:s?[{name:"Tauri Example",extensions:s.split(",").map(k=>k.trim())}]:[],multiple:c,directory:p}).then(function(k){if(Array.isArray(k))i(k);else{var w=k,P=w.match(/\S+\.\S+$/g);jn(w).then(function(C){P&&(w.includes(".png")||w.includes(".jpg"))?br(new Uint8Array(C),function(j){var F="data:image/png;base64,"+j;o('')}):i(k)}).catch(i(k))}}).catch(i)}function f(){co({title:"My wonderful save dialog",defaultPath:l,filters:s?[{name:"Tauri Example",extensions:s.split(",").map(k=>k.trim())}]:[]}).then(i).catch(i)}function M(){l=this.value,n(0,l)}function m(){s=this.value,n(1,s)}function d(){c=this.checked,n(2,c)}function b(){p=this.checked,n(3,p)}return e.$$set=k=>{"onMessage"in k&&n(6,i=k.onMessage),"insecureRenderHtml"in k&&n(7,o=k.insecureRenderHtml)},[l,s,c,p,h,f,i,o,M,m,d,b]}class yr extends K{constructor(t){super();X(this,t,wr,gr,Y,{onMessage:6,insecureRenderHtml:7})}}function po(e,t,n){const i=e.slice();return i[9]=t[n],i}function ho(e){let t,n=e[9][0]+"",i,o;return{c(){t=u("option"),i=S(n),t.__value=o=e[9][1],t.value=t.__value},m(l,s){O(l,t,s),r(t,i)},p:I,d(l){l&&W(t)}}}function Mr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b=e[2],k=[];for(let w=0;wisNaN(parseInt(m))).map(m=>[m,Bt[m]]);function p(){const m=l.match(/\S+\.\S+$/g),d={dir:mo()};(m?jn(l,d):fo(l,d)).then(function(k){if(m)if(l.includes(".png")||l.includes(".jpg"))kr(new Uint8Array(k),function(w){const P="data:image/png;base64,"+w;o('')});else{const w=String.fromCharCode.apply(null,k);o(''),setTimeout(()=>{const P=document.getElementById("file-response");P.value=w,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:l,contents:P.value},{dir:mo()}).catch(i)})})}else i(k)}).catch(i)}function h(){n(1,s.src=Zi(l),s)}function f(){l=this.value,n(0,l)}function M(m){Vo[m?"unshift":"push"](()=>{s=m,n(1,s)})}return e.$$set=m=>{"onMessage"in m&&n(5,i=m.onMessage),"insecureRenderHtml"in m&&n(6,o=m.insecureRenderHtml)},[l,s,c,p,h,i,o,f,M]}class Tr extends K{constructor(t){super();X(this,t,zr,Mr,Y,{onMessage:5,insecureRenderHtml:6})}}var he;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(he||(he={}));var Fn=function(){function e(t,n){this.type=t,this.payload=n}return e.form=function(t){var n={};for(var i in t){var o=t[i];n[i]=typeof o=="string"?o:Array.from(o)}return new e("Form",n)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",Array.from(t))},e}(),vo=function(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data},_o=function(){function e(t){this.id=t}return e.prototype.drop=function(){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},e.prototype.request=function(t){return _(this,void 0,void 0,function(){var n;return g(this,function(i){return(n=!t.responseType||t.responseType===he.JSON)&&(t.responseType=he.Text),[2,z({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(function(o){var l=new vo(o);if(n){try{l.data=JSON.parse(l.data)}catch(s){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(s,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},e.prototype.get=function(t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,this.request(dt({method:"GET",url:t},n))]})})},e.prototype.post=function(t,n,i){return _(this,void 0,void 0,function(){return g(this,function(o){return[2,this.request(dt({method:"POST",url:t,body:n},i))]})})},e.prototype.put=function(t,n,i){return _(this,void 0,void 0,function(){return g(this,function(o){return[2,this.request(dt({method:"PUT",url:t,body:n},i))]})})},e.prototype.patch=function(t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,this.request(dt({method:"PATCH",url:t},n))]})})},e.prototype.delete=function(t,n){return _(this,void 0,void 0,function(){return g(this,function(i){return[2,this.request(dt({method:"DELETE",url:t},n))]})})},e}();function Hn(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(function(n){return new _o(n)})]})})}var Un=null;function Cr(e,t){var n;return _(this,void 0,void 0,function(){return g(this,function(i){switch(i.label){case 0:return Un!==null?[3,2]:[4,Hn()];case 1:Un=i.sent(),i.label=2;case 2:return[2,Un.request(dt({url:e,method:(n=t==null?void 0:t.method)!==null&&n!==void 0?n:"GET"},t))]}})})}Object.freeze({__proto__:null,getClient:Hn,fetch:Cr,Body:Fn,Client:_o,Response:vo,get ResponseType(){return he}});function Sr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w,P;return{c(){t=u("form"),n=u("select"),i=u("option"),i.textContent="GET",o=u("option"),o.textContent="POST",l=u("option"),l.textContent="PUT",s=u("option"),s.textContent="PATCH",c=u("option"),c.textContent="DELETE",p=v(),h=u("input"),f=v(),M=u("br"),m=v(),d=u("textarea"),b=v(),k=u("button"),k.textContent="Make request",i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,s.__value="PATCH",s.value=s.__value,c.__value="DELETE",c.value=c.__value,a(n,"class","button"),a(n,"id","request-method"),e[0]===void 0&&qi(()=>e[5].call(n)),a(h,"id","request-url"),a(h,"placeholder","Type the request URL..."),a(d,"id","request-body"),a(d,"placeholder","Request body"),a(d,"rows","5"),a(d,"class","svelte-1xfmj7b"),a(k,"class","button"),a(k,"id","make-request")},m(C,j){O(C,t,j),r(t,n),r(n,i),r(n,o),r(n,l),r(n,s),r(n,c),Xe(n,e[0]),r(t,p),r(t,h),E(h,e[1]),r(t,f),r(t,M),r(t,m),r(t,d),E(d,e[2]),r(t,b),r(t,k),w||(P=[T(n,"change",e[5]),T(h,"input",e[6]),T(d,"input",e[7]),T(t,"submit",Ke(e[3]))],w=!0)},p(C,[j]){j&1&&Xe(n,C[0]),j&2&&h.value!==C[1]&&E(h,C[1]),j&4&&E(d,C[2])},i:I,o:I,d(C){C&&W(t),w=!1,x(P)}}}function Pr(e,t,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",l="",{onMessage:s}=t;async function c(){const M=await Hn().catch(k=>{throw s(k),k}),b={url:o||""||"",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?b.body=Fn.json(JSON.parse(l)):l!==""&&(b.body=Fn.text(l)),M.request(b).then(s).catch(s)}function p(){i=Ni(this),n(0,i)}function h(){o=this.value,n(1,o)}function f(){l=this.value,n(2,l)}return e.$$set=M=>{"onMessage"in M&&n(4,s=M.onMessage)},[i,o,l,c,s,p,h,f]}class Or extends K{constructor(t){super();X(this,t,Pr,Sr,Y,{onMessage:4})}}function Wr(e){let t,n,i;return{c(){t=u("button"),t.textContent="Send test notification",a(t,"class","button"),a(t,"id","notification")},m(o,l){O(o,t,l),n||(i=T(t,"click",Ar),n=!0)},p:I,i:I,o:I,d(o){o&&W(t),n=!1,i()}}}function Ar(){new Notification("Notification title",{body:"This is the notification body"})}function Lr(e,t,n){let{onMessage:i}=t;return e.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class Er extends K{constructor(t){super();X(this,t,Lr,Wr,Y,{onMessage:0})}}var me,Qe=function(e,t){this.type="Logical",this.width=e,this.height=t},Gt=function(){function e(t,n){this.type="Physical",this.width=t,this.height=n}return e.prototype.toLogical=function(t){return new Qe(this.width/t,this.height/t)},e}(),go=function(e,t){this.type="Logical",this.x=e,this.y=t},Vt=function(){function e(t,n){this.type="Physical",this.x=t,this.y=n}return e.prototype.toLogical=function(t){return new go(this.x/t,this.y/t)},e}();function Dr(){return new ve(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function bo(){return window.__TAURI_METADATA__.__windows.map(function(e){return new ve(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(me||(me={}));var wo=["tauri://created","tauri://error"],yo=function(){function e(t){this.label=t,this.listeners=Object.create(null)}return e.prototype.listen=function(t,n){return _(this,void 0,void 0,function(){var i=this;return g(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Dn(t,this.label,n)]})})},e.prototype.once=function(t,n){return _(this,void 0,void 0,function(){var i=this;return g(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,uo(t,this.label,n)]})})},e.prototype.emit=function(t,n){return _(this,void 0,void 0,function(){var i,o;return g(this,function(l){if(wo.includes(t)){for(i=0,o=this.listeners[t]||[];i{"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('')}):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;wisNaN(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('')});else{const w=String.fromCharCode.apply(null,k);o(''),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]||[];ie[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{typeof q=="string"&&o[i].setIcon(q)})}function ge(){const q=Math.random().toString().replace(".",""),Ct=new ve(q);n(1,o[q]=Ct,o),Ct.once("tauri://error",function(){l("Error creating new webview")})}function At(){o[i].innerSize().then(q=>{n(20,N=q),n(7,d=N.width),n(8,b=N.height)}),o[i].outerSize().then(q=>{n(21,tt=q)})}function be(){o[i].innerPosition().then(q=>{n(18,A=q)}),o[i].outerPosition().then(q=>{n(19,U=q),n(13,j=U.x),n(14,F=U.y)})}async function Jt(q){ut&&ut(),$&&$(),$=await q.listen("tauri://move",be),ut=await q.listen("tauri://resize",At)}async function et(){await o[i].minimize(),await o[i].requestUserAttention(me.Critical),await new Promise(q=>setTimeout(q,3e3)),await o[i].requestUserAttention(null)}function ft(){i=Ni(this),n(0,i),n(1,o)}function Lt(){c=this.checked,n(2,c)}function we(){p=this.checked,n(3,p)}const it=()=>o[i].center();function ye(){h=this.checked,n(16,h)}function Et(){f=this.checked,n(4,f)}function Me(){M=this.checked,n(5,M)}function ot(){m=this.checked,n(6,m)}function ke(){j=J(this.value),n(13,j)}function pt(){F=J(this.value),n(14,F)}function Dt(){d=J(this.value),n(7,d)}function ze(){b=J(this.value),n(8,b)}function rt(){k=J(this.value),n(9,k)}function Te(){w=J(this.value),n(10,w)}function Rt(){P=J(this.value),n(11,P)}function Ce(){C=J(this.value),n(12,C)}function lt(){B=this.value,n(22,B)}function Se(){s=this.value,n(15,s)}return e.$$set=q=>{"onMessage"in q&&n(30,l=q.onMessage)},e.$$.update=()=>{e.$$.dirty[0]&7&&o[i].setResizable(c),e.$$.dirty[0]&11&&(p?o[i].maximize():o[i].unmaximize()),e.$$.dirty[0]&19&&o[i].setDecorations(f),e.$$.dirty[0]&35&&o[i].setAlwaysOnTop(M),e.$$.dirty[0]&67&&o[i].setFullscreen(m),e.$$.dirty[0]&387&&o[i].setSize(new Gt(d,b)),e.$$.dirty[0]&1539&&(k&&w?o[i].setMinSize(new Qe(k,w)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(P&&C?o[i].setMaxSize(new Qe(P,C)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Vt(j,F)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(q=>n(17,H=q)),e.$$.dirty[0]&3&&Jt(o[i])},[i,o,c,p,f,M,m,d,b,k,w,P,C,j,F,s,h,H,A,U,N,tt,B,R,nt,D,Q,_e,ge,et,l,ft,Lt,we,it,ye,Et,Me,ot,ke,pt,Dt,ze,rt,Te,Rt,Ce,lt,Se]}class Ir extends K{constructor(t){super();X(this,t,Ur,Hr,Y,{onMessage:30},[-1,-1])}}function To(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:Wt(t)}})]})})}function qr(e,t){return _(this,void 0,void 0,function(){return g(this,function(n){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:Wt(t)}})]})})}function Nr(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]})})}function Co(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]})})}function So(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:To,registerAll:qr,isRegistered:Nr,unregister:Co,unregisterAll:So});function Po(e,t,n){const i=e.slice();return i[9]=t[n],i}function Oo(e){let t,n=e[9]+"",i,o,l,s,c;function p(){return e[8](e[9])}return{c(){t=u("div"),i=S(n),o=v(),l=u("button"),l.textContent="Unregister",a(l,"type","button")},m(h,f){O(h,t,f),r(t,i),r(t,o),r(t,l),s||(c=T(l,"click",p),s=!0)},p(h,f){e=h,f&2&&n!==(n=e[9]+"")&&G(i,n)},d(h){h&&W(t),s=!1,c()}}}function Wo(e){let t,n,i;return{c(){t=u("button"),t.textContent="Unregister all",a(t,"type","button")},m(o,l){O(o,t,l),n||(i=T(t,"click",e[5]),n=!0)},p:I,d(o){o&&W(t),n=!1,i()}}}function Br(e){let t,n,i,o,l,s,c,p,h,f,M=e[1],m=[];for(let b=0;bn(1,i=m));let s="CmdOrControl+X";function c(){const m=s;To(m,()=>{o(`Shortcut ${m} triggered`)}).then(()=>{l.update(d=>[...d,m]),o(`Shortcut ${m} registered successfully`)}).catch(o)}function p(m){const d=m;Co(d).then(()=>{l.update(b=>b.filter(k=>k!==d)),o(`Shortcut ${d} unregistered`)}).catch(o)}function h(){So().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function f(){s=this.value,n(0,s)}const M=m=>p(m);return e.$$set=m=>{"onMessage"in m&&n(6,o=m.onMessage)},[s,i,l,c,p,h,o,f,M]}class Vr extends K{constructor(t){super();X(this,t,Gr,Br,Y,{onMessage:6})}}function Ao(e){let t,n,i,o,l;return{c(){t=u("input"),n=v(),i=u("button"),i.textContent="Write",a(t,"placeholder","write to stdin"),a(i,"class","button")},m(s,c){O(s,t,c),E(t,e[3]),O(s,n,c),O(s,i,c),o||(l=[T(t,"input",e[10]),T(i,"click",e[7])],o=!0)},p(s,c){c&8&&t.value!==s[3]&&E(t,s[3])},d(s){s&&W(t),s&&W(n),s&&W(i),o=!1,x(l)}}}function Jr(e){let t,n,i,o,l,s,c,p,h,f,M,m,d,b,k,w=e[4]&&Ao(e);return{c(){t=u("div"),n=u("div"),i=u("input"),o=v(),l=u("button"),l.textContent="Run",s=v(),c=u("button"),c.textContent="Kill",p=v(),w&&w.c(),h=v(),f=u("div"),M=u("input"),m=v(),d=u("input"),a(l,"class","button"),a(c,"class","button"),a(M,"placeholder","Working directory"),a(d,"class","env-vars svelte-1g38c1n"),a(d,"placeholder","Environment variables")},m(P,C){O(P,t,C),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(n,s),r(n,c),r(n,p),w&&w.m(n,null),r(t,h),r(t,f),r(f,M),E(M,e[1]),r(f,m),r(f,d),E(d,e[2]),b||(k=[T(i,"input",e[9]),T(l,"click",e[5]),T(c,"click",e[6]),T(M,"input",e[11]),T(d,"input",e[12])],b=!0)},p(P,[C]){C&1&&i.value!==P[0]&&E(i,P[0]),P[4]?w?w.p(P,C):(w=Ao(P),w.c(),w.m(n,null)):w&&(w.d(1),w=null),C&2&&M.value!==P[1]&&E(M,P[1]),C&4&&d.value!==P[2]&&E(d,P[2])},i:I,o:I,d(P){P&&W(t),w&&w.d(),b=!1,x(k)}}}function $r(e,t,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:s}=t,c='echo "hello world"',p=null,h="SOMETHING=value ANOTHER=2",f="",M;function m(){return h.split(" ").reduce((F,H)=>{let[A,U]=H.split("=");return Ii(Ui({},F),{[A]:U})},{})}function d(){n(4,M=null);const F=new to(o,[...l,c],{cwd:p||null,env:m()});F.on("close",H=>{s(`command finished with code ${H.code} and signal ${H.signal}`),n(4,M=null)}),F.on("error",H=>s(`command error: "${H}"`)),F.stdout.on("data",H=>s(`command stdout: "${H}"`)),F.stderr.on("data",H=>s(`command stderr: "${H}"`)),F.spawn().then(H=>{n(4,M=H)}).catch(s)}function b(){M.kill().then(()=>s("killed child process")).catch(s)}function k(){M.write(f).catch(s)}function w(){c=this.value,n(0,c)}function P(){f=this.value,n(3,f)}function C(){p=this.value,n(1,p)}function j(){h=this.value,n(2,h)}return e.$$set=F=>{"onMessage"in F&&n(8,s=F.onMessage)},[c,p,h,f,M,d,b,k,s,w,P,C,j]}class Kr extends K{constructor(t){super();X(this,t,$r,Jr,Y,{onMessage:8})}}function Lo(){return _(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return g(this,function(n){return[2,new Promise(function(i,o){pe("tauri://update-status",function(l){var s;(s=l==null?void 0:l.payload).error?(e(),o(s.error)):s.status==="DONE"&&(e(),i())}).then(function(l){t=l}).catch(function(l){throw e(),l}),Ye("tauri://update-install").catch(function(l){throw e(),l})})]})})}function Eo(){return _(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return g(this,function(n){return[2,new Promise(function(i,o){ao("tauri://update-available",function(l){var s;s=l==null?void 0:l.payload,e(),i({manifest:s,shouldUpdate:!0})}).catch(function(l){throw e(),l}),pe("tauri://update-status",function(l){var s;(s=l==null?void 0:l.payload).error?(e(),o(s.error)):s.status==="UPTODATE"&&(e(),i({shouldUpdate:!1}))}).then(function(l){t=l}).catch(function(l){throw e(),l}),Ye("tauri://update").catch(function(l){throw e(),l})})]})})}Object.freeze({__proto__:null,installUpdate:Lo,checkUpdate:Eo});function Xr(e){let t,n,i,o,l,s;return{c(){t=u("div"),n=u("button"),n.textContent="Check update",i=v(),o=u("button"),o.textContent="Install update",a(n,"class","button"),a(n,"id","check_update"),a(o,"class","button hidden"),a(o,"id","start_update")},m(c,p){O(c,t,p),r(t,n),r(t,i),r(t,o),l||(s=[T(n,"click",e[0]),T(o,"click",e[1])],l=!0)},p:I,i:I,o:I,d(c){c&&W(t),l=!1,x(s)}}}function Yr(e,t,n){let{onMessage:i}=t,o;$e(async()=>{o=await pe("tauri://update-status",i)}),On(()=>{o&&o()});async function l(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:p}=await Eo();i(`Should update: ${c}`),i(p),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function s(){try{document.getElementById("start_update").classList.add("hidden"),await Lo(),i("Installation complete, restart required."),await En()}catch(c){i(c)}}return e.$$set=c=>{"onMessage"in c&&n(2,i=c.onMessage)},[l,s,i]}class Qr extends K{constructor(t){super();X(this,t,Yr,Xr,Y,{onMessage:2})}}function Do(e){return _(this,void 0,void 0,function(){return g(this,function(t){return[2,z({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})]})})}function Ro(){return _(this,void 0,void 0,function(){return g(this,function(e){return[2,z({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:Do,readText:Ro});function Zr(e){let t,n,i,o,l,s,c,p,h;return{c(){t=u("div"),n=u("div"),i=u("input"),o=v(),l=u("button"),l.textContent="Write",s=v(),c=u("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(l,"type","button"),a(c,"type","button")},m(f,M){O(f,t,M),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(t,s),r(t,c),p||(h=[T(i,"input",e[4]),T(l,"click",e[1]),T(c,"click",e[2])],p=!0)},p(f,[M]){M&1&&i.value!==f[0]&&E(i,f[0])},i:I,o:I,d(f){f&&W(t),p=!1,x(h)}}}function xr(e,t,n){let{onMessage:i}=t,o="clipboard message";function l(){Do(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function s(){Ro().then(p=>{i(`Clipboard contents: ${p}`)}).catch(i)}function c(){o=this.value,n(0,o)}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[o,l,s,i,c]}class tl extends K{constructor(t){super();X(this,t,xr,Zr,Y,{onMessage:3})}}function el(e){let t;return{c(){t=u("div"),t.innerHTML=`

    Not available for Linux

    - `},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;RDocumentation + 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{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;bn(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=`

    Not available for Linux

    + `},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;RDocumentation Github - Source`,c=v(),p=u("div"),h=u("div");for(let R=0;R{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{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}); + Source`,c=v(),p=u("div"),h=u("div");for(let R=0;R{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{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}); diff --git a/tooling/api/src/helpers/event.ts b/tooling/api/src/helpers/event.ts index 95d569510..364aab6f0 100644 --- a/tooling/api/src/helpers/event.ts +++ b/tooling/api/src/helpers/event.ts @@ -41,17 +41,19 @@ export type EventCallback = (event: Event) => void export type UnlistenFn = () => void /** - * Unregister the event listener associated with the given id. + * Unregister the event listener associated with the given name and id. * * @ignore + * @param event The event name * @param eventId Event identifier * @returns */ -async function _unlisten(eventId: number): Promise { +async function _unlisten(event: string, eventId: number): Promise { return invokeTauriCommand({ __tauriModule: 'Event', message: { cmd: 'unlisten', + event, eventId } }) @@ -102,7 +104,7 @@ async function listen( handler: transformCallback(handler) } }).then((eventId) => { - return async () => _unlisten(eventId) + return async () => _unlisten(event, eventId) }) } @@ -120,7 +122,7 @@ async function once( ): Promise { return listen(event, windowLabel, (eventData) => { handler(eventData) - _unlisten(eventData.id).catch(() => {}) + _unlisten(event, eventData.id).catch(() => {}) }) }