UNPKG

@wonderwhy-er/desktop-commander

Version:

MCP server for terminal operations and file editing

5 lines 1.17 MB
"use strict";(()=>{var ZM=Object.create;var ol=Object.defineProperty;var HM=Object.getOwnPropertyDescriptor;var qM=Object.getOwnPropertyNames;var WM=Object.getPrototypeOf,VM=Object.prototype.hasOwnProperty;var JM=(e,t,n)=>t in e?ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Kv=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qi=(e,t)=>{for(var n in t)ol(e,n,{get:t[n],enumerable:!0})},KM=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qM(t))!VM.call(e,r)&&r!==n&&ol(e,r,{get:()=>t[r],enumerable:!(i=HM(t,r))||i.enumerable});return e};var Gv=(e,t,n)=>(n=e!=null?ZM(WM(e)):{},KM(t||!e||!e.__esModule?ol(n,"default",{value:e,enumerable:!0}):n,e));var At=(e,t,n)=>JM(e,typeof t!="symbol"?t+"":t,n);var J$=Kv((mQ,V$)=>{function O$(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&O$(n)}),e}var Wu=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function R$(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Tr(e,...t){let n=Object.create(null);for(let i in e)n[i]=e[i];return t.forEach(function(i){for(let r in i)n[r]=i[r]}),n}var b8="</span>",I$=e=>!!e.scope,v8=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},Mm=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=R$(t)}openNode(t){if(!I$(t))return;let n=v8(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){I$(t)&&(this.buffer+=b8)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},A$=(e={})=>{let t={children:[]};return Object.assign(t,e),t},Nm=class e{constructor(){this.rootNode=A$(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=A$({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(i=>this._walk(t,i)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},Dm=class extends Nm{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let i=t.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Mm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Xs(e){return e?typeof e=="string"?e:e.source:null}function P$(e){return li("(?=",e,")")}function y8(e){return li("(?:",e,")*")}function x8(e){return li("(?:",e,")?")}function li(...e){return e.map(n=>Xs(n)).join("")}function k8(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Rm(...e){return"("+(k8(e).capture?"":"?:")+e.map(i=>Xs(i)).join("|")+")"}function L$(e){return new RegExp(e.toString()+"|").exec("").length-1}function _8(e,t){let n=e&&e.exec(t);return n&&n.index===0}var w8=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Pm(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;let r=n,o=Xs(i),s="";for(;o.length>0;){let a=w8.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+r):(s+=a[0],a[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(t)}var S8=/\b\B/,F$="[a-zA-Z]\\w*",Lm="[a-zA-Z_]\\w*",B$="\\b\\d+(\\.\\d+)?",U$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",j$="\\b(0b[01]+)",E8="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",$8=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=li(t,/.*\b/,e.binary,/\b.*/)),Tr({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},Ys={begin:"\\\\[\\s\\S]",relevance:0},C8={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ys]},T8={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ys]},I8={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ju=function(e,t,n={}){let i=Tr({scope:"comment",begin:e,end:t,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Rm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:li(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},A8=Ju("//","$"),z8=Ju("/\\*","\\*/"),M8=Ju("#","$"),N8={scope:"number",begin:B$,relevance:0},D8={scope:"number",begin:U$,relevance:0},O8={scope:"number",begin:j$,relevance:0},R8={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ys,{begin:/\[/,end:/\]/,relevance:0,contains:[Ys]}]},P8={scope:"title",begin:F$,relevance:0},L8={scope:"title",begin:Lm,relevance:0},F8={begin:"\\.\\s*"+Lm,relevance:0},B8=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},qu=Object.freeze({__proto__:null,APOS_STRING_MODE:C8,BACKSLASH_ESCAPE:Ys,BINARY_NUMBER_MODE:O8,BINARY_NUMBER_RE:j$,COMMENT:Ju,C_BLOCK_COMMENT_MODE:z8,C_LINE_COMMENT_MODE:A8,C_NUMBER_MODE:D8,C_NUMBER_RE:U$,END_SAME_AS_BEGIN:B8,HASH_COMMENT_MODE:M8,IDENT_RE:F$,MATCH_NOTHING_RE:S8,METHOD_GUARD:F8,NUMBER_MODE:N8,NUMBER_RE:B$,PHRASAL_WORDS_MODE:I8,QUOTE_STRING_MODE:T8,REGEXP_MODE:R8,RE_STARTERS_RE:E8,SHEBANG:$8,TITLE_MODE:P8,UNDERSCORE_IDENT_RE:Lm,UNDERSCORE_TITLE_MODE:L8});function U8(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function j8(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Z8(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=U8,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function H8(e,t){Array.isArray(e.illegal)&&(e.illegal=Rm(...e.illegal))}function q8(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function W8(e,t){e.relevance===void 0&&(e.relevance=1)}var V8=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(i=>{delete e[i]}),e.keywords=n.keywords,e.begin=li(n.beforeMatch,P$(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},J8=["of","and","for","in","not","or","if","then","parent","list","value"],K8="keyword";function Z$(e,t,n=K8){let i=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(o){Object.assign(i,Z$(e[o],t,o))}),i;function r(o,s){t&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");i[l[0]]=[o,G8(l[0],l[1])]})}}function G8(e,t){return t?Number(t):X8(e)?0:1}function X8(e){return J8.includes(e.toLowerCase())}var z$={},ai=e=>{console.error(e)},M$=(e,...t)=>{console.log(`WARN: ${e}`,...t)},po=(e,t)=>{z$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z$[`${e}/${t}`]=!0)},Vu=new Error;function H$(e,t,{key:n}){let i=0,r=e[n],o={},s={};for(let a=1;a<=t.length;a++)s[a+i]=r[a],o[a+i]=!0,i+=L$(t[a-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function Y8(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ai("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Vu;if(typeof e.beginScope!="object"||e.beginScope===null)throw ai("beginScope must be object"),Vu;H$(e,e.begin,{key:"beginScope"}),e.begin=Pm(e.begin,{joinWith:""})}}function Q8(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ai("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Vu;if(typeof e.endScope!="object"||e.endScope===null)throw ai("endScope must be object"),Vu;H$(e,e.end,{key:"endScope"}),e.end=Pm(e.end,{joinWith:""})}}function e9(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function t9(e){e9(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Y8(e),Q8(e)}function n9(e){function t(s,a){return new RegExp(Xs(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=L$(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(Pm(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let u=l.findIndex((d,f)=>f>0&&d!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(s){let a=new i;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[j8,q8,t9,V8].forEach(c=>c(s,a)),e.compilerExtensions.forEach(c=>c(s,a)),s.__beforeBegin=null,[Z8,H8,W8].forEach(c=>c(s,a)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=Z$(s.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=t(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=t(l.end)),l.terminatorEnd=Xs(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(c){return r9(c==="self"?s:c)})),s.contains.forEach(function(c){o(c,l)}),s.starts&&o(s.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Tr(e.classNameAliases||{}),o(e)}function q$(e){return e?e.endsWithParent||q$(e.starts):!1}function r9(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Tr(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:q$(e)?Tr(e,{starts:e.starts?Tr(e.starts):null}):Object.isFrozen(e)?Tr(e):e}var i9="11.11.1",Om=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},zm=R$,N$=Tr,D$=Symbol("nomatch"),o9=7,W$=function(e){let t=Object.create(null),n=Object.create(null),i=[],r=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Dm};function l(A){return a.noHighlightRe.test(A)}function u(A){let Z=A.className+" ";Z+=A.parentNode?A.parentNode.className:"";let q=a.languageDetectRe.exec(Z);if(q){let re=M(q[1]);return re||(M$(o.replace("{}",q[1])),M$("Falling back to no-highlight mode for this block.",A)),re?q[1]:"no-highlight"}return Z.split(/\s+/).find(re=>l(re)||M(re))}function c(A,Z,q){let re="",pe="";typeof Z=="object"?(re=A,q=Z.ignoreIllegals,pe=Z.language):(po("10.7.0","highlight(lang, code, ...args) has been deprecated."),po("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),pe=A,re=Z),q===void 0&&(q=!0);let k={code:re,language:pe};ve("before:highlight",k);let S=k.result?k.result:d(k.language,k.code,q);return S.code=k.code,ve("after:highlight",S),S}function d(A,Z,q,re){let pe=Object.create(null);function k($,D){return $.keywords[D]}function S(){if(!le.keywords){st.addText(Ae);return}let $=0;le.keywordPatternRe.lastIndex=0;let D=le.keywordPatternRe.exec(Ae),U="";for(;D;){U+=Ae.substring($,D.index);let ue=Ye.case_insensitive?D[0].toLowerCase():D[0],Se=k(le,ue);if(Se){let[at,Mn]=Se;if(st.addText(U),U="",pe[ue]=(pe[ue]||0)+1,pe[ue]<=o9&&(Kr+=Mn),at.startsWith("_"))U+=D[0];else{let Gr=Ye.classNameAliases[at]||at;oe(D[0],Gr)}}else U+=D[0];$=le.keywordPatternRe.lastIndex,D=le.keywordPatternRe.exec(Ae)}U+=Ae.substring($),st.addText(U)}function O(){if(Ae==="")return;let $=null;if(typeof le.subLanguage=="string"){if(!t[le.subLanguage]){st.addText(Ae);return}$=d(le.subLanguage,Ae,!0,Vo[le.subLanguage]),Vo[le.subLanguage]=$._top}else $=p(Ae,le.subLanguage.length?le.subLanguage:null);le.relevance>0&&(Kr+=$.relevance),st.__addSublanguage($._emitter,$.language)}function L(){le.subLanguage!=null?O():S(),Ae=""}function oe($,D){$!==""&&(st.startScope(D),st.addText($),st.endScope())}function ee($,D){let U=1,ue=D.length-1;for(;U<=ue;){if(!$._emit[U]){U++;continue}let Se=Ye.classNameAliases[$[U]]||$[U],at=D[U];Se?oe(at,Se):(Ae=at,S(),Ae=""),U++}}function $e($,D){return $.scope&&typeof $.scope=="string"&&st.openNode(Ye.classNameAliases[$.scope]||$.scope),$.beginScope&&($.beginScope._wrap?(oe(Ae,Ye.classNameAliases[$.beginScope._wrap]||$.beginScope._wrap),Ae=""):$.beginScope._multi&&(ee($.beginScope,D),Ae="")),le=Object.create($,{parent:{value:le}}),le}function ft($,D,U){let ue=_8($.endRe,U);if(ue){if($["on:end"]){let Se=new Wu($);$["on:end"](D,Se),Se.isMatchIgnored&&(ue=!1)}if(ue){for(;$.endsParent&&$.parent;)$=$.parent;return $}}if($.endsWithParent)return ft($.parent,D,U)}function ke($){return le.matcher.regexIndex===0?(Ae+=$[0],1):(Hi=!0,0)}function Re($){let D=$[0],U=$.rule,ue=new Wu(U),Se=[U.__beforeBegin,U["on:begin"]];for(let at of Se)if(at&&(at($,ue),ue.isMatchIgnored))return ke(D);return U.skip?Ae+=D:(U.excludeBegin&&(Ae+=D),L(),!U.returnBegin&&!U.excludeBegin&&(Ae=D)),$e(U,$),U.returnBegin?0:D.length}function bt($){let D=$[0],U=Z.substring($.index),ue=ft(le,$,U);if(!ue)return D$;let Se=le;le.endScope&&le.endScope._wrap?(L(),oe(D,le.endScope._wrap)):le.endScope&&le.endScope._multi?(L(),ee(le.endScope,$)):Se.skip?Ae+=D:(Se.returnEnd||Se.excludeEnd||(Ae+=D),L(),Se.excludeEnd&&(Ae=D));do le.scope&&st.closeNode(),!le.skip&&!le.subLanguage&&(Kr+=le.relevance),le=le.parent;while(le!==ue.parent);return ue.starts&&$e(ue.starts,$),Se.returnEnd?0:D.length}function It(){let $=[];for(let D=le;D!==Ye;D=D.parent)D.scope&&$.unshift(D.scope);$.forEach(D=>st.openNode(D))}let Xe={};function Ne($,D){let U=D&&D[0];if(Ae+=$,U==null)return L(),0;if(Xe.type==="begin"&&D.type==="end"&&Xe.index===D.index&&U===""){if(Ae+=Z.slice(D.index,D.index+1),!r){let ue=new Error(`0 width match regex (${A})`);throw ue.languageName=A,ue.badRule=Xe.rule,ue}return 1}if(Xe=D,D.type==="begin")return Re(D);if(D.type==="illegal"&&!q){let ue=new Error('Illegal lexeme "'+U+'" for mode "'+(le.scope||"<unnamed>")+'"');throw ue.mode=le,ue}else if(D.type==="end"){let ue=bt(D);if(ue!==D$)return ue}if(D.type==="illegal"&&U==="")return Ae+=` `,1;if(Zi>1e5&&Zi>D.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=U,U.length}let Ye=M(A);if(!Ye)throw ai(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let ji=n9(Ye),An="",le=re||ji,Vo={},st=new a.__emitter(a);It();let Ae="",Kr=0,zn=0,Zi=0,Hi=!1;try{if(Ye.__emitTokens)Ye.__emitTokens(Z,st);else{for(le.matcher.considerAll();;){Zi++,Hi?Hi=!1:le.matcher.considerAll(),le.matcher.lastIndex=zn;let $=le.matcher.exec(Z);if(!$)break;let D=Z.substring(zn,$.index),U=Ne(D,$);zn=$.index+U}Ne(Z.substring(zn))}return st.finalize(),An=st.toHTML(),{language:A,value:An,relevance:Kr,illegal:!1,_emitter:st,_top:le}}catch($){if($.message&&$.message.includes("Illegal"))return{language:A,value:zm(Z),illegal:!0,relevance:0,_illegalBy:{message:$.message,index:zn,context:Z.slice(zn-100,zn+100),mode:$.mode,resultSoFar:An},_emitter:st};if(r)return{language:A,value:zm(Z),illegal:!1,relevance:0,errorRaised:$,_emitter:st,_top:le};throw $}}function f(A){let Z={value:zm(A),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return Z._emitter.addText(A),Z}function p(A,Z){Z=Z||a.languages||Object.keys(t);let q=f(A),re=Z.filter(M).filter(ce).map(L=>d(L,A,!1));re.unshift(q);let pe=re.sort((L,oe)=>{if(L.relevance!==oe.relevance)return oe.relevance-L.relevance;if(L.language&&oe.language){if(M(L.language).supersetOf===oe.language)return 1;if(M(oe.language).supersetOf===L.language)return-1}return 0}),[k,S]=pe,O=k;return O.secondBest=S,O}function h(A,Z,q){let re=Z&&n[Z]||q;A.classList.add("hljs"),A.classList.add(`language-${re}`)}function m(A){let Z=null,q=u(A);if(l(q))return;if(ve("before:highlightElement",{el:A,language:q}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),a.throwUnescapedHTML))throw new Om("One of your code blocks includes unescaped HTML.",A.innerHTML);Z=A;let re=Z.textContent,pe=q?c(re,{language:q,ignoreIllegals:!0}):p(re);A.innerHTML=pe.value,A.dataset.highlighted="yes",h(A,q,pe.language),A.result={language:pe.language,re:pe.relevance,relevance:pe.relevance},pe.secondBest&&(A.secondBest={language:pe.secondBest.language,relevance:pe.secondBest.relevance}),ve("after:highlightElement",{el:A,result:pe,text:re})}function g(A){a=N$(a,A)}let b=()=>{_(),po("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function v(){_(),po("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function _(){function A(){_()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",A,!1),x=!0;return}document.querySelectorAll(a.cssSelector).forEach(m)}function E(A,Z){let q=null;try{q=Z(e)}catch(re){if(ai("Language definition for '{}' could not be registered.".replace("{}",A)),r)ai(re);else throw re;q=s}q.name||(q.name=A),t[A]=q,q.rawDefinition=Z.bind(null,e),q.aliases&&H(q.aliases,{languageName:A})}function T(A){delete t[A];for(let Z of Object.keys(n))n[Z]===A&&delete n[Z]}function N(){return Object.keys(t)}function M(A){return A=(A||"").toLowerCase(),t[A]||t[n[A]]}function H(A,{languageName:Z}){typeof A=="string"&&(A=[A]),A.forEach(q=>{n[q.toLowerCase()]=Z})}function ce(A){let Z=M(A);return Z&&!Z.disableAutodetect}function Ze(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=Z=>{A["before:highlightBlock"](Object.assign({block:Z.el},Z))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=Z=>{A["after:highlightBlock"](Object.assign({block:Z.el},Z))})}function Fe(A){Ze(A),i.push(A)}function Ie(A){let Z=i.indexOf(A);Z!==-1&&i.splice(Z,1)}function ve(A,Z){let q=A;i.forEach(function(re){re[q]&&re[q](Z)})}function Y(A){return po("10.7.0","highlightBlock will be removed entirely in v12.0"),po("10.7.0","Please use highlightElement now."),m(A)}Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:_,highlightElement:m,highlightBlock:Y,configure:g,initHighlighting:b,initHighlightingOnLoad:v,registerLanguage:E,unregisterLanguage:T,listLanguages:N,getLanguage:M,registerAliases:H,autoDetection:ce,inherit:N$,addPlugin:Fe,removePlugin:Ie}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=i9,e.regex={concat:li,lookahead:P$,either:Rm,optional:x8,anyNumberOfTimes:y8};for(let A in qu)typeof qu[A]=="object"&&O$(qu[A]);return Object.assign(e,qu),e},ho=W$({});ho.newInstance=()=>W$({});V$.exports=ho;ho.HighlightJS=ho;ho.default=ho});var $z=Kv((yle,Ez)=>{var $v=!0,wz=!1,Sz=!1;Ez.exports=function(e,t){t&&($v=!t.enabled,wz=!!t.label,Sz=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)oq(i,r)&&(sq(i[r],n.Token),_z(i[r-2],"class","task-list-item"+($v?"":" enabled")),_z(i[iq(i,r-2)],"class","contains-task-list"))})};function _z(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function iq(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function oq(e,t){return dq(e[t])&&fq(e[t-1])&&pq(e[t-2])&&hq(e[t])}function sq(e,t){if(e.children.unshift(aq(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),wz)if(Sz){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(cq(e.content,n,t))}else e.children.unshift(lq(t)),e.children.push(uq(t))}function aq(e,t){var n=new t("html_inline","",0),i=$v?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function lq(e){var t=new e("html_inline","",0);return t.content="<label>",t}function uq(e){var t=new e("html_inline","",0);return t.content="</label>",t}function cq(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function dq(e){return e.type==="inline"}function fq(e){return e.type==="paragraph_open"}function pq(e){return e.type==="list_item_open"}function hq(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}});var pV=Object.freeze({status:"aborted"});function I(e,t,n){function i(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(let c in s.prototype)c in a||Object.defineProperty(a,c,{value:s.prototype[c].bind(a)});a._zod.constr=s,a._zod.def=l}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function s(a){var l;let u=n?.Parent?new o:this;i(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let c of u._zod.deferred)c();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Xn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},sl={};function sn(e){return e&&Object.assign(sl,e),sl}var Ce={};qi(Ce,{BIGINT_FORMAT_RANGES:()=>Yv,Class:()=>_f,NUMBER_FORMAT_RANGES:()=>Af,aborted:()=>Yr,allowsEval:()=>Cf,assert:()=>e3,assertEqual:()=>GM,assertIs:()=>YM,assertNever:()=>QM,assertNotEqual:()=>XM,assignProp:()=>$f,cached:()=>Go,captureStackTrace:()=>ll,cleanEnum:()=>p3,cleanRegex:()=>Yo,clone:()=>Nn,createTransparentProxy:()=>s3,defineLazy:()=>Be,esc:()=>Xr,escapeRegex:()=>kr,extend:()=>u3,finalizeIssue:()=>En,floatSafeRemainder:()=>Ef,getElementAtPath:()=>t3,getEnumValues:()=>wf,getLengthableOrigin:()=>Qo,getParsedType:()=>o3,getSizableOrigin:()=>Qv,isObject:()=>Wi,isPlainObject:()=>Vi,issue:()=>zf,joinValues:()=>al,jsonStringifyReplacer:()=>Sf,merge:()=>c3,normalizeParams:()=>ne,nullish:()=>Xo,numKeys:()=>i3,omit:()=>l3,optionalKeys:()=>If,partial:()=>d3,pick:()=>a3,prefixIssues:()=>Dn,primitiveTypes:()=>Xv,promiseAllObject:()=>n3,propertyKeyTypes:()=>Tf,randomString:()=>r3,required:()=>f3,stringifyPrimitive:()=>ul,unwrapMessage:()=>Ko});function GM(e){return e}function XM(e){return e}function YM(e){}function QM(e){throw new Error}function e3(e){}function wf(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function al(e,t="|"){return e.map(n=>ul(n)).join(t)}function Sf(e,t){return typeof t=="bigint"?t.toString():t}function Go(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Xo(e){return e==null}function Yo(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ef(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return o%s/10**r}function Be(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw new Error("cached value already set")},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function $f(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function t3(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function n3(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function r3(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function Xr(e){return JSON.stringify(e)}var ll=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Cf=Go(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Vi(e){if(Wi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Wi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function i3(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var o3=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Tf=new Set(["string","number","symbol"]),Xv=new Set(["string","number","bigint","boolean","symbol","undefined"]);function kr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nn(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function s3(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function ul(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function If(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Af={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yv={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function a3(e,t){let n={},i=e._zod.def;for(let r in t){if(!(r in i.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(n[r]=i.shape[r])}return Nn(e,{...e._zod.def,shape:n,checks:[]})}function l3(e,t){let n={...e._zod.def.shape},i=e._zod.def;for(let r in t){if(!(r in i.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete n[r]}return Nn(e,{...e._zod.def,shape:n,checks:[]})}function u3(e,t){if(!Vi(t))throw new Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let i={...e._zod.def.shape,...t};return $f(this,"shape",i),i},checks:[]};return Nn(e,n)}function c3(e,t){return Nn(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return $f(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function d3(e,t,n){let i=t._zod.def.shape,r={...i};if(n)for(let o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)r[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Nn(t,{...t._zod.def,shape:r,checks:[]})}function f3(e,t,n){let i=t._zod.def.shape,r={...i};if(n)for(let o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(let o in i)r[o]=new e({type:"nonoptional",innerType:i[o]});return Nn(t,{...t._zod.def,shape:r,checks:[]})}function Yr(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Dn(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ko(e){return typeof e=="string"?e:e?.message}function En(e,t,n){let i={...e,path:e.path??[]};if(!e.message){let r=Ko(e.inst?._zod.def?.error?.(e))??Ko(t?.error?.(e))??Ko(n.customError?.(e))??Ko(n.localeError?.(e))??"Invalid input";i.message=r}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Qv(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Qo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function zf(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function p3(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var _f=class{constructor(...t){}};var ey=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Sf,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cl=I("$ZodError",ey),Mf=I("$ZodError",ey,{Parent:Error});function ty(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function ny(e,t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)i._errors.push(n(s));else{let a=i,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(e),i}var ry=e=>(t,n,i,r)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Xn;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map(l=>En(l,o,sn())));throw ll(a,r?.callee),a}return s.value};var iy=e=>async(t,n,i,r)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(r?.Err??e)(s.issues.map(l=>En(l,o,sn())));throw ll(a,r?.callee),a}return s.value};var Nf=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Xn;return o.issues.length?{success:!1,error:new(e??cl)(o.issues.map(s=>En(s,r,sn())))}:{success:!0,data:o.value}},es=Nf(Mf),Df=e=>async(t,n,i)=>{let r=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>En(s,r,sn())))}:{success:!0,data:o.value}},dl=Df(Mf);var oy=/^[cC][^\s-]{8,}$/,sy=/^[0-9a-z]+$/,ay=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ly=/^[0-9a-vA-V]{20}$/,uy=/^[A-Za-z0-9]{27}$/,cy=/^[a-zA-Z0-9_-]{21}$/,dy=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var fy=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Of=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var py=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var m3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hy(){return new RegExp(m3,"u")}var my=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,by=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yy=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rf=/^[A-Za-z0-9_-]*$/,xy=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var ky=/^\+(?:[0-9]){6,14}[0-9]$/,_y="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wy=new RegExp(`^${_y}$`);function Sy(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ey(e){return new RegExp(`^${Sy(e)}$`)}function $y(e){let t=Sy({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let i=`${t}(?:${n.join("|")})`;return new RegExp(`^${_y}T(?:${i})$`)}var Cy=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Ty=/^\d+$/,Iy=/^-?\d+(?:\.\d+)?/i,Ay=/true|false/i,zy=/null/i;var My=/^[^A-Z]*$/,Ny=/^[^a-z]*$/;var zt=I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Dy={number:"number",bigint:"bigint",object:"date"},Lf=I("$ZodCheckLessThan",(e,t)=>{zt.init(e,t);let n=Dy[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ff=I("$ZodCheckGreaterThan",(e,t)=>{zt.init(e,t);let n=Dy[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oy=I("$ZodCheckMultipleOf",(e,t)=>{zt.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Ef(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ry=I("$ZodCheckNumberFormat",(e,t)=>{zt.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Af[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=r,a.maximum=o,n&&(a.pattern=Ty)}),e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inst:e})}});var Py=I("$ZodCheckMaxLength",(e,t)=>{var n;zt.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Xo(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;if(r.length<=t.maximum)return;let s=Qo(r);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ly=I("$ZodCheckMinLength",(e,t)=>{var n;zt.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Xo(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;if(r.length>=t.minimum)return;let s=Qo(r);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Fy=I("$ZodCheckLengthEquals",(e,t)=>{var n;zt.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Xo(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=i=>{let r=i.value,o=r.length;if(o===t.length)return;let s=Qo(r),a=o>t.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),ts=I("$ZodCheckStringFormat",(e,t)=>{var n,i;zt.init(e,t),e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),By=I("$ZodCheckRegex",(e,t)=>{ts.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Uy=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=My),ts.init(e,t)}),jy=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ny),ts.init(e,t)}),Zy=I("$ZodCheckIncludes",(e,t)=>{zt.init(e,t);let n=kr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Hy=I("$ZodCheckStartsWith",(e,t)=>{zt.init(e,t);let n=new RegExp(`^${kr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),qy=I("$ZodCheckEndsWith",(e,t)=>{zt.init(e,t);let n=new RegExp(`.*${kr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});var Wy=I("$ZodCheckOverwrite",(e,t)=>{zt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var fl=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(` `).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,r.join(` `))}};var Jy={major:4,minor:0,patch:0};var Ue=I("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jy;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let r of i)for(let o of r._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(o,s,a)=>{let l=Yr(o),u;for(let c of s){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(l)continue;let d=o.issues.length,f=c._zod.check(o);if(f instanceof Promise&&a?.async===!1)throw new Xn;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,o.issues.length!==d&&(l||(l=Yr(o,d)))});else{if(o.issues.length===d)continue;l||(l=Yr(o,d))}}return u?u.then(()=>o):o};e._zod.run=(o,s)=>{let a=e._zod.parse(o,s);if(a instanceof Promise){if(s.async===!1)throw new Xn;return a.then(l=>r(l,i,s))}return r(a,i,s)}}e["~standard"]={validate:r=>{try{let o=es(e,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return dl(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),hl=I("$ZodString",(e,t)=>{Ue.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cy(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),He=I("$ZodStringFormat",(e,t)=>{ts.init(e,t),hl.init(e,t)}),i1=I("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=fy),He.init(e,t)}),o1=I("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Of(i))}else t.pattern??(t.pattern=Of());He.init(e,t)}),s1=I("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=py),He.init(e,t)}),a1=I("$ZodURL",(e,t)=>{He.init(e,t),e._zod.check=n=>{try{let i=n.value,r=new URL(i),o=r.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:xy.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!i.endsWith("/")&&o.endsWith("/")?n.value=o.slice(0,-1):n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),l1=I("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=hy()),He.init(e,t)}),u1=I("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=cy),He.init(e,t)}),c1=I("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=oy),He.init(e,t)}),d1=I("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sy),He.init(e,t)}),f1=I("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ay),He.init(e,t)}),p1=I("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ly),He.init(e,t)}),h1=I("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=uy),He.init(e,t)}),m1=I("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=$y(t)),He.init(e,t)}),g1=I("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wy),He.init(e,t)}),b1=I("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ey(t)),He.init(e,t)}),v1=I("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=dy),He.init(e,t)}),y1=I("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=my),He.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv4"})}),x1=I("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gy),He.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),k1=I("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=by),He.init(e,t)}),_1=I("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vy),He.init(e,t),e._zod.check=n=>{let[i,r]=n.value.split("/");try{if(!r)throw new Error;let o=Number(r);if(`${o}`!==r)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function w1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var S1=I("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yy),He.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{w1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function g3(e){if(!Rf.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return w1(n)}var E1=I("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rf),He.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{g3(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$1=I("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ky),He.init(e,t)});function b3(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var C1=I("$ZodJWT",(e,t)=>{He.init(e,t),e._zod.check=n=>{b3(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}});var Uf=I("$ZodNumber",(e,t)=>{Ue.init(e,t),e._zod.pattern=e._zod.bag.pattern??Iy,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),T1=I("$ZodNumber",(e,t)=>{Ry.init(e,t),Uf.init(e,t)}),I1=I("$ZodBoolean",(e,t)=>{Ue.init(e,t),e._zod.pattern=Ay,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}});var A1=I("$ZodNull",(e,t)=>{Ue.init(e,t),e._zod.pattern=zy,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}});var z1=I("$ZodUnknown",(e,t)=>{Ue.init(e,t),e._zod.parse=n=>n}),M1=I("$ZodNever",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Ky(e,t,n){e.issues.length&&t.issues.push(...Dn(n,e.issues)),t.value[n]=e.value}var N1=I("$ZodArray",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let a=r[s],l=t.element._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(u=>Ky(u,n,s))):Ky(l,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function pl(e,t,n){e.issues.length&&t.issues.push(...Dn(n,e.issues)),t.value[n]=e.value}function