From aeda95097f7b02148e882d5a9c59bb2560c7a4df Mon Sep 17 00:00:00 2001 From: FabianLars Date: Wed, 1 May 2024 14:00:27 +0200 Subject: [PATCH] changefile and rebuild iife [skip ci] --- .changes/tauri-beta-17.md | 57 +++++++++++++++++++++++++++ plugins/clipboard-manager/api-iife.js | 2 +- plugins/deep-link/api-iife.js | 2 +- plugins/fs/api-iife.js | 2 +- plugins/global-shortcut/api-iife.js | 2 +- plugins/log/api-iife.js | 2 +- plugins/notification/api-iife.js | 2 +- plugins/shell/api-iife.js | 2 +- plugins/store/api-iife.js | 2 +- plugins/updater/api-iife.js | 2 +- plugins/upload/api-iife.js | 2 +- plugins/websocket/api-iife.js | 2 +- plugins/window-state/api-iife.js | 2 +- 13 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 .changes/tauri-beta-17.md diff --git a/.changes/tauri-beta-17.md b/.changes/tauri-beta-17.md new file mode 100644 index 000000000..dbcd3b20c --- /dev/null +++ b/.changes/tauri-beta-17.md @@ -0,0 +1,57 @@ +--- +"authenticator": patch +"autostart": patch +"barcode-scanner": patch +"biometric": patch +"cli": patch +"clipboard-manager": patch +"deep-link": patch +"dialog": patch +"fs": patch +"global-shortcut": patch +"http": patch +"localhost": patch +"log": patch +"nfc": patch +"notification": patch +"os": patch +"persisted-scope": patch +"positioner": patch +"process": patch +"shell": patch +"single-instance": patch +"sql": patch +"store": patch +"stronghold": patch +"updater": patch +"upload": patch +"websocket": patch +"window-state": patch +"authenticator-js": patch +"autostart-js": patch +"barcode-scanner-js": patch +"biometric-js": patch +"cli-js": patch +"clipboard-manager-js": patch +"deep-link-js": patch +"dialog-js": patch +"fs-js": patch +"global-shortcut-js": patch +"http-js": patch +"log-js": patch +"nfc-js": patch +"notification-js": patch +"os-js": patch +"positioner-js": patch +"process-js": patch +"shell-js": patch +"sql-js": patch +"store-js": patch +"stronghold-js": patch +"updater-js": patch +"upload-js": patch +"websocket-js": patch +"window-state-js": patch +--- + +Update to tauri beta.17. diff --git a/plugins/clipboard-manager/api-iife.js b/plugins/clipboard-manager/api-iife.js index 77cbbdf06..e2b2f6e3e 100644 --- a/plugins/clipboard-manager/api-iife.js +++ b/plugins/clipboard-manager/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(e){"use strict";var r;async function t(e,r={},t){return window.__TAURI_INTERNALS__.invoke(e,r,t)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}(this,r,"f")}constructor(e){r.set(this,void 0),function(e,r,t,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!a:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,t):a?a.value=t:r.set(e,t)}(this,r,e,"f")}async close(){return t("plugin:resources|close",{rid:this.rid})}}r=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,r,n){return t("plugin:image|new",{rgba:i(e),width:r,height:n}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await t("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,r){await t("plugin:clipboard-manager|write_html",{html:e,altHtml:r})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,r){await t("plugin:clipboard-manager|write_text",{label:r?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(e){"use strict";var r;async function t(e,r={},t){return window.__TAURI_INTERNALS__.invoke(e,r,t)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}(this,r,"f")}constructor(e){r.set(this,void 0),function(e,r,t,n,a){if("function"==typeof r?e!==r||!a:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");r.set(e,t)}(this,r,e)}async close(){return t("plugin:resources|close",{rid:this.rid})}}r=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,r,n){return t("plugin:image|new",{rgba:i(e),width:r,height:n}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return await t("plugin:clipboard-manager|read_text")},e.writeHtml=async function(e,r){await t("plugin:clipboard-manager|write_html",{html:e,altHtml:r})},e.writeImage=async function(e){await t("plugin:clipboard-manager|write_image",{image:i(e)})},e.writeText=async function(e,r){await t("plugin:clipboard-manager|write_text",{label:r?.label,text:e})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})} diff --git a/plugins/deep-link/api-iife.js b/plugins/deep-link/api-iife.js index 34d3ad52f..9f139a80c 100644 --- a/plugins/deep-link/api-iife.js +++ b/plugins/deep-link/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_DEEPLINK__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}var r;async function a(e,r,a){const i="string"==typeof a?.target?{kind:"AnyLabel",label:a.target}:a?.target??{kind:"Any"};return t("plugin:event|listen",{event:e,target:i,handler:n(r)}).then((n=>async()=>async function(e,n){await t("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(){return await t("plugin:deep-link|get_current")}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG="tauri://drag",e.DROP="tauri://drop",e.DROP_OVER="tauri://drop-over",e.DROP_CANCELLED="tauri://drag-cancelled"}(r||(r={})),e.getCurrent=i,e.onOpenUrl=async function(e){const n=await i();return null!=n&&e(n),await a("deep-link://new-url",(n=>{e(n.payload)}))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEPLINK__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_DEEPLINK__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var t;async function i(e,t,i){const _=(void 0,{kind:"Any"});return r("plugin:event|listen",{event:e,target:_,handler:n(t)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function _(){return await r("plugin:deep-link|get_current")}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG="tauri://drag",e.DROP="tauri://drop",e.DROP_OVER="tauri://drop-over",e.DROP_CANCELLED="tauri://drag-cancelled"}(t||(t={})),e.getCurrent=_,e.onOpenUrl=async function(e){const n=await _();return null!=n&&e(n),await i("deep-link://new-url",(n=>{e(n.payload)}))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEPLINK__})} diff --git a/plugins/fs/api-iife.js b/plugins/fs/api-iife.js index 48a3b6f73..491200a02 100644 --- a/plugins/fs/api-iife.js +++ b/plugins/fs/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}var i,o,r,a,s,f;"function"==typeof SuppressedError&&SuppressedError;class c{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),r.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:a})=>{if(a===e(this,o,"f")){n(this,o,a+1,"f"),e(this,i,"f").call(this,t);const s=Object.keys(e(this,r,"f"));if(s.length>0){let t=a+1;for(const n of s.sort()){if(parseInt(n)!==t)break;{const o=e(this,r,"f")[n];delete e(this,r,"f")[n],e(this,i,"f").call(this,o),t+=1}}}}else e(this,r,"f")[a.toString()]=t}))}set onmessage(t){n(this,i,t,"f")}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function l(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}i=new WeakMap,o=new WeakMap,r=new WeakMap;class u{get rid(){return e(this,a,"f")}constructor(t){a.set(this,void 0),n(this,a,t,"f")}async close(){return l("plugin:resources|close",{rid:this.rid})}}function p(t){return{isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:null!=t.mtime?new Date(t.mtime):null,atime:null!=t.atime?new Date(t.atime):null,birthtime:null!=t.birthtime?new Date(t.birthtime):null,readonly:t.readonly,fileAttributes:t.fileAttributes,dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,blksize:t.blksize,blocks:t.blocks}}a=new WeakMap,t.BaseDirectory=void 0,(s=t.BaseDirectory||(t.BaseDirectory={}))[s.Audio=1]="Audio",s[s.Cache=2]="Cache",s[s.Config=3]="Config",s[s.Data=4]="Data",s[s.LocalData=5]="LocalData",s[s.Document=6]="Document",s[s.Download=7]="Download",s[s.Picture=8]="Picture",s[s.Public=9]="Public",s[s.Video=10]="Video",s[s.Resource=11]="Resource",s[s.Temp=12]="Temp",s[s.AppConfig=13]="AppConfig",s[s.AppData=14]="AppData",s[s.AppLocalData=15]="AppLocalData",s[s.AppCache=16]="AppCache",s[s.AppLog=17]="AppLog",s[s.Desktop=18]="Desktop",s[s.Executable=19]="Executable",s[s.Font=20]="Font",s[s.Home=21]="Home",s[s.Runtime=22]="Runtime",s[s.Template=23]="Template",t.SeekMode=void 0,(f=t.SeekMode||(t.SeekMode={}))[f.Start=0]="Start",f[f.Current=1]="Current",f[f.End=2]="End";class w extends u{async read(t){if(0===t.byteLength)return 0;const[e,n]=await l("plugin:fs|read",{rid:this.rid,len:t.byteLength});return t.set(e),0===n?null:n}async seek(t,e){return await l("plugin:fs|seek",{rid:this.rid,offset:t,whence:e})}async stat(){return p(await l("plugin:fs|fstat",{rid:this.rid}))}async truncate(t){await l("plugin:fs|ftruncate",{rid:this.rid,len:t})}async write(t){return await l("plugin:fs|write",{rid:this.rid,data:Array.from(t)})}}async function h(t){await l("plugin:fs|unwatch",{rid:t})}return t.FileHandle=w,t.copyFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|copy_file",{fromPath:t instanceof URL?t.toString():t,toPath:e instanceof URL?e.toString():e,options:n})},t.create=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|create",{path:t instanceof URL?t.toString():t,options:e});return new w(n)},t.exists=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})},t.lstat=async function(t,e){return p(await l("plugin:fs|lstat",{path:t instanceof URL?t.toString():t,options:e}))},t.mkdir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})},t.open=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|open",{path:t instanceof URL?t.toString():t,options:e});return new w(n)},t.readDir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})},t.readFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|read_file",{path:t instanceof URL?t.toString():t,options:e});return Uint8Array.from(n)},t.readTextFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})},t.readTextFileLines=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=t instanceof URL?t.toString():t;return await Promise.resolve({path:n,rid:null,async next(){null==this.rid&&(this.rid=await l("plugin:fs|read_text_file_lines",{path:n,options:e}));const[t,i]=await l("plugin:fs|read_text_file_lines_next",{rid:this.rid});return i&&(this.rid=null),{value:i?"":t,done:i}},[Symbol.asyncIterator](){return this}})},t.remove=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})},t.rename=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|rename",{oldPath:t instanceof URL?t.toString():t,newPath:e instanceof URL?e.toString():e,options:n})},t.stat=async function(t,e){return p(await l("plugin:fs|stat",{path:t instanceof URL?t.toString():t,options:e}))},t.truncate=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|truncate",{path:t instanceof URL?t.toString():t,len:e,options:n})},t.watch=async function(t,e,n){const i={recursive:!1,delayMs:2e3,...n},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new c;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.watchImmediate=async function(t,e,n){const i={recursive:!1,...n,delayMs:null},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new c;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.writeFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_file",{path:t instanceof URL?t.toString():t,data:Array.from(e),options:n})},t.writeTextFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:n})},t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";function e(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function n(t,e,n,i,o){if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}var i,o,r,a,s,c;"function"==typeof SuppressedError&&SuppressedError;class f{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,i.set(this,(()=>{})),o.set(this,0),r.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:a})=>{if(a===e(this,o,"f")){n(this,o,a+1),e(this,i,"f").call(this,t);const s=Object.keys(e(this,r,"f"));if(s.length>0){let t=a+1;for(const n of s.sort()){if(parseInt(n)!==t)break;{const o=e(this,r,"f")[n];delete e(this,r,"f")[n],e(this,i,"f").call(this,o),t+=1}}n(this,o,t)}}else e(this,r,"f")[a.toString()]=t}))}set onmessage(t){n(this,i,t)}get onmessage(){return e(this,i,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function l(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}i=new WeakMap,o=new WeakMap,r=new WeakMap;class u{get rid(){return e(this,a,"f")}constructor(t){a.set(this,void 0),n(this,a,t)}async close(){return l("plugin:resources|close",{rid:this.rid})}}function p(t){return{isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:null!=t.mtime?new Date(t.mtime):null,atime:null!=t.atime?new Date(t.atime):null,birthtime:null!=t.birthtime?new Date(t.birthtime):null,readonly:t.readonly,fileAttributes:t.fileAttributes,dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,blksize:t.blksize,blocks:t.blocks}}a=new WeakMap,t.BaseDirectory=void 0,(s=t.BaseDirectory||(t.BaseDirectory={}))[s.Audio=1]="Audio",s[s.Cache=2]="Cache",s[s.Config=3]="Config",s[s.Data=4]="Data",s[s.LocalData=5]="LocalData",s[s.Document=6]="Document",s[s.Download=7]="Download",s[s.Picture=8]="Picture",s[s.Public=9]="Public",s[s.Video=10]="Video",s[s.Resource=11]="Resource",s[s.Temp=12]="Temp",s[s.AppConfig=13]="AppConfig",s[s.AppData=14]="AppData",s[s.AppLocalData=15]="AppLocalData",s[s.AppCache=16]="AppCache",s[s.AppLog=17]="AppLog",s[s.Desktop=18]="Desktop",s[s.Executable=19]="Executable",s[s.Font=20]="Font",s[s.Home=21]="Home",s[s.Runtime=22]="Runtime",s[s.Template=23]="Template",t.SeekMode=void 0,(c=t.SeekMode||(t.SeekMode={}))[c.Start=0]="Start",c[c.Current=1]="Current",c[c.End=2]="End";class w extends u{async read(t){if(0===t.byteLength)return 0;const[e,n]=await l("plugin:fs|read",{rid:this.rid,len:t.byteLength});return t.set(e),0===n?null:n}async seek(t,e){return await l("plugin:fs|seek",{rid:this.rid,offset:t,whence:e})}async stat(){return p(await l("plugin:fs|fstat",{rid:this.rid}))}async truncate(t){await l("plugin:fs|ftruncate",{rid:this.rid,len:t})}async write(t){return await l("plugin:fs|write",{rid:this.rid,data:Array.from(t)})}}async function h(t){await l("plugin:fs|unwatch",{rid:t})}return t.FileHandle=w,t.copyFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|copy_file",{fromPath:t instanceof URL?t.toString():t,toPath:e instanceof URL?e.toString():e,options:n})},t.create=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|create",{path:t instanceof URL?t.toString():t,options:e});return new w(n)},t.exists=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|exists",{path:t instanceof URL?t.toString():t,options:e})},t.lstat=async function(t,e){return p(await l("plugin:fs|lstat",{path:t instanceof URL?t.toString():t,options:e}))},t.mkdir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|mkdir",{path:t instanceof URL?t.toString():t,options:e})},t.open=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|open",{path:t instanceof URL?t.toString():t,options:e});return new w(n)},t.readDir=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|read_dir",{path:t instanceof URL?t.toString():t,options:e})},t.readFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=await l("plugin:fs|read_file",{path:t instanceof URL?t.toString():t,options:e});return Uint8Array.from(n)},t.readTextFile=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");return await l("plugin:fs|read_text_file",{path:t instanceof URL?t.toString():t,options:e})},t.readTextFileLines=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const n=t instanceof URL?t.toString():t;return await Promise.resolve({path:n,rid:null,async next(){null==this.rid&&(this.rid=await l("plugin:fs|read_text_file_lines",{path:n,options:e}));const[t,i]=await l("plugin:fs|read_text_file_lines_next",{rid:this.rid});return i&&(this.rid=null),{value:i?"":t,done:i}},[Symbol.asyncIterator](){return this}})},t.remove=async function(t,e){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|remove",{path:t instanceof URL?t.toString():t,options:e})},t.rename=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol||e instanceof URL&&"file:"!==e.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|rename",{oldPath:t instanceof URL?t.toString():t,newPath:e instanceof URL?e.toString():e,options:n})},t.stat=async function(t,e){return p(await l("plugin:fs|stat",{path:t instanceof URL?t.toString():t,options:e}))},t.truncate=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|truncate",{path:t instanceof URL?t.toString():t,len:e,options:n})},t.watch=async function(t,e,n){const i={recursive:!1,delayMs:2e3,...n},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new f;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.watchImmediate=async function(t,e,n){const i={recursive:!1,...n,delayMs:null},o=Array.isArray(t)?t:[t];for(const t of o)if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");const r=new f;r.onmessage=e;const a=await l("plugin:fs|watch",{paths:o.map((t=>t instanceof URL?t.toString():t)),options:i,onEvent:r});return()=>{h(a)}},t.writeFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_file",{path:t instanceof URL?t.toString():t,data:Array.from(e),options:n})},t.writeTextFile=async function(t,e,n){if(t instanceof URL&&"file:"!==t.protocol)throw new TypeError("Must be a file URL.");await l("plugin:fs|write_text_file",{path:t instanceof URL?t.toString():t,data:e,options:n})},t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})} diff --git a/plugins/global-shortcut/api-iife.js b/plugins/global-shortcut/api-iife.js index 6fb8bca38..613fcbc18 100644 --- a/plugins/global-shortcut/api-iife.js +++ b/plugins/global-shortcut/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBALSHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(t,r):n?n.value=r:e.set(t,r),r}var s,n,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,n,"f")){r(this,n,o+1,"f"),e(this,s,"f").call(this,t);const a=Object.keys(e(this,i,"f"));if(a.length>0){let t=o+1;for(const r of a.sort()){if(parseInt(r)!==t)break;{const n=e(this,i,"f")[r];delete e(this,i,"f")[r],e(this,s,"f").call(this,n),t+=1}}}}else e(this,i,"f")[o.toString()]=t}))}set onmessage(t){r(this,s,t,"f")}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return s=new WeakMap,n=new WeakMap,i=new WeakMap,t.isRegistered=async function(t){return await a("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new o;r.onmessage=e,await a("plugin:global-shortcut|register",{shortcut:t,handler:r})},t.registerAll=async function(t,e){const r=new o;r.onmessage=e,await a("plugin:global-shortcut|register_all",{shortcuts:t,handler:r})},t.unregister=async function(t){await a("plugin:global-shortcut|unregister",{shortcut:t})},t.unregisterAll=async function(){await a("plugin:global-shortcut|unregister_all")},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBALSHORTCUT__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_GLOBALSHORTCUT__=function(t){"use strict";function e(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)}function r(t,e,r,s,n){if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var s,n,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,n,"f")){r(this,n,o+1),e(this,s,"f").call(this,t);const a=Object.keys(e(this,i,"f"));if(a.length>0){let t=o+1;for(const r of a.sort()){if(parseInt(r)!==t)break;{const n=e(this,i,"f")[r];delete e(this,i,"f")[r],e(this,s,"f").call(this,n),t+=1}}r(this,n,t)}}else e(this,i,"f")[o.toString()]=t}))}set onmessage(t){r(this,s,t)}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},r){return window.__TAURI_INTERNALS__.invoke(t,e,r)}return s=new WeakMap,n=new WeakMap,i=new WeakMap,t.isRegistered=async function(t){return await a("plugin:global-shortcut|is_registered",{shortcut:t})},t.register=async function(t,e){const r=new o;r.onmessage=e,await a("plugin:global-shortcut|register",{shortcut:t,handler:r})},t.registerAll=async function(t,e){const r=new o;r.onmessage=e,await a("plugin:global-shortcut|register_all",{shortcuts:t,handler:r})},t.unregister=async function(t){await a("plugin:global-shortcut|unregister",{shortcut:t})},t.unregisterAll=async function(){await a("plugin:global-shortcut|unregister_all")},t}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_PLUGIN_GLOBALSHORTCUT__})} diff --git a/plugins/log/api-iife.js b/plugins/log/api-iife.js index 38e80058f..b6daa4969 100644 --- a/plugins/log/api-iife.js +++ b/plugins/log/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o="string"==typeof t?.target?{kind:"AnyLabel",label:t.target}:t?.target??{kind:"Any"};return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:u}=a??{};let l=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===l&&(l="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:l,file:i,line:c,keyValues:u})}async function c(e){return await o("log://log",(n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})}))}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG="tauri://drag",e.DROP="tauri://drop",e.DROP_OVER="tauri://drop-over",e.DROP_CANCELLED="tauri://drag-cancelled"}(a||(a={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await c((({level:e,message:n})=>{switch(e){case t.Trace:console.log(n);break;case t.Debug:console.debug(n);break;case t.Info:console.info(n);break;case t.Warn:console.warn(n);break;case t.Error:console.error(n);break;default:throw new Error(`unknown log level ${e}`)}}))},e.attachLogger=c,e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_LOG__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var a,t;async function o(e,a,t){const o=(void 0,{kind:"Any"});return r("plugin:event|listen",{event:e,target:o,handler:n(a)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(e,n,a){const t=(new Error).stack?.split("\n").map((e=>e.split("@"))),o=t?.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:i,line:c,keyValues:u}=a??{};let l=o?.[0]?.filter((e=>e.length>0)).join("@");"Error"===l&&(l="webview::unknown"),await r("plugin:log|log",{level:e,message:n,location:l,file:i,line:c,keyValues:u})}async function c(e){return await o("log://log",(n=>{const{level:r}=n.payload;let{message:a}=n.payload;a=a.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),e({message:a,level:r})}))}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG="tauri://drag",e.DROP="tauri://drop",e.DROP_OVER="tauri://drop-over",e.DROP_CANCELLED="tauri://drag-cancelled"}(a||(a={})),function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(t||(t={})),e.attachConsole=async function(){return await c((({level:e,message:n})=>{switch(e){case t.Trace:console.log(n);break;case t.Debug:console.debug(n);break;case t.Info:console.info(n);break;case t.Warn:console.warn(n);break;case t.Error:console.error(n);break;default:throw new Error(`unknown log level ${e}`)}}))},e.attachLogger=c,e.debug=async function(e,n){await i(t.Debug,e,n)},e.error=async function(e,n){await i(t.Error,e,n)},e.info=async function(e,n){await i(t.Info,e,n)},e.trace=async function(e,n){await i(t.Trace,e,n)},e.warn=async function(e,n){await i(t.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_PLUGIN_LOG__})} diff --git a/plugins/notification/api-iife.js b/plugins/notification/api-iife.js index 45602bfaa..1f961120b 100644 --- a/plugins/notification/api-iife.js +++ b/plugins/notification/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,e,n){if("a"===e&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!n:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?n:"a"===e?n.call(i):n?n.value:t.get(i)}function e(i,t,e,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(i,e):o?o.value=e:t.set(i,e),e}var n,o,a,r,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),o.set(this,0),a.set(this,{}),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r===t(this,o,"f")){e(this,o,r+1,"f"),t(this,n,"f").call(this,i);const c=Object.keys(t(this,a,"f"));if(c.length>0){let i=r+1;for(const e of c.sort()){if(parseInt(e)!==i)break;{const o=t(this,a,"f")[e];delete t(this,a,"f")[e],t(this,n,"f").call(this,o),i+=1}}}}else t(this,a,"f")[r.toString()]=i}))}set onmessage(i){e(this,n,i,"f")}get onmessage(){return t(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}n=new WeakMap,o=new WeakMap,a=new WeakMap;class u{constructor(i,t,e){this.plugin=i,this.event=t,this.channelId=e}async unregister(){return w(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(i,t,e){const n=new l;return n.onmessage=e,w(`plugin:${i}|register_listener`,{event:t,handler:n}).then((()=>new u(i,t,n.id)))}async function w(i,t={},e){return window.__TAURI_INTERNALS__.invoke(i,t,e)}i.ScheduleEvery=void 0,(r=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",r.Month="month",r.TwoWeeks="twoWeeks",r.Week="week",r.Day="day",r.Hour="hour",r.Minute="minute",r.Second="second";return i.Importance=void 0,(c=i.Importance||(i.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",i.Schedule=class{static at(i,t=!1,e=!1){return{at:{date:i,repeating:t,allowWhileIdle:e},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,e=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:e}}}},i.active=async function(){return await w("plugin:notification|get_active")},i.cancel=async function(i){await w("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await w("plugin:notification|cancel")},i.channels=async function(){return await w("plugin:notification|listChannels")},i.createChannel=async function(i){await w("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await w("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await f("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await f("notification","notification",i)},i.pending=async function(){return await w("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await w("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await w("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await w("plugin:notification|remove_active")},i.removeChannel=async function(i){await w("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_NOTIFICATION__=function(i){"use strict";function t(i,t,n,e){if("a"===n&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?i!==t||!e:!t.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?e:"a"===n?e.call(i):e?e.value:t.get(i)}function n(i,t,n,e,o){if("function"==typeof t?i!==t||!o:!t.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(i,n),n}var e,o,a,r,c,s;"function"==typeof SuppressedError&&SuppressedError;class l{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,e.set(this,(()=>{})),o.set(this,0),a.set(this,{}),this.id=function(i,t=!1){return window.__TAURI_INTERNALS__.transformCallback(i,t)}((({message:i,id:r})=>{if(r===t(this,o,"f")){n(this,o,r+1),t(this,e,"f").call(this,i);const c=Object.keys(t(this,a,"f"));if(c.length>0){let i=r+1;for(const n of c.sort()){if(parseInt(n)!==i)break;{const o=t(this,a,"f")[n];delete t(this,a,"f")[n],t(this,e,"f").call(this,o),i+=1}}n(this,o,i)}}else t(this,a,"f")[r.toString()]=i}))}set onmessage(i){n(this,e,i)}get onmessage(){return t(this,e,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}e=new WeakMap,o=new WeakMap,a=new WeakMap;class u{constructor(i,t,n){this.plugin=i,this.event=t,this.channelId=n}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}}async function f(i,t,n){const e=new l;return e.onmessage=n,d(`plugin:${i}|register_listener`,{event:t,handler:e}).then((()=>new u(i,t,e.id)))}async function d(i,t={},n){return window.__TAURI_INTERNALS__.invoke(i,t,n)}i.ScheduleEvery=void 0,(r=i.ScheduleEvery||(i.ScheduleEvery={})).Year="year",r.Month="month",r.TwoWeeks="twoWeeks",r.Week="week",r.Day="day",r.Hour="hour",r.Minute="minute",r.Second="second";return i.Importance=void 0,(c=i.Importance||(i.Importance={}))[c.None=0]="None",c[c.Min=1]="Min",c[c.Low=2]="Low",c[c.Default=3]="Default",c[c.High=4]="High",i.Visibility=void 0,(s=i.Visibility||(i.Visibility={}))[s.Secret=-1]="Secret",s[s.Private=0]="Private",s[s.Public=1]="Public",i.Schedule=class{static at(i,t=!1,n=!1){return{at:{date:i,repeating:t,allowWhileIdle:n},interval:void 0,every:void 0}}static interval(i,t=!1){return{at:void 0,interval:{interval:i,allowWhileIdle:t},every:void 0}}static every(i,t,n=!1){return{at:void 0,interval:void 0,every:{interval:i,count:t,allowWhileIdle:n}}}},i.active=async function(){return await d("plugin:notification|get_active")},i.cancel=async function(i){await d("plugin:notification|cancel",{notifications:i})},i.cancelAll=async function(){await d("plugin:notification|cancel")},i.channels=async function(){return await d("plugin:notification|listChannels")},i.createChannel=async function(i){await d("plugin:notification|create_channel",{...i})},i.isPermissionGranted=async function(){return"default"!==window.Notification.permission?await Promise.resolve("granted"===window.Notification.permission):await d("plugin:notification|is_permission_granted")},i.onAction=async function(i){return await f("notification","actionPerformed",i)},i.onNotificationReceived=async function(i){return await f("notification","notification",i)},i.pending=async function(){return await d("plugin:notification|get_pending")},i.registerActionTypes=async function(i){await d("plugin:notification|register_action_types",{types:i})},i.removeActive=async function(i){await d("plugin:notification|remove_active",{notifications:i})},i.removeAllActive=async function(){await d("plugin:notification|remove_active")},i.removeChannel=async function(i){await d("plugin:notification|delete_channel",{id:i})},i.requestPermission=async function(){return await window.Notification.requestPermission()},i.sendNotification=function(i){"string"==typeof i?new window.Notification(i):new window.Notification(i.title,i)},i}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_PLUGIN_NOTIFICATION__})} diff --git a/plugins/shell/api-iife.js b/plugins/shell/api-iife.js index 00f2b2889..971f25802 100644 --- a/plugins/shell/api-iife.js +++ b/plugins/shell/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e){"use strict";function t(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}function s(e,t,s,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,s):n?n.value=s:t.set(e,s),s}var r,n,i;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:o})=>{if(o===t(this,n,"f")){s(this,n,o+1,"f"),t(this,r,"f").call(this,e);const a=Object.keys(t(this,i,"f"));if(a.length>0){let e=o+1;for(const s of a.sort()){if(parseInt(s)!==e)break;{const n=t(this,i,"f")[s];delete t(this,i,"f")[s],t(this,r,"f").call(this,n),e+=1}}}}else t(this,i,"f")[o.toString()]=e}))}set onmessage(e){s(this,r,e,"f")}get onmessage(){return t(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}r=new WeakMap,n=new WeakMap,i=new WeakMap;class h{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.addListener(e,s)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const s=this.eventListeners[e];for(const e of s)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const s=r=>{this.removeListener(e,s),t(r)};return this.prependListener(e,s)}}class c{constructor(e){this.pid=e}async write(e){await a("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){await a("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class u extends h{constructor(e,t=[],s){super(),this.stdout=new h,this.stderr=new h,this.program=e,this.args="string"==typeof t?[t]:t,this.options=s??{}}static create(e,t=[],s){return new u(e,t,s)}static sidecar(e,t=[],s){const r=new u(e,t,s);return r.options.sidecar=!0,r}async spawn(){return await async function(e,t,s=[],r){"object"==typeof s&&Object.freeze(s);const n=new o;return n.onmessage=e,await a("plugin:shell|execute",{program:t,args:s,options:r,onEvent:n})}((e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((e=>new c(e)))}async execute(){return await new Promise(((e,t)=>{this.on("error",t);const s=[],r=[];this.stdout.on("data",(e=>{s.push(e)})),this.stderr.on("data",(e=>{r.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(s),stderr:this.collectOutput(r)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=c,e.Command=u,e.EventEmitter=h,e.open=async function(e,t){await a("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(t){"use strict";function e(t,e,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(t):n?n.value:e.get(t)}function s(t,e,s,n,i){if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,s),s}var n,i,r;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),i.set(this,0),r.set(this,{}),this.id=function(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((({message:t,id:o})=>{if(o===e(this,i,"f")){s(this,i,o+1),e(this,n,"f").call(this,t);const a=Object.keys(e(this,r,"f"));if(a.length>0){let t=o+1;for(const s of a.sort()){if(parseInt(s)!==t)break;{const i=e(this,r,"f")[s];delete e(this,r,"f")[s],e(this,n,"f").call(this,i),t+=1}}s(this,i,t)}}else e(this,r,"f")[o.toString()]=t}))}set onmessage(t){s(this,n,t)}get onmessage(){return e(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(t,e={},s){return window.__TAURI_INTERNALS__.invoke(t,e,s)}n=new WeakMap,i=new WeakMap,r=new WeakMap;class h{constructor(){this.eventListeners=Object.create(null)}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}on(t,e){return t in this.eventListeners?this.eventListeners[t].push(e):this.eventListeners[t]=[e],this}once(t,e){const s=n=>{this.removeListener(t,s),e(n)};return this.addListener(t,s)}off(t,e){return t in this.eventListeners&&(this.eventListeners[t]=this.eventListeners[t].filter((t=>t!==e))),this}removeAllListeners(t){return t?delete this.eventListeners[t]:this.eventListeners=Object.create(null),this}emit(t,e){if(t in this.eventListeners){const s=this.eventListeners[t];for(const t of s)t(e);return!0}return!1}listenerCount(t){return t in this.eventListeners?this.eventListeners[t].length:0}prependListener(t,e){return t in this.eventListeners?this.eventListeners[t].unshift(e):this.eventListeners[t]=[e],this}prependOnceListener(t,e){const s=n=>{this.removeListener(t,s),e(n)};return this.prependListener(t,s)}}class c{constructor(t){this.pid=t}async write(t){await a("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)})}async kill(){await a("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class u extends h{constructor(t,e=[],s){super(),this.stdout=new h,this.stderr=new h,this.program=t,this.args="string"==typeof e?[e]:e,this.options=s??{}}static create(t,e=[],s){return new u(t,e,s)}static sidecar(t,e=[],s){const n=new u(t,e,s);return n.options.sidecar=!0,n}async spawn(){return await async function(t,e,s=[],n){"object"==typeof s&&Object.freeze(s);const i=new o;return i.onmessage=t,await a("plugin:shell|execute",{program:e,args:s,options:n,onEvent:i})}((t=>{switch(t.event){case"Error":this.emit("error",t.payload);break;case"Terminated":this.emit("close",t.payload);break;case"Stdout":this.stdout.emit("data",t.payload);break;case"Stderr":this.stderr.emit("data",t.payload)}}),this.program,this.args,this.options).then((t=>new c(t)))}async execute(){return await new Promise(((t,e)=>{this.on("error",e);const s=[],n=[];this.stdout.on("data",(t=>{s.push(t)})),this.stderr.on("data",(t=>{n.push(t)})),this.on("close",(e=>{t({code:e.code,signal:e.signal,stdout:this.collectOutput(s),stderr:this.collectOutput(n)})})),this.spawn().catch(e)}))}collectOutput(t){return"raw"===this.options.encoding?t.reduce(((t,e)=>new Uint8Array([...t,...e,10])),new Uint8Array):t.join("\n")}}return t.Child=c,t.Command=u,t.EventEmitter=h,t.open=async function(t,e){await a("plugin:shell|open",{path:t,with:e})},t}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})} diff --git a/plugins/store/api-iife.js b/plugins/store/api-iife.js index a44e3c503..77bea5295 100644 --- a/plugins/store/api-iife.js +++ b/plugins/store/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";function a(t,a=!1){return window.__TAURI_INTERNALS__.transformCallback(t,a)}async function e(t,a={},e){return window.__TAURI_INTERNALS__.invoke(t,a,e)}var n;async function r(t,n,r){const i="string"==typeof r?.target?{kind:"AnyLabel",label:r.target}:r?.target??{kind:"Any"};return e("plugin:event|listen",{event:t,target:i,handler:a(n)}).then((a=>async()=>async function(t,a){await e("plugin:event|unlisten",{event:t,eventId:a})}(t,a)))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG="tauri://drag",t.DROP="tauri://drop",t.DROP_OVER="tauri://drop-over",t.DROP_CANCELLED="tauri://drag-cancelled"}(n||(n={}));return t.Store=class{constructor(t){this.path=t}async set(t,a){await e("plugin:store|set",{path:this.path,key:t,value:a})}async get(t){return await e("plugin:store|get",{path:this.path,key:t})}async has(t){return await e("plugin:store|has",{path:this.path,key:t})}async delete(t){return await e("plugin:store|delete",{path:this.path,key:t})}async clear(){await e("plugin:store|clear",{path:this.path})}async reset(){await e("plugin:store|reset",{path:this.path})}async keys(){return await e("plugin:store|keys",{path:this.path})}async values(){return await e("plugin:store|values",{path:this.path})}async entries(){return await e("plugin:store|entries",{path:this.path})}async length(){return await e("plugin:store|length",{path:this.path})}async load(){await e("plugin:store|load",{path:this.path})}async save(){await e("plugin:store|save",{path:this.path})}async onKeyChange(t,a){return await r("store://change",(e=>{e.payload.path===this.path&&e.payload.key===t&&a(e.payload.value)}))}async onChange(t){return await r("store://change",(a=>{a.payload.path===this.path&&t(a.payload.key,a.payload.value)}))}},t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_STORE__=function(t){"use strict";function a(t,a=!1){return window.__TAURI_INTERNALS__.transformCallback(t,a)}async function e(t,a={},e){return window.__TAURI_INTERNALS__.invoke(t,a,e)}var n;async function r(t,n,r){const i=(void 0,{kind:"Any"});return e("plugin:event|listen",{event:t,target:i,handler:a(n)}).then((a=>async()=>async function(t,a){await e("plugin:event|unlisten",{event:t,eventId:a})}(t,a)))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG="tauri://drag",t.DROP="tauri://drop",t.DROP_OVER="tauri://drop-over",t.DROP_CANCELLED="tauri://drag-cancelled"}(n||(n={}));return t.Store=class{constructor(t){this.path=t}async set(t,a){await e("plugin:store|set",{path:this.path,key:t,value:a})}async get(t){return await e("plugin:store|get",{path:this.path,key:t})}async has(t){return await e("plugin:store|has",{path:this.path,key:t})}async delete(t){return await e("plugin:store|delete",{path:this.path,key:t})}async clear(){await e("plugin:store|clear",{path:this.path})}async reset(){await e("plugin:store|reset",{path:this.path})}async keys(){return await e("plugin:store|keys",{path:this.path})}async values(){return await e("plugin:store|values",{path:this.path})}async entries(){return await e("plugin:store|entries",{path:this.path})}async length(){return await e("plugin:store|length",{path:this.path})}async load(){await e("plugin:store|load",{path:this.path})}async save(){await e("plugin:store|save",{path:this.path})}async onKeyChange(t,a){return await r("store://change",(e=>{e.payload.path===this.path&&e.payload.key===t&&a(e.payload.value)}))}async onChange(t){return await r("store://change",(a=>{a.payload.path===this.path&&t(a.payload.key,a.payload.value)}))}},t}({});Object.defineProperty(window.__TAURI__,"store",{value:__TAURI_PLUGIN_STORE__})} diff --git a/plugins/updater/api-iife.js b/plugins/updater/api-iife.js index 4a701ad7b..86e602948 100644 --- a/plugins/updater/api-iife.js +++ b/plugins/updater/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function t(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)}function r(e,t,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,r):n?n.value=r:t.set(e,r),r}var s,n,i,a;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:a})=>{if(a===t(this,n,"f")){r(this,n,a+1,"f"),t(this,s,"f").call(this,e);const o=Object.keys(t(this,i,"f"));if(o.length>0){let e=a+1;for(const r of o.sort()){if(parseInt(r)!==e)break;{const n=t(this,i,"f")[r];delete t(this,i,"f")[r],t(this,s,"f").call(this,n),e+=1}}}}else t(this,i,"f")[a.toString()]=e}))}set onmessage(e){r(this,s,e,"f")}get onmessage(){return t(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function c(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}s=new WeakMap,n=new WeakMap,i=new WeakMap;class d{get rid(){return t(this,a,"f")}constructor(e){a.set(this,void 0),r(this,a,e,"f")}async close(){return c("plugin:resources|close",{rid:this.rid})}}a=new WeakMap;class l extends d{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const t=new o;null!=e&&(t.onmessage=e),await c("plugin:updater|download_and_install",{onEvent:t,rid:this.rid})}}return e.Update=l,e.check=async function(e){return null!=e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),await c("plugin:updater|check",{...e}).then((e=>e.available?new l(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function t(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}function s(e,t,s,r,n){if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var r,n,i,a;"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),n.set(this,0),i.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:a})=>{if(a===t(this,n,"f")){s(this,n,a+1),t(this,r,"f").call(this,e);const o=Object.keys(t(this,i,"f"));if(o.length>0){let e=a+1;for(const s of o.sort()){if(parseInt(s)!==e)break;{const n=t(this,i,"f")[s];delete t(this,i,"f")[s],t(this,r,"f").call(this,n),e+=1}}s(this,n,e)}}else t(this,i,"f")[a.toString()]=e}))}set onmessage(e){s(this,r,e)}get onmessage(){return t(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function c(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}r=new WeakMap,n=new WeakMap,i=new WeakMap;class d{get rid(){return t(this,a,"f")}constructor(e){a.set(this,void 0),s(this,a,e)}async close(){return c("plugin:resources|close",{rid:this.rid})}}a=new WeakMap;class h extends d{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const t=new o;null!=e&&(t.onmessage=e),await c("plugin:updater|download_and_install",{onEvent:t,rid:this.rid})}}return e.Update=h,e.check=async function(e){return null!=e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),await c("plugin:updater|check",{...e}).then((e=>e.available?new h(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})} diff --git a/plugins/upload/api-iife.js b/plugins/upload/api-iife.js index 1c5089ae1..459beda90 100644 --- a/plugins/upload/api-iife.js +++ b/plugins/upload/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_UPLOAD__=function(e){"use strict";function t(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function n(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}var r,o,s;"function"==typeof SuppressedError&&SuppressedError;class a{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),o.set(this,0),s.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:a})=>{if(a===t(this,o,"f")){n(this,o,a+1,"f"),t(this,r,"f").call(this,e);const i=Object.keys(t(this,s,"f"));if(i.length>0){let e=a+1;for(const n of i.sort()){if(parseInt(n)!==e)break;{const o=t(this,s,"f")[n];delete t(this,s,"f")[n],t(this,r,"f").call(this,o),e+=1}}}}else t(this,s,"f")[a.toString()]=e}))}set onmessage(e){n(this,r,e,"f")}get onmessage(){return t(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function i(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}return r=new WeakMap,o=new WeakMap,s=new WeakMap,e.download=async function(e,t,n,r){const o=new Uint32Array(1);window.crypto.getRandomValues(o);const s=o[0],c=new a;null!=n&&(c.onmessage=n),await i("plugin:upload|download",{id:s,url:e,filePath:t,headers:r??{},onProgress:c})},e.upload=async function(e,t,n,r){const o=new Uint32Array(1);window.crypto.getRandomValues(o);const s=o[0],c=new a;return null!=n&&(c.onmessage=n),await i("plugin:upload|upload",{id:s,url:e,filePath:t,headers:r??{},onProgress:c})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_PLUGIN_UPLOAD__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_UPLOAD__=function(e){"use strict";function t(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function n(e,t,n,o,s){if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var o,s,r;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,o.set(this,(()=>{})),s.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:e,id:i})=>{if(i===t(this,s,"f")){n(this,s,i+1),t(this,o,"f").call(this,e);const a=Object.keys(t(this,r,"f"));if(a.length>0){let e=i+1;for(const n of a.sort()){if(parseInt(n)!==e)break;{const s=t(this,r,"f")[n];delete t(this,r,"f")[n],t(this,o,"f").call(this,s),e+=1}}n(this,s,e)}}else t(this,r,"f")[i.toString()]=e}))}set onmessage(e){n(this,o,e)}get onmessage(){return t(this,o,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}return o=new WeakMap,s=new WeakMap,r=new WeakMap,e.download=async function(e,t,n,o){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0],c=new i;null!=n&&(c.onmessage=n),await a("plugin:upload|download",{id:r,url:e,filePath:t,headers:o??{},onProgress:c})},e.upload=async function(e,t,n,o){const s=new Uint32Array(1);window.crypto.getRandomValues(s);const r=s[0],c=new i;return null!=n&&(c.onmessage=n),await a("plugin:upload|upload",{id:r,url:e,filePath:t,headers:o??{},onProgress:c})},e}({});Object.defineProperty(window.__TAURI__,"upload",{value:__TAURI_PLUGIN_UPLOAD__})} diff --git a/plugins/websocket/api-iife.js b/plugins/websocket/api-iife.js index 941602b31..944d7a61a 100644 --- a/plugins/websocket/api-iife.js +++ b/plugins/websocket/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WEBSOCKET__=function(){"use strict";function e(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}function t(e,t,s,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,s):n?n.value=s:t.set(e,s),s}var s,r,n;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),r.set(this,0),n.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:i,id:a})=>{if(a===e(this,r,"f")){t(this,r,a+1,"f"),e(this,s,"f").call(this,i);const o=Object.keys(e(this,n,"f"));if(o.length>0){let t=a+1;for(const r of o.sort()){if(parseInt(r)!==t)break;{const i=e(this,n,"f")[r];delete e(this,n,"f")[r],e(this,s,"f").call(this,i),t+=1}}}}else e(this,n,"f")[a.toString()]=i}))}set onmessage(e){t(this,s,e,"f")}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}s=new WeakMap,r=new WeakMap,n=new WeakMap;class o{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const s=[],r=new i;return r.onmessage=e=>{s.forEach((t=>{t(e)}))},null!=t?.headers&&(t.headers=Array.from(new Headers(t.headers).entries())),await a("plugin:websocket|connect",{url:e,onMessage:r,config:t}).then((e=>new o(e,s)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}await a("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return o}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_PLUGIN_WEBSOCKET__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_WEBSOCKET__=function(){"use strict";function e(e,t,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(e):n?n.value:t.get(e)}function t(e,t,s,n,r){if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,s),s}var s,n,r;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,s.set(this,(()=>{})),n.set(this,0),r.set(this,{}),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((({message:i,id:a})=>{if(a===e(this,n,"f")){t(this,n,a+1),e(this,s,"f").call(this,i);const o=Object.keys(e(this,r,"f"));if(o.length>0){let i=a+1;for(const t of o.sort()){if(parseInt(t)!==i)break;{const n=e(this,r,"f")[t];delete e(this,r,"f")[t],e(this,s,"f").call(this,n),i+=1}}t(this,n,i)}}else e(this,r,"f")[a.toString()]=i}))}set onmessage(e){t(this,s,e)}get onmessage(){return e(this,s,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},s){return window.__TAURI_INTERNALS__.invoke(e,t,s)}s=new WeakMap,n=new WeakMap,r=new WeakMap;class o{constructor(e,t){this.id=e,this.listeners=t}static async connect(e,t){const s=[],n=new i;return n.onmessage=e=>{s.forEach((t=>{t(e)}))},null!=t?.headers&&(t.headers=Array.from(new Headers(t.headers).entries())),await a("plugin:websocket|connect",{url:e,onMessage:n,config:t}).then((e=>new o(e,s)))}addListener(e){this.listeners.push(e)}async send(e){let t;if("string"==typeof e)t={type:"Text",data:e};else if("object"==typeof e&&"type"in e)t=e;else{if(!Array.isArray(e))throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");t={type:"Binary",data:e}}await a("plugin:websocket|send",{id:this.id,message:t})}async disconnect(){await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}return o}();Object.defineProperty(window.__TAURI__,"websocket",{value:__TAURI_PLUGIN_WEBSOCKET__})} diff --git a/plugins/window-state/api-iife.js b/plugins/window-state/api-iife.js index 6b6f96c69..54090898c 100644 --- a/plugins/window-state/api-iife.js +++ b/plugins/window-state/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOWSTATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,i):a?a.value=i:t.set(e,i)}(this,t,e,"f")}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function w(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function h(e,t,i){const n="string"==typeof i?.target?{kind:"AnyLabel",label:i.target}:i?.target??{kind:"Any"};return s("plugin:event|listen",{event:e,target:n,handler:l(t)}).then((t=>async()=>w(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG="tauri://drag",e.DROP="tauri://drop",e.DROP_OVER="tauri://drop-over",e.DROP_CANCELLED="tauri://drag-cancelled"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:p(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:p(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function p(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class y{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new m(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new m(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const f=["tauri://created","tauri://error"];class m{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t?.skip||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:t.parent?.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return _().find((t=>t.label===e))??null}static getCurrent(){return g()}static getAll(){return _()}static async getFocusedWindow(){for(const e of _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):h(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):async function(e,t,i){return h(e,(i=>{t(i),w(e,i.id).catch((()=>{}))}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(f.includes(e)){for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t});return Promise.resolve()}return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t)}async emitTo(e,t,i){if(f.includes(t)){for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i});return Promise.resolve()}return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i)}_handleTauriEvent(e,t){return!!f.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===n.Critical?{type:"Critical"}:{type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");const t={};return t[`${e.type}`]={width:e.width,height:e.height},s("plugin:window|set_size",{label:this.label,value:t})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_min_size",{label:this.label,value:t})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_max_size",{label:this.label,value:t})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_position",{label:this.label,value:t})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:p(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_cursor_position",{label:this.label,value:t})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async onResized(e){return this.listen(i.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new u(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(i.WINDOW_MOVED,(t=>{t.payload=I(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(i.WINDOW_CLOSE_REQUESTED,(t=>{const i=new y(t);Promise.resolve(e(i)).then((()=>{if(!i.isPreventDefault())return this.destroy()}))}))}async onDragDropEvent(e){const t=await this.listen(i.DRAG,(t=>{e({...t,payload:{type:"dragged",paths:t.payload.paths,position:I(t.payload.position)}})})),n=await this.listen(i.DROP,(t=>{e({...t,payload:{type:"dropped",paths:t.payload.paths,position:I(t.payload.position)}})})),a=await this.listen(i.DROP_OVER,(t=>{e({...t,payload:{type:"dragOver",position:I(t.payload.position)}})})),l=await this.listen(i.DROP_CANCELLED,(t=>{e({...t,payload:{type:"cancelled"}})}));return()=>{t(),n(),a(),l()}}async onFocusChanged(e){const t=await this.listen(i.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),n=await this.listen(i.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),n()}}async onScaleChanged(e){return this.listen(i.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(i.WINDOW_THEME_CHANGED,e)}}var v,E,D;function I(e){return new d(e.x,e.y)}async function S(e,t){await s("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(v||(v={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(E||(E={})),e.StateFlags=void 0,(D=e.StateFlags||(e.StateFlags={}))[D.SIZE=1]="SIZE",D[D.POSITION=2]="POSITION",D[D.MAXIMIZED=4]="MAXIMIZED",D[D.VISIBLE=8]="VISIBLE",D[D.DECORATIONS=16]="DECORATIONS",D[D.FULLSCREEN=32]="FULLSCREEN",D[D.ALL=63]="ALL",e.filename=async function(){return await s("plugin:window-state|filename")},e.restoreState=S,e.restoreStateCurrent=async function(e){await S(g().label,e)},e.saveWindowState=async function(e){await s("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOWSTATE__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOWSTATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,i)}(this,t,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function w(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function h(e,t,i){var n;const a="string"==typeof(null==i?void 0:i.target)?{kind:"AnyLabel",label:i.target}:null!==(n=null==i?void 0:i.target)&&void 0!==n?n:{kind:"Any"};return s("plugin:event|listen",{event:e,target:a,handler:l(t)}).then((t=>async()=>w(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG="tauri://drag",e.DROP="tauri://drop",e.DROP_OVER="tauri://drop-over",e.DROP_CANCELLED="tauri://drag-cancelled"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:p(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:p(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function p(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class y{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new f(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new f(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const m=["tauri://created","tauri://error"];class f{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),(null==t?void 0:t.skip)||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){var t;return null!==(t=_().find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return g()}static getAll(){return _()}static async getFocusedWindow(){for(const e of _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):h(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve((()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)})):async function(e,t,i){return h(e,(i=>{t(i),w(e,i.id).catch((()=>{}))}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(m.includes(e)){for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t});return Promise.resolve()}return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t)}async emitTo(e,t,i){if(m.includes(t)){for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i});return Promise.resolve()}return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i)}_handleTauriEvent(e,t){return!!m.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then((({x:e,y:t})=>new d(e,t)))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then((({width:e,height:t})=>new u(e,t)))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===n.Critical?{type:"Critical"}:{type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");const t={};return t[`${e.type}`]={width:e.width,height:e.height},s("plugin:window|set_size",{label:this.label,value:t})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_min_size",{label:this.label,value:t})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");let t=null;return e&&(t={},t[`${e.type}`]={width:e.width,height:e.height}),s("plugin:window|set_max_size",{label:this.label,value:t})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_position",{label:this.label,value:t})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:p(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");const t={};return t[`${e.type}`]={x:e.x,y:e.y},s("plugin:window|set_cursor_position",{label:this.label,value:t})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async onResized(e){return this.listen(i.WINDOW_RESIZED,(t=>{var i;t.payload=(i=t.payload,new u(i.width,i.height)),e(t)}))}async onMoved(e){return this.listen(i.WINDOW_MOVED,(t=>{t.payload=I(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(i.WINDOW_CLOSE_REQUESTED,(t=>{const i=new y(t);Promise.resolve(e(i)).then((()=>{if(!i.isPreventDefault())return this.destroy()}))}))}async onDragDropEvent(e){const t=await this.listen(i.DRAG,(t=>{e({...t,payload:{type:"dragged",paths:t.payload.paths,position:I(t.payload.position)}})})),n=await this.listen(i.DROP,(t=>{e({...t,payload:{type:"dropped",paths:t.payload.paths,position:I(t.payload.position)}})})),a=await this.listen(i.DROP_OVER,(t=>{e({...t,payload:{type:"dragOver",position:I(t.payload.position)}})})),l=await this.listen(i.DROP_CANCELLED,(t=>{e({...t,payload:{type:"cancelled"}})}));return()=>{t(),n(),a(),l()}}async onFocusChanged(e){const t=await this.listen(i.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),n=await this.listen(i.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),n()}}async onScaleChanged(e){return this.listen(i.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(i.WINDOW_THEME_CHANGED,e)}}var v,E,D;function I(e){return new d(e.x,e.y)}async function S(e,t){await s("plugin:window-state|restore_state",{label:e,flags:t})}return function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(v||(v={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(E||(E={})),e.StateFlags=void 0,(D=e.StateFlags||(e.StateFlags={}))[D.SIZE=1]="SIZE",D[D.POSITION=2]="POSITION",D[D.MAXIMIZED=4]="MAXIMIZED",D[D.VISIBLE=8]="VISIBLE",D[D.DECORATIONS=16]="DECORATIONS",D[D.FULLSCREEN=32]="FULLSCREEN",D[D.ALL=63]="ALL",e.filename=async function(){return await s("plugin:window-state|filename")},e.restoreState=S,e.restoreStateCurrent=async function(e){await S(g().label,e)},e.saveWindowState=async function(e){await s("plugin:window-state|save_window_state",{flags:e})},e}({});Object.defineProperty(window.__TAURI__,"windowState",{value:__TAURI_PLUGIN_WINDOWSTATE__})}