if("__TAURI__"in window){var __TAURI_PLUGIN_SHELL__=function(e,t){"use strict";class s{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=n=>{this.removeListener(e,s),t(n)};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=n=>{this.removeListener(e,s),t(n)};return this.prependListener(e,s)}}class n{constructor(e){this.pid=e}async write(e){await t.invoke("plugin:shell|stdin_write",{pid:this.pid,buffer:e})}async kill(){await t.invoke("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class i extends s{constructor(e,t=[],n){super(),this.stdout=new s,this.stderr=new s,this.program=e,this.args="string"==typeof t?[t]:t,this.options=n??{}}static create(e,t=[],s){return new i(e,t,s)}static sidecar(e,t=[],s){const n=new i(e,t,s);return n.options.sidecar=!0,n}async spawn(){const e=this.program,s=this.args,i=this.options;"object"==typeof s&&Object.freeze(s);const r=new t.Channel;return r.onmessage=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)}},await t.invoke("plugin:shell|spawn",{program:e,args:s,options:i,onEvent:r}).then(e=>new n(e))}async execute(){const e=this.program,s=this.args,n=this.options;return"object"==typeof s&&Object.freeze(s),await t.invoke("plugin:shell|execute",{program:e,args:s,options:n})}}return e.Child=n,e.Command=i,e.EventEmitter=s,e.open=async function(e,s){await t.invoke("plugin:shell|open",{path:e,with:s})},e}({},window.__TAURI__.core);Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_PLUGIN_SHELL__})}