var H$=Object.defineProperty;var sF=(F,Q)=>{for(var $ in Q)H$(F,$,{get:Q[$],enumerable:!0,configurable:!0,set:(H)=>Q[$]=()=>H})};var PF="__DESTROY__";var qF=class{name="worker-child-io";messageQueue=[];resolveRead=null;constructor(){self.onmessage=this.handleMessage}handleMessage=(F)=>{let Q=F.data;if(Q===PF){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(PF),self.close()}signalDestroy(){self.postMessage(PF)}};function Y$(F,Q){if(Q instanceof Uint8Array)return{type:"Uint8Array",data:Array.from(Q)};return Q}function J$(F,Q){if(Q&&Q.type==="Uint8Array"&&Array.isArray(Q.data))return new Uint8Array(Q.data);return Q}function t(F){return JSON.stringify(F,Y$)+` `}function tF(F){return new Promise((Q,$)=>{try{let H=JSON.parse(F,J$);Q(H)}catch(H){console.error("failed to parse message",typeof F,F,H),$(H)}})}function ZF(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var h=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],H=this.messageStr.split(` `),M=$===` `?H:H.slice(0,-1);this.messageStr=$===` `?"":H.at(-1)??"";for(let w of M.map((R)=>R.trim()).filter(Boolean))if(w.startsWith("{"))this.handleMessageStr(w);else console.log("(kkrpc stdout passthrough):",w)}}async handleMessageStr(F){return this.count++,tF(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(($,H)=>{let M=ZF();this.pendingRequests[M]={resolve:$,reject:H};let w=[],R=Q.map((z)=>{if(typeof z==="function"){let T=this.callbackCache.get(z);if(!T)T=ZF(),this.callbacks[T]=z,this.callbackCache.set(z,T);return w.push(T),`__callback__${T}`}return z}),X={id:M,method:F,args:R,type:"request",callbackIds:w.length>0?w:void 0};this.io.write(t(X))})}handleResponse(F){let{id:Q}=F,{result:$,error:H}=F.args;if(this.pendingRequests[Q]){if(H)this.pendingRequests[Q].reject(new Error(H));else this.pendingRequests[Q].resolve($);delete this.pendingRequests[Q]}}handleRequest(F){let{id:Q,method:$,args:H}=F,M=$.split(".");if(!this.apiImplementation)return;let w=this.apiImplementation;for(let T=0;T{if(typeof T==="string"&&T.startsWith("__callback__")){let G=T.slice(12);return(...b)=>{this.invokeCallback(G,b)}}return T});try{let T=X.apply(w,z);Promise.resolve(T).then((G)=>{return this.sendResponse(Q,G)}).catch((G)=>this.sendError(Q,G.message))}catch(T){this.sendError(Q,T.message??T.toString())}}invokeCallback(F,Q){let $={id:ZF(),method:F,args:Q,type:"callback"};this.io.write(t($))}handleCallback(F){let{method:Q,args:$}=F,H=this.callbacks[Q];if(H)H(...$);else console.error(`Callback with id ${Q} not found`)}sendResponse(F,Q){let $={id:F,method:"",args:{result:Q},type:"response"};this.io.write(t($))}sendError(F,Q){let $={id:F,method:"",args:{error:Q},type:"response"};this.io.write(t($))}createNestedProxy(F=[]){return new Proxy(()=>{},{get:(Q,$)=>{if(typeof $==="string"&&$!=="then")return this.createNestedProxy([...F,$]);return},apply:(Q,$,H)=>{let M=F.join(".");return this.callMethod(M,H)}})}getAPI(){return this.createNestedProxy()}freeCallbacks(){this.callbacks={},this.callbackCache.clear()}};function C(F,Q,$,H){if($==="a"&&!H)throw new TypeError("Private accessor was defined without a getter");if(typeof Q==="function"?F!==Q||!H:!Q.has(F))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?H:$==="a"?H.call(F):H?H.value:Q.get(F)}function MF(F,Q,$,H,M){if(H==="m")throw new TypeError("Private method is not writable");if(H==="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 H==="a"?M.call(F,$):M?M.value=$:Q.set(F,$),$}var c,I,r,U$,eF="__TAURI_TO_IPC_KEY__";function aF(F,Q=!1){return window.__TAURI_INTERNALS__.transformCallback(F,Q)}class SF{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,c.set(this,()=>{}),I.set(this,0),r.set(this,[]),this.id=aF(({message:F,id:Q})=>{if(Q==C(this,I,"f")){C(this,c,"f").call(this,F),MF(this,I,C(this,I,"f")+1,"f");while(C(this,I,"f")in C(this,r,"f")){let $=C(this,r,"f")[C(this,I,"f")];C(this,c,"f").call(this,$),delete C(this,r,"f")[C(this,I,"f")],MF(this,I,C(this,I,"f")+1,"f")}}else C(this,r,"f")[Q]=F})}set onmessage(F){MF(this,c,F,"f")}get onmessage(){return C(this,c,"f")}[(c=new WeakMap,I=new WeakMap,r=new WeakMap,eF)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[eF]()}}U$=new WeakMap;var FQ;(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"})(FQ||(FQ={}));var a;(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"})(a||(a={}));var QQ;(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"})(QQ||(QQ={}));function EF(F){return async function Q($,H){console.log("fetch",$,H);let M=H?.maxRedirections,w=H?.connectTimeout,R=H?.proxy;if(H!=null)delete H.maxRedirections,delete H.connectTimeout,delete H.proxy;let X=H?.signal,T=(H?.headers==null?[]:H.headers instanceof Headers?Array.from(H.headers.entries()):Array.isArray(H.headers)?H.headers:Object.entries(H.headers)).map(([A,u])=>[A,typeof u==="string"?u:u.toString()]),G=new Request($,H),b=await G.arrayBuffer(),NF=b.byteLength!==0?Array.from(new Uint8Array(b)):null,JF=await F.rawFetch({clientConfig:{method:G.method,url:G.url,headers:T,data:NF,maxRedirections:M,connectTimeout:w,proxy:R}});X?.addEventListener("abort",()=>{F.fetchCancel(JF)});let{status:BF,statusText:bF,url:CF,headers:j,rid:y}=await F.fetchSend(JF),S=await F.fetchReadBody(y),UF=new Response(S instanceof ArrayBuffer&&S.byteLength!==0?S:S instanceof Array&&S.length>0?new Uint8Array(S):null,{headers:j,status:BF,statusText:bF});return Object.defineProperty(UF,"url",{value:CF}),UF}}class FF{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 $=(H)=>{this.removeListener(F,$),Q(H)};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 H of $)H(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 $=(H)=>{this.removeListener(F,$),Q(H)};return this.prependListener(F,$)}}function IF(F){return{upload:(Q,$,H,M)=>F.upload(Q,$,H?H:void 0,M),download:(Q,$,H,M)=>F.download(Q,$,H?H:void 0,M)}}function $Q(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 HQ(F){return{BaseDirectory:a,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 QF{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 kF extends FF{program;args;options;stdout=new FF;stderr=new FF;constructor(F,Q=[],$){super();this.program=F,this.args=typeof Q==="string"?[Q]:Q,this.options=$??{}}}class hF extends kF{api;constructor(F,Q=[],$,H){super(F,Q,H);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 QF(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 _F extends kF{config;scriptPath;api;constructor(F,Q,$,H){super("deno",Q);this.config=$,this.scriptPath=F,this.api=H}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 QF(F,this.api)})}}class DF{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 YQ(F){function Q(j,y=[],S){return new hF(j,y,F,S)}function $(j,y,S){return new _F(j,y,S,F)}async function H(j,y,S,UF){let A=$(j,y,S),u=await A.spawn(),$$=new DF(A.stdout,u);return{rpcChannel:new h($$,{expose:UF}),process:u,command:A}}function M(j){return Q("bash",["-c",j])}function w(j){return Q("powershell",["-Command",j])}function R(j){return Q("osascript",["-e",j])}function X(j){return Q("python",["-c",j])}function z(j){return Q("zsh",["-c",j])}function T(j){return Q("node",["-e",j])}async function G(j){return M(j).execute()}async function b(j){return w(j).execute()}async function NF(j){return R(j).execute()}async function JF(j){return X(j).execute()}async function BF(j){return z(j).execute()}async function bF(j){return T(j).execute()}function CF(){return F.likelyOnWindows()}return{open:F.open,killPid:F.killPid,makeBashScript:M,makePowershellScript:w,makeAppleScript:R,makePythonScript:X,makeZshScript:z,makeNodeScript:T,executeBashScript:G,executePowershellScript:b,executeAppleScript:NF,executePythonScript:JF,executeZshScript:BF,executeNodeScript:bF,hasCommand:F.hasCommand,likelyOnWindows:CF,createCommand:Q,createDenoCommand:$,Child:QF,TauriShellStdio:DF,createDenoRpcChannel:H,RPCChannel:h,whereIsCommand:F.whereIsCommand}}function JQ(F){return{message:(Q,$,H)=>F.message(Q,$,H?H:void 0),info:(Q,$,H)=>F.info(Q,$,H?H:void 0),success:(Q,$,H)=>F.success(Q,$,H?H:void 0),warning:(Q,$,H)=>F.warning(Q,$,H?H:void 0),error:(Q,$,H)=>F.error(Q,$,H?H:void 0)}}class wF{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 fF;function Z$(F){return{lang:F?.lang??fF?.lang,message:F?.message,abortEarly:F?.abortEarly??fF?.abortEarly,abortPipeEarly:F?.abortPipeEarly??fF?.abortPipeEarly}}var M$;function w$(F){return M$?.get(F)}var z$;function x$(F){return z$?.get(F)}var O$;function W$(F,Q){return O$?.get(F)?.get(Q)}function v(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 L(F,Q,$,H,M){let w=M&&"input"in M?M.input:$.value,R=M?.expected??F.expects??null,X=M?.received??v(w),z={kind:F.kind,type:F.type,input:w,expected:R,received:X,message:`Invalid ${Q}: ${R?`Expected ${R} but r`:"R"}eceived ${X}`,requirement:F.requirement,path:M?.path,issues:M?.issues,lang:H.lang,abortEarly:H.abortEarly,abortPipeEarly:H.abortPipeEarly},T=F.kind==="schema",G=M?.message??F.message??W$(F.reference,z.lang)??(T?x$(z.lang):null)??H.message??w$(z.lang);if(G!==void 0)z.message=typeof G==="function"?G(z):G;if(T)$.typed=!1;if($.issues)$.issues.push(z);else $.issues=[z]}function N(F){return{version:1,vendor:"valibot",validate(Q){return F["~run"]({value:Q},Z$())}}}function R$(F,Q){return Object.hasOwn(F,Q)&&Q!=="__proto__"&&Q!=="prototype"&&Q!=="constructor"}function ZQ(F,Q){let $=[...new Set(F)];if($.length>1)return`(${$.join(` ${Q} `)})`;return $[0]??"never"}var T$=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u;function yF(F){return{kind:"validation",type:"hex_color",reference:yF,async:!1,expects:null,requirement:T$,message:F,"~run"(Q,$){if(Q.typed&&!this.requirement.test(Q.value))L(this,"hex color",Q,$);return Q}}}function vF(F,Q){return{kind:"validation",type:"max_value",reference:vF,async:!1,expects:`<=${F instanceof Date?F.toJSON():v(F)}`,requirement:F,message:Q,"~run"($,H){if($.typed&&!($.value<=this.requirement))L(this,"value",$,H,{received:$.value instanceof Date?$.value.toJSON():v($.value)});return $}}}function lF(F,Q){return{kind:"validation",type:"min_value",reference:lF,async:!1,expects:`>=${F instanceof Date?F.toJSON():v(F)}`,requirement:F,message:Q,"~run"($,H){if($.typed&&!($.value>=this.requirement))L(this,"value",$,H,{received:$.value instanceof Date?$.value.toJSON():v($.value)});return $}}}function X$(F,Q,$){return typeof F.fallback==="function"?F.fallback(Q,$):F.fallback}function pF(F,Q,$){return typeof F.default==="function"?F.default(Q,$):F.default}function $F(){return{kind:"schema",type:"any",reference:$F,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"($,H){let M=$.value;if(Array.isArray(M)){$.typed=!0,$.value=[];for(let w=0;w$.expects),"|"),async:!1,options:F,message:Q,get "~standard"(){return N(this)},"~run"($,H){let M,w,R;for(let X of this.options){let z=X["~run"]({value:$.value},H);if(z.typed)if(z.issues)if(w)w.push(z);else w=[z];else{M=z;break}else if(R)R.push(z);else R=[z]}if(M)return M;if(w){if(w.length===1)return w[0];L(this,"type",$,H,{issues:UQ(w)}),$.typed=!0}else if(R?.length===1)return R[0];else L(this,"type",$,H,{issues:UQ(R)});return $}}}function mF(...F){return{...F[0],pipe:F,get "~standard"(){return N(this)},"~run"(Q,$){for(let H of F)if(H.kind!=="metadata"){if(Q.issues&&(H.kind==="schema"||H.kind==="transformation")){Q.typed=!1;break}if(!Q.issues||!$.abortEarly&&!$.abortPipeEarly)Q=H["~run"](Q,$)}return Q}}}var _;((A)=>{A.List="List";A.ListItem="ListItem";A.ListItemDetail="ListItemDetail";A.ListItemAccessory="ListItemAccessory";A.ListSection="ListSection";A.ListItemDetailMetadata="ListItemDetailMetadata";A.ListItemDetailMetadataLabel="ListItemDetailMetadataLabel";A.ListItemDetailMetadataLink="ListItemDetailMetadataLink";A.ListItemDetailMetadataTagList="ListItemDetailMetadataTagList";A.ListItemDetailMetadataTagListItem="ListItemDetailMetadataTagListItem";A.ListItemDetailMetadataSeparator="ListItemDetailMetadataSeparator";A.Icon="Icon";A.EmptyView="EmptyView";A.Dropdown="Dropdown";A.DropdownSection="DropdownSection";A.DropdownItem="DropdownItem";A.ActionPanel="ActionPanel";A.Action="Action";A.ActionPanelSection="ActionPanelSection";A.ActionPanelSubmenu="ActionPanelSubmenu";A.Markdown="Markdown"})(_||={});var q=P(_),xF;((z)=>{z.Base="Base";z.Number="Number";z.Select="Select";z.Boolean="Boolean";z.Input="Input";z.Date="Date";z.Array="Array";z.Form="Form"})(xF||={});var HF=P(xF);var OF;((w)=>{w.Iconify="iconify";w.RemoteUrl="remote-url";w.Svg="svg";w.Base64PNG="base64-png";w.Text="text"})(OF||={});var MQ=P(OF),wQ=Z({type:MQ,value:J(),invert:U(K()),darkInvert:U(K()),hexColor:U(J()),bgColor:U(J())}),B=Z({...wQ.entries,fallback:U(k(()=>B))}),V$=Z({...wQ.entries,nodeName:q,fallback:U(k(()=>B))});var o=mF(J(),yF()),v1=Z({top:U(V()),right:U(V()),bottom:U(V()),left:U(V())}),l1=x([Y("light"),Y("dark"),Y("auto")]),p1=x([Y("zinc"),Y("slate"),Y("stone"),Y("gray"),Y("neutral"),Y("red"),Y("rose"),Y("orange"),Y("green"),Y("blue"),Y("yellow"),Y("violet")]),g1=mF(V(),lF(0),vF(1));var K$=Z({nodeName:q,icon:U(B),title:J(),value:J()}),uF=Z({nodeName:q,title:U(J()),items:O(x([K$]))});var WF=Z({nodeName:q,content:J()});var RY=Z({nodeName:q,title:U(J()),description:U(J()),icon:U(B)}),j$=Z({nodeName:q,title:J(),value:J(),icon:U(B),keywords:U(O(J()))}),A$=Z({nodeName:q,title:J(),items:O(j$)}),TY=Z({nodeName:q,tooltip:J(),sections:O(A$),defaultValue:J()}),G$=Z({nodeName:q,tag:U(x([J(),Z({color:o,text:J()})])),text:U(x([J(),Z({color:o,text:J()})])),date:U(x([l(),Z({color:o,text:l()})])),icon:U(B),tooltip:U(J())}),L$=Z({nodeName:Y("ListItemDetailMetadataLabel"),title:J(),icon:U(B),text:U(x([J(),Z({color:o,text:J()})]))}),N$=Z({nodeName:Y("ListItemDetailMetadataLink"),title:J(),text:J(),url:J()}),B$=Z({nodeName:Y("ListItemDetailMetadataTagListItem"),text:U(J()),color:U(o)}),b$=Z({nodeName:Y("ListItemDetailMetadataTagList"),title:J(),tags:O(B$)}),C$=Z({nodeName:Y("ListItemDetailMetadataSeparator")}),P$=x([L$,N$,b$,C$]),q$=Z({nodeName:Y("ListItemDetailMetadata"),items:O(P$)}),S$=Z({nodeName:Y("ListItemDetail"),children:O(x([WF,q$])),width:U(V())}),xQ=Z({nodeName:Y("ListItem"),title:J(),subTitle:U(J()),accessories:U(O(G$)),value:J(),defaultAction:U(J()),actions:U(uF),icon:U(B),keywords:U(O(J()))}),E$=Z({nodeName:Y("ListSection"),title:U(J()),subtitle:U(J()),items:O(xQ)}),I$=x([Y("items"),Y("detail"),Y("filter"),Y("sections"),Y("actions"),Y("defaultAction")]),XY=Z({nodeName:Y("List"),sections:U(O(E$)),items:U(O(xQ)),filter:x([Y("none"),Y("default")]),detail:U(S$),actions:U(uF),defaultAction:U(J()),inherits:U(O(I$))});var D$=x([Y("color"),Y("date"),Y("datetime-local"),Y("month"),Y("number"),Y("password"),Y("text"),Y("url"),Y("week"),Y("time"),Y("search")]),n=Z({nodeName:HF,key:J(),label:U(J()),hideLabel:U(K()),placeholder:U(J()),optional:U(K()),description:U(J()),default:U($F())}),OQ=Z({...n.entries,type:U(D$),component:U(x([Y("textarea"),Y("default")])),default:U(J())}),WQ=Z({...n.entries,nodeName:HF,default:U(V())}),RQ=Z({...n.entries,options:O(J()),default:U(J())}),TQ=Z({...n.entries,component:U(x([Y("checkbox"),Y("switch")]))}),XQ=Z({...n.entries,default:U(J())}),k$=x([OQ,WQ,RQ,TQ,XQ]),h$=Z({...n.entries,content:k$}),_$=x([h$,RQ,OQ,WQ,TQ,XQ]),f$=Z({nodeName:HF,key:J(),showFormDataDebug:U(K()),fields:O(x([k(()=>f$),_$])),title:U(J()),description:U(J()),submitBtnText:U(J())});class i{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}}}var E={};sF(E,{Section:()=>IQ,List:()=>DQ,ItemDetailMetadataTagListItem:()=>bQ,ItemDetailMetadataTagList:()=>CQ,ItemDetailMetadataSeparator:()=>PQ,ItemDetailMetadataLink:()=>BQ,ItemDetailMetadataLabel:()=>NQ,ItemDetailMetadata:()=>qQ,ItemDetail:()=>SQ,ItemAccessory:()=>LQ,Item:()=>EQ,EmptyView:()=>KQ,DropdownSection:()=>AQ,DropdownItem:()=>jQ,Dropdown:()=>GQ});class KQ{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 jQ{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 AQ{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 GQ{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 LQ{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 NQ{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 BQ{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 bQ{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 CQ{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 PQ{nodeName="ListItemDetailMetadataSeparator";toModel(){return{nodeName:this.nodeName}}}class qQ{nodeName="ListItemDetailMetadata";items;constructor(F){this.items=F}toModel(){return{nodeName:this.nodeName,items:this.items.map((F)=>F.toModel())}}}class SQ{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 EQ{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 IQ{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 DQ{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}}}var p={};sF(p,{ActionPanel:()=>hQ,Action:()=>kQ});class kQ{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 hQ{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 EY=Z({name:J(),icon_path:W(J()),app_path_exe:W(J()),app_desktop_path:J()});var hY=D(J("Window label"),Z({path:J("Path to the extension"),processes:O(V()),dist:U(W(J()))})),_Y=Z({extId:V(),identifier:J(),version:J(),enabled:K(),installed_at:J(),path:W(J()),data:W($F())}),_Q;((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"})(_Q||={});var f=P(_Q),y$=Z({cmdId:V(),extId:V(),name:J(),type:f,data:J(),alias:W(U(J())),hotkey:W(U(J())),enabled:K()}),fY=Z({...y$.entries,data:Z({link:J(),icon:B})}),yY=Z({dataId:V(),extId:V(),dataType:J(),data:U(J()),searchText:U(J()),createdAt:l(),updatedAt:l()}),vY=Z({name:J(),value:J(),icon:W(B),keywords:W(O(J())),function:gF(),confirmRequired:K()});var fQ;(($)=>{$.Asc="ASC";$.Desc="DESC"})(fQ||={});var gY=P(fQ),yQ;((H)=>{H.ExactMatch="exact_match";H.Like="like";H.FTS="fts"})(yQ||={});var mY=P(yQ);var RF=x([Y("clipboard:read-all"),Y("clipboard:write-all"),Y("clipboard:read-text"),Y("clipboard:write-text"),Y("clipboard:read-image"),Y("clipboard:write-image"),Y("clipboard:read-files"),Y("clipboard:write-files")]),TF=x([Y("dialog:all")]),XF=x([Y("notification:all")]),VF=x([Y("fs:read"),Y("fs:write"),Y("fs:exists")]),KF=Y("os:all"),vQ=x([Y("shell:open"),Y("shell:execute"),Y("shell:kill-any")]),jF=Y("fetch:all"),AF=x([Y("system-info:all"),Y("system-info:memory"),Y("system-info:cpu"),Y("system-info:os"),Y("system-info:disk"),Y("system-info:network"),Y("system-info:battery"),Y("system-info:process"),Y("system-info:components")]),GF=x([Y("network:interface"),Y("network:port")]),LF=x([Y("updownload:download"),Y("updownload:upload")]),v$=x([RF,TF,XF,VF,KF,vQ,jF,AF,GF,LF]);var rF={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 r$=x([RF,Y("clipboard:paste")]),lQ=x([Y("system:volumn"),Y("system:boot"),Y("system:disk"),Y("system:apps"),Y("system:fs"),Y("system:ui")]),pQ=x([VF,Y("fs:read-dir"),Y("fs:stat"),Y("fs:search")]),o$=x([Y("event:drag-drop"),Y("event:drag-enter"),Y("event:drag-leave"),Y("event:drag-over"),Y("event:window-blur"),Y("event:window-close-requested"),Y("event:window-focus")]),n$=x([Y("security:mac:reveal-security-pane"),Y("security:mac:verify-fingerprint"),Y("security:mac:reset-screencapture-permission"),Y("security:mac:request-permission"),Y("security:mac:check-permission"),Y("security:mac:all")]),i$=x([Y("hostname"),Y("osRelease"),Y("osUptime"),Y("loadavg"),Y("networkInterfaces"),Y("systemMemoryInfo"),Y("uid"),Y("gid"),Y("cpus"),J()]),d$=Z({net:U(x([Y("*"),O(J())])),env:U(x([Y("*"),O(J())])),read:U(x([Y("*"),O(J())])),write:U(x([Y("*"),O(J())])),run:U(x([Y("*"),O(J())])),ffi:U(x([Y("*"),O(J())])),sys:U(x([Y("*"),O(i$)]))}),d=Z({path:U(J()),url:U(J()),cmd:U(Z({program:J(),args:O(J())})),...d$.entries}),gQ=Z({permission:pQ,allow:U(O(d)),deny:U(O(d))}),mQ=x([Y("open:url"),Y("open:file"),Y("open:folder")]),uQ=Z({permission:mQ,allow:U(O(d)),deny:U(O(d))}),cQ=x([Y("shell:execute"),Y("shell:deno:execute"),Y("shell:spawn"),Y("shell:deno:spawn"),Y("shell:open"),Y("shell:kill"),Y("shell:kill-any"),Y("shell:all"),Y("shell:stdin-write")]),rQ=Z({permission:cQ,allow:U(O(d)),deny:U(O(d))}),oF=x([r$,o$,TF,XF,KF,cQ,jF,AF,GF,LF,lQ,n$]),s$=x([oF,pQ,mQ]);var U8={...rF,paste:["clipboard:paste"]};var nF;((H)=>{H.linux="linux";H.macos="macos";H.windows="windows"})(nF||={});var t$=P(nF),oQ=Object.values(nF),e$=Z({type:x([Y("text"),Y("regex")]),value:J()}),iQ;((H)=>{H.visible="visible";H.transparent="transparent";H.overlay="overlay"})(iQ||={});var a$=P(iQ),dQ=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(a$)),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()))}),iF=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(e$,"Commands to trigger the UI"),icon:U(B),platforms:U(W(O(t$,"Platforms available on. Leave empty for all platforms."),oQ),oQ)}),FH=Z({...iF.entries,type:U(f,f.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(dQ))}),QH=Z({...iF.entries,type:U(f,f.enum.UiWorker),window:U(W(dQ))}),$H=Z({...iF.entries,type:U(f,f.enum.HeadlessWorker)}),HH=x([oF,gQ,uQ,rQ]),YH=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(HH,"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(FH,"Custom UI Commands")),templateUiCmds:U(O(QH,"Template UI Commands")),headlessCmds:U(O($H,"Headless Commands"))}),nQ=x([Z({name:J("GitHub Username"),email:U(W(J("Email of the person"))),url:U(W(J("URL of the person")))}),J("GitHub Username")]),JH=x([Y("AGPL-3.0-only"),Y("Apache-2.0"),Y("BSD-2-Clause"),Y("BSD-3-Clause"),Y("BSL-1.0"),Y("CC0-1.0"),Y("CDDL-1.0"),Y("CDDL-1.1"),Y("EPL-1.0"),Y("EPL-2.0"),Y("GPL-2.0-only"),Y("GPL-3.0-only"),Y("ISC"),Y("LGPL-2.0-only"),Y("LGPL-2.1-only"),Y("LGPL-2.1-or-later"),Y("LGPL-3.0-only"),Y("LGPL-3.0-or-later"),Y("MIT"),Y("MPL-2.0"),Y("MS-PL"),Y("UNLICENSED")]),UH=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:JH,author:U(nQ),draft:U(K("Whether the extension is a draft, draft will not be published")),contributors:U(O(nQ,"Contributors of the extension")),repository:U(x([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(D(J(),J())),kunkun:YH,files:U(O(J("Files to include in the extension. e.g. ['dist']")))}),K8=Z({...UH.entries,...{extPath:J(),extFolderName:J()}});var ZH=Z({addresses:O(J()),fullname:J(),hostname:J(),port:V(),service_type:J(),subType:U(J()),properties:U(D(J(),J())),publicKey:J(),sslCert:J()}),G8=D(J(),ZH);var sQ=Z({filename:J(),fileSize:V(),id:J(),type:V(),children:O(k(()=>sQ))}),N8=Z({port:J(),code:J(),totalBytes:V(),totalFiles:V(),sslCert:J(),root:k(()=>sQ),ip:J()}),B8=Z({code:J(),idPathMap:D(J(),J())});class g{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 MH extends g{nodeName="Input";component;constructor(F){super(F);this.component=F.component}toModel(){return{...super.toModel(),component:this.component}}}class wH extends g{nodeName="Number"}class zH extends g{nodeName="Select";options;constructor(F){super(F);this.options=F.options}toModel(){return{...super.toModel(),options:this.options}}}class xH extends g{nodeName="Boolean";component;constructor(F){super(F);this.component=F.component??"checkbox"}toModel(){return{...super.toModel(),component:this.component}}}class OH extends g{nodeName="Date"}class WH extends g{nodeName="Array";content;constructor(F){super(F);this.content=F.content}toModel(){return{...super.toModel(),content:this.content.toModel()}}}class RH{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 dF{nodeName="Markdown";content;constructor(F){this.content=F}toModel(){return{nodeName:this.nodeName,content:this.content}}}var XH=new qF,eQ=new h(XH,{}),m=eQ.getAPI();function aQ(F){eQ.expose(F)}var F6=$Q(m.event),Q6=EF(m.fetch),$6=HQ(m.path),H6=YQ(m.shell),Y6=JQ(m.toast),J6=IF(m.updownload),{db:s,kv:U6,os:Z6,clipboard:M6,dialog:w6,fs:z6,log:x6,notification:O6,sysInfo:W6,network:R6,system:T6,open:F$,utils:X6,app:V6,security:K6,helper:j6,workerUi:YF}=m;class Q$ extends wF{nips=[];preferences="";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()}try{let F=await s.retrieveAll({fields:["data","search_text"]});if(F.length>0&&F[0].data)this.preferences=JSON.parse(F[0].data)?JSON.parse(F[0].data):"nostr",this.updateUI();else this.preferences="nostr",this.updateUI()}catch(F){console.error("Failed to load preferences:",F)}}async fetchNostrNips(){try{let Q=await(await fetch("https://api.github.com/repos/nostr-protocol/nips/contents/README.md")).json(),$=atob(Q.content),H=/\- \[NIP-(\d+)\: (.*?)\]\((\d+\.md)\)/g,M=[],w;while((w=H.exec($))!==null){let R=w[1].padStart(2,"0"),X=parseInt(R),z=w[2],T=w[3];M.push({nip:R,title:z,rawTitle:z,urlGithub:`https://github.com/nostr-protocol/nips/blob/master/${T}`,urlNostrCom:`https://nips.nostr.com/${X}`,content:`NIP-${R}: ${z}`})}return M.sort((R,X)=>parseInt(R.nip)-parseInt(X.nip))}catch(F){return console.error("Error fetching NIPs:",F),[]}}getFilteredNips(){if(!this.searchQuery)return this.nips;let F=this.searchQuery.toLowerCase();return this.nips.filter((Q)=>Q.rawTitle.toLowerCase().includes(F)||Q.nip.includes(F)||Q.content.toLowerCase().includes(F))}async onSearchTermChange(F){this.searchQuery=F,this.updateUI()}getFooterActions(){let F=[new p.Action({title:"Always open on nips.nostr.com",value:"open-nostr",icon:new i({type:"iconify",value:"game-icons:ostrich"})}),new p.Action({title:"Always open on GitHub",value:"open-github",icon:new i({type:"iconify",value:"mdi:github"})})];if(this.preferences==="github")F.reverse();return F}async updateUI(){return console.log("updateUI",this.preferences),YF.setSearchBarPlaceholder("Search NIPs by number or title… or k[X] \uD83E\uDD73").then(()=>{let F=this.getFilteredNips();if(this.loading)return YF.render(new E.List({sections:[new E.Section({title:"Loading...",items:[]})]}));if(F.length===0)return YF.render(new E.List({sections:[new E.Section({title:"No NIPs found",items:[]})]}));return YF.render(new E.List({sections:[new E.Section({title:"Nostr Implementation Possibilities",items:F.map((Q)=>new E.Item({title:`NIP-${Q.nip}: ${Q.title}`,value:this.preferences==="nostr"?Q.urlNostrCom:Q.urlGithub,icon:new i({type:"iconify",value:"majesticons:open"})}))})],actions:new p.ActionPanel({items:this.getFooterActions()})}))})}onListItemSelected(F){return F$.url(F)}async onActionSelected(F){if(F==="open-nostr")await s.deleteAll(),await s.add({data:JSON.stringify("nostr"),dataType:"preference",searchText:"open_with"}),this.preferences="nostr",this.updateUI();if(F==="open-github")await s.deleteAll(),await s.add({data:JSON.stringify("github"),dataType:"preference",searchText:"open_with"}),this.preferences="github",this.updateUI();return Promise.resolve()}}aQ(new Q$);