2025-03-13 14:40:12 +00:00

7 lines
40 KiB
JavaScript

var AF="__DESTROY__";var GF=class{name="worker-child-io";messageQueue=[];resolveRead=null;constructor(){self.onmessage=this.handleMessage}handleMessage=(F)=>{let Q=F.data;if(Q===AF){this.destroy();return}if(this.resolveRead)this.resolveRead(Q),this.resolveRead=null;else this.messageQueue.push(Q)};async read(){if(this.messageQueue.length>0)return this.messageQueue.shift()??null;return new Promise((F)=>{this.resolveRead=F})}async write(F){self.postMessage(F)}destroy(){self.postMessage(AF),self.close()}signalDestroy(){self.postMessage(AF)}};function yQ(F,Q){if(Q instanceof Uint8Array)return{type:"Uint8Array",data:Array.from(Q)};return Q}function vQ(F,Q){if(Q&&Q.type==="Uint8Array"&&Array.isArray(Q.data))return new Uint8Array(Q.data);return Q}function n(F){return JSON.stringify(F,yQ)+`
`}function rF(F){return new Promise((Q,$)=>{try{let Y=JSON.parse(F,vQ);Q(Y)}catch(Y){console.error("failed to parse message",typeof F,F,Y),$(Y)}})}function $F(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var k=class{constructor(F,Q){this.io=F,this.apiImplementation=Q?.expose,this.listen()}pendingRequests={};callbacks={};callbackCache=new Map;count=0;messageStr="";apiImplementation;expose(F){this.apiImplementation=F}getIO(){return this.io}async listen(){while(!0){let F=await this.io.read();if(!F)continue;let Q=F.toString("utf-8");if(Q.trim().length===0)continue;this.messageStr+=Q;let $=this.messageStr[this.messageStr.length-1],Y=this.messageStr.split(`
`),M=$===`
`?Y:Y.slice(0,-1);this.messageStr=$===`
`?"":Y.at(-1)??"";for(let w of M.map((T)=>T.trim()).filter(Boolean))if(w.startsWith("{"))this.handleMessageStr(w);else console.log("(kkrpc stdout passthrough):",w)}}async handleMessageStr(F){return this.count++,rF(F).then((Q)=>{if(Q.type==="response")this.handleResponse(Q);else if(Q.type==="request")this.handleRequest(Q);else if(Q.type==="callback")this.handleCallback(Q);else console.error("received unknown message type",Q,typeof Q)}).catch((Q)=>{console.log("(kkrpc stdout passthrough):",F)})}callMethod(F,Q){return new Promise(($,Y)=>{let M=$F();this.pendingRequests[M]={resolve:$,reject:Y};let w=[],T=Q.map((x)=>{if(typeof x==="function"){let R=this.callbackCache.get(x);if(!R)R=$F(),this.callbacks[R]=x,this.callbackCache.set(x,R);return w.push(R),`__callback__${R}`}return x}),X={id:M,method:F,args:T,type:"request",callbackIds:w.length>0?w:void 0};this.io.write(n(X))})}handleResponse(F){let{id:Q}=F,{result:$,error:Y}=F.args;if(this.pendingRequests[Q]){if(Y)this.pendingRequests[Q].reject(new Error(Y));else this.pendingRequests[Q].resolve($);delete this.pendingRequests[Q]}}handleRequest(F){let{id:Q,method:$,args:Y}=F,M=$.split(".");if(!this.apiImplementation)return;let w=this.apiImplementation;for(let R=0;R<M.length-1;R++)if(w=w[M[R]],!w){this.sendError(Q,`Method path ${$} not found at ${M[R]}`);return}let T=M[M.length-1],X=w[T];if(typeof X!=="function"){this.sendError(Q,`Method ${$} is not a function`);return}let x=Y.map((R)=>{if(typeof R==="string"&&R.startsWith("__callback__")){let A=R.slice(12);return(...b)=>{this.invokeCallback(A,b)}}return R});try{let R=X.apply(w,x);Promise.resolve(R).then((A)=>{return this.sendResponse(Q,A)}).catch((A)=>this.sendError(Q,A.message))}catch(R){this.sendError(Q,R.message??R.toString())}}invokeCallback(F,Q){let $={id:$F(),method:F,args:Q,type:"callback"};this.io.write(n($))}handleCallback(F){let{method:Q,args:$}=F,Y=this.callbacks[Q];if(Y)Y(...$);else console.error(`Callback with id ${Q} not found`)}sendResponse(F,Q){let $={id:F,method:"",args:{result:Q},type:"response"};this.io.write(n($))}sendError(F,Q){let $={id:F,method:"",args:{error:Q},type:"response"};this.io.write(n($))}createNestedProxy(F=[]){return new Proxy(()=>{},{get:(Q,$)=>{if(typeof $==="string"&&$!=="then")return this.createNestedProxy([...F,$]);return},apply:(Q,$,Y)=>{let M=F.join(".");return this.callMethod(M,Y)}})}getAPI(){return this.createNestedProxy()}freeCallbacks(){this.callbacks={},this.callbackCache.clear()}};function C(F,Q,$,Y){if($==="a"&&!Y)throw new TypeError("Private accessor was defined without a getter");if(typeof Q==="function"?F!==Q||!Y:!Q.has(F))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?Y:$==="a"?Y.call(F):Y?Y.value:Q.get(F)}function HF(F,Q,$,Y,M){if(Y==="m")throw new TypeError("Private method is not writable");if(Y==="a"&&!M)throw new TypeError("Private accessor was defined without a setter");if(typeof Q==="function"?F!==Q||!M:!Q.has(F))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Y==="a"?M.call(F,$):M?M.value=$:Q.set(F,$),$}var m,E,u,lQ,oF="__TAURI_TO_IPC_KEY__";function nF(F,Q=!1){return window.__TAURI_INTERNALS__.transformCallback(F,Q)}class NF{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,m.set(this,()=>{}),E.set(this,0),u.set(this,[]),this.id=nF(({message:F,id:Q})=>{if(Q==C(this,E,"f")){C(this,m,"f").call(this,F),HF(this,E,C(this,E,"f")+1,"f");while(C(this,E,"f")in C(this,u,"f")){let $=C(this,u,"f")[C(this,E,"f")];C(this,m,"f").call(this,$),delete C(this,u,"f")[C(this,E,"f")],HF(this,E,C(this,E,"f")+1,"f")}}else C(this,u,"f")[Q]=F})}set onmessage(F){HF(this,m,F,"f")}get onmessage(){return C(this,m,"f")}[(m=new WeakMap,E=new WeakMap,u=new WeakMap,oF)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[oF]()}}lQ=new WeakMap;var iF;(function(F){F.WINDOW_RESIZED="tauri://resize",F.WINDOW_MOVED="tauri://move",F.WINDOW_CLOSE_REQUESTED="tauri://close-requested",F.WINDOW_DESTROYED="tauri://destroyed",F.WINDOW_FOCUS="tauri://focus",F.WINDOW_BLUR="tauri://blur",F.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",F.WINDOW_THEME_CHANGED="tauri://theme-changed",F.WINDOW_CREATED="tauri://window-created",F.WEBVIEW_CREATED="tauri://webview-created",F.DRAG_ENTER="tauri://drag-enter",F.DRAG_OVER="tauri://drag-over",F.DRAG_DROP="tauri://drag-drop",F.DRAG_LEAVE="tauri://drag-leave"})(iF||(iF={}));var d;(function(F){F[F.Audio=1]="Audio",F[F.Cache=2]="Cache",F[F.Config=3]="Config",F[F.Data=4]="Data",F[F.LocalData=5]="LocalData",F[F.Document=6]="Document",F[F.Download=7]="Download",F[F.Picture=8]="Picture",F[F.Public=9]="Public",F[F.Video=10]="Video",F[F.Resource=11]="Resource",F[F.Temp=12]="Temp",F[F.AppConfig=13]="AppConfig",F[F.AppData=14]="AppData",F[F.AppLocalData=15]="AppLocalData",F[F.AppCache=16]="AppCache",F[F.AppLog=17]="AppLog",F[F.Desktop=18]="Desktop",F[F.Executable=19]="Executable",F[F.Font=20]="Font",F[F.Home=21]="Home",F[F.Runtime=22]="Runtime",F[F.Template=23]="Template"})(d||(d={}));var dF;(function(F){F[F.Trace=1]="Trace",F[F.Debug=2]="Debug",F[F.Info=3]="Info",F[F.Warn=4]="Warn",F[F.Error=5]="Error"})(dF||(dF={}));function BF(F){return async function Q($,Y){console.log("fetch",$,Y);let M=Y?.maxRedirections,w=Y?.connectTimeout,T=Y?.proxy;if(Y!=null)delete Y.maxRedirections,delete Y.connectTimeout,delete Y.proxy;let X=Y?.signal,R=(Y?.headers==null?[]:Y.headers instanceof Headers?Array.from(Y.headers.entries()):Array.isArray(Y.headers)?Y.headers:Object.entries(Y.headers)).map(([j,g])=>[j,typeof g==="string"?g:g.toString()]),A=new Request($,Y),b=await A.arrayBuffer(),VF=b.byteLength!==0?Array.from(new Uint8Array(b)):null,FF=await F.rawFetch({clientConfig:{method:A.method,url:A.url,headers:R,data:VF,maxRedirections:M,connectTimeout:w,proxy:T}});X?.addEventListener("abort",()=>{F.fetchCancel(FF)});let{status:KF,statusText:LF,url:jF,headers:L,rid:f}=await F.fetchSend(FF),S=await F.fetchReadBody(f),QF=new Response(S instanceof ArrayBuffer&&S.byteLength!==0?S:S instanceof Array&&S.length>0?new Uint8Array(S):null,{headers:L,status:KF,statusText:LF});return Object.defineProperty(QF,"url",{value:jF}),QF}}class s{constructor(){this.eventListeners=Object.create(null)}addListener(F,Q){return this.on(F,Q)}removeListener(F,Q){return this.off(F,Q)}on(F,Q){if(F in this.eventListeners)this.eventListeners[F].push(Q);else this.eventListeners[F]=[Q];return this}once(F,Q){let $=(Y)=>{this.removeListener(F,$),Q(Y)};return this.addListener(F,$)}off(F,Q){if(F in this.eventListeners)this.eventListeners[F]=this.eventListeners[F].filter(($)=>$!==Q);return this}removeAllListeners(F){if(F)delete this.eventListeners[F];else this.eventListeners=Object.create(null);return this}emit(F,Q){if(F in this.eventListeners){let $=this.eventListeners[F];for(let Y of $)Y(Q);return!0}return!1}listenerCount(F){if(F in this.eventListeners)return this.eventListeners[F].length;return 0}prependListener(F,Q){if(F in this.eventListeners)this.eventListeners[F].unshift(Q);else this.eventListeners[F]=[Q];return this}prependOnceListener(F,Q){let $=(Y)=>{this.removeListener(F,$),Q(Y)};return this.prependListener(F,$)}}function bF(F){return{upload:(Q,$,Y,M)=>F.upload(Q,$,Y?Y:void 0,M),download:(Q,$,Y,M)=>F.download(Q,$,Y?Y:void 0,M)}}function sF(F){return{onDragDrop:(Q)=>F.onDragDrop(Q),onDragEnter:(Q)=>F.onDragEnter(Q),onDragLeave:(Q)=>F.onDragLeave(Q),onDragOver:(Q)=>F.onDragOver(Q),onWindowBlur:(Q)=>F.onWindowBlur(Q),onWindowCloseRequested:(Q)=>F.onWindowCloseRequested(Q),onWindowFocus:(Q)=>F.onWindowFocus(Q)}}function tF(F){return{BaseDirectory:d,appCacheDir:F.appCacheDir,appConfigDir:F.appConfigDir,appDataDir:F.appDataDir,appLocalDataDir:F.appLocalDataDir,appLogDir:F.appLogDir,audioDir:F.audioDir,basename:F.basename,cacheDir:F.cacheDir,configDir:F.configDir,dataDir:F.dataDir,delimiter:F.delimiter,desktopDir:F.desktopDir,dirname:F.dirname,documentDir:F.documentDir,downloadDir:F.downloadDir,executableDir:F.executableDir,extname:F.extname,fontDir:F.fontDir,homeDir:F.homeDir,isAbsolute:F.isAbsolute,join:F.join,localDataDir:F.localDataDir,normalize:F.normalize,pictureDir:F.pictureDir,publicDir:F.publicDir,resolve:F.resolve,resolveResource:F.resolveResource,resourceDir:F.resourceDir,runtimeDir:F.runtimeDir,sep:F.sep,tempDir:F.tempDir,templateDir:F.templateDir,videoDir:F.videoDir,extensionDir:F.extensionDir,extensionSupportDir:F.extensionSupportDir}}class t{pid;api;constructor(F,Q){this.pid=F,this.api=Q}async write(F){this.api.stdinWrite(F.toString(),this.pid)}kill(){return this.api.kill(this.pid)}}class PF extends s{program;args;options;stdout=new s;stderr=new s;constructor(F,Q=[],$){super();this.program=F,this.args=typeof Q==="string"?[Q]:Q,this.options=$??{}}}class qF extends PF{api;constructor(F,Q=[],$,Y){super(F,Q,Y);this.api=$}async spawn(){let F=this.args;if(typeof F==="object")Object.freeze(F);return this.api.rawSpawn(this.program,F,this.options,(Q)=>{switch(Q.event){case"Error":this.emit("error",Q.payload);break;case"Terminated":this.emit("close",Q.payload);break;case"Stdout":this.stdout.emit("data",Q.payload);break;case"Stderr":this.stderr.emit("data",Q.payload);break}}).then(async(Q)=>{return await this.api.recordSpawnedProcess(Q),new t(Q,this.api)})}async execute(){let F=this.args;if(typeof F==="object")Object.freeze(F);return this.api.execute(this.program,this.args,this.options)}}class SF extends PF{config;scriptPath;api;constructor(F,Q,$,Y){super("deno",Q);this.config=$,this.scriptPath=F,this.api=Y}execute(){return this.api.denoExecute(this.scriptPath,this.config,this.args)}spawn(){return this.api.denoRawSpawn(this.scriptPath,this.config,this.args,(F)=>{switch(F.event){case"Error":this.emit("error",F.payload);break;case"Terminated":this.emit("close",F.payload);break;case"Stdout":this.stdout.emit("data",F.payload);break;case"Stderr":this.stderr.emit("data",F.payload);break}}).then(async(F)=>{return console.log("spawned deno process",F),await this.api.recordSpawnedProcess(F),new t(F,this.api)})}}class CF{readStream;childProcess;name="tauri-shell-stdio";constructor(F,Q){this.readStream=F;this.childProcess=Q}read(){return new Promise((F,Q)=>{this.readStream.on("data",($)=>{F($)})})}async write(F){return this.childProcess.write(F+`
`)}}function eF(F){function Q(L,f=[],S){return new qF(L,f,F,S)}function $(L,f,S){return new SF(L,f,S,F)}async function Y(L,f,S,QF){let j=$(L,f,S),g=await j.spawn(),fQ=new CF(j.stdout,g);return{rpcChannel:new k(fQ,{expose:QF}),process:g,command:j}}function M(L){return Q("bash",["-c",L])}function w(L){return Q("powershell",["-Command",L])}function T(L){return Q("osascript",["-e",L])}function X(L){return Q("python",["-c",L])}function x(L){return Q("zsh",["-c",L])}function R(L){return Q("node",["-e",L])}async function A(L){return M(L).execute()}async function b(L){return w(L).execute()}async function VF(L){return T(L).execute()}async function FF(L){return X(L).execute()}async function KF(L){return x(L).execute()}async function LF(L){return R(L).execute()}function jF(){return F.likelyOnWindows()}return{open:F.open,killPid:F.killPid,makeBashScript:M,makePowershellScript:w,makeAppleScript:T,makePythonScript:X,makeZshScript:x,makeNodeScript:R,executeBashScript:A,executePowershellScript:b,executeAppleScript:VF,executePythonScript:FF,executeZshScript:KF,executeNodeScript:LF,hasCommand:F.hasCommand,likelyOnWindows:jF,createCommand:Q,createDenoCommand:$,Child:t,TauriShellStdio:CF,createDenoRpcChannel:Y,RPCChannel:k,whereIsCommand:F.whereIsCommand}}function aF(F){return{message:(Q,$,Y)=>F.message(Q,$,Y?Y:void 0),info:(Q,$,Y)=>F.info(Q,$,Y?Y:void 0),success:(Q,$,Y)=>F.success(Q,$,Y?Y:void 0),warning:(Q,$,Y)=>F.warning(Q,$,Y?Y:void 0),error:(Q,$,Y)=>F.error(Q,$,Y?Y:void 0)}}class YF{searchTerm="";highlightedListItemValue;onSearchTermChange(F){return this.searchTerm=F,Promise.resolve()}onActionSelected(F){return Promise.resolve()}onEnterPressedOnSearchBar(){return Promise.resolve()}onFilesDropped(F){return Promise.resolve()}onBeforeGoBack(){return Promise.resolve()}onListItemSelected(F){return Promise.resolve()}onListScrolledToBottom(){return Promise.resolve()}onHighlightedListItemChanged(F){return this.highlightedListItemValue=F,Promise.resolve()}onFormSubmit(F){return Promise.resolve()}}var EF;function pQ(F){return{lang:F?.lang??EF?.lang,message:F?.message,abortEarly:F?.abortEarly??EF?.abortEarly,abortPipeEarly:F?.abortPipeEarly??EF?.abortPipeEarly}}var gQ;function mQ(F){return gQ?.get(F)}var uQ;function cQ(F){return uQ?.get(F)}var rQ;function oQ(F,Q){return rQ?.get(F)?.get(Q)}function y(F){let Q=typeof F;if(Q==="string")return`"${F}"`;if(Q==="number"||Q==="bigint"||Q==="boolean")return`${F}`;if(Q==="object"||Q==="function")return(F&&Object.getPrototypeOf(F)?.constructor?.name)??"null";return Q}function G(F,Q,$,Y,M){let w=M&&"input"in M?M.input:$.value,T=M?.expected??F.expects??null,X=M?.received??y(w),x={kind:F.kind,type:F.type,input:w,expected:T,received:X,message:`Invalid ${Q}: ${T?`Expected ${T} but r`:"R"}eceived ${X}`,requirement:F.requirement,path:M?.path,issues:M?.issues,lang:Y.lang,abortEarly:Y.abortEarly,abortPipeEarly:Y.abortPipeEarly},R=F.kind==="schema",A=M?.message??F.message??oQ(F.reference,x.lang)??(R?cQ(x.lang):null)??Y.message??mQ(x.lang);if(A!==void 0)x.message=typeof A==="function"?A(x):A;if(R)$.typed=!1;if($.issues)$.issues.push(x);else $.issues=[x]}function N(F){return{version:1,vendor:"valibot",validate(Q){return F["~run"]({value:Q},pQ())}}}function nQ(F,Q){return Object.hasOwn(F,Q)&&Q!=="__proto__"&&Q!=="prototype"&&Q!=="constructor"}function QQ(F,Q){let $=[...new Set(F)];if($.length>1)return`(${$.join(` ${Q} `)})`;return $[0]??"never"}var iQ=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u;function IF(F){return{kind:"validation",type:"hex_color",reference:IF,async:!1,expects:null,requirement:iQ,message:F,"~run"(Q,$){if(Q.typed&&!this.requirement.test(Q.value))G(this,"hex color",Q,$);return Q}}}function DF(F,Q){return{kind:"validation",type:"max_value",reference:DF,async:!1,expects:`<=${F instanceof Date?F.toJSON():y(F)}`,requirement:F,message:Q,"~run"($,Y){if($.typed&&!($.value<=this.requirement))G(this,"value",$,Y,{received:$.value instanceof Date?$.value.toJSON():y($.value)});return $}}}function kF(F,Q){return{kind:"validation",type:"min_value",reference:kF,async:!1,expects:`>=${F instanceof Date?F.toJSON():y(F)}`,requirement:F,message:Q,"~run"($,Y){if($.typed&&!($.value>=this.requirement))G(this,"value",$,Y,{received:$.value instanceof Date?$.value.toJSON():y($.value)});return $}}}function dQ(F,Q,$){return typeof F.fallback==="function"?F.fallback(Q,$):F.fallback}function hF(F,Q,$){return typeof F.default==="function"?F.default(Q,$):F.default}function e(){return{kind:"schema",type:"any",reference:e,expects:"any",async:!1,get "~standard"(){return N(this)},"~run"(F){return F.typed=!0,F}}}function O(F,Q){return{kind:"schema",type:"array",reference:O,expects:"Array",async:!1,item:F,message:Q,get "~standard"(){return N(this)},"~run"($,Y){let M=$.value;if(Array.isArray(M)){$.typed=!0,$.value=[];for(let w=0;w<M.length;w++){let T=M[w],X=this.item["~run"]({value:T},Y);if(X.issues){let x={type:"array",origin:"value",input:M,key:w,value:T};for(let R of X.issues){if(R.path)R.path.unshift(x);else R.path=[x];$.issues?.push(R)}if(!$.issues)$.issues=X.issues;if(Y.abortEarly){$.typed=!1;break}}if(!X.typed)$.typed=!1;$.value.push(X.value)}}else G(this,"type",$,Y);return $}}}function K(F){return{kind:"schema",type:"boolean",reference:K,expects:"boolean",async:!1,message:F,get "~standard"(){return N(this)},"~run"(Q,$){if(typeof Q.value==="boolean")Q.typed=!0;else G(this,"type",Q,$);return Q}}}function v(F){return{kind:"schema",type:"date",reference:v,expects:"Date",async:!1,message:F,get "~standard"(){return N(this)},"~run"(Q,$){if(Q.value instanceof Date)if(!isNaN(Q.value))Q.typed=!0;else G(this,"type",Q,$,{received:'"Invalid Date"'});else G(this,"type",Q,$);return Q}}}function P(F,Q){let $=[];for(let Y in F)if(`${+Y}`!==Y||typeof F[Y]!=="string"||!Object.is(F[F[Y]],+Y))$.push(F[Y]);return{kind:"schema",type:"enum",reference:P,expects:QQ($.map(y),"|"),async:!1,enum:F,options:$,message:Q,get "~standard"(){return N(this)},"~run"(Y,M){if(this.options.includes(Y.value))Y.typed=!0;else G(this,"type",Y,M);return Y}}}function _F(F){return{kind:"schema",type:"function",reference:_F,expects:"Function",async:!1,message:F,get "~standard"(){return N(this)},"~run"(Q,$){if(typeof Q.value==="function")Q.typed=!0;else G(this,"type",Q,$);return Q}}}function D(F){return{kind:"schema",type:"lazy",reference:D,expects:"unknown",async:!1,getter:F,get "~standard"(){return N(this)},"~run"(Q,$){return this.getter(Q.value)["~run"](Q,$)}}}function H(F,Q){return{kind:"schema",type:"literal",reference:H,expects:y(F),async:!1,literal:F,message:Q,get "~standard"(){return N(this)},"~run"($,Y){if($.value===this.literal)$.typed=!0;else G(this,"type",$,Y);return $}}}function W(F,Q){return{kind:"schema",type:"nullable",reference:W,expects:`(${F.expects} | null)`,async:!1,wrapped:F,default:Q,get "~standard"(){return N(this)},"~run"($,Y){if($.value===null){if(this.default!==void 0)$.value=hF(this,$,Y);if($.value===null)return $.typed=!0,$}return this.wrapped["~run"]($,Y)}}}function V(F){return{kind:"schema",type:"number",reference:V,expects:"number",async:!1,message:F,get "~standard"(){return N(this)},"~run"(Q,$){if(typeof Q.value==="number"&&!isNaN(Q.value))Q.typed=!0;else G(this,"type",Q,$);return Q}}}function Z(F,Q){return{kind:"schema",type:"object",reference:Z,expects:"Object",async:!1,entries:F,message:Q,get "~standard"(){return N(this)},"~run"($,Y){let M=$.value;if(M&&typeof M==="object"){$.typed=!0,$.value={};for(let w in this.entries){let T=this.entries[w];if(w in M||(T.type==="exact_optional"||T.type==="optional"||T.type==="nullish")&&T.default!==void 0){let X=w in M?M[w]:hF(T),x=T["~run"]({value:X},Y);if(x.issues){let R={type:"object",origin:"value",input:M,key:w,value:X};for(let A of x.issues){if(A.path)A.path.unshift(R);else A.path=[R];$.issues?.push(A)}if(!$.issues)$.issues=x.issues;if(Y.abortEarly){$.typed=!1;break}}if(!x.typed)$.typed=!1;$.value[w]=x.value}else if(T.fallback!==void 0)$.value[w]=dQ(T);else if(T.type!=="exact_optional"&&T.type!=="optional"&&T.type!=="nullish"){if(G(this,"key",$,Y,{input:void 0,expected:`"${w}"`,path:[{type:"object",origin:"key",input:M,key:w,value:M[w]}]}),Y.abortEarly)break}}}else G(this,"type",$,Y);return $}}}function U(F,Q){return{kind:"schema",type:"optional",reference:U,expects:`(${F.expects} | undefined)`,async:!1,wrapped:F,default:Q,get "~standard"(){return N(this)},"~run"($,Y){if($.value===void 0){if(this.default!==void 0)$.value=hF(this,$,Y);if($.value===void 0)return $.typed=!0,$}return this.wrapped["~run"]($,Y)}}}function I(F,Q,$){return{kind:"schema",type:"record",reference:I,expects:"Object",async:!1,key:F,value:Q,message:$,get "~standard"(){return N(this)},"~run"(Y,M){let w=Y.value;if(w&&typeof w==="object"){Y.typed=!0,Y.value={};for(let T in w)if(nQ(w,T)){let X=w[T],x=this.key["~run"]({value:T},M);if(x.issues){let A={type:"object",origin:"key",input:w,key:T,value:X};for(let b of x.issues)b.path=[A],Y.issues?.push(b);if(!Y.issues)Y.issues=x.issues;if(M.abortEarly){Y.typed=!1;break}}let R=this.value["~run"]({value:X},M);if(R.issues){let A={type:"object",origin:"value",input:w,key:T,value:X};for(let b of R.issues){if(b.path)b.path.unshift(A);else b.path=[A];Y.issues?.push(b)}if(!Y.issues)Y.issues=R.issues;if(M.abortEarly){Y.typed=!1;break}}if(!x.typed||!R.typed)Y.typed=!1;if(x.typed)Y.value[x.value]=R.value}}else G(this,"type",Y,M);return Y}}}function J(F){return{kind:"schema",type:"string",reference:J,expects:"string",async:!1,message:F,get "~standard"(){return N(this)},"~run"(Q,$){if(typeof Q.value==="string")Q.typed=!0;else G(this,"type",Q,$);return Q}}}function FQ(F){let Q;if(F)for(let $ of F)if(Q)Q.push(...$.issues);else Q=$.issues;return Q}function z(F,Q){return{kind:"schema",type:"union",reference:z,expects:QQ(F.map(($)=>$.expects),"|"),async:!1,options:F,message:Q,get "~standard"(){return N(this)},"~run"($,Y){let M,w,T;for(let X of this.options){let x=X["~run"]({value:$.value},Y);if(x.typed)if(x.issues)if(w)w.push(x);else w=[x];else{M=x;break}else if(T)T.push(x);else T=[x]}if(M)return M;if(w){if(w.length===1)return w[0];G(this,"type",$,Y,{issues:FQ(w)}),$.typed=!0}else if(T?.length===1)return T[0];else G(this,"type",$,Y,{issues:FQ(T)});return $}}}function fF(...F){return{...F[0],pipe:F,get "~standard"(){return N(this)},"~run"(Q,$){for(let Y of F)if(Y.kind!=="metadata"){if(Q.issues&&(Y.kind==="schema"||Y.kind==="transformation")){Q.typed=!1;break}if(!Q.issues||!$.abortEarly&&!$.abortPipeEarly)Q=Y["~run"](Q,$)}return Q}}}var h;((j)=>{j.List="List";j.ListItem="ListItem";j.ListItemDetail="ListItemDetail";j.ListItemAccessory="ListItemAccessory";j.ListSection="ListSection";j.ListItemDetailMetadata="ListItemDetailMetadata";j.ListItemDetailMetadataLabel="ListItemDetailMetadataLabel";j.ListItemDetailMetadataLink="ListItemDetailMetadataLink";j.ListItemDetailMetadataTagList="ListItemDetailMetadataTagList";j.ListItemDetailMetadataTagListItem="ListItemDetailMetadataTagListItem";j.ListItemDetailMetadataSeparator="ListItemDetailMetadataSeparator";j.Icon="Icon";j.EmptyView="EmptyView";j.Dropdown="Dropdown";j.DropdownSection="DropdownSection";j.DropdownItem="DropdownItem";j.ActionPanel="ActionPanel";j.Action="Action";j.ActionPanelSection="ActionPanelSection";j.ActionPanelSubmenu="ActionPanelSubmenu";j.Markdown="Markdown"})(h||={});var q=P(h),UF;((x)=>{x.Base="Base";x.Number="Number";x.Select="Select";x.Boolean="Boolean";x.Input="Input";x.Date="Date";x.Array="Array";x.Form="Form"})(UF||={});var a=P(UF);var yF;((w)=>{w.Iconify="iconify";w.RemoteUrl="remote-url";w.Svg="svg";w.Base64PNG="base64-png";w.Text="text"})(yF||={});var $Q=P(yF),HQ=Z({type:$Q,value:J(),invert:U(K()),darkInvert:U(K()),hexColor:U(J()),bgColor:U(J())}),B=Z({...HQ.entries,fallback:U(D(()=>B))}),sQ=Z({...HQ.entries,nodeName:q,fallback:U(D(()=>B))});var c=fF(J(),IF()),kH=Z({top:U(V()),right:U(V()),bottom:U(V()),left:U(V())}),hH=z([H("light"),H("dark"),H("auto")]),_H=z([H("zinc"),H("slate"),H("stone"),H("gray"),H("neutral"),H("red"),H("rose"),H("orange"),H("green"),H("blue"),H("yellow"),H("violet")]),fH=fF(V(),kF(0),DF(1));var tQ=Z({nodeName:q,icon:U(B),title:J(),value:J()}),vF=Z({nodeName:q,title:U(J()),items:O(z([tQ]))});var ZF=Z({nodeName:q,content:J()});var wY=Z({nodeName:q,title:U(J()),description:U(J()),icon:U(B)}),eQ=Z({nodeName:q,title:J(),value:J(),icon:U(B),keywords:U(O(J()))}),aQ=Z({nodeName:q,title:J(),items:O(eQ)}),zY=Z({nodeName:q,tooltip:J(),sections:O(aQ),defaultValue:J()}),F$=Z({nodeName:q,tag:U(z([J(),Z({color:c,text:J()})])),text:U(z([J(),Z({color:c,text:J()})])),date:U(z([v(),Z({color:c,text:v()})])),icon:U(B),tooltip:U(J())}),Q$=Z({nodeName:H("ListItemDetailMetadataLabel"),title:J(),icon:U(B),text:U(z([J(),Z({color:c,text:J()})]))}),$$=Z({nodeName:H("ListItemDetailMetadataLink"),title:J(),text:J(),url:J()}),H$=Z({nodeName:H("ListItemDetailMetadataTagListItem"),text:U(J()),color:U(c)}),Y$=Z({nodeName:H("ListItemDetailMetadataTagList"),title:J(),tags:O(H$)}),J$=Z({nodeName:H("ListItemDetailMetadataSeparator")}),U$=z([Q$,$$,Y$,J$]),Z$=Z({nodeName:H("ListItemDetailMetadata"),items:O(U$)}),M$=Z({nodeName:H("ListItemDetail"),children:O(z([ZF,Z$])),width:U(V())}),JQ=Z({nodeName:H("ListItem"),title:J(),subTitle:U(J()),accessories:U(O(F$)),value:J(),defaultAction:U(J()),actions:U(vF),icon:U(B),keywords:U(O(J()))}),w$=Z({nodeName:H("ListSection"),title:U(J()),subtitle:U(J()),items:O(JQ)}),z$=z([H("items"),H("detail"),H("filter"),H("sections"),H("actions"),H("defaultAction")]),xY=Z({nodeName:H("List"),sections:U(O(w$)),items:U(O(JQ)),filter:z([H("none"),H("default")]),detail:U(M$),actions:U(vF),defaultAction:U(J()),inherits:U(O(z$))});var x$=z([H("color"),H("date"),H("datetime-local"),H("month"),H("number"),H("password"),H("text"),H("url"),H("week"),H("time"),H("search")]),r=Z({nodeName:a,key:J(),label:U(J()),hideLabel:U(K()),placeholder:U(J()),optional:U(K()),description:U(J()),default:U(e())}),UQ=Z({...r.entries,type:U(x$),component:U(z([H("textarea"),H("default")])),default:U(J())}),ZQ=Z({...r.entries,nodeName:a,default:U(V())}),MQ=Z({...r.entries,options:O(J()),default:U(J())}),wQ=Z({...r.entries,component:U(z([H("checkbox"),H("switch")]))}),zQ=Z({...r.entries,default:U(J())}),O$=z([UQ,ZQ,MQ,wQ,zQ]),W$=Z({...r.entries,content:O$}),R$=z([W$,MQ,UQ,ZQ,wQ,zQ]),T$=Z({nodeName:a,key:J(),showFormDataDebug:U(K()),fields:O(z([D(()=>T$),R$])),title:U(J()),description:U(J()),submitBtnText:U(J())});class OQ{nodeName="Icon";type;value;invert;darkInvert;hexColor;bgColor;constructor(F){this.type=F.type,this.value=F.value,this.invert=F.invert,this.darkInvert=F.darkInvert,this.hexColor=F.hexColor,this.bgColor=F.bgColor}toModel(){return{nodeName:this.nodeName,type:this.type,value:this.value,invert:this.invert,darkInvert:this.darkInvert,hexColor:this.hexColor,bgColor:this.bgColor}}}class X${nodeName="EmptyView";title;description;icon;constructor(F){this.title=F.title,this.description=F.description,this.icon=F.icon}toModel(){return{nodeName:this.nodeName,title:this.title,description:this.description,icon:this.icon?.toModel()}}}class V${nodeName="DropdownItem";title;value;icon;keywords;constructor(F){this.title=F.title,this.value=F.value,this.icon=F.icon,this.keywords=F.keywords}toModel(){return{nodeName:this.nodeName,title:this.title,value:this.value,icon:this.icon?.toModel(),keywords:this.keywords}}}class K${nodeName="DropdownSection";title;items;constructor(F){this.title=F.title,this.items=F.items}toModel(){return{nodeName:this.nodeName,title:this.title,items:this.items.map((F)=>F.toModel())}}}class L${nodeName="Dropdown";tooltip;sections;defaultValue;constructor(F){this.tooltip=F.tooltip,this.sections=F.sections,this.defaultValue=F.defaultValue}toModel(){return{nodeName:this.nodeName,tooltip:this.tooltip,sections:this.sections.map((F)=>F.toModel()),defaultValue:this.defaultValue}}}class j${nodeName="ListItemAccessory";tag;text;date;icon;tooltip;constructor(F){this.tag=F.tag,this.text=F.text,this.date=F.date,this.icon=F.icon,this.tooltip=F.tooltip}toModel(){return{nodeName:this.nodeName,tag:this.tag,text:this.text,date:this.date,icon:this.icon?.toModel(),tooltip:this.tooltip}}}class A${nodeName="ListItemDetailMetadataLabel";title;icon;text;constructor(F){this.title=F.title,this.icon=F.icon,this.text=F.text}toModel(){return{nodeName:this.nodeName,title:this.title,icon:this.icon?.toModel(),text:this.text}}}class G${nodeName="ListItemDetailMetadataLink";title;text;url;constructor(F){this.title=F.title,this.text=F.text,this.url=F.url}toModel(){return{nodeName:this.nodeName,title:this.title,text:this.text,url:this.url}}}class N${nodeName="ListItemDetailMetadataTagListItem";text;color;icon;constructor(F){this.text=F.text,this.color=F.color,this.icon=F.icon}toModel(){return{nodeName:this.nodeName,text:this.text,color:this.color}}}class B${nodeName="ListItemDetailMetadataTagList";title;tags;constructor(F){this.title=F.title,this.tags=F.tags}toModel(){return{nodeName:this.nodeName,title:this.title,tags:this.tags.map((F)=>F.toModel())}}}class b${nodeName="ListItemDetailMetadataSeparator";toModel(){return{nodeName:this.nodeName}}}class C${nodeName="ListItemDetailMetadata";items;constructor(F){this.items=F}toModel(){return{nodeName:this.nodeName,items:this.items.map((F)=>F.toModel())}}}class P${nodeName="ListItemDetail";children;width;constructor(F){this.children=F.children,this.width=F.width}toModel(){return{nodeName:this.nodeName,children:this.children.map((F)=>F.toModel()),width:this.width}}}class q${nodeName="ListItem";title;value;subTitle;accessories;icon;keywords;defaultAction;actions;constructor(F){this.title=F.title,this.value=F.value,this.actions=F.actions,this.defaultAction=F.defaultAction,this.subTitle=F.subTitle,this.accessories=F.accessories,this.icon=F.icon,this.keywords=F.keywords}toModel(){return{nodeName:this.nodeName,title:this.title,value:this.value,defaultAction:this.defaultAction,actions:this.actions?.toModel(),subTitle:this.subTitle,accessories:this.accessories?.map((F)=>F.toModel()),icon:this.icon?.toModel(),keywords:this.keywords}}}class S${nodeName="ListSection";title;items;constructor(F){this.title=F.title,this.items=F.items}toModel(){return{nodeName:this.nodeName,title:this.title,items:this.items.map((F)=>F.toModel())}}}class E${nodeName="List";sections;items;detail;filter;inherits;actions;defaultAction;constructor(F){this.sections=F.sections,this.items=F.items,this.detail=F.detail,this.filter=F.filter??"default",this.inherits=F.inherits??[],this.actions=F.actions,this.defaultAction=F.defaultAction}toModel(){return{nodeName:this.nodeName,sections:this.sections?.map((F)=>F.toModel()),items:this.items?.map((F)=>F.toModel()),filter:this.filter,detail:this.detail?.toModel(),inherits:this.inherits,actions:this.actions?.toModel(),defaultAction:this.defaultAction}}}class I${nodeName="Action";icon;title;value;constructor(F){this.icon=F.icon,this.title=F.title,this.value=F.value}toModel(){return{nodeName:this.nodeName,title:this.title,value:this.value,icon:this.icon}}}class D${nodeName="ActionPanel";title;items;constructor(F){this.title=F.title,this.items=F.items}toModel(){return{nodeName:this.nodeName,title:this.title,items:this.items.map((F)=>F.toModel())}}}var bY=Z({name:J(),icon_path:W(J()),app_path_exe:W(J()),app_desktop_path:J()});var SY=I(J("Window label"),Z({path:J("Path to the extension"),processes:O(V()),dist:U(W(J()))})),EY=Z({extId:V(),identifier:J(),version:J(),enabled:K(),installed_at:J(),path:W(J()),data:W(e())}),TQ;((X)=>{X.HeadlessWorker="headless_worker";X.Builtin="builtin";X.System="system";X.UiWorker="ui_worker";X.UiIframe="ui_iframe";X.QuickLink="quick_link";X.Remote="remote"})(TQ||={});var _=P(TQ),k$=Z({cmdId:V(),extId:V(),name:J(),type:_,data:J(),alias:W(U(J())),hotkey:W(U(J())),enabled:K()}),IY=Z({...k$.entries,data:Z({link:J(),icon:B})}),DY=Z({dataId:V(),extId:V(),dataType:J(),data:U(J()),searchText:U(J()),createdAt:v(),updatedAt:v()}),kY=Z({name:J(),value:J(),icon:W(B),keywords:W(O(J())),function:_F(),confirmRequired:K()});var XQ;(($)=>{$.Asc="ASC";$.Desc="DESC"})(XQ||={});var fY=P(XQ),VQ;((Y)=>{Y.ExactMatch="exact_match";Y.Like="like";Y.FTS="fts"})(VQ||={});var yY=P(VQ);var MF=z([H("clipboard:read-all"),H("clipboard:write-all"),H("clipboard:read-text"),H("clipboard:write-text"),H("clipboard:read-image"),H("clipboard:write-image"),H("clipboard:read-files"),H("clipboard:write-files")]),wF=z([H("dialog:all")]),zF=z([H("notification:all")]),xF=z([H("fs:read"),H("fs:write"),H("fs:exists")]),OF=H("os:all"),KQ=z([H("shell:open"),H("shell:execute"),H("shell:kill-any")]),WF=H("fetch:all"),RF=z([H("system-info:all"),H("system-info:memory"),H("system-info:cpu"),H("system-info:os"),H("system-info:disk"),H("system-info:network"),H("system-info:battery"),H("system-info:process"),H("system-info:components")]),TF=z([H("network:interface"),H("network:port")]),XF=z([H("updownload:download"),H("updownload:upload")]),h$=z([MF,wF,zF,xF,OF,KQ,WF,RF,TF,XF]);var pF={readText:["clipboard:read-text","clipboard:read-all"],writeText:["clipboard:write-text","clipboard:write-all"],readImageBase64:["clipboard:read-all","clipboard:read-image"],readImageBinary:["clipboard:read-all","clipboard:read-image"],writeImageBase64:["clipboard:write-all","clipboard:write-image"],writeImageBinary:["clipboard:write-all","clipboard:write-image"],readFiles:["clipboard:read-all","clipboard:read-files"],writeFiles:["clipboard:write-all","clipboard:write-files"],readRtf:["clipboard:read-all","clipboard:read-text"],writeRtf:["clipboard:write-all","clipboard:write-text"],readHtml:["clipboard:read-all","clipboard:read-text"],writeHtml:["clipboard:write-all","clipboard:write-text"],writeHtmlAndText:["clipboard:write-all","clipboard:write-text"],hasText:[],hasRTF:[],hasHTML:[],hasImage:[],hasFiles:[]};var g$=z([MF,H("clipboard:paste")]),LQ=z([H("system:volumn"),H("system:boot"),H("system:disk"),H("system:apps"),H("system:fs"),H("system:ui")]),jQ=z([xF,H("fs:read-dir"),H("fs:stat"),H("fs:search")]),m$=z([H("event:drag-drop"),H("event:drag-enter"),H("event:drag-leave"),H("event:drag-over"),H("event:window-blur"),H("event:window-close-requested"),H("event:window-focus")]),u$=z([H("security:mac:reveal-security-pane"),H("security:mac:verify-fingerprint"),H("security:mac:reset-screencapture-permission"),H("security:mac:request-permission"),H("security:mac:check-permission"),H("security:mac:all")]),c$=z([H("hostname"),H("osRelease"),H("osUptime"),H("loadavg"),H("networkInterfaces"),H("systemMemoryInfo"),H("uid"),H("gid"),H("cpus"),J()]),r$=Z({net:U(z([H("*"),O(J())])),env:U(z([H("*"),O(J())])),read:U(z([H("*"),O(J())])),write:U(z([H("*"),O(J())])),run:U(z([H("*"),O(J())])),ffi:U(z([H("*"),O(J())])),sys:U(z([H("*"),O(c$)]))}),o=Z({path:U(J()),url:U(J()),cmd:U(Z({program:J(),args:O(J())})),...r$.entries}),AQ=Z({permission:jQ,allow:U(O(o)),deny:U(O(o))}),GQ=z([H("open:url"),H("open:file"),H("open:folder")]),NQ=Z({permission:GQ,allow:U(O(o)),deny:U(O(o))}),BQ=z([H("shell:execute"),H("shell:deno:execute"),H("shell:spawn"),H("shell:deno:spawn"),H("shell:open"),H("shell:kill"),H("shell:kill-any"),H("shell:all"),H("shell:stdin-write")]),bQ=Z({permission:BQ,allow:U(O(o)),deny:U(O(o))}),gF=z([g$,m$,wF,zF,OF,BQ,WF,RF,TF,XF,LQ,u$]),o$=z([gF,jQ,GQ]);var Q8={...pF,paste:["clipboard:paste"]};var mF;((Y)=>{Y.linux="linux";Y.macos="macos";Y.windows="windows"})(mF||={});var n$=P(mF),CQ=Object.values(mF),i$=Z({type:z([H("text"),H("regex")]),value:J()}),qQ;((Y)=>{Y.visible="visible";Y.transparent="transparent";Y.overlay="overlay"})(qQ||={});var d$=P(qQ),SQ=Z({center:U(W(K())),x:U(W(V())),y:U(W(V())),width:U(W(V())),height:U(W(V())),minWidth:U(W(V())),minHeight:U(W(V())),maxWidth:U(W(V())),maxHeight:U(W(V())),resizable:U(W(K())),title:U(W(J())),fullscreen:U(W(K())),focus:U(W(K())),transparent:U(W(K())),maximized:U(W(K())),visible:U(W(K())),decorations:U(W(K())),alwaysOnTop:U(W(K())),alwaysOnBottom:U(W(K())),contentProtected:U(W(K())),skipTaskbar:U(W(K())),shadow:U(W(K())),titleBarStyle:U(W(d$)),hiddenTitle:U(W(K())),tabbingIdentifier:U(W(J())),maximizable:U(W(K())),minimizable:U(W(K())),closable:U(W(K())),parent:U(W(J())),visibleOnAllWorkspaces:U(W(K()))}),uF=Z({main:J("HTML file to load, e.g. dist/index.html"),description:U(W(J("Description of the Command"),""),""),name:J("Name of the command"),cmds:O(i$,"Commands to trigger the UI"),icon:U(B),platforms:U(W(O(n$,"Platforms available on. Leave empty for all platforms."),CQ),CQ)}),s$=Z({...uF.entries,type:U(_,_.enum.UiIframe),dist:J("Dist folder to load, e.g. dist, build, out"),devMain:J("URL to load in development to support live reload, e.g. http://localhost:5173/"),window:U(W(SQ))}),t$=Z({...uF.entries,type:U(_,_.enum.UiWorker),window:U(W(SQ))}),e$=Z({...uF.entries,type:U(_,_.enum.HeadlessWorker)}),a$=z([gF,AQ,NQ,bQ]),F1=Z({name:J("Name of the extension (Human Readable)"),shortDescription:J("Description of the extension (Will be displayed in store)"),longDescription:J("Long description of the extension (Will be displayed in store)"),identifier:J("Unique identifier for the extension, must be the same as extension folder name"),icon:B,permissions:O(a$,"Permissions Declared by the extension. e.g. clipboard-all. Not declared APIs will be blocked."),demoImages:O(J("Demo images for the extension")),customUiCmds:U(O(s$,"Custom UI Commands")),templateUiCmds:U(O(t$,"Template UI Commands")),headlessCmds:U(O(e$,"Headless Commands"))}),PQ=z([Z({name:J("GitHub Username"),email:U(W(J("Email of the person"))),url:U(W(J("URL of the person")))}),J("GitHub Username")]),Q1=z([H("AGPL-3.0-only"),H("Apache-2.0"),H("BSD-2-Clause"),H("BSD-3-Clause"),H("BSL-1.0"),H("CC0-1.0"),H("CDDL-1.0"),H("CDDL-1.1"),H("EPL-1.0"),H("EPL-2.0"),H("GPL-2.0-only"),H("GPL-3.0-only"),H("ISC"),H("LGPL-2.0-only"),H("LGPL-2.1-only"),H("LGPL-2.1-or-later"),H("LGPL-3.0-only"),H("LGPL-3.0-or-later"),H("MIT"),H("MPL-2.0"),H("MS-PL"),H("UNLICENSED")]),$1=Z({name:J("Package name for the extension (just a regular npm package name)"),version:J("Version of the extension"),readme:U(J("Custom README.md path of the extension")),license:Q1,author:U(PQ),draft:U(K("Whether the extension is a draft, draft will not be published")),contributors:U(O(PQ,"Contributors of the extension")),repository:U(z([J("URL of the repository"),Z({type:J("Type of the repository"),url:J("URL of the repository"),directory:U(J("Directory of the repository"))})])),dependencies:U(I(J(),J())),kunkun:F1,files:U(O(J("Files to include in the extension. e.g. ['dist']")))}),W8=Z({...$1.entries,...{extPath:J(),extFolderName:J()}});var H1=Z({addresses:O(J()),fullname:J(),hostname:J(),port:V(),service_type:J(),subType:U(J()),properties:U(I(J(),J())),publicKey:J(),sslCert:J()}),X8=I(J(),H1);var EQ=Z({filename:J(),fileSize:V(),id:J(),type:V(),children:O(D(()=>EQ))}),K8=Z({port:J(),code:J(),totalBytes:V(),totalFiles:V(),sslCert:J(),root:D(()=>EQ),ip:J()}),L8=Z({code:J(),idPathMap:I(J(),J())});class l{nodeName="Base";key;label;hideLabel;placeholder;optional;description;default;constructor(F){this.key=F.key,this.key=F.key,this.label=F.label,this.hideLabel=F.hideLabel,this.placeholder=F.placeholder,this.optional=F.optional,this.description=F.description,this.default=F.default}toModel(){return{nodeName:this.nodeName,key:this.key,label:this.label,hideLabel:this.hideLabel,placeholder:this.placeholder,optional:this.optional,description:this.description,default:this.default}}}class Y1 extends l{nodeName="Input";component;constructor(F){super(F);this.component=F.component}toModel(){return{...super.toModel(),component:this.component}}}class J1 extends l{nodeName="Number"}class U1 extends l{nodeName="Select";options;constructor(F){super(F);this.options=F.options}toModel(){return{...super.toModel(),options:this.options}}}class Z1 extends l{nodeName="Boolean";component;constructor(F){super(F);this.component=F.component??"checkbox"}toModel(){return{...super.toModel(),component:this.component}}}class M1 extends l{nodeName="Date"}class w1 extends l{nodeName="Array";content;constructor(F){super(F);this.content=F.content}toModel(){return{...super.toModel(),content:this.content.toModel()}}}class z1{nodeName="Form";fields;showFormDataDebug;key;title;description;submitBtnText;constructor(F){this.fields=F.fields,this.key=F.key,this.title=F.title,this.description=F.description,this.submitBtnText=F.submitBtnText,this.showFormDataDebug=F.showFormDataDebug}toModel(){return{nodeName:this.nodeName,key:this.key,title:this.title,description:this.description,submitBtnText:this.submitBtnText,fields:this.fields.map((F)=>F.toModel())}}}class cF{nodeName="Markdown";content;constructor(F){this.content=F}toModel(){return{nodeName:this.nodeName,content:this.content}}}var O1=new GF,DQ=new k(O1,{}),p=DQ.getAPI();function kQ(F){DQ.expose(F)}var d8=sF(p.event),s8=BF(p.fetch),t8=tF(p.path),e8=eF(p.shell),a8=aF(p.toast),F6=bF(p.updownload),{db:Q6,kv:$6,os:H6,clipboard:Y6,dialog:J6,fs:U6,log:Z6,notification:M6,sysInfo:w6,network:z6,system:x6,open:hQ,utils:O6,app:W6,security:R6,helper:T6,workerUi:X6}=p;class _Q extends YF{nips=[];loading=!1;searchQuery="";async load(){this.loading=!0,this.updateUI();try{this.nips=await this.fetchNostrNips()}catch(F){console.error("Failed to load NIPs:",F)}finally{this.loading=!1,this.updateUI()}}async fetchNostrNips(){return[]}getFilteredNips(){return[]}handleSearchInput(F){this.searchQuery=F,this.updateUI()}handleOpenUrl(F){hQ.url(F)}updateUI(){return"Nostr NIPs"}}kQ(new _Q);