nemar-cli 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ ${FC.default.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)jJ(th
|
|
|
88
88
|
${F}`,n0D=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),i0D=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),a0D=(D,F,$)=>{let B=$===""?"":`with ${$.trim()}() `,J=c0D.bind(null,B,F.toString());Object.defineProperty(J,"name",i0D);let{writable:Y,enumerable:Q,configurable:X}=n0D;Object.defineProperty(D,"toString",{value:J,writable:Y,enumerable:Q,configurable:X})};function $3(D,F,{ignoreNonConfigurable:$=!1}={}){let{name:B}=D;for(let J of Reflect.ownKeys(F))l0D(D,F,J,$);return p0D(D,F),a0D(D,F,B),D}var h9=new WeakMap,DR=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let $,B=0,J=D.displayName||D.name||"<anonymous>",Y=function(...Q){if(h9.set(Y,++B),B===1)$=D.apply(this,Q),D=void 0;else if(F.throw===!0)throw Error(`Function \`${J}\` can only be called once`);return $};return $3(Y,D),h9.set(Y,B),Y};DR.callCount=(D)=>{if(!h9.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return h9.get(D)};var FR=DR;var F6=[];F6.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")F6.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")F6.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var g9=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",PY=Symbol.for("signal-exit emitter"),wY=globalThis,o0D=Object.defineProperty.bind(Object);class $R{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(wY[PY])return wY[PY];o0D(wY,PY,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,F){this.listeners[D].push(F)}removeListener(D,F){let $=this.listeners[D],B=$.indexOf(F);if(B===-1)return;if(B===0&&$.length===1)$.length=0;else $.splice(B,1)}emit(D,F,$){if(this.emitted[D])return!1;this.emitted[D]=!0;let B=!1;for(let J of this.listeners[D])B=J(F,$)===!0||B;if(D==="exit")B=this.emit("afterExit",F,$)||B;return B}}class SY{}var s0D=(D)=>{return{onExit(F,$){return D.onExit(F,$)},load(){return D.load()},unload(){return D.unload()}}};class BR extends SY{onExit(){return()=>{}}load(){}unload(){}}class JR extends SY{#$=jY.platform==="win32"?"SIGINT":"SIGHUP";#F=new $R;#D;#J;#q;#B={};#Q=!1;constructor(D){super();this.#D=D,this.#B={};for(let F of F6)this.#B[F]=()=>{let $=this.#D.listeners(F),{count:B}=this.#F,J=D;if(typeof J.__signal_exit_emitter__==="object"&&typeof J.__signal_exit_emitter__.count==="number")B+=J.__signal_exit_emitter__.count;if($.length===B){this.unload();let Y=this.#F.emit("exit",null,F),Q=F==="SIGHUP"?this.#$:F;if(!Y)D.kill(D.pid,Q)}};this.#q=D.reallyExit,this.#J=D.emit}onExit(D,F){if(!g9(this.#D))return()=>{};if(this.#Q===!1)this.load();let $=F?.alwaysLast?"afterExit":"exit";return this.#F.on($,D),()=>{if(this.#F.removeListener($,D),this.#F.listeners.exit.length===0&&this.#F.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Q)return;this.#Q=!0,this.#F.count+=1;for(let D of F6)try{let F=this.#B[D];if(F)this.#D.on(D,F)}catch(F){}this.#D.emit=(D,...F)=>{return this.#z(D,...F)},this.#D.reallyExit=(D)=>{return this.#Y(D)}}unload(){if(!this.#Q)return;this.#Q=!1,F6.forEach((D)=>{let F=this.#B[D];if(!F)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,F)}catch($){}}),this.#D.emit=this.#J,this.#D.reallyExit=this.#q,this.#F.count-=1}#Y(D){if(!g9(this.#D))return 0;return this.#D.exitCode=D||0,this.#F.emit("exit",this.#D.exitCode,null),this.#q.call(this.#D,this.#D.exitCode)}#z(D,...F){let $=this.#J;if(D==="exit"&&g9(this.#D)){if(typeof F[0]==="number")this.#D.exitCode=F[0];let B=$.call(this.#D,D,...F);return this.#F.emit("exit",this.#D.exitCode,null),B}else return $.call(this.#D,D,...F)}}var jY=globalThis.process,{onExit:YR,load:jKD,unload:SKD}=s0D(g9(jY)?new JR(jY):new BR);var QR=u9.stderr.isTTY?u9.stderr:u9.stdout.isTTY?u9.stdout:void 0,r0D=QR?FR(()=>{YR(()=>{QR.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},XR=r0D;var b9=!1,L4={};L4.show=(D=ER.stderr)=>{if(!D.isTTY)return;b9=!1,D.write("\x1B[?25h")};L4.hide=(D=ER.stderr)=>{if(!D.isTTY)return;XR(),b9=!0,D.write("\x1B[?25l")};L4.toggle=(D,F)=>{if(D!==void 0)b9=D;if(b9)L4.show(F);else L4.hide(F)};var kY=L4;var Y3=h(f5(),1);import g0 from"process";function vY(){if(g0.platform!=="win32")return g0.env.TERM!=="linux";return Boolean(g0.env.CI)||Boolean(g0.env.WT_SESSION)||Boolean(g0.env.TERMINUS_SUBLIME)||g0.env.ConEmuTask==="{cmd::Cmder}"||g0.env.TERM_PROGRAM==="Terminus-Sublime"||g0.env.TERM_PROGRAM==="vscode"||g0.env.TERM==="xterm-256color"||g0.env.TERM==="alacritty"||g0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var t0D={info:M.blue("\u2139"),success:M.green("\u2714"),warning:M.yellow("\u26A0"),error:M.red("\u2716")},e0D={info:M.blue("i"),success:M.green("\u221A"),warning:M.yellow("\u203C"),error:M.red("\xD7")},D1D=vY()?t0D:e0D,B3=D1D;function yY({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var F1D=yY();function J3(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(F1D,"")}function GR(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function HR(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function WR(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function $1D(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function qR(D,{ambiguousAsWide:F=!1}={}){if($1D(D),HR(D)||WR(D)||F&&GR(D))return 2;return 1}var zR=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g};var B1D=new Intl.Segmenter,J1D=/^\p{Default_Ignorable_Code_Point}$/u;function xY(D,F={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:$=!0,countAnsiEscapeCodes:B=!1}=F;if(!B)D=J3(D);if(D.length===0)return 0;let J=0,Y={ambiguousAsWide:!$};for(let{segment:Q}of B1D.segment(D)){let X=Q.codePointAt(0);if(X<=31||X>=127&&X<=159)continue;if(X>=8203&&X<=8207||X===65279)continue;if(X>=768&&X<=879||X>=6832&&X<=6911||X>=7616&&X<=7679||X>=8400&&X<=8447||X>=65056&&X<=65071)continue;if(X>=55296&&X<=57343)continue;if(X>=65024&&X<=65039)continue;if(J1D.test(Q))continue;if(zR().test(Q)){J+=2;continue}J+=qR(X,Y)}return J}function fY({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import KR from"process";function _Y(){let{env:D}=KR,{TERM:F,TERM_PROGRAM:$}=D;if(KR.platform!=="win32")return F!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||$==="Terminus-Sublime"||$==="vscode"||F==="xterm-256color"||F==="alacritty"||F==="rxvt-unicode"||F==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import q1 from"process";var Y1D=3;class VR{#$=0;start(){if(this.#$++,this.#$===1)this.#F()}stop(){if(this.#$<=0)throw Error("`stop` called more times than `start`");if(this.#$--,this.#$===0)this.#D()}#F(){if(q1.platform==="win32"||!q1.stdin.isTTY)return;q1.stdin.setRawMode(!0),q1.stdin.on("data",this.#J),q1.stdin.resume()}#D(){if(!q1.stdin.isTTY)return;q1.stdin.off("data",this.#J),q1.stdin.pause(),q1.stdin.setRawMode(!1)}#J(D){if(D[0]===Y1D)q1.emit("SIGINT")}}var Q1D=new VR,hY=Q1D;var X1D=h(f5(),1);class AR{#$=0;#F=!1;#D=0;#J=-1;#q=0;#B;#Q;#Y;#z;#V;#G;#H;#W;#A;#X;#E;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#B={color:"cyan",stream:m9.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#B.color,this.spinner=this.#B.spinner,this.#V=this.#B.interval,this.#Y=this.#B.stream,this.#G=typeof this.#B.isEnabled==="boolean"?this.#B.isEnabled:fY({stream:this.#Y}),this.#H=typeof this.#B.isSilent==="boolean"?this.#B.isSilent:!1,this.text=this.#B.text,this.prefixText=this.#B.prefixText,this.suffixText=this.#B.suffixText,this.indent=this.#B.indent,m9.env.NODE_ENV==="test")this._stream=this.#Y,this._isEnabled=this.#G,Object.defineProperty(this,"_linesToClear",{get(){return this.#$},set(F){this.#$=F}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#J}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#W}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#W=D,this.#K()}get interval(){return this.#V??this.#Q.interval??100}get spinner(){return this.#Q}set spinner(D){if(this.#J=-1,this.#V=void 0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#Q=D}else if(!_Y())this.#Q=Y3.default.line;else if(D===void 0)this.#Q=Y3.default.dots;else if(D!=="default"&&Y3.default[D])this.#Q=Y3.default[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#A}set text(D=""){this.#A=D,this.#K()}get prefixText(){return this.#X}set prefixText(D=""){this.#X=D,this.#K()}get suffixText(){return this.#E}set suffixText(D=""){this.#E=D,this.#K()}get isSpinning(){return this.#z!==void 0}#U(D=this.#X,F=" "){if(typeof D==="string"&&D!=="")return D+F;if(typeof D==="function")return D()+F;return""}#M(D=this.#E,F=" "){if(typeof D==="string"&&D!=="")return F+D;if(typeof D==="function")return F+D();return""}#K(){let D=this.#Y.columns??80,F=this.#U(this.#X,"-"),$=this.#M(this.#E,"-"),B=" ".repeat(this.#W)+F+"--"+this.#A+"--"+$;this.#D=0;for(let J of J3(B).split(`
|
|
89
89
|
`))this.#D+=Math.max(1,Math.ceil(xY(J,{countAnsiEscapeCodes:!0})/D))}get isEnabled(){return this.#G&&!this.#H}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#G=D}get isSilent(){return this.#H}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#H=D}frame(){let D=Date.now();if(this.#J===-1||D-this.#q>=this.interval)this.#J=++this.#J%this.#Q.frames.length,this.#q=D;let{frames:F}=this.#Q,$=F[this.#J];if(this.color)$=M[this.color]($);let B=typeof this.#X==="string"&&this.#X!==""?this.#X+" ":"",J=typeof this.text==="string"?" "+this.text:"",Y=typeof this.#E==="string"&&this.#E!==""?" "+this.#E:"";return B+$+J+Y}clear(){if(!this.#G||!this.#Y.isTTY)return this;this.#Y.cursorTo(0);for(let D=0;D<this.#$;D++){if(D>0)this.#Y.moveCursor(0,-1);this.#Y.clearLine(1)}if(this.#W||this.lastIndent!==this.#W)this.#Y.cursorTo(this.#W);return this.lastIndent=this.#W,this.#$=0,this}render(){if(this.#H)return this;return this.clear(),this.#Y.write(this.frame()),this.#$=this.#D,this}start(D){if(D)this.text=D;if(this.#H)return this;if(!this.#G){if(this.text)this.#Y.write(`- ${this.text}
|
|
90
90
|
`);return this}if(this.isSpinning)return this;if(this.#B.hideCursor)kY.hide(this.#Y);if(this.#B.discardStdin&&m9.stdin.isTTY)this.#F=!0,hY.start();return this.render(),this.#z=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#G)return this;if(clearInterval(this.#z),this.#z=void 0,this.#J=0,this.clear(),this.#B.hideCursor)kY.show(this.#Y);if(this.#B.discardStdin&&m9.stdin.isTTY&&this.#F)hY.stop(),this.#F=!1;return this}succeed(D){return this.stopAndPersist({symbol:B3.success,text:D})}fail(D){return this.stopAndPersist({symbol:B3.error,text:D})}warn(D){return this.stopAndPersist({symbol:B3.warning,text:D})}info(D){return this.stopAndPersist({symbol:B3.info,text:D})}stopAndPersist(D={}){if(this.#H)return this;let F=D.prefixText??this.#X,$=this.#U(F," "),B=D.symbol??" ",J=D.text??this.text,Q=typeof J==="string"?(B?" ":"")+J:"",X=D.suffixText??this.#E,E=this.#M(X," "),G=$+B+Q+E+`
|
|
91
|
-
`;return this.stop(),this.#Y.write(G),this}}function o(D){return new AR(D)}import{existsSync as RXD}from"fs";import{join as IXD}from"path";import{isDeepStrictEqual as $QD}from"util";import nS from"process";import q6 from"fs";import iS from"path";import m3 from"crypto";import BQD from"assert";var $6=(D)=>{let F=typeof D;return D!==null&&(F==="object"||F==="function")};var gY=new Set(["__proto__","prototype","constructor"]),E1D=new Set("0123456789");function l9(D){let F=[],$="",B="start",J=!1;for(let Y of D)switch(Y){case"\\":{if(B==="index")throw Error("Invalid character in an index");if(B==="indexEnd")throw Error("Invalid character after an index");if(J)$+=Y;B="property",J=!J;break}case".":{if(B==="index")throw Error("Invalid character in an index");if(B==="indexEnd"){B="property";break}if(J){J=!1,$+=Y;break}if(gY.has($))return[];F.push($),$="",B="property";break}case"[":{if(B==="index")throw Error("Invalid character in an index");if(B==="indexEnd"){B="index";break}if(J){J=!1,$+=Y;break}if(B==="property"){if(gY.has($))return[];F.push($),$=""}B="index";break}case"]":{if(B==="index"){F.push(Number.parseInt($,10)),$="",B="indexEnd";break}if(B==="indexEnd")throw Error("Invalid character after an index")}default:{if(B==="index"&&!E1D.has(Y))throw Error("Invalid character in an index");if(B==="indexEnd")throw Error("Invalid character after an index");if(B==="start")B="property";if(J)J=!1,$+="\\";$+=Y}}if(J)$+="\\";switch(B){case"property":{if(gY.has($))return[];F.push($);break}case"index":throw Error("Index was not closed");case"start":{F.push("");break}}return F}function uY(D,F){if(typeof F!=="number"&&Array.isArray(D)){let $=Number.parseInt(F,10);return Number.isInteger($)&&D[$]===D[F]}return!1}function UR(D,F){if(uY(D,F))throw Error("Cannot use string index")}function MR(D,F,$){if(!$6(D)||typeof F!=="string")return $===void 0?D:$;let B=l9(F);if(B.length===0)return $;for(let J=0;J<B.length;J++){let Y=B[J];if(uY(D,Y))D=J===B.length-1?void 0:null;else D=D[Y];if(D===void 0||D===null){if(J!==B.length-1)return $;break}}return D===void 0?$:D}function bY(D,F,$){if(!$6(D)||typeof F!=="string")return D;let B=D,J=l9(F);for(let Y=0;Y<J.length;Y++){let Q=J[Y];if(UR(D,Q),Y===J.length-1)D[Q]=$;else if(!$6(D[Q]))D[Q]=typeof J[Y+1]==="number"?[]:{};D=D[Q]}return B}function NR(D,F){if(!$6(D)||typeof F!=="string")return!1;let $=l9(F);for(let B=0;B<$.length;B++){let J=$[B];if(UR(D,J),B===$.length-1)return delete D[J],!0;if(D=D[J],!$6(D))return!1}}function ZR(D,F){if(!$6(D)||typeof F!=="string")return!1;let $=l9(F);if($.length===0)return!1;for(let B of $){if(!$6(D)||!(B in D)||uY(D,B))return!1;D=D[B]}return!0}import CD from"path";import CR from"os";import mY from"process";var R8=CR.homedir(),lY=CR.tmpdir(),{env:R4}=mY,G1D=(D)=>{let F=CD.join(R8,"Library");return{data:CD.join(F,"Application Support",D),config:CD.join(F,"Preferences",D),cache:CD.join(F,"Caches",D),log:CD.join(F,"Logs",D),temp:CD.join(lY,D)}},H1D=(D)=>{let F=R4.APPDATA||CD.join(R8,"AppData","Roaming"),$=R4.LOCALAPPDATA||CD.join(R8,"AppData","Local");return{data:CD.join($,D,"Data"),config:CD.join(F,D,"Config"),cache:CD.join($,D,"Cache"),log:CD.join($,D,"Log"),temp:CD.join(lY,D)}},W1D=(D)=>{let F=CD.basename(R8);return{data:CD.join(R4.XDG_DATA_HOME||CD.join(R8,".local","share"),D),config:CD.join(R4.XDG_CONFIG_HOME||CD.join(R8,".config"),D),cache:CD.join(R4.XDG_CACHE_HOME||CD.join(R8,".cache"),D),log:CD.join(R4.XDG_STATE_HOME||CD.join(R8,".local","state"),D),temp:CD.join(lY,F,D)}};function dY(D,{suffix:F="nodejs"}={}){if(typeof D!=="string")throw TypeError(`Expected a string, got ${typeof D}`);if(F)D+=`-${F}`;if(mY.platform==="darwin")return G1D(D);if(mY.platform==="win32")return H1D(D);return W1D(D)}import N1D from"path";import BD from"fs";import{promisify as mD}from"util";var q1D=(D,F)=>{let{onError:$}=F;return function(...J){return D.apply(void 0,J).catch($)}},z1=q1D;var z1D=(D,F)=>{let{onError:$}=F;return function(...J){try{return D.apply(void 0,J)}catch(Y){return $(Y)}}},u0=z1D;var LR=250;var K1D=(D,F)=>{let{isRetriable:$}=F;return function(J){let{timeout:Y}=J,Q=J.interval??LR,X=Date.now()+Y;return function E(...G){return D.apply(void 0,G).catch((H)=>{if(!$(H))throw H;if(Date.now()>=X)throw H;let q=Math.round(Q*Math.random());if(q>0)return new Promise((V)=>setTimeout(V,q)).then(()=>E.apply(void 0,G));else return E.apply(void 0,G)})}}},K1=K1D;var V1D=(D,F)=>{let{isRetriable:$}=F;return function(J){let{timeout:Y}=J,Q=Date.now()+Y;return function(...E){while(!0)try{return D.apply(void 0,E)}catch(G){if(!$(G))throw G;if(Date.now()>=Q)throw G;continue}}}},V1=V1D;import IR from"process";var Q3={isChangeErrorOk:(D)=>{if(!Q3.isNodeError(D))return!1;let{code:F}=D;if(F==="ENOSYS")return!0;if(!RR&&(F==="EINVAL"||F==="EPERM"))return!0;return!1},isNodeError:(D)=>{return D instanceof Error},isRetriableError:(D)=>{if(!Q3.isNodeError(D))return!1;let{code:F}=D;if(F==="EMFILE"||F==="ENFILE"||F==="EAGAIN"||F==="EBUSY"||F==="EACCESS"||F==="EACCES"||F==="EACCS"||F==="EPERM")return!0;return!1},onChangeError:(D)=>{if(!Q3.isNodeError(D))throw D;if(Q3.isChangeErrorOk(D))return;throw D}},pY=Q3;var X3={onError:pY.onChangeError},$0={onError:()=>{return}},RR=IR.getuid?!IR.getuid():!1,hD={isRetriable:pY.isRetriableError};var A1D={attempt:{chmod:z1(mD(BD.chmod),X3),chown:z1(mD(BD.chown),X3),close:z1(mD(BD.close),$0),fsync:z1(mD(BD.fsync),$0),mkdir:z1(mD(BD.mkdir),$0),realpath:z1(mD(BD.realpath),$0),stat:z1(mD(BD.stat),$0),unlink:z1(mD(BD.unlink),$0),chmodSync:u0(BD.chmodSync,X3),chownSync:u0(BD.chownSync,X3),closeSync:u0(BD.closeSync,$0),existsSync:u0(BD.existsSync,$0),fsyncSync:u0(BD.fsync,$0),mkdirSync:u0(BD.mkdirSync,$0),realpathSync:u0(BD.realpathSync,$0),statSync:u0(BD.statSync,$0),unlinkSync:u0(BD.unlinkSync,$0)},retry:{close:K1(mD(BD.close),hD),fsync:K1(mD(BD.fsync),hD),open:K1(mD(BD.open),hD),readFile:K1(mD(BD.readFile),hD),rename:K1(mD(BD.rename),hD),stat:K1(mD(BD.stat),hD),write:K1(mD(BD.write),hD),writeFile:K1(mD(BD.writeFile),hD),closeSync:V1(BD.closeSync,hD),fsyncSync:V1(BD.fsyncSync,hD),openSync:V1(BD.openSync,hD),readFileSync:V1(BD.readFileSync,hD),renameSync:V1(BD.renameSync,hD),statSync:V1(BD.statSync,hD),writeSync:V1(BD.writeSync,hD),writeFileSync:V1(BD.writeFileSync,hD)}},SD=A1D;import B6 from"process";var OR="utf8",cY=438,TR=511;var PR={},wR=B6.geteuid?B6.geteuid():-1,jR=B6.getegid?B6.getegid():-1;var SR=1000,kR=!!B6.getuid,cVD=B6.getuid?!B6.getuid():!1,nY=128;var vR=(D)=>{return D instanceof Error&&"code"in D};var iY=(D)=>{return typeof D==="string"},d9=(D)=>{return D===void 0};import M1D from"path";import I4 from"process";import yR from"process";var xR=yR.platform==="linux",p9=yR.platform==="win32";var aY=["SIGHUP","SIGINT","SIGTERM"];if(!p9)aY.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(xR)aY.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var fR=aY;class _R{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(D)=>{if(this.exited)return;this.exited=!0;for(let F of this.callbacks)F();if(D)if(p9&&(D!=="SIGINT"&&D!=="SIGTERM"&&D!=="SIGKILL"))I4.kill(I4.pid,"SIGTERM");else I4.kill(I4.pid,D)},this.hook=()=>{I4.once("exit",()=>this.exit());for(let D of fR)try{I4.once(D,()=>this.exit(D))}catch{}},this.register=(D)=>{return this.callbacks.add(D),()=>{this.callbacks.delete(D)}},this.hook()}}var hR=new _R;var U1D=hR.register,gR=U1D;var K0={store:{},create:(D)=>{let F=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),$=Date.now().toString().slice(-10),B="tmp-",J=`.tmp-${$}${F}`;return`${D}${J}`},get:(D,F,$=!0)=>{let B=K0.truncate(F(D));if(B in K0.store)return K0.get(D,F,$);return K0.store[B]=$,[B,()=>delete K0.store[B]]},purge:(D)=>{if(!K0.store[D])return;delete K0.store[D],SD.attempt.unlink(D)},purgeSync:(D)=>{if(!K0.store[D])return;delete K0.store[D],SD.attempt.unlinkSync(D)},purgeSyncAll:()=>{for(let D in K0.store)K0.purgeSync(D)},truncate:(D)=>{let F=M1D.basename(D);if(F.length<=nY)return D;let $=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(F);if(!$)return D;let B=F.length-nY;return`${D.slice(0,-F.length)}${$[1]}${$[2].slice(0,-B)}${$[3]}`}};gR(K0.purgeSyncAll);var E3=K0;function oY(D,F,$=PR){if(iY($))return oY(D,F,{encoding:$});let J={timeout:$.timeout??SR},Y=null,Q=null,X=null;try{let E=SD.attempt.realpathSync(D),G=!!E;D=E||D,[Q,Y]=E3.get(D,$.tmpCreate||E3.create,$.tmpPurge!==!1);let H=kR&&d9($.chown),q=d9($.mode);if(G&&(H||q)){let K=SD.attempt.statSync(D);if(K){if($={...$},H)$.chown={uid:K.uid,gid:K.gid};if(q)$.mode=K.mode}}if(!G){let K=N1D.dirname(D);SD.attempt.mkdirSync(K,{mode:TR,recursive:!0})}if(X=SD.retry.openSync(J)(Q,"w",$.mode||cY),$.tmpCreated)$.tmpCreated(Q);if(iY(F))SD.retry.writeSync(J)(X,F,0,$.encoding||OR);else if(!d9(F))SD.retry.writeSync(J)(X,F,0,F.length,0);if($.fsync!==!1)if($.fsyncWait!==!1)SD.retry.fsyncSync(J)(X);else SD.attempt.fsync(X);if(SD.retry.closeSync(J)(X),X=null,$.chown&&($.chown.uid!==wR||$.chown.gid!==jR))SD.attempt.chownSync(Q,$.chown.uid,$.chown.gid);if($.mode&&$.mode!==cY)SD.attempt.chmodSync(Q,$.mode);try{SD.retry.renameSync(J)(Q,D)}catch(K){if(!vR(K))throw K;if(K.code!=="ENAMETOOLONG")throw K;SD.retry.renameSync(J)(Q,E3.truncate(D))}Y(),Q=null}finally{if(X)SD.attempt.closeSync(X);if(Q)E3.purge(Q)}}var oS=h(Sw(),1),sS=h(tw(),1);var $BD=(D,F={})=>{if(typeof D!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof D}\``);let{wait:$=0,maxWait:B=Number.POSITIVE_INFINITY,before:J=!1,after:Y=!0}=F;if($<0||B<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!J&&!Y)throw Error("Both `before` and `after` are false, function wouldn't be called.");let Q,X,E,G=function(...H){let q=this,K=()=>{if(Q=void 0,X)clearTimeout(X),X=void 0;if(Y)E=D.apply(q,H)},V=()=>{if(X=void 0,Q)clearTimeout(Q),Q=void 0;if(Y)E=D.apply(q,H)},A=J&&!Q;if(clearTimeout(Q),Q=setTimeout(K,$),B>0&&B!==Number.POSITIVE_INFINITY&&!X)X=setTimeout(V,B);if(A)E=D.apply(q,H);return E};return $3(G,D),G.cancel=()=>{if(Q)clearTimeout(Q),Q=void 0;if(X)clearTimeout(X),X=void 0},G},HX=$BD;var z6=h(lS(),1);var oYD=Object.prototype.toString;function pS(D,F,$){if(!D)return!1;if(D.constructor===F)return!0;return oYD.call(D)===$}function cS(D){return pS(D,Uint8Array,"[object Uint8Array]")}function sYD(D){return pS(D,ArrayBuffer,"[object ArrayBuffer]")}function rYD(D){return cS(D)||sYD(D)}function tYD(D){if(!cS(D))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof D}\``)}function eYD(D){if(!rYD(D))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof D}\``)}function TX(D,F){if(D.length===0)return new Uint8Array(0);F??=D.reduce((J,Y)=>J+Y.length,0);let $=new Uint8Array(F),B=0;for(let J of D)tYD(J),$.set(J,B),B+=J.length;return $}var dS={utf8:new globalThis.TextDecoder("utf8")};function PX(D,F="utf8"){return eYD(D),dS[F]??=new globalThis.TextDecoder(F),dS[F].decode(D)}function DQD(D){if(typeof D!=="string")throw TypeError(`Expected \`string\`, got \`${typeof D}\``)}var FQD=new globalThis.TextEncoder;function l7(D){return DQD(D),FQD.encode(D)}var kND=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"));var JQD=sS.default.default,aS="aes-256-cbc",b4=()=>Object.create(null),YQD=(D)=>D!==void 0&&D!==null,QQD=(D,F)=>{let $=new Set(["undefined","symbol","function"]),B=typeof F;if($.has(B))throw TypeError(`Setting a value of type \`${B}\` for key \`${D}\` is not allowed as it's not supported by JSON`)},d7="__internal__",wX=`${d7}.migrations.version`;class p7{path;events;#$;#F;#D;#J={};constructor(D={}){let F={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...D};if(!F.cwd){if(!F.projectName)throw Error("Please specify the `projectName` option.");F.cwd=dY(F.projectName,{suffix:F.projectSuffix}).config}if(this.#D=F,F.schema??F.ajvOptions??F.rootSchema){if(F.schema&&typeof F.schema!=="object")throw TypeError("The `schema` option must be an object.");let Y=new oS.Ajv2020({allErrors:!0,useDefaults:!0,...F.ajvOptions});JQD(Y);let Q={...F.rootSchema,type:"object",properties:F.schema};this.#$=Y.compile(Q);for(let[X,E]of Object.entries(F.schema??{}))if(E?.default)this.#J[X]=E.default}if(F.defaults)this.#J={...this.#J,...F.defaults};if(F.serialize)this._serialize=F.serialize;if(F.deserialize)this._deserialize=F.deserialize;this.events=new EventTarget,this.#F=F.encryptionKey;let $=F.fileExtension?`.${F.fileExtension}`:"";this.path=iS.resolve(F.cwd,`${F.configName??"config"}${$}`);let B=this.store,J=Object.assign(b4(),F.defaults,B);if(F.migrations){if(!F.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(F.migrations,F.projectVersion,F.beforeEachMigration)}this._validate(J);try{BQD.deepEqual(B,J)}catch{this.store=J}if(F.watch)this._watch()}get(D,F){if(this.#D.accessPropertiesByDotNotation)return this._get(D,F);let{store:$}=this;return D in $?$[D]:F}set(D,F){if(typeof D!=="string"&&typeof D!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof D}`);if(typeof D!=="object"&&F===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(D))throw TypeError(`Please don't use the ${d7} key, as it's used to manage this module internal operations.`);let{store:$}=this,B=(J,Y)=>{if(QQD(J,Y),this.#D.accessPropertiesByDotNotation)bY($,J,Y);else $[J]=Y};if(typeof D==="object"){let J=D;for(let[Y,Q]of Object.entries(J))B(Y,Q)}else B(D,F);this.store=$}has(D){if(this.#D.accessPropertiesByDotNotation)return ZR(this.store,D);return D in this.store}reset(...D){for(let F of D)if(YQD(this.#J[F]))this.set(F,this.#J[F])}delete(D){let{store:F}=this;if(this.#D.accessPropertiesByDotNotation)NR(F,D);else delete F[D];this.store=F}clear(){this.store=b4();for(let D of Object.keys(this.#J))this.reset(D)}onDidChange(D,F){if(typeof D!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof D}`);if(typeof F!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof F}`);return this._handleChange(()=>this.get(D),F)}onDidAnyChange(D){if(typeof D!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof D}`);return this._handleChange(()=>this.store,D)}get size(){return Object.keys(this.store).length}get store(){try{let D=q6.readFileSync(this.path,this.#F?null:"utf8"),F=this._encryptData(D),$=this._deserialize(F);return this._validate($),Object.assign(b4(),$)}catch(D){if(D?.code==="ENOENT")return this._ensureDirectory(),b4();if(this.#D.clearInvalidConfig&&D.name==="SyntaxError")return b4();throw D}}set store(D){this._ensureDirectory(),this._validate(D),this._write(D),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[D,F]of Object.entries(this.store))yield[D,F]}_encryptData(D){if(!this.#F)return typeof D==="string"?D:PX(D);try{let F=D.slice(0,16),$=m3.pbkdf2Sync(this.#F,F.toString(),1e4,32,"sha512"),B=m3.createDecipheriv(aS,$,F),J=D.slice(17),Y=typeof J==="string"?l7(J):J;return PX(TX([B.update(Y),B.final()]))}catch{}return D.toString()}_handleChange(D,F){let $=D(),B=()=>{let J=$,Y=D();if($QD(Y,J))return;$=Y,F.call(this,Y,J)};return this.events.addEventListener("change",B),()=>{this.events.removeEventListener("change",B)}}_deserialize=(D)=>JSON.parse(D);_serialize=(D)=>JSON.stringify(D,void 0,"\t");_validate(D){if(!this.#$)return;if(this.#$(D)||!this.#$.errors)return;let $=this.#$.errors.map(({instancePath:B,message:J=""})=>`\`${B.slice(1)}\` ${J}`);throw Error("Config schema violation: "+$.join("; "))}_ensureDirectory(){q6.mkdirSync(iS.dirname(this.path),{recursive:!0})}_write(D){let F=this._serialize(D);if(this.#F){let $=m3.randomBytes(16),B=m3.pbkdf2Sync(this.#F,$.toString(),1e4,32,"sha512"),J=m3.createCipheriv(aS,B,$);F=TX([$,l7(":"),J.update(l7(F)),J.final()])}if(nS.env.SNAP)q6.writeFileSync(this.path,F,{mode:this.#D.configFileMode});else try{oY(this.path,F,{mode:this.#D.configFileMode})}catch($){if($?.code==="EXDEV"){q6.writeFileSync(this.path,F,{mode:this.#D.configFileMode});return}throw $}}_watch(){if(this._ensureDirectory(),!q6.existsSync(this.path))this._write(b4());if(nS.platform==="win32")q6.watch(this.path,{persistent:!1},HX(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else q6.watchFile(this.path,{persistent:!1},HX(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(D,F,$){let B=this._get(wX,"0.0.0"),J=Object.keys(D).filter((Q)=>this._shouldPerformMigration(Q,B,F)),Y={...this.store};for(let Q of J)try{if($)$(this,{fromVersion:B,toVersion:Q,finalVersion:F,versions:J});let X=D[Q];X?.(this),this._set(wX,Q),B=Q,Y={...this.store}}catch(X){throw this.store=Y,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${X}`)}if(this._isVersionInRangeFormat(B)||!z6.default.eq(B,F))this._set(wX,F)}_containsReservedKey(D){if(typeof D==="object"){if(Object.keys(D)[0]===d7)return!0}if(typeof D!=="string")return!1;if(this.#D.accessPropertiesByDotNotation){if(D.startsWith(`${d7}.`))return!0;return!1}return!1}_isVersionInRangeFormat(D){return z6.default.clean(D)===null}_shouldPerformMigration(D,F,$){if(this._isVersionInRangeFormat(D)){if(F!=="0.0.0"&&z6.default.satisfies(F,D))return!1;return z6.default.satisfies($,D)}if(z6.default.lte(D,F))return!1;if(z6.default.gt(D,$))return!1;return!0}_get(D,F){return MR(this.store,D,F)}_set(D,F){let{store:$}=this;bY($,D,F),this.store=$}}var p1={};rk(p1,{void:()=>pQD,util:()=>r,unknown:()=>lQD,union:()=>aQD,undefined:()=>uQD,tuple:()=>rQD,transformer:()=>XXD,symbol:()=>gQD,string:()=>Yk,strictObject:()=>iQD,setErrorMap:()=>GQD,set:()=>DXD,record:()=>tQD,quotelessJson:()=>XQD,promise:()=>QXD,preprocess:()=>HXD,pipeline:()=>WXD,ostring:()=>qXD,optional:()=>EXD,onumber:()=>zXD,oboolean:()=>KXD,objectUtil:()=>jX,object:()=>nQD,number:()=>Qk,nullable:()=>GXD,null:()=>bQD,never:()=>dQD,nativeEnum:()=>YXD,nan:()=>fQD,map:()=>eQD,makeIssue:()=>l3,literal:()=>BXD,lazy:()=>$XD,late:()=>yQD,isValid:()=>v8,isDirty:()=>n7,isAsync:()=>l4,isAborted:()=>c7,intersection:()=>sQD,instanceof:()=>xQD,getParsedType:()=>Z1,getErrorMap:()=>m4,function:()=>FXD,enum:()=>JXD,effect:()=>XXD,discriminatedUnion:()=>oQD,defaultErrorMap:()=>m1,datetimeRegex:()=>$k,date:()=>hQD,custom:()=>Jk,coerce:()=>VXD,boolean:()=>Xk,bigint:()=>_QD,array:()=>cQD,any:()=>mQD,addIssueToContext:()=>I,ZodVoid:()=>p3,ZodUnknown:()=>y8,ZodUnion:()=>a4,ZodUndefined:()=>n4,ZodType:()=>i,ZodTuple:()=>L1,ZodTransformer:()=>r0,ZodSymbol:()=>d3,ZodString:()=>i0,ZodSet:()=>U6,ZodSchema:()=>i,ZodRecord:()=>c3,ZodReadonly:()=>FF,ZodPromise:()=>M6,ZodPipeline:()=>a3,ZodParsedType:()=>L,ZodOptional:()=>o0,ZodObject:()=>LD,ZodNumber:()=>x8,ZodNullable:()=>d1,ZodNull:()=>i4,ZodNever:()=>C1,ZodNativeEnum:()=>t4,ZodNaN:()=>i3,ZodMap:()=>n3,ZodLiteral:()=>r4,ZodLazy:()=>s4,ZodIssueCode:()=>C,ZodIntersection:()=>o4,ZodFunction:()=>p4,ZodFirstPartyTypeKind:()=>_,ZodError:()=>E0,ZodEnum:()=>_8,ZodEffects:()=>r0,ZodDiscriminatedUnion:()=>i7,ZodDefault:()=>e4,ZodDate:()=>V6,ZodCatch:()=>DF,ZodBranded:()=>a7,ZodBoolean:()=>c4,ZodBigInt:()=>f8,ZodArray:()=>a0,ZodAny:()=>A6,Schema:()=>i,ParseStatus:()=>uD,OK:()=>cD,NEVER:()=>AXD,INVALID:()=>f,EMPTY_PATH:()=>HQD,DIRTY:()=>K6,BRAND:()=>vQD});var r;(function(D){D.assertEqual=(J)=>{};function F(J){}D.assertIs=F;function $(J){throw Error()}D.assertNever=$,D.arrayToEnum=(J)=>{let Y={};for(let Q of J)Y[Q]=Q;return Y},D.getValidEnumValues=(J)=>{let Y=D.objectKeys(J).filter((X)=>typeof J[J[X]]!=="number"),Q={};for(let X of Y)Q[X]=J[X];return D.objectValues(Q)},D.objectValues=(J)=>{return D.objectKeys(J).map(function(Y){return J[Y]})},D.objectKeys=typeof Object.keys==="function"?(J)=>Object.keys(J):(J)=>{let Y=[];for(let Q in J)if(Object.prototype.hasOwnProperty.call(J,Q))Y.push(Q);return Y},D.find=(J,Y)=>{for(let Q of J)if(Y(Q))return Q;return},D.isInteger=typeof Number.isInteger==="function"?(J)=>Number.isInteger(J):(J)=>typeof J==="number"&&Number.isFinite(J)&&Math.floor(J)===J;function B(J,Y=" | "){return J.map((Q)=>typeof Q==="string"?`'${Q}'`:Q).join(Y)}D.joinValues=B,D.jsonStringifyReplacer=(J,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(r||(r={}));var jX;(function(D){D.mergeShapes=(F,$)=>{return{...F,...$}}})(jX||(jX={}));var L=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z1=(D)=>{switch(typeof D){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(D)?L.nan:L.number;case"boolean":return L.boolean;case"function":return L.function;case"bigint":return L.bigint;case"symbol":return L.symbol;case"object":if(Array.isArray(D))return L.array;if(D===null)return L.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return L.promise;if(typeof Map<"u"&&D instanceof Map)return L.map;if(typeof Set<"u"&&D instanceof Set)return L.set;if(typeof Date<"u"&&D instanceof Date)return L.date;return L.object;default:return L.unknown}};var C=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),XQD=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")};class E0 extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=($)=>{this.issues=[...this.issues,$]},this.addIssues=($=[])=>{this.issues=[...this.issues,...$]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function(J){return J.message},$={_errors:[]},B=(J)=>{for(let Y of J.issues)if(Y.code==="invalid_union")Y.unionErrors.map(B);else if(Y.code==="invalid_return_type")B(Y.returnTypeError);else if(Y.code==="invalid_arguments")B(Y.argumentsError);else if(Y.path.length===0)$._errors.push(F(Y));else{let Q=$,X=0;while(X<Y.path.length){let E=Y.path[X];if(X!==Y.path.length-1)Q[E]=Q[E]||{_errors:[]};else Q[E]=Q[E]||{_errors:[]},Q[E]._errors.push(F(Y));Q=Q[E],X++}}};return B(this),$}static assert(D){if(!(D instanceof E0))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},$=[];for(let B of this.issues)if(B.path.length>0){let J=B.path[0];F[J]=F[J]||[],F[J].push(D(B))}else $.push(D(B));return{formErrors:$,fieldErrors:F}}get formErrors(){return this.flatten()}}E0.create=(D)=>{return new E0(D)};var EQD=(D,F)=>{let $;switch(D.code){case C.invalid_type:if(D.received===L.undefined)$="Required";else $=`Expected ${D.expected}, received ${D.received}`;break;case C.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(D.expected,r.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:$=`Unrecognized key(s) in object: ${r.joinValues(D.keys,", ")}`;break;case C.invalid_union:$="Invalid input";break;case C.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${r.joinValues(D.options)}`;break;case C.invalid_enum_value:$=`Invalid enum value. Expected ${r.joinValues(D.options)}, received '${D.received}'`;break;case C.invalid_arguments:$="Invalid function arguments";break;case C.invalid_return_type:$="Invalid function return type";break;case C.invalid_date:$="Invalid date";break;case C.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if($=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")$=`${$} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)$=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)$=`Invalid input: must end with "${D.validation.endsWith}"`;else r.assertNever(D.validation);else if(D.validation!=="regex")$=`Invalid ${D.validation}`;else $="Invalid";break;case C.too_small:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else $="Invalid input";break;case C.too_big:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")$=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else $="Invalid input";break;case C.custom:$="Invalid input";break;case C.invalid_intersection_types:$="Intersection results could not be merged";break;case C.not_multiple_of:$=`Number must be a multiple of ${D.multipleOf}`;break;case C.not_finite:$="Number must be finite";break;default:$=F.defaultError,r.assertNever(D)}return{message:$}},m1=EQD;var rS=m1;function GQD(D){rS=D}function m4(){return rS}var l3=(D)=>{let{data:F,path:$,errorMaps:B,issueData:J}=D,Y=[...$,...J.path||[]],Q={...J,path:Y};if(J.message!==void 0)return{...J,path:Y,message:J.message};let X="",E=B.filter((G)=>!!G).slice().reverse();for(let G of E)X=G(Q,{data:F,defaultError:X}).message;return{...J,path:Y,message:X}},HQD=[];function I(D,F){let $=m4(),B=l3({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,$,$===m1?void 0:m1].filter((J)=>!!J)});D.common.issues.push(B)}class uD{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let $=[];for(let B of F){if(B.status==="aborted")return f;if(B.status==="dirty")D.dirty();$.push(B.value)}return{status:D.value,value:$}}static async mergeObjectAsync(D,F){let $=[];for(let B of F){let J=await B.key,Y=await B.value;$.push({key:J,value:Y})}return uD.mergeObjectSync(D,$)}static mergeObjectSync(D,F){let $={};for(let B of F){let{key:J,value:Y}=B;if(J.status==="aborted")return f;if(Y.status==="aborted")return f;if(J.status==="dirty")D.dirty();if(Y.status==="dirty")D.dirty();if(J.value!=="__proto__"&&(typeof Y.value<"u"||B.alwaysSet))$[J.value]=Y.value}return{status:D.value,value:$}}}var f=Object.freeze({status:"aborted"}),K6=(D)=>({status:"dirty",value:D}),cD=(D)=>({status:"valid",value:D}),c7=(D)=>D.status==="aborted",n7=(D)=>D.status==="dirty",v8=(D)=>D.status==="valid",l4=(D)=>typeof Promise<"u"&&D instanceof Promise;var k;(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(k||(k={}));class s0{constructor(D,F,$,B){this._cachedPath=[],this.parent=D,this.data=F,this._path=$,this._key=B}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var tS=(D,F)=>{if(v8(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let $=new E0(D.common.issues);return this._error=$,this._error}}}};function p(D){if(!D)return{};let{errorMap:F,invalid_type_error:$,required_error:B,description:J}=D;if(F&&($||B))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:J};return{errorMap:(Q,X)=>{let{message:E}=D;if(Q.code==="invalid_enum_value")return{message:E??X.defaultError};if(typeof X.data>"u")return{message:E??B??X.defaultError};if(Q.code!=="invalid_type")return{message:X.defaultError};return{message:E??$??X.defaultError}},description:J}}class i{get description(){return this._def.description}_getType(D){return Z1(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:Z1(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new uD,ctx:{common:D.parent.common,data:D.data,parsedType:Z1(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(l4(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let $=this.safeParse(D,F);if($.success)return $.data;throw $.error}safeParse(D,F){let $={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:Z1(D)},B=this._parseSync({data:D,path:$.path,parent:$});return tS($,B)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:Z1(D)};if(!this["~standard"].async)try{let $=this._parseSync({data:D,path:[],parent:F});return v8($)?{value:$.value}:{issues:F.common.issues}}catch($){if($?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then(($)=>v8($)?{value:$.value}:{issues:F.common.issues})}async parseAsync(D,F){let $=await this.safeParseAsync(D,F);if($.success)return $.data;throw $.error}async safeParseAsync(D,F){let $={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:Z1(D)},B=this._parse({data:D,path:$.path,parent:$}),J=await(l4(B)?B:Promise.resolve(B));return tS($,J)}refine(D,F){let $=(B)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(B);else return F};return this._refinement((B,J)=>{let Y=D(B),Q=()=>J.addIssue({code:C.custom,...$(B)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((X)=>{if(!X)return Q(),!1;else return!0});if(!Y)return Q(),!1;else return!0})}refinement(D,F){return this._refinement(($,B)=>{if(!D($))return B.addIssue(typeof F==="function"?F($,B):F),!1;else return!0})}_refinement(D){return new r0({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return o0.create(this,this._def)}nullable(){return d1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return a0.create(this)}promise(){return M6.create(this,this._def)}or(D){return a4.create([this,D],this._def)}and(D){return o4.create(this,D,this._def)}transform(D){return new r0({...p(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new e4({...p(this._def),innerType:this,defaultValue:F,typeName:_.ZodDefault})}brand(){return new a7({typeName:_.ZodBranded,type:this,...p(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new DF({...p(this._def),innerType:this,catchValue:F,typeName:_.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return a3.create(this,D)}readonly(){return FF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var WQD=/^c[^\s-]{8,}$/i,qQD=/^[0-9a-z]+$/,zQD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KQD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,VQD=/^[a-z0-9_-]{21}$/i,AQD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UQD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MQD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,NQD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",SX,ZQD=/^(?:(?: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])$/,CQD=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,LQD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,RQD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,IQD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OQD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dk="((\\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])))",TQD=new RegExp(`^${Dk}$`);function Fk(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let $=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${$}`}function PQD(D){return new RegExp(`^${Fk(D)}$`)}function $k(D){let F=`${Dk}T${Fk(D)}`,$=[];if($.push(D.local?"Z?":"Z"),D.offset)$.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${$.join("|")})`,new RegExp(`^${F}$`)}function wQD(D,F){if((F==="v4"||!F)&&ZQD.test(D))return!0;if((F==="v6"||!F)&&LQD.test(D))return!0;return!1}function jQD(D,F){if(!AQD.test(D))return!1;try{let[$]=D.split(".");if(!$)return!1;let B=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),J=JSON.parse(atob(B));if(typeof J!=="object"||J===null)return!1;if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(F&&J.alg!==F)return!1;return!0}catch{return!1}}function SQD(D,F){if((F==="v4"||!F)&&CQD.test(D))return!0;if((F==="v6"||!F)&&RQD.test(D))return!0;return!1}class i0 extends i{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==L.string){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_type,expected:L.string,received:J.parsedType}),f}let $=new uD,B=void 0;for(let J of this._def.checks)if(J.kind==="min"){if(D.data.length<J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),$.dirty()}else if(J.kind==="max"){if(D.data.length>J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),$.dirty()}else if(J.kind==="length"){let Y=D.data.length>J.value,Q=D.data.length<J.value;if(Y||Q){if(B=this._getOrReturnCtx(D,B),Y)I(B,{code:C.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});else if(Q)I(B,{code:C.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});$.dirty()}}else if(J.kind==="email"){if(!MQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"email",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="emoji"){if(!SX)SX=new RegExp(NQD,"u");if(!SX.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"emoji",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="uuid"){if(!KQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"uuid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="nanoid"){if(!VQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"nanoid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="cuid"){if(!WQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"cuid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="cuid2"){if(!qQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"cuid2",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="ulid"){if(!zQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"ulid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="url")try{new URL(D.data)}catch{B=this._getOrReturnCtx(D,B),I(B,{validation:"url",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="regex"){if(J.regex.lastIndex=0,!J.regex.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"regex",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="trim")D.data=D.data.trim();else if(J.kind==="includes"){if(!D.data.includes(J.value,J.position))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:{includes:J.value,position:J.position},message:J.message}),$.dirty()}else if(J.kind==="toLowerCase")D.data=D.data.toLowerCase();else if(J.kind==="toUpperCase")D.data=D.data.toUpperCase();else if(J.kind==="startsWith"){if(!D.data.startsWith(J.value))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:{startsWith:J.value},message:J.message}),$.dirty()}else if(J.kind==="endsWith"){if(!D.data.endsWith(J.value))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:{endsWith:J.value},message:J.message}),$.dirty()}else if(J.kind==="datetime"){if(!$k(J).test(D.data))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:"datetime",message:J.message}),$.dirty()}else if(J.kind==="date"){if(!TQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:"date",message:J.message}),$.dirty()}else if(J.kind==="time"){if(!PQD(J).test(D.data))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:"time",message:J.message}),$.dirty()}else if(J.kind==="duration"){if(!UQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"duration",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="ip"){if(!wQD(D.data,J.version))B=this._getOrReturnCtx(D,B),I(B,{validation:"ip",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="jwt"){if(!jQD(D.data,J.alg))B=this._getOrReturnCtx(D,B),I(B,{validation:"jwt",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="cidr"){if(!SQD(D.data,J.version))B=this._getOrReturnCtx(D,B),I(B,{validation:"cidr",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="base64"){if(!IQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"base64",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="base64url"){if(!OQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"base64url",code:C.invalid_string,message:J.message}),$.dirty()}else r.assertNever(J);return{status:$.value,value:D.data}}_regex(D,F,$){return this.refinement((B)=>D.test(B),{validation:F,code:C.invalid_string,...k.errToObj($)})}_addCheck(D){return new i0({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...k.errToObj(D)})}url(D){return this._addCheck({kind:"url",...k.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...k.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...k.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...k.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...k.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...k.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...k.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...k.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...k.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...k.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...k.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...k.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...k.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...k.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...k.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...k.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...k.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...k.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...k.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...k.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...k.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...k.errToObj(F)})}nonempty(D){return this.min(1,k.errToObj(D))}trim(){return new i0({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i0({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i0({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}i0.create=(D)=>{return new i0({checks:[],typeName:_.ZodString,coerce:D?.coerce??!1,...p(D)})};function kQD(D,F){let $=(D.toString().split(".")[1]||"").length,B=(F.toString().split(".")[1]||"").length,J=$>B?$:B,Y=Number.parseInt(D.toFixed(J).replace(".","")),Q=Number.parseInt(F.toFixed(J).replace(".",""));return Y%Q/10**J}class x8 extends i{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==L.number){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_type,expected:L.number,received:J.parsedType}),f}let $=void 0,B=new uD;for(let J of this._def.checks)if(J.kind==="int"){if(!r.isInteger(D.data))$=this._getOrReturnCtx(D,$),I($,{code:C.invalid_type,expected:"integer",received:"float",message:J.message}),B.dirty()}else if(J.kind==="min"){if(J.inclusive?D.data<J.value:D.data<=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_small,minimum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),B.dirty()}else if(J.kind==="max"){if(J.inclusive?D.data>J.value:D.data>=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_big,maximum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),B.dirty()}else if(J.kind==="multipleOf"){if(kQD(D.data,J.value)!==0)$=this._getOrReturnCtx(D,$),I($,{code:C.not_multiple_of,multipleOf:J.value,message:J.message}),B.dirty()}else if(J.kind==="finite"){if(!Number.isFinite(D.data))$=this._getOrReturnCtx(D,$),I($,{code:C.not_finite,message:J.message}),B.dirty()}else r.assertNever(J);return{status:B.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,k.toString(F))}gt(D,F){return this.setLimit("min",D,!1,k.toString(F))}lte(D,F){return this.setLimit("max",D,!0,k.toString(F))}lt(D,F){return this.setLimit("max",D,!1,k.toString(F))}setLimit(D,F,$,B){return new x8({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:k.toString(B)}]})}_addCheck(D){return new x8({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:k.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:k.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:k.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&r.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let $ of this._def.checks)if($.kind==="finite"||$.kind==="int"||$.kind==="multipleOf")return!0;else if($.kind==="min"){if(F===null||$.value>F)F=$.value}else if($.kind==="max"){if(D===null||$.value<D)D=$.value}return Number.isFinite(F)&&Number.isFinite(D)}}x8.create=(D)=>{return new x8({checks:[],typeName:_.ZodNumber,coerce:D?.coerce||!1,...p(D)})};class f8 extends i{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==L.bigint)return this._getInvalidInput(D);let $=void 0,B=new uD;for(let J of this._def.checks)if(J.kind==="min"){if(J.inclusive?D.data<J.value:D.data<=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_small,type:"bigint",minimum:J.value,inclusive:J.inclusive,message:J.message}),B.dirty()}else if(J.kind==="max"){if(J.inclusive?D.data>J.value:D.data>=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_big,type:"bigint",maximum:J.value,inclusive:J.inclusive,message:J.message}),B.dirty()}else if(J.kind==="multipleOf"){if(D.data%J.value!==BigInt(0))$=this._getOrReturnCtx(D,$),I($,{code:C.not_multiple_of,multipleOf:J.value,message:J.message}),B.dirty()}else r.assertNever(J);return{status:B.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return I(F,{code:C.invalid_type,expected:L.bigint,received:F.parsedType}),f}gte(D,F){return this.setLimit("min",D,!0,k.toString(F))}gt(D,F){return this.setLimit("min",D,!1,k.toString(F))}lte(D,F){return this.setLimit("max",D,!0,k.toString(F))}lt(D,F){return this.setLimit("max",D,!1,k.toString(F))}setLimit(D,F,$,B){return new f8({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:k.toString(B)}]})}_addCheck(D){return new f8({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:k.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}f8.create=(D)=>{return new f8({checks:[],typeName:_.ZodBigInt,coerce:D?.coerce??!1,...p(D)})};class c4 extends i{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==L.boolean){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.boolean,received:$.parsedType}),f}return cD(D.data)}}c4.create=(D)=>{return new c4({typeName:_.ZodBoolean,coerce:D?.coerce||!1,...p(D)})};class V6 extends i{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==L.date){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_type,expected:L.date,received:J.parsedType}),f}if(Number.isNaN(D.data.getTime())){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_date}),f}let $=new uD,B=void 0;for(let J of this._def.checks)if(J.kind==="min"){if(D.data.getTime()<J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_small,message:J.message,inclusive:!0,exact:!1,minimum:J.value,type:"date"}),$.dirty()}else if(J.kind==="max"){if(D.data.getTime()>J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_big,message:J.message,inclusive:!0,exact:!1,maximum:J.value,type:"date"}),$.dirty()}else r.assertNever(J);return{status:$.value,value:new Date(D.data.getTime())}}_addCheck(D){return new V6({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:k.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:k.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}}V6.create=(D)=>{return new V6({checks:[],coerce:D?.coerce||!1,typeName:_.ZodDate,...p(D)})};class d3 extends i{_parse(D){if(this._getType(D)!==L.symbol){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.symbol,received:$.parsedType}),f}return cD(D.data)}}d3.create=(D)=>{return new d3({typeName:_.ZodSymbol,...p(D)})};class n4 extends i{_parse(D){if(this._getType(D)!==L.undefined){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.undefined,received:$.parsedType}),f}return cD(D.data)}}n4.create=(D)=>{return new n4({typeName:_.ZodUndefined,...p(D)})};class i4 extends i{_parse(D){if(this._getType(D)!==L.null){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.null,received:$.parsedType}),f}return cD(D.data)}}i4.create=(D)=>{return new i4({typeName:_.ZodNull,...p(D)})};class A6 extends i{constructor(){super(...arguments);this._any=!0}_parse(D){return cD(D.data)}}A6.create=(D)=>{return new A6({typeName:_.ZodAny,...p(D)})};class y8 extends i{constructor(){super(...arguments);this._unknown=!0}_parse(D){return cD(D.data)}}y8.create=(D)=>{return new y8({typeName:_.ZodUnknown,...p(D)})};class C1 extends i{_parse(D){let F=this._getOrReturnCtx(D);return I(F,{code:C.invalid_type,expected:L.never,received:F.parsedType}),f}}C1.create=(D)=>{return new C1({typeName:_.ZodNever,...p(D)})};class p3 extends i{_parse(D){if(this._getType(D)!==L.undefined){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.void,received:$.parsedType}),f}return cD(D.data)}}p3.create=(D)=>{return new p3({typeName:_.ZodVoid,...p(D)})};class a0 extends i{_parse(D){let{ctx:F,status:$}=this._processInputParams(D),B=this._def;if(F.parsedType!==L.array)return I(F,{code:C.invalid_type,expected:L.array,received:F.parsedType}),f;if(B.exactLength!==null){let Y=F.data.length>B.exactLength.value,Q=F.data.length<B.exactLength.value;if(Y||Q)I(F,{code:Y?C.too_big:C.too_small,minimum:Q?B.exactLength.value:void 0,maximum:Y?B.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:B.exactLength.message}),$.dirty()}if(B.minLength!==null){if(F.data.length<B.minLength.value)I(F,{code:C.too_small,minimum:B.minLength.value,type:"array",inclusive:!0,exact:!1,message:B.minLength.message}),$.dirty()}if(B.maxLength!==null){if(F.data.length>B.maxLength.value)I(F,{code:C.too_big,maximum:B.maxLength.value,type:"array",inclusive:!0,exact:!1,message:B.maxLength.message}),$.dirty()}if(F.common.async)return Promise.all([...F.data].map((Y,Q)=>{return B.type._parseAsync(new s0(F,Y,F.path,Q))})).then((Y)=>{return uD.mergeArray($,Y)});let J=[...F.data].map((Y,Q)=>{return B.type._parseSync(new s0(F,Y,F.path,Q))});return uD.mergeArray($,J)}get element(){return this._def.type}min(D,F){return new a0({...this._def,minLength:{value:D,message:k.toString(F)}})}max(D,F){return new a0({...this._def,maxLength:{value:D,message:k.toString(F)}})}length(D,F){return new a0({...this._def,exactLength:{value:D,message:k.toString(F)}})}nonempty(D){return this.min(1,D)}}a0.create=(D,F)=>{return new a0({type:D,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...p(F)})};function d4(D){if(D instanceof LD){let F={};for(let $ in D.shape){let B=D.shape[$];F[$]=o0.create(d4(B))}return new LD({...D._def,shape:()=>F})}else if(D instanceof a0)return new a0({...D._def,type:d4(D.element)});else if(D instanceof o0)return o0.create(d4(D.unwrap()));else if(D instanceof d1)return d1.create(d4(D.unwrap()));else if(D instanceof L1)return L1.create(D.items.map((F)=>d4(F)));else return D}class LD extends i{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=r.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==L.object){let E=this._getOrReturnCtx(D);return I(E,{code:C.invalid_type,expected:L.object,received:E.parsedType}),f}let{status:$,ctx:B}=this._processInputParams(D),{shape:J,keys:Y}=this._getCached(),Q=[];if(!(this._def.catchall instanceof C1&&this._def.unknownKeys==="strip")){for(let E in B.data)if(!Y.includes(E))Q.push(E)}let X=[];for(let E of Y){let G=J[E],H=B.data[E];X.push({key:{status:"valid",value:E},value:G._parse(new s0(B,H,B.path,E)),alwaysSet:E in B.data})}if(this._def.catchall instanceof C1){let E=this._def.unknownKeys;if(E==="passthrough")for(let G of Q)X.push({key:{status:"valid",value:G},value:{status:"valid",value:B.data[G]}});else if(E==="strict"){if(Q.length>0)I(B,{code:C.unrecognized_keys,keys:Q}),$.dirty()}else if(E==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let G of Q){let H=B.data[G];X.push({key:{status:"valid",value:G},value:E._parse(new s0(B,H,B.path,G)),alwaysSet:G in B.data})}}if(B.common.async)return Promise.resolve().then(async()=>{let E=[];for(let G of X){let H=await G.key,q=await G.value;E.push({key:H,value:q,alwaysSet:G.alwaysSet})}return E}).then((E)=>{return uD.mergeObjectSync($,E)});else return uD.mergeObjectSync($,X)}get shape(){return this._def.shape()}strict(D){return k.errToObj,new LD({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,$)=>{let B=this._def.errorMap?.(F,$).message??$.defaultError;if(F.code==="unrecognized_keys")return{message:k.errToObj(D).message??B};return{message:B}}}:{}})}strip(){return new LD({...this._def,unknownKeys:"strip"})}passthrough(){return new LD({...this._def,unknownKeys:"passthrough"})}extend(D){return new LD({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new LD({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:_.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new LD({...this._def,catchall:D})}pick(D){let F={};for(let $ of r.objectKeys(D))if(D[$]&&this.shape[$])F[$]=this.shape[$];return new LD({...this._def,shape:()=>F})}omit(D){let F={};for(let $ of r.objectKeys(this.shape))if(!D[$])F[$]=this.shape[$];return new LD({...this._def,shape:()=>F})}deepPartial(){return d4(this)}partial(D){let F={};for(let $ of r.objectKeys(this.shape)){let B=this.shape[$];if(D&&!D[$])F[$]=B;else F[$]=B.optional()}return new LD({...this._def,shape:()=>F})}required(D){let F={};for(let $ of r.objectKeys(this.shape))if(D&&!D[$])F[$]=this.shape[$];else{let J=this.shape[$];while(J instanceof o0)J=J._def.innerType;F[$]=J}return new LD({...this._def,shape:()=>F})}keyof(){return Bk(r.objectKeys(this.shape))}}LD.create=(D,F)=>{return new LD({shape:()=>D,unknownKeys:"strip",catchall:C1.create(),typeName:_.ZodObject,...p(F)})};LD.strictCreate=(D,F)=>{return new LD({shape:()=>D,unknownKeys:"strict",catchall:C1.create(),typeName:_.ZodObject,...p(F)})};LD.lazycreate=(D,F)=>{return new LD({shape:D,unknownKeys:"strip",catchall:C1.create(),typeName:_.ZodObject,...p(F)})};class a4 extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$=this._def.options;function B(J){for(let Q of J)if(Q.result.status==="valid")return Q.result;for(let Q of J)if(Q.result.status==="dirty")return F.common.issues.push(...Q.ctx.common.issues),Q.result;let Y=J.map((Q)=>new E0(Q.ctx.common.issues));return I(F,{code:C.invalid_union,unionErrors:Y}),f}if(F.common.async)return Promise.all($.map(async(J)=>{let Y={...F,common:{...F.common,issues:[]},parent:null};return{result:await J._parseAsync({data:F.data,path:F.path,parent:Y}),ctx:Y}})).then(B);else{let J=void 0,Y=[];for(let X of $){let E={...F,common:{...F.common,issues:[]},parent:null},G=X._parseSync({data:F.data,path:F.path,parent:E});if(G.status==="valid")return G;else if(G.status==="dirty"&&!J)J={result:G,ctx:E};if(E.common.issues.length)Y.push(E.common.issues)}if(J)return F.common.issues.push(...J.ctx.common.issues),J.result;let Q=Y.map((X)=>new E0(X));return I(F,{code:C.invalid_union,unionErrors:Q}),f}}get options(){return this._def.options}}a4.create=(D,F)=>{return new a4({options:D,typeName:_.ZodUnion,...p(F)})};var l1=(D)=>{if(D instanceof s4)return l1(D.schema);else if(D instanceof r0)return l1(D.innerType());else if(D instanceof r4)return[D.value];else if(D instanceof _8)return D.options;else if(D instanceof t4)return r.objectValues(D.enum);else if(D instanceof e4)return l1(D._def.innerType);else if(D instanceof n4)return[void 0];else if(D instanceof i4)return[null];else if(D instanceof o0)return[void 0,...l1(D.unwrap())];else if(D instanceof d1)return[null,...l1(D.unwrap())];else if(D instanceof a7)return l1(D.unwrap());else if(D instanceof FF)return l1(D.unwrap());else if(D instanceof DF)return l1(D._def.innerType);else return[]};class i7 extends i{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==L.object)return I(F,{code:C.invalid_type,expected:L.object,received:F.parsedType}),f;let $=this.discriminator,B=F.data[$],J=this.optionsMap.get(B);if(!J)return I(F,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[$]}),f;if(F.common.async)return J._parseAsync({data:F.data,path:F.path,parent:F});else return J._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,$){let B=new Map;for(let J of F){let Y=l1(J.shape[D]);if(!Y.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let Q of Y){if(B.has(Q))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(Q)}`);B.set(Q,J)}}return new i7({typeName:_.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:B,...p($)})}}function kX(D,F){let $=Z1(D),B=Z1(F);if(D===F)return{valid:!0,data:D};else if($===L.object&&B===L.object){let J=r.objectKeys(F),Y=r.objectKeys(D).filter((X)=>J.indexOf(X)!==-1),Q={...D,...F};for(let X of Y){let E=kX(D[X],F[X]);if(!E.valid)return{valid:!1};Q[X]=E.data}return{valid:!0,data:Q}}else if($===L.array&&B===L.array){if(D.length!==F.length)return{valid:!1};let J=[];for(let Y=0;Y<D.length;Y++){let Q=D[Y],X=F[Y],E=kX(Q,X);if(!E.valid)return{valid:!1};J.push(E.data)}return{valid:!0,data:J}}else if($===L.date&&B===L.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class o4 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D),B=(J,Y)=>{if(c7(J)||c7(Y))return f;let Q=kX(J.value,Y.value);if(!Q.valid)return I($,{code:C.invalid_intersection_types}),f;if(n7(J)||n7(Y))F.dirty();return{status:F.value,value:Q.data}};if($.common.async)return Promise.all([this._def.left._parseAsync({data:$.data,path:$.path,parent:$}),this._def.right._parseAsync({data:$.data,path:$.path,parent:$})]).then(([J,Y])=>B(J,Y));else return B(this._def.left._parseSync({data:$.data,path:$.path,parent:$}),this._def.right._parseSync({data:$.data,path:$.path,parent:$}))}}o4.create=(D,F,$)=>{return new o4({left:D,right:F,typeName:_.ZodIntersection,...p($)})};class L1 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.array)return I($,{code:C.invalid_type,expected:L.array,received:$.parsedType}),f;if($.data.length<this._def.items.length)return I($,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;if(!this._def.rest&&$.data.length>this._def.items.length)I($,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let J=[...$.data].map((Y,Q)=>{let X=this._def.items[Q]||this._def.rest;if(!X)return null;return X._parse(new s0($,Y,$.path,Q))}).filter((Y)=>!!Y);if($.common.async)return Promise.all(J).then((Y)=>{return uD.mergeArray(F,Y)});else return uD.mergeArray(F,J)}get items(){return this._def.items}rest(D){return new L1({...this._def,rest:D})}}L1.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new L1({items:D,typeName:_.ZodTuple,rest:null,...p(F)})};class c3 extends i{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.object)return I($,{code:C.invalid_type,expected:L.object,received:$.parsedType}),f;let B=[],J=this._def.keyType,Y=this._def.valueType;for(let Q in $.data)B.push({key:J._parse(new s0($,Q,$.path,Q)),value:Y._parse(new s0($,$.data[Q],$.path,Q)),alwaysSet:Q in $.data});if($.common.async)return uD.mergeObjectAsync(F,B);else return uD.mergeObjectSync(F,B)}get element(){return this._def.valueType}static create(D,F,$){if(F instanceof i)return new c3({keyType:D,valueType:F,typeName:_.ZodRecord,...p($)});return new c3({keyType:i0.create(),valueType:D,typeName:_.ZodRecord,...p(F)})}}class n3 extends i{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.map)return I($,{code:C.invalid_type,expected:L.map,received:$.parsedType}),f;let B=this._def.keyType,J=this._def.valueType,Y=[...$.data.entries()].map(([Q,X],E)=>{return{key:B._parse(new s0($,Q,$.path,[E,"key"])),value:J._parse(new s0($,X,$.path,[E,"value"]))}});if($.common.async){let Q=new Map;return Promise.resolve().then(async()=>{for(let X of Y){let E=await X.key,G=await X.value;if(E.status==="aborted"||G.status==="aborted")return f;if(E.status==="dirty"||G.status==="dirty")F.dirty();Q.set(E.value,G.value)}return{status:F.value,value:Q}})}else{let Q=new Map;for(let X of Y){let{key:E,value:G}=X;if(E.status==="aborted"||G.status==="aborted")return f;if(E.status==="dirty"||G.status==="dirty")F.dirty();Q.set(E.value,G.value)}return{status:F.value,value:Q}}}}n3.create=(D,F,$)=>{return new n3({valueType:F,keyType:D,typeName:_.ZodMap,...p($)})};class U6 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.set)return I($,{code:C.invalid_type,expected:L.set,received:$.parsedType}),f;let B=this._def;if(B.minSize!==null){if($.data.size<B.minSize.value)I($,{code:C.too_small,minimum:B.minSize.value,type:"set",inclusive:!0,exact:!1,message:B.minSize.message}),F.dirty()}if(B.maxSize!==null){if($.data.size>B.maxSize.value)I($,{code:C.too_big,maximum:B.maxSize.value,type:"set",inclusive:!0,exact:!1,message:B.maxSize.message}),F.dirty()}let J=this._def.valueType;function Y(X){let E=new Set;for(let G of X){if(G.status==="aborted")return f;if(G.status==="dirty")F.dirty();E.add(G.value)}return{status:F.value,value:E}}let Q=[...$.data.values()].map((X,E)=>J._parse(new s0($,X,$.path,E)));if($.common.async)return Promise.all(Q).then((X)=>Y(X));else return Y(Q)}min(D,F){return new U6({...this._def,minSize:{value:D,message:k.toString(F)}})}max(D,F){return new U6({...this._def,maxSize:{value:D,message:k.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}}U6.create=(D,F)=>{return new U6({valueType:D,minSize:null,maxSize:null,typeName:_.ZodSet,...p(F)})};class p4 extends i{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==L.function)return I(F,{code:C.invalid_type,expected:L.function,received:F.parsedType}),f;function $(Q,X){return l3({data:Q,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,m4(),m1].filter((E)=>!!E),issueData:{code:C.invalid_arguments,argumentsError:X}})}function B(Q,X){return l3({data:Q,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,m4(),m1].filter((E)=>!!E),issueData:{code:C.invalid_return_type,returnTypeError:X}})}let J={errorMap:F.common.contextualErrorMap},Y=F.data;if(this._def.returns instanceof M6){let Q=this;return cD(async function(...X){let E=new E0([]),G=await Q._def.args.parseAsync(X,J).catch((K)=>{throw E.addIssue($(X,K)),E}),H=await Reflect.apply(Y,this,G);return await Q._def.returns._def.type.parseAsync(H,J).catch((K)=>{throw E.addIssue(B(H,K)),E})})}else{let Q=this;return cD(function(...X){let E=Q._def.args.safeParse(X,J);if(!E.success)throw new E0([$(X,E.error)]);let G=Reflect.apply(Y,this,E.data),H=Q._def.returns.safeParse(G,J);if(!H.success)throw new E0([B(G,H.error)]);return H.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new p4({...this._def,args:L1.create(D).rest(y8.create())})}returns(D){return new p4({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,$){return new p4({args:D?D:L1.create([]).rest(y8.create()),returns:F||y8.create(),typeName:_.ZodFunction,...p($)})}}class s4 extends i{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}}s4.create=(D,F)=>{return new s4({getter:D,typeName:_.ZodLazy,...p(F)})};class r4 extends i{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return I(F,{received:F.data,code:C.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:D.data}}get value(){return this._def.value}}r4.create=(D,F)=>{return new r4({value:D,typeName:_.ZodLiteral,...p(F)})};function Bk(D,F){return new _8({values:D,typeName:_.ZodEnum,...p(F)})}class _8 extends i{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),$=this._def.values;return I(F,{expected:r.joinValues($),received:F.parsedType,code:C.invalid_type}),f}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),$=this._def.values;return I(F,{received:F.data,code:C.invalid_enum_value,options:$}),f}return cD(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return _8.create(D,{...this._def,...F})}exclude(D,F=this._def){return _8.create(this.options.filter(($)=>!D.includes($)),{...this._def,...F})}}_8.create=Bk;class t4 extends i{_parse(D){let F=r.getValidEnumValues(this._def.values),$=this._getOrReturnCtx(D);if($.parsedType!==L.string&&$.parsedType!==L.number){let B=r.objectValues(F);return I($,{expected:r.joinValues(B),received:$.parsedType,code:C.invalid_type}),f}if(!this._cache)this._cache=new Set(r.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let B=r.objectValues(F);return I($,{received:$.data,code:C.invalid_enum_value,options:B}),f}return cD(D.data)}get enum(){return this._def.values}}t4.create=(D,F)=>{return new t4({values:D,typeName:_.ZodNativeEnum,...p(F)})};class M6 extends i{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==L.promise&&F.common.async===!1)return I(F,{code:C.invalid_type,expected:L.promise,received:F.parsedType}),f;let $=F.parsedType===L.promise?F.data:Promise.resolve(F.data);return cD($.then((B)=>{return this._def.type.parseAsync(B,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}M6.create=(D,F)=>{return new M6({type:D,typeName:_.ZodPromise,...p(F)})};class r0 extends i{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:$}=this._processInputParams(D),B=this._def.effect||null,J={addIssue:(Y)=>{if(I($,Y),Y.fatal)F.abort();else F.dirty()},get path(){return $.path}};if(J.addIssue=J.addIssue.bind(J),B.type==="preprocess"){let Y=B.transform($.data,J);if($.common.async)return Promise.resolve(Y).then(async(Q)=>{if(F.value==="aborted")return f;let X=await this._def.schema._parseAsync({data:Q,path:$.path,parent:$});if(X.status==="aborted")return f;if(X.status==="dirty")return K6(X.value);if(F.value==="dirty")return K6(X.value);return X});else{if(F.value==="aborted")return f;let Q=this._def.schema._parseSync({data:Y,path:$.path,parent:$});if(Q.status==="aborted")return f;if(Q.status==="dirty")return K6(Q.value);if(F.value==="dirty")return K6(Q.value);return Q}}if(B.type==="refinement"){let Y=(Q)=>{let X=B.refinement(Q,J);if($.common.async)return Promise.resolve(X);if(X instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Q};if($.common.async===!1){let Q=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(Q.status==="aborted")return f;if(Q.status==="dirty")F.dirty();return Y(Q.value),{status:F.value,value:Q.value}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((Q)=>{if(Q.status==="aborted")return f;if(Q.status==="dirty")F.dirty();return Y(Q.value).then(()=>{return{status:F.value,value:Q.value}})})}if(B.type==="transform")if($.common.async===!1){let Y=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(!v8(Y))return f;let Q=B.transform(Y.value,J);if(Q instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:Q}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((Y)=>{if(!v8(Y))return f;return Promise.resolve(B.transform(Y.value,J)).then((Q)=>({status:F.value,value:Q}))});r.assertNever(B)}}r0.create=(D,F,$)=>{return new r0({schema:D,typeName:_.ZodEffects,effect:F,...p($)})};r0.createWithPreprocess=(D,F,$)=>{return new r0({schema:F,effect:{type:"preprocess",transform:D},typeName:_.ZodEffects,...p($)})};class o0 extends i{_parse(D){if(this._getType(D)===L.undefined)return cD(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}o0.create=(D,F)=>{return new o0({innerType:D,typeName:_.ZodOptional,...p(F)})};class d1 extends i{_parse(D){if(this._getType(D)===L.null)return cD(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}d1.create=(D,F)=>{return new d1({innerType:D,typeName:_.ZodNullable,...p(F)})};class e4 extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;if(F.parsedType===L.undefined)$=this._def.defaultValue();return this._def.innerType._parse({data:$,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}e4.create=(D,F)=>{return new e4({innerType:D,typeName:_.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...p(F)})};class DF extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$={...F,common:{...F.common,issues:[]}},B=this._def.innerType._parse({data:$.data,path:$.path,parent:{...$}});if(l4(B))return B.then((J)=>{return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new E0($.common.issues)},input:$.data})}});else return{status:"valid",value:B.status==="valid"?B.value:this._def.catchValue({get error(){return new E0($.common.issues)},input:$.data})}}removeCatch(){return this._def.innerType}}DF.create=(D,F)=>{return new DF({innerType:D,typeName:_.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...p(F)})};class i3 extends i{_parse(D){if(this._getType(D)!==L.nan){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.nan,received:$.parsedType}),f}return{status:"valid",value:D.data}}}i3.create=(D)=>{return new i3({typeName:_.ZodNaN,...p(D)})};var vQD=Symbol("zod_brand");class a7 extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;return this._def.type._parse({data:$,path:F.path,parent:F})}unwrap(){return this._def.type}}class a3 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.common.async)return(async()=>{let J=await this._def.in._parseAsync({data:$.data,path:$.path,parent:$});if(J.status==="aborted")return f;if(J.status==="dirty")return F.dirty(),K6(J.value);else return this._def.out._parseAsync({data:J.value,path:$.path,parent:$})})();else{let B=this._def.in._parseSync({data:$.data,path:$.path,parent:$});if(B.status==="aborted")return f;if(B.status==="dirty")return F.dirty(),{status:"dirty",value:B.value};else return this._def.out._parseSync({data:B.value,path:$.path,parent:$})}}static create(D,F){return new a3({in:D,out:F,typeName:_.ZodPipeline})}}class FF extends i{_parse(D){let F=this._def.innerType._parse(D),$=(B)=>{if(v8(B))B.value=Object.freeze(B.value);return B};return l4(F)?F.then((B)=>$(B)):$(F)}unwrap(){return this._def.innerType}}FF.create=(D,F)=>{return new FF({innerType:D,typeName:_.ZodReadonly,...p(F)})};function eS(D,F){let $=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof $==="string"?{message:$}:$}function Jk(D,F={},$){if(D)return A6.create().superRefine((B,J)=>{let Y=D(B);if(Y instanceof Promise)return Y.then((Q)=>{if(!Q){let X=eS(F,B),E=X.fatal??$??!0;J.addIssue({code:"custom",...X,fatal:E})}});if(!Y){let Q=eS(F,B),X=Q.fatal??$??!0;J.addIssue({code:"custom",...Q,fatal:X})}return});return A6.create()}var yQD={object:LD.lazycreate},_;(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(_||(_={}));var xQD=(D,F={message:`Input not instance of ${D.name}`})=>Jk(($)=>$ instanceof D,F),Yk=i0.create,Qk=x8.create,fQD=i3.create,_QD=f8.create,Xk=c4.create,hQD=V6.create,gQD=d3.create,uQD=n4.create,bQD=i4.create,mQD=A6.create,lQD=y8.create,dQD=C1.create,pQD=p3.create,cQD=a0.create,nQD=LD.create,iQD=LD.strictCreate,aQD=a4.create,oQD=i7.create,sQD=o4.create,rQD=L1.create,tQD=c3.create,eQD=n3.create,DXD=U6.create,FXD=p4.create,$XD=s4.create,BXD=r4.create,JXD=_8.create,YXD=t4.create,QXD=M6.create,XXD=r0.create,EXD=o0.create,GXD=d1.create,HXD=r0.createWithPreprocess,WXD=a3.create,qXD=()=>Yk().optional(),zXD=()=>Qk().optional(),KXD=()=>Xk().optional(),VXD={string:(D)=>i0.create({...D,coerce:!0}),number:(D)=>x8.create({...D,coerce:!0}),boolean:(D)=>c4.create({...D,coerce:!0}),bigint:(D)=>f8.create({...D,coerce:!0}),date:(D)=>V6.create({...D,coerce:!0})};var AXD=f;var NZD=p1.object({apiKey:p1.string().optional(),apiUrl:p1.string().url().default("https://nemar-api.shirazi-10f.workers.dev"),username:p1.string().optional(),email:p1.string().email().optional(),githubUsername:p1.string().optional()}),c1=new p7({projectName:"nemar",schema:{apiKey:{type:"string"},apiUrl:{type:"string",default:"https://nemar-api.shirazi-10f.workers.dev"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"}},...process.env.NEMAR_CONFIG_DIR?{cwd:process.env.NEMAR_CONFIG_DIR}:{}});function t0(){return{apiKey:c1.get("apiKey"),apiUrl:c1.get("apiUrl"),username:c1.get("username"),email:c1.get("email"),githubUsername:c1.get("githubUsername")}}function h8(D,F){c1.set(D,F)}function Ek(){c1.clear()}function R1(){return!!c1.get("apiKey")}function Gk(){return c1.path}var UXD="https://nemar-api.shirazi-10f.workers.dev";class TD extends Error{statusCode;details;constructor(D,F,$){super(F);this.statusCode=D;this.details=$;this.name="ApiError"}}function MXD(){return t0().apiUrl||UXD}async function V0(D,F={},$=!1){let B=`${MXD()}${D}`,J={"Content-Type":"application/json",...F.headers};if($){let X=t0();if(!X.apiKey)throw new TD(401,"Not authenticated. Run 'nemar auth login' first.");J.Authorization=`Bearer ${X.apiKey}`}let Y=await fetch(B,{...F,headers:J}),Q=await Y.json();if(!Y.ok)throw new TD(Y.status,Q.error||Q.message||"Request failed",Q.details);return Q}async function Hk(D){return V0("/auth/signup",{method:"POST",body:JSON.stringify(D)})}async function Wk(D){return V0("/auth/login",{method:"POST",body:JSON.stringify({api_key:D})})}async function qk(D){return V0("/auth/resend-verification",{method:"POST",body:JSON.stringify({email:D})})}async function zk(){return V0("/users/me",{},!0)}async function Kk(D){let F=D?`?status=${D}`:"";return V0(`/admin/users${F}`,{},!0)}async function Vk(D){return V0(`/admin/approve/${D}`,{method:"POST"},!0)}async function Ak(D){return V0(`/admin/revoke/${D}`,{method:"POST"},!0)}async function Uk(){return V0("/datasets")}async function $F(D){return V0(`/datasets/${D}`)}async function Mk(D){return V0("/datasets",{method:"POST",body:JSON.stringify(D)},!0)}async function Nk(D){return V0(`/datasets/${D}/finalize`,{method:"POST"},!0)}async function Zk(D,F){return V0(`/admin/datasets/${D}/doi/concept`,{method:"POST",body:JSON.stringify(F)},!0)}async function vX(D){return V0(`/admin/datasets/${D}/doi`,{},!0)}var{spawn:NXD}=globalThis.Bun;import{existsSync as Lk}from"fs";import{join as ZXD}from"path";async function YD(D,F={}){let $=NXD({cmd:D,cwd:F.cwd,stdout:"pipe",stderr:"pipe",env:{...process.env,...F.env}}),B=await new Response($.stdout).text(),J=await new Response($.stderr).text(),Y=await $.exited;return{stdout:B,stderr:J,exitCode:Y}}function Ck(D){return D.split(".").map((F)=>{let $=parseInt(F.replace(/[^0-9]/g,""),10);return isNaN($)?0:$})}function Rk(D,F){let $=Ck(D),B=Ck(F);for(let J=0;J<Math.max($.length,B.length);J++){let Y=$[J]||0,Q=B[J]||0;if(Y>Q)return!0;if(Y<Q)return!1}return!0}async function Ik(){try{let{stdout:F,exitCode:$}=await YD(["datalad","--version"]);if($!==0)return{installed:!1,minVersion:"0.19.0"};let B=F.match(/(\d+\.\d+\.\d+)/),J=B?B[1]:void 0;return{installed:!0,version:J,minVersion:"0.19.0",compatible:J?Rk(J,"0.19.0"):void 0}}catch{return{installed:!1,minVersion:"0.19.0"}}}async function Ok(){try{let{stdout:F,exitCode:$}=await YD(["git-annex","version"]);if($!==0)return{installed:!1,minVersion:"10.0"};let B=F.match(/version:\s*(\d+\.\d+)/),J=B?B[1]:void 0;return{installed:!0,version:J,minVersion:"10.0",compatible:J?Rk(J,"10.0"):void 0}}catch{return{installed:!1,minVersion:"10.0"}}}async function CXD(){if(process.env.GH_TOKEN)return{accessible:!0,username:"token-auth",useHttps:!0};try{let{stdout:D,stderr:F,exitCode:$}=await YD(["ssh","-T","-o","BatchMode=yes","-o","StrictHostKeyChecking=accept-new","git@github.com"],{timeout:1e4}),B=D+F,J=B.match(/Hi ([^!]+)!/);if(J)return{accessible:!0,username:J[1]};if(B.includes("Permission denied"))return{accessible:!1};return{accessible:B.includes("successfully authenticated")}}catch{return{accessible:!1}}}async function LXD(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY)return{configured:!0,source:"environment"};try{let{stdout:D,exitCode:F}=await YD(["aws","configure","get","aws_access_key_id"]);if(F===0&&D.trim())return{configured:!0,source:"aws-cli"}}catch{}return{configured:!1}}async function Tk(){let[D,F,$,B]=await Promise.all([Ik(),Ok(),CXD(),LXD()]),J=[];if(!D.installed)J.push("DataLad is not installed. Install: pip install datalad");else if(D.compatible===!1)J.push(`DataLad version ${D.version} is too old. Required: >= ${D.minVersion}`);if(!F.installed)J.push("git-annex is not installed. Install: brew install git-annex (macOS) or apt install git-annex (Linux)");else if(F.compatible===!1)J.push(`git-annex version ${F.version} is too old. Required: >= ${F.minVersion}`);if(!$.accessible)J.push("GitHub SSH access not configured. Add your SSH key to GitHub: https://github.com/settings/keys");if(!B.configured)J.push("AWS credentials not found. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables");return{datalad:D,gitAnnex:F,githubSSH:$,awsCredentials:B,allPassed:J.length===0,errors:J}}async function yX(D){if(Lk(ZXD(D,".datalad")))return!0;try{let{exitCode:F}=await YD(["datalad","status"],{cwd:D});return F===0}catch{return!1}}async function Pk(D,F={}){if(!F.force&&await yX(D))return{success:!0};try{let{stderr:$,exitCode:B}=await YD(["datalad","create","--force",D]);if(B!==0)return{success:!1,error:$.trim()||"Failed to create DataLad dataset"};return{success:!0}}catch($){return{success:!1,error:$.message}}}async function wk(D,F){let B=F||"include=*.edf or include=*.bdf or include=*.set or include=*.fif or include=*.vhdr or include=*.eeg or include=*.cnt or include=*.fdt or largerthan=100kb";try{let{stderr:J,exitCode:Y}=await YD(["git","annex","config","--set","annex.largefiles",B],{cwd:D});if(Y!==0)return{success:!1,error:J.trim()||"Failed to configure largefiles"};return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function jk(D,F,$){let B=["git","annex","initremote",F.name,"type=S3","encryption=none",`bucket=${F.bucket}`,`fileprefix=${F.prefix}/`,`datacenter=${F.region}`,"signature=v4"];if(F.publicUrl)B.push(`publicurl=${F.publicUrl}`);try{let{stderr:J,exitCode:Y}=await YD(B,{cwd:D,env:{AWS_ACCESS_KEY_ID:$.accessKeyId,AWS_SECRET_ACCESS_KEY:$.secretAccessKey}});if(Y!==0){if(J.includes("already exists")){let Q=await YD(["git","annex","enableremote",F.name],{cwd:D,env:{AWS_ACCESS_KEY_ID:$.accessKeyId,AWS_SECRET_ACCESS_KEY:$.secretAccessKey}});if(Q.exitCode===0)return{success:!0};return{success:!1,error:Q.stderr.trim()}}return{success:!1,error:J.trim()||"Failed to configure S3 remote"}}return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function Sk(D,F,$="origin"){let B=F;if(process.env.GH_TOKEN&&F.startsWith("git@github.com:")){let J=F.match(/git@github\.com:(.+)/);if(J)B=`https://${process.env.GH_TOKEN}@github.com/${J[1]}`}try{let{stdout:J}=await YD(["git","remote","get-url",$],{cwd:D});if(J.trim()){let{stderr:Y,exitCode:Q}=await YD(["git","remote","set-url",$,B],{cwd:D});if(Q!==0)return{success:!1,error:Y.trim()}}else{let{stderr:Y,exitCode:Q}=await YD(["git","remote","add",$,B],{cwd:D});if(Q!==0)return{success:!1,error:Y.trim()}}return{success:!0}}catch{let{stderr:J,exitCode:Y}=await YD(["git","remote","add",$,B],{cwd:D});if(Y!==0)return{success:!1,error:J.trim()};return{success:!0}}}async function kk(D,F){try{let{stderr:$,exitCode:B}=await YD(["datalad","save","-m",F],{cwd:D});if(B!==0){if($.includes("nothing to save")||$.includes("no changes"))return{success:!0};return{success:!1,error:$.trim()||"Failed to save dataset"}}return{success:!0}}catch($){return{success:!1,error:$.message}}}async function vk(D,F,$){let B=$.jobs||8;try{let{stdout:J,stderr:Y,exitCode:Q}=await YD(["git","annex","copy","--to",F,"-J",B.toString(),"."],{cwd:D,env:{AWS_ACCESS_KEY_ID:$.credentials.accessKeyId,AWS_SECRET_ACCESS_KEY:$.credentials.secretAccessKey}});if(Q!==0)return{success:!1,error:Y.trim()||"Failed to push data to S3"};let X=J.match(/copy .+ ok/g);return{success:!0,filesUploaded:X?X.length:0}}catch(J){return{success:!1,error:J.message}}}async function yk(D,F="origin",$="main"){try{let{stderr:B,exitCode:J}=await YD(["git","push","-u",F,$],{cwd:D});if(J!==0)return{success:!1,error:B.trim()||"Failed to push to GitHub"};let{stderr:Y,exitCode:Q}=await YD(["git","push",F,"git-annex"],{cwd:D});if(Q!==0)console.warn("Warning: Could not push git-annex branch:",Y.trim());return{success:!0}}catch(B){return{success:!1,error:B.message}}}async function xk(D){try{let{stdout:B,exitCode:J}=await YD(["git","annex","info","--json"],{cwd:D});if(J===0){let Y=JSON.parse(B);return{totalFiles:Y["local annex keys"]||0,totalSize:Y["local annex size"]||0,annexedFiles:Y["local annex keys"]||0,annexedSize:Y["local annex size"]||0}}}catch{}let{stdout:F}=await YD(["find",D,"-type","f"],{cwd:D});return{totalFiles:F.trim().split(`
|
|
91
|
+
`;return this.stop(),this.#Y.write(G),this}}function o(D){return new AR(D)}import{existsSync as RXD}from"fs";import{join as IXD}from"path";import{isDeepStrictEqual as $QD}from"util";import nS from"process";import q6 from"fs";import iS from"path";import m3 from"crypto";import BQD from"assert";var $6=(D)=>{let F=typeof D;return D!==null&&(F==="object"||F==="function")};var gY=new Set(["__proto__","prototype","constructor"]),E1D=new Set("0123456789");function l9(D){let F=[],$="",B="start",J=!1;for(let Y of D)switch(Y){case"\\":{if(B==="index")throw Error("Invalid character in an index");if(B==="indexEnd")throw Error("Invalid character after an index");if(J)$+=Y;B="property",J=!J;break}case".":{if(B==="index")throw Error("Invalid character in an index");if(B==="indexEnd"){B="property";break}if(J){J=!1,$+=Y;break}if(gY.has($))return[];F.push($),$="",B="property";break}case"[":{if(B==="index")throw Error("Invalid character in an index");if(B==="indexEnd"){B="index";break}if(J){J=!1,$+=Y;break}if(B==="property"){if(gY.has($))return[];F.push($),$=""}B="index";break}case"]":{if(B==="index"){F.push(Number.parseInt($,10)),$="",B="indexEnd";break}if(B==="indexEnd")throw Error("Invalid character after an index")}default:{if(B==="index"&&!E1D.has(Y))throw Error("Invalid character in an index");if(B==="indexEnd")throw Error("Invalid character after an index");if(B==="start")B="property";if(J)J=!1,$+="\\";$+=Y}}if(J)$+="\\";switch(B){case"property":{if(gY.has($))return[];F.push($);break}case"index":throw Error("Index was not closed");case"start":{F.push("");break}}return F}function uY(D,F){if(typeof F!=="number"&&Array.isArray(D)){let $=Number.parseInt(F,10);return Number.isInteger($)&&D[$]===D[F]}return!1}function UR(D,F){if(uY(D,F))throw Error("Cannot use string index")}function MR(D,F,$){if(!$6(D)||typeof F!=="string")return $===void 0?D:$;let B=l9(F);if(B.length===0)return $;for(let J=0;J<B.length;J++){let Y=B[J];if(uY(D,Y))D=J===B.length-1?void 0:null;else D=D[Y];if(D===void 0||D===null){if(J!==B.length-1)return $;break}}return D===void 0?$:D}function bY(D,F,$){if(!$6(D)||typeof F!=="string")return D;let B=D,J=l9(F);for(let Y=0;Y<J.length;Y++){let Q=J[Y];if(UR(D,Q),Y===J.length-1)D[Q]=$;else if(!$6(D[Q]))D[Q]=typeof J[Y+1]==="number"?[]:{};D=D[Q]}return B}function NR(D,F){if(!$6(D)||typeof F!=="string")return!1;let $=l9(F);for(let B=0;B<$.length;B++){let J=$[B];if(UR(D,J),B===$.length-1)return delete D[J],!0;if(D=D[J],!$6(D))return!1}}function ZR(D,F){if(!$6(D)||typeof F!=="string")return!1;let $=l9(F);if($.length===0)return!1;for(let B of $){if(!$6(D)||!(B in D)||uY(D,B))return!1;D=D[B]}return!0}import CD from"path";import CR from"os";import mY from"process";var R8=CR.homedir(),lY=CR.tmpdir(),{env:R4}=mY,G1D=(D)=>{let F=CD.join(R8,"Library");return{data:CD.join(F,"Application Support",D),config:CD.join(F,"Preferences",D),cache:CD.join(F,"Caches",D),log:CD.join(F,"Logs",D),temp:CD.join(lY,D)}},H1D=(D)=>{let F=R4.APPDATA||CD.join(R8,"AppData","Roaming"),$=R4.LOCALAPPDATA||CD.join(R8,"AppData","Local");return{data:CD.join($,D,"Data"),config:CD.join(F,D,"Config"),cache:CD.join($,D,"Cache"),log:CD.join($,D,"Log"),temp:CD.join(lY,D)}},W1D=(D)=>{let F=CD.basename(R8);return{data:CD.join(R4.XDG_DATA_HOME||CD.join(R8,".local","share"),D),config:CD.join(R4.XDG_CONFIG_HOME||CD.join(R8,".config"),D),cache:CD.join(R4.XDG_CACHE_HOME||CD.join(R8,".cache"),D),log:CD.join(R4.XDG_STATE_HOME||CD.join(R8,".local","state"),D),temp:CD.join(lY,F,D)}};function dY(D,{suffix:F="nodejs"}={}){if(typeof D!=="string")throw TypeError(`Expected a string, got ${typeof D}`);if(F)D+=`-${F}`;if(mY.platform==="darwin")return G1D(D);if(mY.platform==="win32")return H1D(D);return W1D(D)}import N1D from"path";import BD from"fs";import{promisify as mD}from"util";var q1D=(D,F)=>{let{onError:$}=F;return function(...J){return D.apply(void 0,J).catch($)}},z1=q1D;var z1D=(D,F)=>{let{onError:$}=F;return function(...J){try{return D.apply(void 0,J)}catch(Y){return $(Y)}}},u0=z1D;var LR=250;var K1D=(D,F)=>{let{isRetriable:$}=F;return function(J){let{timeout:Y}=J,Q=J.interval??LR,X=Date.now()+Y;return function E(...G){return D.apply(void 0,G).catch((H)=>{if(!$(H))throw H;if(Date.now()>=X)throw H;let q=Math.round(Q*Math.random());if(q>0)return new Promise((V)=>setTimeout(V,q)).then(()=>E.apply(void 0,G));else return E.apply(void 0,G)})}}},K1=K1D;var V1D=(D,F)=>{let{isRetriable:$}=F;return function(J){let{timeout:Y}=J,Q=Date.now()+Y;return function(...E){while(!0)try{return D.apply(void 0,E)}catch(G){if(!$(G))throw G;if(Date.now()>=Q)throw G;continue}}}},V1=V1D;import IR from"process";var Q3={isChangeErrorOk:(D)=>{if(!Q3.isNodeError(D))return!1;let{code:F}=D;if(F==="ENOSYS")return!0;if(!RR&&(F==="EINVAL"||F==="EPERM"))return!0;return!1},isNodeError:(D)=>{return D instanceof Error},isRetriableError:(D)=>{if(!Q3.isNodeError(D))return!1;let{code:F}=D;if(F==="EMFILE"||F==="ENFILE"||F==="EAGAIN"||F==="EBUSY"||F==="EACCESS"||F==="EACCES"||F==="EACCS"||F==="EPERM")return!0;return!1},onChangeError:(D)=>{if(!Q3.isNodeError(D))throw D;if(Q3.isChangeErrorOk(D))return;throw D}},pY=Q3;var X3={onError:pY.onChangeError},$0={onError:()=>{return}},RR=IR.getuid?!IR.getuid():!1,hD={isRetriable:pY.isRetriableError};var A1D={attempt:{chmod:z1(mD(BD.chmod),X3),chown:z1(mD(BD.chown),X3),close:z1(mD(BD.close),$0),fsync:z1(mD(BD.fsync),$0),mkdir:z1(mD(BD.mkdir),$0),realpath:z1(mD(BD.realpath),$0),stat:z1(mD(BD.stat),$0),unlink:z1(mD(BD.unlink),$0),chmodSync:u0(BD.chmodSync,X3),chownSync:u0(BD.chownSync,X3),closeSync:u0(BD.closeSync,$0),existsSync:u0(BD.existsSync,$0),fsyncSync:u0(BD.fsync,$0),mkdirSync:u0(BD.mkdirSync,$0),realpathSync:u0(BD.realpathSync,$0),statSync:u0(BD.statSync,$0),unlinkSync:u0(BD.unlinkSync,$0)},retry:{close:K1(mD(BD.close),hD),fsync:K1(mD(BD.fsync),hD),open:K1(mD(BD.open),hD),readFile:K1(mD(BD.readFile),hD),rename:K1(mD(BD.rename),hD),stat:K1(mD(BD.stat),hD),write:K1(mD(BD.write),hD),writeFile:K1(mD(BD.writeFile),hD),closeSync:V1(BD.closeSync,hD),fsyncSync:V1(BD.fsyncSync,hD),openSync:V1(BD.openSync,hD),readFileSync:V1(BD.readFileSync,hD),renameSync:V1(BD.renameSync,hD),statSync:V1(BD.statSync,hD),writeSync:V1(BD.writeSync,hD),writeFileSync:V1(BD.writeFileSync,hD)}},SD=A1D;import B6 from"process";var OR="utf8",cY=438,TR=511;var PR={},wR=B6.geteuid?B6.geteuid():-1,jR=B6.getegid?B6.getegid():-1;var SR=1000,kR=!!B6.getuid,cVD=B6.getuid?!B6.getuid():!1,nY=128;var vR=(D)=>{return D instanceof Error&&"code"in D};var iY=(D)=>{return typeof D==="string"},d9=(D)=>{return D===void 0};import M1D from"path";import I4 from"process";import yR from"process";var xR=yR.platform==="linux",p9=yR.platform==="win32";var aY=["SIGHUP","SIGINT","SIGTERM"];if(!p9)aY.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(xR)aY.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var fR=aY;class _R{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(D)=>{if(this.exited)return;this.exited=!0;for(let F of this.callbacks)F();if(D)if(p9&&(D!=="SIGINT"&&D!=="SIGTERM"&&D!=="SIGKILL"))I4.kill(I4.pid,"SIGTERM");else I4.kill(I4.pid,D)},this.hook=()=>{I4.once("exit",()=>this.exit());for(let D of fR)try{I4.once(D,()=>this.exit(D))}catch{}},this.register=(D)=>{return this.callbacks.add(D),()=>{this.callbacks.delete(D)}},this.hook()}}var hR=new _R;var U1D=hR.register,gR=U1D;var K0={store:{},create:(D)=>{let F=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),$=Date.now().toString().slice(-10),B="tmp-",J=`.tmp-${$}${F}`;return`${D}${J}`},get:(D,F,$=!0)=>{let B=K0.truncate(F(D));if(B in K0.store)return K0.get(D,F,$);return K0.store[B]=$,[B,()=>delete K0.store[B]]},purge:(D)=>{if(!K0.store[D])return;delete K0.store[D],SD.attempt.unlink(D)},purgeSync:(D)=>{if(!K0.store[D])return;delete K0.store[D],SD.attempt.unlinkSync(D)},purgeSyncAll:()=>{for(let D in K0.store)K0.purgeSync(D)},truncate:(D)=>{let F=M1D.basename(D);if(F.length<=nY)return D;let $=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(F);if(!$)return D;let B=F.length-nY;return`${D.slice(0,-F.length)}${$[1]}${$[2].slice(0,-B)}${$[3]}`}};gR(K0.purgeSyncAll);var E3=K0;function oY(D,F,$=PR){if(iY($))return oY(D,F,{encoding:$});let J={timeout:$.timeout??SR},Y=null,Q=null,X=null;try{let E=SD.attempt.realpathSync(D),G=!!E;D=E||D,[Q,Y]=E3.get(D,$.tmpCreate||E3.create,$.tmpPurge!==!1);let H=kR&&d9($.chown),q=d9($.mode);if(G&&(H||q)){let K=SD.attempt.statSync(D);if(K){if($={...$},H)$.chown={uid:K.uid,gid:K.gid};if(q)$.mode=K.mode}}if(!G){let K=N1D.dirname(D);SD.attempt.mkdirSync(K,{mode:TR,recursive:!0})}if(X=SD.retry.openSync(J)(Q,"w",$.mode||cY),$.tmpCreated)$.tmpCreated(Q);if(iY(F))SD.retry.writeSync(J)(X,F,0,$.encoding||OR);else if(!d9(F))SD.retry.writeSync(J)(X,F,0,F.length,0);if($.fsync!==!1)if($.fsyncWait!==!1)SD.retry.fsyncSync(J)(X);else SD.attempt.fsync(X);if(SD.retry.closeSync(J)(X),X=null,$.chown&&($.chown.uid!==wR||$.chown.gid!==jR))SD.attempt.chownSync(Q,$.chown.uid,$.chown.gid);if($.mode&&$.mode!==cY)SD.attempt.chmodSync(Q,$.mode);try{SD.retry.renameSync(J)(Q,D)}catch(K){if(!vR(K))throw K;if(K.code!=="ENAMETOOLONG")throw K;SD.retry.renameSync(J)(Q,E3.truncate(D))}Y(),Q=null}finally{if(X)SD.attempt.closeSync(X);if(Q)E3.purge(Q)}}var oS=h(Sw(),1),sS=h(tw(),1);var $BD=(D,F={})=>{if(typeof D!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof D}\``);let{wait:$=0,maxWait:B=Number.POSITIVE_INFINITY,before:J=!1,after:Y=!0}=F;if($<0||B<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!J&&!Y)throw Error("Both `before` and `after` are false, function wouldn't be called.");let Q,X,E,G=function(...H){let q=this,K=()=>{if(Q=void 0,X)clearTimeout(X),X=void 0;if(Y)E=D.apply(q,H)},V=()=>{if(X=void 0,Q)clearTimeout(Q),Q=void 0;if(Y)E=D.apply(q,H)},A=J&&!Q;if(clearTimeout(Q),Q=setTimeout(K,$),B>0&&B!==Number.POSITIVE_INFINITY&&!X)X=setTimeout(V,B);if(A)E=D.apply(q,H);return E};return $3(G,D),G.cancel=()=>{if(Q)clearTimeout(Q),Q=void 0;if(X)clearTimeout(X),X=void 0},G},HX=$BD;var z6=h(lS(),1);var oYD=Object.prototype.toString;function pS(D,F,$){if(!D)return!1;if(D.constructor===F)return!0;return oYD.call(D)===$}function cS(D){return pS(D,Uint8Array,"[object Uint8Array]")}function sYD(D){return pS(D,ArrayBuffer,"[object ArrayBuffer]")}function rYD(D){return cS(D)||sYD(D)}function tYD(D){if(!cS(D))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof D}\``)}function eYD(D){if(!rYD(D))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof D}\``)}function TX(D,F){if(D.length===0)return new Uint8Array(0);F??=D.reduce((J,Y)=>J+Y.length,0);let $=new Uint8Array(F),B=0;for(let J of D)tYD(J),$.set(J,B),B+=J.length;return $}var dS={utf8:new globalThis.TextDecoder("utf8")};function PX(D,F="utf8"){return eYD(D),dS[F]??=new globalThis.TextDecoder(F),dS[F].decode(D)}function DQD(D){if(typeof D!=="string")throw TypeError(`Expected \`string\`, got \`${typeof D}\``)}var FQD=new globalThis.TextEncoder;function l7(D){return DQD(D),FQD.encode(D)}var kND=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"));var JQD=sS.default.default,aS="aes-256-cbc",b4=()=>Object.create(null),YQD=(D)=>D!==void 0&&D!==null,QQD=(D,F)=>{let $=new Set(["undefined","symbol","function"]),B=typeof F;if($.has(B))throw TypeError(`Setting a value of type \`${B}\` for key \`${D}\` is not allowed as it's not supported by JSON`)},d7="__internal__",wX=`${d7}.migrations.version`;class p7{path;events;#$;#F;#D;#J={};constructor(D={}){let F={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...D};if(!F.cwd){if(!F.projectName)throw Error("Please specify the `projectName` option.");F.cwd=dY(F.projectName,{suffix:F.projectSuffix}).config}if(this.#D=F,F.schema??F.ajvOptions??F.rootSchema){if(F.schema&&typeof F.schema!=="object")throw TypeError("The `schema` option must be an object.");let Y=new oS.Ajv2020({allErrors:!0,useDefaults:!0,...F.ajvOptions});JQD(Y);let Q={...F.rootSchema,type:"object",properties:F.schema};this.#$=Y.compile(Q);for(let[X,E]of Object.entries(F.schema??{}))if(E?.default)this.#J[X]=E.default}if(F.defaults)this.#J={...this.#J,...F.defaults};if(F.serialize)this._serialize=F.serialize;if(F.deserialize)this._deserialize=F.deserialize;this.events=new EventTarget,this.#F=F.encryptionKey;let $=F.fileExtension?`.${F.fileExtension}`:"";this.path=iS.resolve(F.cwd,`${F.configName??"config"}${$}`);let B=this.store,J=Object.assign(b4(),F.defaults,B);if(F.migrations){if(!F.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(F.migrations,F.projectVersion,F.beforeEachMigration)}this._validate(J);try{BQD.deepEqual(B,J)}catch{this.store=J}if(F.watch)this._watch()}get(D,F){if(this.#D.accessPropertiesByDotNotation)return this._get(D,F);let{store:$}=this;return D in $?$[D]:F}set(D,F){if(typeof D!=="string"&&typeof D!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof D}`);if(typeof D!=="object"&&F===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(D))throw TypeError(`Please don't use the ${d7} key, as it's used to manage this module internal operations.`);let{store:$}=this,B=(J,Y)=>{if(QQD(J,Y),this.#D.accessPropertiesByDotNotation)bY($,J,Y);else $[J]=Y};if(typeof D==="object"){let J=D;for(let[Y,Q]of Object.entries(J))B(Y,Q)}else B(D,F);this.store=$}has(D){if(this.#D.accessPropertiesByDotNotation)return ZR(this.store,D);return D in this.store}reset(...D){for(let F of D)if(YQD(this.#J[F]))this.set(F,this.#J[F])}delete(D){let{store:F}=this;if(this.#D.accessPropertiesByDotNotation)NR(F,D);else delete F[D];this.store=F}clear(){this.store=b4();for(let D of Object.keys(this.#J))this.reset(D)}onDidChange(D,F){if(typeof D!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof D}`);if(typeof F!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof F}`);return this._handleChange(()=>this.get(D),F)}onDidAnyChange(D){if(typeof D!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof D}`);return this._handleChange(()=>this.store,D)}get size(){return Object.keys(this.store).length}get store(){try{let D=q6.readFileSync(this.path,this.#F?null:"utf8"),F=this._encryptData(D),$=this._deserialize(F);return this._validate($),Object.assign(b4(),$)}catch(D){if(D?.code==="ENOENT")return this._ensureDirectory(),b4();if(this.#D.clearInvalidConfig&&D.name==="SyntaxError")return b4();throw D}}set store(D){this._ensureDirectory(),this._validate(D),this._write(D),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[D,F]of Object.entries(this.store))yield[D,F]}_encryptData(D){if(!this.#F)return typeof D==="string"?D:PX(D);try{let F=D.slice(0,16),$=m3.pbkdf2Sync(this.#F,F.toString(),1e4,32,"sha512"),B=m3.createDecipheriv(aS,$,F),J=D.slice(17),Y=typeof J==="string"?l7(J):J;return PX(TX([B.update(Y),B.final()]))}catch{}return D.toString()}_handleChange(D,F){let $=D(),B=()=>{let J=$,Y=D();if($QD(Y,J))return;$=Y,F.call(this,Y,J)};return this.events.addEventListener("change",B),()=>{this.events.removeEventListener("change",B)}}_deserialize=(D)=>JSON.parse(D);_serialize=(D)=>JSON.stringify(D,void 0,"\t");_validate(D){if(!this.#$)return;if(this.#$(D)||!this.#$.errors)return;let $=this.#$.errors.map(({instancePath:B,message:J=""})=>`\`${B.slice(1)}\` ${J}`);throw Error("Config schema violation: "+$.join("; "))}_ensureDirectory(){q6.mkdirSync(iS.dirname(this.path),{recursive:!0})}_write(D){let F=this._serialize(D);if(this.#F){let $=m3.randomBytes(16),B=m3.pbkdf2Sync(this.#F,$.toString(),1e4,32,"sha512"),J=m3.createCipheriv(aS,B,$);F=TX([$,l7(":"),J.update(l7(F)),J.final()])}if(nS.env.SNAP)q6.writeFileSync(this.path,F,{mode:this.#D.configFileMode});else try{oY(this.path,F,{mode:this.#D.configFileMode})}catch($){if($?.code==="EXDEV"){q6.writeFileSync(this.path,F,{mode:this.#D.configFileMode});return}throw $}}_watch(){if(this._ensureDirectory(),!q6.existsSync(this.path))this._write(b4());if(nS.platform==="win32")q6.watch(this.path,{persistent:!1},HX(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else q6.watchFile(this.path,{persistent:!1},HX(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(D,F,$){let B=this._get(wX,"0.0.0"),J=Object.keys(D).filter((Q)=>this._shouldPerformMigration(Q,B,F)),Y={...this.store};for(let Q of J)try{if($)$(this,{fromVersion:B,toVersion:Q,finalVersion:F,versions:J});let X=D[Q];X?.(this),this._set(wX,Q),B=Q,Y={...this.store}}catch(X){throw this.store=Y,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${X}`)}if(this._isVersionInRangeFormat(B)||!z6.default.eq(B,F))this._set(wX,F)}_containsReservedKey(D){if(typeof D==="object"){if(Object.keys(D)[0]===d7)return!0}if(typeof D!=="string")return!1;if(this.#D.accessPropertiesByDotNotation){if(D.startsWith(`${d7}.`))return!0;return!1}return!1}_isVersionInRangeFormat(D){return z6.default.clean(D)===null}_shouldPerformMigration(D,F,$){if(this._isVersionInRangeFormat(D)){if(F!=="0.0.0"&&z6.default.satisfies(F,D))return!1;return z6.default.satisfies($,D)}if(z6.default.lte(D,F))return!1;if(z6.default.gt(D,$))return!1;return!0}_get(D,F){return MR(this.store,D,F)}_set(D,F){let{store:$}=this;bY($,D,F),this.store=$}}var p1={};rk(p1,{void:()=>pQD,util:()=>r,unknown:()=>lQD,union:()=>aQD,undefined:()=>uQD,tuple:()=>rQD,transformer:()=>XXD,symbol:()=>gQD,string:()=>Yk,strictObject:()=>iQD,setErrorMap:()=>GQD,set:()=>DXD,record:()=>tQD,quotelessJson:()=>XQD,promise:()=>QXD,preprocess:()=>HXD,pipeline:()=>WXD,ostring:()=>qXD,optional:()=>EXD,onumber:()=>zXD,oboolean:()=>KXD,objectUtil:()=>jX,object:()=>nQD,number:()=>Qk,nullable:()=>GXD,null:()=>bQD,never:()=>dQD,nativeEnum:()=>YXD,nan:()=>fQD,map:()=>eQD,makeIssue:()=>l3,literal:()=>BXD,lazy:()=>$XD,late:()=>yQD,isValid:()=>v8,isDirty:()=>n7,isAsync:()=>l4,isAborted:()=>c7,intersection:()=>sQD,instanceof:()=>xQD,getParsedType:()=>Z1,getErrorMap:()=>m4,function:()=>FXD,enum:()=>JXD,effect:()=>XXD,discriminatedUnion:()=>oQD,defaultErrorMap:()=>m1,datetimeRegex:()=>$k,date:()=>hQD,custom:()=>Jk,coerce:()=>VXD,boolean:()=>Xk,bigint:()=>_QD,array:()=>cQD,any:()=>mQD,addIssueToContext:()=>I,ZodVoid:()=>p3,ZodUnknown:()=>y8,ZodUnion:()=>a4,ZodUndefined:()=>n4,ZodType:()=>i,ZodTuple:()=>L1,ZodTransformer:()=>r0,ZodSymbol:()=>d3,ZodString:()=>i0,ZodSet:()=>U6,ZodSchema:()=>i,ZodRecord:()=>c3,ZodReadonly:()=>FF,ZodPromise:()=>M6,ZodPipeline:()=>a3,ZodParsedType:()=>L,ZodOptional:()=>o0,ZodObject:()=>LD,ZodNumber:()=>x8,ZodNullable:()=>d1,ZodNull:()=>i4,ZodNever:()=>C1,ZodNativeEnum:()=>t4,ZodNaN:()=>i3,ZodMap:()=>n3,ZodLiteral:()=>r4,ZodLazy:()=>s4,ZodIssueCode:()=>C,ZodIntersection:()=>o4,ZodFunction:()=>p4,ZodFirstPartyTypeKind:()=>_,ZodError:()=>E0,ZodEnum:()=>_8,ZodEffects:()=>r0,ZodDiscriminatedUnion:()=>i7,ZodDefault:()=>e4,ZodDate:()=>V6,ZodCatch:()=>DF,ZodBranded:()=>a7,ZodBoolean:()=>c4,ZodBigInt:()=>f8,ZodArray:()=>a0,ZodAny:()=>A6,Schema:()=>i,ParseStatus:()=>uD,OK:()=>cD,NEVER:()=>AXD,INVALID:()=>f,EMPTY_PATH:()=>HQD,DIRTY:()=>K6,BRAND:()=>vQD});var r;(function(D){D.assertEqual=(J)=>{};function F(J){}D.assertIs=F;function $(J){throw Error()}D.assertNever=$,D.arrayToEnum=(J)=>{let Y={};for(let Q of J)Y[Q]=Q;return Y},D.getValidEnumValues=(J)=>{let Y=D.objectKeys(J).filter((X)=>typeof J[J[X]]!=="number"),Q={};for(let X of Y)Q[X]=J[X];return D.objectValues(Q)},D.objectValues=(J)=>{return D.objectKeys(J).map(function(Y){return J[Y]})},D.objectKeys=typeof Object.keys==="function"?(J)=>Object.keys(J):(J)=>{let Y=[];for(let Q in J)if(Object.prototype.hasOwnProperty.call(J,Q))Y.push(Q);return Y},D.find=(J,Y)=>{for(let Q of J)if(Y(Q))return Q;return},D.isInteger=typeof Number.isInteger==="function"?(J)=>Number.isInteger(J):(J)=>typeof J==="number"&&Number.isFinite(J)&&Math.floor(J)===J;function B(J,Y=" | "){return J.map((Q)=>typeof Q==="string"?`'${Q}'`:Q).join(Y)}D.joinValues=B,D.jsonStringifyReplacer=(J,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(r||(r={}));var jX;(function(D){D.mergeShapes=(F,$)=>{return{...F,...$}}})(jX||(jX={}));var L=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z1=(D)=>{switch(typeof D){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(D)?L.nan:L.number;case"boolean":return L.boolean;case"function":return L.function;case"bigint":return L.bigint;case"symbol":return L.symbol;case"object":if(Array.isArray(D))return L.array;if(D===null)return L.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return L.promise;if(typeof Map<"u"&&D instanceof Map)return L.map;if(typeof Set<"u"&&D instanceof Set)return L.set;if(typeof Date<"u"&&D instanceof Date)return L.date;return L.object;default:return L.unknown}};var C=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),XQD=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")};class E0 extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=($)=>{this.issues=[...this.issues,$]},this.addIssues=($=[])=>{this.issues=[...this.issues,...$]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function(J){return J.message},$={_errors:[]},B=(J)=>{for(let Y of J.issues)if(Y.code==="invalid_union")Y.unionErrors.map(B);else if(Y.code==="invalid_return_type")B(Y.returnTypeError);else if(Y.code==="invalid_arguments")B(Y.argumentsError);else if(Y.path.length===0)$._errors.push(F(Y));else{let Q=$,X=0;while(X<Y.path.length){let E=Y.path[X];if(X!==Y.path.length-1)Q[E]=Q[E]||{_errors:[]};else Q[E]=Q[E]||{_errors:[]},Q[E]._errors.push(F(Y));Q=Q[E],X++}}};return B(this),$}static assert(D){if(!(D instanceof E0))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},$=[];for(let B of this.issues)if(B.path.length>0){let J=B.path[0];F[J]=F[J]||[],F[J].push(D(B))}else $.push(D(B));return{formErrors:$,fieldErrors:F}}get formErrors(){return this.flatten()}}E0.create=(D)=>{return new E0(D)};var EQD=(D,F)=>{let $;switch(D.code){case C.invalid_type:if(D.received===L.undefined)$="Required";else $=`Expected ${D.expected}, received ${D.received}`;break;case C.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(D.expected,r.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:$=`Unrecognized key(s) in object: ${r.joinValues(D.keys,", ")}`;break;case C.invalid_union:$="Invalid input";break;case C.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${r.joinValues(D.options)}`;break;case C.invalid_enum_value:$=`Invalid enum value. Expected ${r.joinValues(D.options)}, received '${D.received}'`;break;case C.invalid_arguments:$="Invalid function arguments";break;case C.invalid_return_type:$="Invalid function return type";break;case C.invalid_date:$="Invalid date";break;case C.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if($=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")$=`${$} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)$=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)$=`Invalid input: must end with "${D.validation.endsWith}"`;else r.assertNever(D.validation);else if(D.validation!=="regex")$=`Invalid ${D.validation}`;else $="Invalid";break;case C.too_small:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else $="Invalid input";break;case C.too_big:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")$=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else $="Invalid input";break;case C.custom:$="Invalid input";break;case C.invalid_intersection_types:$="Intersection results could not be merged";break;case C.not_multiple_of:$=`Number must be a multiple of ${D.multipleOf}`;break;case C.not_finite:$="Number must be finite";break;default:$=F.defaultError,r.assertNever(D)}return{message:$}},m1=EQD;var rS=m1;function GQD(D){rS=D}function m4(){return rS}var l3=(D)=>{let{data:F,path:$,errorMaps:B,issueData:J}=D,Y=[...$,...J.path||[]],Q={...J,path:Y};if(J.message!==void 0)return{...J,path:Y,message:J.message};let X="",E=B.filter((G)=>!!G).slice().reverse();for(let G of E)X=G(Q,{data:F,defaultError:X}).message;return{...J,path:Y,message:X}},HQD=[];function I(D,F){let $=m4(),B=l3({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,$,$===m1?void 0:m1].filter((J)=>!!J)});D.common.issues.push(B)}class uD{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let $=[];for(let B of F){if(B.status==="aborted")return f;if(B.status==="dirty")D.dirty();$.push(B.value)}return{status:D.value,value:$}}static async mergeObjectAsync(D,F){let $=[];for(let B of F){let J=await B.key,Y=await B.value;$.push({key:J,value:Y})}return uD.mergeObjectSync(D,$)}static mergeObjectSync(D,F){let $={};for(let B of F){let{key:J,value:Y}=B;if(J.status==="aborted")return f;if(Y.status==="aborted")return f;if(J.status==="dirty")D.dirty();if(Y.status==="dirty")D.dirty();if(J.value!=="__proto__"&&(typeof Y.value<"u"||B.alwaysSet))$[J.value]=Y.value}return{status:D.value,value:$}}}var f=Object.freeze({status:"aborted"}),K6=(D)=>({status:"dirty",value:D}),cD=(D)=>({status:"valid",value:D}),c7=(D)=>D.status==="aborted",n7=(D)=>D.status==="dirty",v8=(D)=>D.status==="valid",l4=(D)=>typeof Promise<"u"&&D instanceof Promise;var k;(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(k||(k={}));class s0{constructor(D,F,$,B){this._cachedPath=[],this.parent=D,this.data=F,this._path=$,this._key=B}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var tS=(D,F)=>{if(v8(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let $=new E0(D.common.issues);return this._error=$,this._error}}}};function p(D){if(!D)return{};let{errorMap:F,invalid_type_error:$,required_error:B,description:J}=D;if(F&&($||B))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:J};return{errorMap:(Q,X)=>{let{message:E}=D;if(Q.code==="invalid_enum_value")return{message:E??X.defaultError};if(typeof X.data>"u")return{message:E??B??X.defaultError};if(Q.code!=="invalid_type")return{message:X.defaultError};return{message:E??$??X.defaultError}},description:J}}class i{get description(){return this._def.description}_getType(D){return Z1(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:Z1(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new uD,ctx:{common:D.parent.common,data:D.data,parsedType:Z1(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(l4(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let $=this.safeParse(D,F);if($.success)return $.data;throw $.error}safeParse(D,F){let $={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:Z1(D)},B=this._parseSync({data:D,path:$.path,parent:$});return tS($,B)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:Z1(D)};if(!this["~standard"].async)try{let $=this._parseSync({data:D,path:[],parent:F});return v8($)?{value:$.value}:{issues:F.common.issues}}catch($){if($?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then(($)=>v8($)?{value:$.value}:{issues:F.common.issues})}async parseAsync(D,F){let $=await this.safeParseAsync(D,F);if($.success)return $.data;throw $.error}async safeParseAsync(D,F){let $={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:Z1(D)},B=this._parse({data:D,path:$.path,parent:$}),J=await(l4(B)?B:Promise.resolve(B));return tS($,J)}refine(D,F){let $=(B)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(B);else return F};return this._refinement((B,J)=>{let Y=D(B),Q=()=>J.addIssue({code:C.custom,...$(B)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((X)=>{if(!X)return Q(),!1;else return!0});if(!Y)return Q(),!1;else return!0})}refinement(D,F){return this._refinement(($,B)=>{if(!D($))return B.addIssue(typeof F==="function"?F($,B):F),!1;else return!0})}_refinement(D){return new r0({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return o0.create(this,this._def)}nullable(){return d1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return a0.create(this)}promise(){return M6.create(this,this._def)}or(D){return a4.create([this,D],this._def)}and(D){return o4.create(this,D,this._def)}transform(D){return new r0({...p(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new e4({...p(this._def),innerType:this,defaultValue:F,typeName:_.ZodDefault})}brand(){return new a7({typeName:_.ZodBranded,type:this,...p(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new DF({...p(this._def),innerType:this,catchValue:F,typeName:_.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return a3.create(this,D)}readonly(){return FF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var WQD=/^c[^\s-]{8,}$/i,qQD=/^[0-9a-z]+$/,zQD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KQD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,VQD=/^[a-z0-9_-]{21}$/i,AQD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,UQD=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MQD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,NQD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",SX,ZQD=/^(?:(?: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])$/,CQD=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,LQD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,RQD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,IQD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OQD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dk="((\\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])))",TQD=new RegExp(`^${Dk}$`);function Fk(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let $=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${$}`}function PQD(D){return new RegExp(`^${Fk(D)}$`)}function $k(D){let F=`${Dk}T${Fk(D)}`,$=[];if($.push(D.local?"Z?":"Z"),D.offset)$.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${$.join("|")})`,new RegExp(`^${F}$`)}function wQD(D,F){if((F==="v4"||!F)&&ZQD.test(D))return!0;if((F==="v6"||!F)&&LQD.test(D))return!0;return!1}function jQD(D,F){if(!AQD.test(D))return!1;try{let[$]=D.split(".");if(!$)return!1;let B=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),J=JSON.parse(atob(B));if(typeof J!=="object"||J===null)return!1;if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(F&&J.alg!==F)return!1;return!0}catch{return!1}}function SQD(D,F){if((F==="v4"||!F)&&CQD.test(D))return!0;if((F==="v6"||!F)&&RQD.test(D))return!0;return!1}class i0 extends i{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==L.string){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_type,expected:L.string,received:J.parsedType}),f}let $=new uD,B=void 0;for(let J of this._def.checks)if(J.kind==="min"){if(D.data.length<J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),$.dirty()}else if(J.kind==="max"){if(D.data.length>J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),$.dirty()}else if(J.kind==="length"){let Y=D.data.length>J.value,Q=D.data.length<J.value;if(Y||Q){if(B=this._getOrReturnCtx(D,B),Y)I(B,{code:C.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});else if(Q)I(B,{code:C.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});$.dirty()}}else if(J.kind==="email"){if(!MQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"email",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="emoji"){if(!SX)SX=new RegExp(NQD,"u");if(!SX.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"emoji",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="uuid"){if(!KQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"uuid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="nanoid"){if(!VQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"nanoid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="cuid"){if(!WQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"cuid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="cuid2"){if(!qQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"cuid2",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="ulid"){if(!zQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"ulid",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="url")try{new URL(D.data)}catch{B=this._getOrReturnCtx(D,B),I(B,{validation:"url",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="regex"){if(J.regex.lastIndex=0,!J.regex.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"regex",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="trim")D.data=D.data.trim();else if(J.kind==="includes"){if(!D.data.includes(J.value,J.position))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:{includes:J.value,position:J.position},message:J.message}),$.dirty()}else if(J.kind==="toLowerCase")D.data=D.data.toLowerCase();else if(J.kind==="toUpperCase")D.data=D.data.toUpperCase();else if(J.kind==="startsWith"){if(!D.data.startsWith(J.value))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:{startsWith:J.value},message:J.message}),$.dirty()}else if(J.kind==="endsWith"){if(!D.data.endsWith(J.value))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:{endsWith:J.value},message:J.message}),$.dirty()}else if(J.kind==="datetime"){if(!$k(J).test(D.data))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:"datetime",message:J.message}),$.dirty()}else if(J.kind==="date"){if(!TQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:"date",message:J.message}),$.dirty()}else if(J.kind==="time"){if(!PQD(J).test(D.data))B=this._getOrReturnCtx(D,B),I(B,{code:C.invalid_string,validation:"time",message:J.message}),$.dirty()}else if(J.kind==="duration"){if(!UQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"duration",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="ip"){if(!wQD(D.data,J.version))B=this._getOrReturnCtx(D,B),I(B,{validation:"ip",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="jwt"){if(!jQD(D.data,J.alg))B=this._getOrReturnCtx(D,B),I(B,{validation:"jwt",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="cidr"){if(!SQD(D.data,J.version))B=this._getOrReturnCtx(D,B),I(B,{validation:"cidr",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="base64"){if(!IQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"base64",code:C.invalid_string,message:J.message}),$.dirty()}else if(J.kind==="base64url"){if(!OQD.test(D.data))B=this._getOrReturnCtx(D,B),I(B,{validation:"base64url",code:C.invalid_string,message:J.message}),$.dirty()}else r.assertNever(J);return{status:$.value,value:D.data}}_regex(D,F,$){return this.refinement((B)=>D.test(B),{validation:F,code:C.invalid_string,...k.errToObj($)})}_addCheck(D){return new i0({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...k.errToObj(D)})}url(D){return this._addCheck({kind:"url",...k.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...k.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...k.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...k.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...k.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...k.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...k.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...k.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...k.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...k.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...k.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...k.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...k.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...k.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...k.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...k.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...k.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...k.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...k.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...k.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...k.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...k.errToObj(F)})}nonempty(D){return this.min(1,k.errToObj(D))}trim(){return new i0({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i0({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i0({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}i0.create=(D)=>{return new i0({checks:[],typeName:_.ZodString,coerce:D?.coerce??!1,...p(D)})};function kQD(D,F){let $=(D.toString().split(".")[1]||"").length,B=(F.toString().split(".")[1]||"").length,J=$>B?$:B,Y=Number.parseInt(D.toFixed(J).replace(".","")),Q=Number.parseInt(F.toFixed(J).replace(".",""));return Y%Q/10**J}class x8 extends i{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==L.number){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_type,expected:L.number,received:J.parsedType}),f}let $=void 0,B=new uD;for(let J of this._def.checks)if(J.kind==="int"){if(!r.isInteger(D.data))$=this._getOrReturnCtx(D,$),I($,{code:C.invalid_type,expected:"integer",received:"float",message:J.message}),B.dirty()}else if(J.kind==="min"){if(J.inclusive?D.data<J.value:D.data<=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_small,minimum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),B.dirty()}else if(J.kind==="max"){if(J.inclusive?D.data>J.value:D.data>=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_big,maximum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),B.dirty()}else if(J.kind==="multipleOf"){if(kQD(D.data,J.value)!==0)$=this._getOrReturnCtx(D,$),I($,{code:C.not_multiple_of,multipleOf:J.value,message:J.message}),B.dirty()}else if(J.kind==="finite"){if(!Number.isFinite(D.data))$=this._getOrReturnCtx(D,$),I($,{code:C.not_finite,message:J.message}),B.dirty()}else r.assertNever(J);return{status:B.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,k.toString(F))}gt(D,F){return this.setLimit("min",D,!1,k.toString(F))}lte(D,F){return this.setLimit("max",D,!0,k.toString(F))}lt(D,F){return this.setLimit("max",D,!1,k.toString(F))}setLimit(D,F,$,B){return new x8({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:k.toString(B)}]})}_addCheck(D){return new x8({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:k.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:k.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:k.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&r.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let $ of this._def.checks)if($.kind==="finite"||$.kind==="int"||$.kind==="multipleOf")return!0;else if($.kind==="min"){if(F===null||$.value>F)F=$.value}else if($.kind==="max"){if(D===null||$.value<D)D=$.value}return Number.isFinite(F)&&Number.isFinite(D)}}x8.create=(D)=>{return new x8({checks:[],typeName:_.ZodNumber,coerce:D?.coerce||!1,...p(D)})};class f8 extends i{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==L.bigint)return this._getInvalidInput(D);let $=void 0,B=new uD;for(let J of this._def.checks)if(J.kind==="min"){if(J.inclusive?D.data<J.value:D.data<=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_small,type:"bigint",minimum:J.value,inclusive:J.inclusive,message:J.message}),B.dirty()}else if(J.kind==="max"){if(J.inclusive?D.data>J.value:D.data>=J.value)$=this._getOrReturnCtx(D,$),I($,{code:C.too_big,type:"bigint",maximum:J.value,inclusive:J.inclusive,message:J.message}),B.dirty()}else if(J.kind==="multipleOf"){if(D.data%J.value!==BigInt(0))$=this._getOrReturnCtx(D,$),I($,{code:C.not_multiple_of,multipleOf:J.value,message:J.message}),B.dirty()}else r.assertNever(J);return{status:B.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return I(F,{code:C.invalid_type,expected:L.bigint,received:F.parsedType}),f}gte(D,F){return this.setLimit("min",D,!0,k.toString(F))}gt(D,F){return this.setLimit("min",D,!1,k.toString(F))}lte(D,F){return this.setLimit("max",D,!0,k.toString(F))}lt(D,F){return this.setLimit("max",D,!1,k.toString(F))}setLimit(D,F,$,B){return new f8({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:k.toString(B)}]})}_addCheck(D){return new f8({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:k.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}}f8.create=(D)=>{return new f8({checks:[],typeName:_.ZodBigInt,coerce:D?.coerce??!1,...p(D)})};class c4 extends i{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==L.boolean){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.boolean,received:$.parsedType}),f}return cD(D.data)}}c4.create=(D)=>{return new c4({typeName:_.ZodBoolean,coerce:D?.coerce||!1,...p(D)})};class V6 extends i{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==L.date){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_type,expected:L.date,received:J.parsedType}),f}if(Number.isNaN(D.data.getTime())){let J=this._getOrReturnCtx(D);return I(J,{code:C.invalid_date}),f}let $=new uD,B=void 0;for(let J of this._def.checks)if(J.kind==="min"){if(D.data.getTime()<J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_small,message:J.message,inclusive:!0,exact:!1,minimum:J.value,type:"date"}),$.dirty()}else if(J.kind==="max"){if(D.data.getTime()>J.value)B=this._getOrReturnCtx(D,B),I(B,{code:C.too_big,message:J.message,inclusive:!0,exact:!1,maximum:J.value,type:"date"}),$.dirty()}else r.assertNever(J);return{status:$.value,value:new Date(D.data.getTime())}}_addCheck(D){return new V6({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:k.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:k.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}}V6.create=(D)=>{return new V6({checks:[],coerce:D?.coerce||!1,typeName:_.ZodDate,...p(D)})};class d3 extends i{_parse(D){if(this._getType(D)!==L.symbol){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.symbol,received:$.parsedType}),f}return cD(D.data)}}d3.create=(D)=>{return new d3({typeName:_.ZodSymbol,...p(D)})};class n4 extends i{_parse(D){if(this._getType(D)!==L.undefined){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.undefined,received:$.parsedType}),f}return cD(D.data)}}n4.create=(D)=>{return new n4({typeName:_.ZodUndefined,...p(D)})};class i4 extends i{_parse(D){if(this._getType(D)!==L.null){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.null,received:$.parsedType}),f}return cD(D.data)}}i4.create=(D)=>{return new i4({typeName:_.ZodNull,...p(D)})};class A6 extends i{constructor(){super(...arguments);this._any=!0}_parse(D){return cD(D.data)}}A6.create=(D)=>{return new A6({typeName:_.ZodAny,...p(D)})};class y8 extends i{constructor(){super(...arguments);this._unknown=!0}_parse(D){return cD(D.data)}}y8.create=(D)=>{return new y8({typeName:_.ZodUnknown,...p(D)})};class C1 extends i{_parse(D){let F=this._getOrReturnCtx(D);return I(F,{code:C.invalid_type,expected:L.never,received:F.parsedType}),f}}C1.create=(D)=>{return new C1({typeName:_.ZodNever,...p(D)})};class p3 extends i{_parse(D){if(this._getType(D)!==L.undefined){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.void,received:$.parsedType}),f}return cD(D.data)}}p3.create=(D)=>{return new p3({typeName:_.ZodVoid,...p(D)})};class a0 extends i{_parse(D){let{ctx:F,status:$}=this._processInputParams(D),B=this._def;if(F.parsedType!==L.array)return I(F,{code:C.invalid_type,expected:L.array,received:F.parsedType}),f;if(B.exactLength!==null){let Y=F.data.length>B.exactLength.value,Q=F.data.length<B.exactLength.value;if(Y||Q)I(F,{code:Y?C.too_big:C.too_small,minimum:Q?B.exactLength.value:void 0,maximum:Y?B.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:B.exactLength.message}),$.dirty()}if(B.minLength!==null){if(F.data.length<B.minLength.value)I(F,{code:C.too_small,minimum:B.minLength.value,type:"array",inclusive:!0,exact:!1,message:B.minLength.message}),$.dirty()}if(B.maxLength!==null){if(F.data.length>B.maxLength.value)I(F,{code:C.too_big,maximum:B.maxLength.value,type:"array",inclusive:!0,exact:!1,message:B.maxLength.message}),$.dirty()}if(F.common.async)return Promise.all([...F.data].map((Y,Q)=>{return B.type._parseAsync(new s0(F,Y,F.path,Q))})).then((Y)=>{return uD.mergeArray($,Y)});let J=[...F.data].map((Y,Q)=>{return B.type._parseSync(new s0(F,Y,F.path,Q))});return uD.mergeArray($,J)}get element(){return this._def.type}min(D,F){return new a0({...this._def,minLength:{value:D,message:k.toString(F)}})}max(D,F){return new a0({...this._def,maxLength:{value:D,message:k.toString(F)}})}length(D,F){return new a0({...this._def,exactLength:{value:D,message:k.toString(F)}})}nonempty(D){return this.min(1,D)}}a0.create=(D,F)=>{return new a0({type:D,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...p(F)})};function d4(D){if(D instanceof LD){let F={};for(let $ in D.shape){let B=D.shape[$];F[$]=o0.create(d4(B))}return new LD({...D._def,shape:()=>F})}else if(D instanceof a0)return new a0({...D._def,type:d4(D.element)});else if(D instanceof o0)return o0.create(d4(D.unwrap()));else if(D instanceof d1)return d1.create(d4(D.unwrap()));else if(D instanceof L1)return L1.create(D.items.map((F)=>d4(F)));else return D}class LD extends i{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=r.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==L.object){let E=this._getOrReturnCtx(D);return I(E,{code:C.invalid_type,expected:L.object,received:E.parsedType}),f}let{status:$,ctx:B}=this._processInputParams(D),{shape:J,keys:Y}=this._getCached(),Q=[];if(!(this._def.catchall instanceof C1&&this._def.unknownKeys==="strip")){for(let E in B.data)if(!Y.includes(E))Q.push(E)}let X=[];for(let E of Y){let G=J[E],H=B.data[E];X.push({key:{status:"valid",value:E},value:G._parse(new s0(B,H,B.path,E)),alwaysSet:E in B.data})}if(this._def.catchall instanceof C1){let E=this._def.unknownKeys;if(E==="passthrough")for(let G of Q)X.push({key:{status:"valid",value:G},value:{status:"valid",value:B.data[G]}});else if(E==="strict"){if(Q.length>0)I(B,{code:C.unrecognized_keys,keys:Q}),$.dirty()}else if(E==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let E=this._def.catchall;for(let G of Q){let H=B.data[G];X.push({key:{status:"valid",value:G},value:E._parse(new s0(B,H,B.path,G)),alwaysSet:G in B.data})}}if(B.common.async)return Promise.resolve().then(async()=>{let E=[];for(let G of X){let H=await G.key,q=await G.value;E.push({key:H,value:q,alwaysSet:G.alwaysSet})}return E}).then((E)=>{return uD.mergeObjectSync($,E)});else return uD.mergeObjectSync($,X)}get shape(){return this._def.shape()}strict(D){return k.errToObj,new LD({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,$)=>{let B=this._def.errorMap?.(F,$).message??$.defaultError;if(F.code==="unrecognized_keys")return{message:k.errToObj(D).message??B};return{message:B}}}:{}})}strip(){return new LD({...this._def,unknownKeys:"strip"})}passthrough(){return new LD({...this._def,unknownKeys:"passthrough"})}extend(D){return new LD({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new LD({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:_.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new LD({...this._def,catchall:D})}pick(D){let F={};for(let $ of r.objectKeys(D))if(D[$]&&this.shape[$])F[$]=this.shape[$];return new LD({...this._def,shape:()=>F})}omit(D){let F={};for(let $ of r.objectKeys(this.shape))if(!D[$])F[$]=this.shape[$];return new LD({...this._def,shape:()=>F})}deepPartial(){return d4(this)}partial(D){let F={};for(let $ of r.objectKeys(this.shape)){let B=this.shape[$];if(D&&!D[$])F[$]=B;else F[$]=B.optional()}return new LD({...this._def,shape:()=>F})}required(D){let F={};for(let $ of r.objectKeys(this.shape))if(D&&!D[$])F[$]=this.shape[$];else{let J=this.shape[$];while(J instanceof o0)J=J._def.innerType;F[$]=J}return new LD({...this._def,shape:()=>F})}keyof(){return Bk(r.objectKeys(this.shape))}}LD.create=(D,F)=>{return new LD({shape:()=>D,unknownKeys:"strip",catchall:C1.create(),typeName:_.ZodObject,...p(F)})};LD.strictCreate=(D,F)=>{return new LD({shape:()=>D,unknownKeys:"strict",catchall:C1.create(),typeName:_.ZodObject,...p(F)})};LD.lazycreate=(D,F)=>{return new LD({shape:D,unknownKeys:"strip",catchall:C1.create(),typeName:_.ZodObject,...p(F)})};class a4 extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$=this._def.options;function B(J){for(let Q of J)if(Q.result.status==="valid")return Q.result;for(let Q of J)if(Q.result.status==="dirty")return F.common.issues.push(...Q.ctx.common.issues),Q.result;let Y=J.map((Q)=>new E0(Q.ctx.common.issues));return I(F,{code:C.invalid_union,unionErrors:Y}),f}if(F.common.async)return Promise.all($.map(async(J)=>{let Y={...F,common:{...F.common,issues:[]},parent:null};return{result:await J._parseAsync({data:F.data,path:F.path,parent:Y}),ctx:Y}})).then(B);else{let J=void 0,Y=[];for(let X of $){let E={...F,common:{...F.common,issues:[]},parent:null},G=X._parseSync({data:F.data,path:F.path,parent:E});if(G.status==="valid")return G;else if(G.status==="dirty"&&!J)J={result:G,ctx:E};if(E.common.issues.length)Y.push(E.common.issues)}if(J)return F.common.issues.push(...J.ctx.common.issues),J.result;let Q=Y.map((X)=>new E0(X));return I(F,{code:C.invalid_union,unionErrors:Q}),f}}get options(){return this._def.options}}a4.create=(D,F)=>{return new a4({options:D,typeName:_.ZodUnion,...p(F)})};var l1=(D)=>{if(D instanceof s4)return l1(D.schema);else if(D instanceof r0)return l1(D.innerType());else if(D instanceof r4)return[D.value];else if(D instanceof _8)return D.options;else if(D instanceof t4)return r.objectValues(D.enum);else if(D instanceof e4)return l1(D._def.innerType);else if(D instanceof n4)return[void 0];else if(D instanceof i4)return[null];else if(D instanceof o0)return[void 0,...l1(D.unwrap())];else if(D instanceof d1)return[null,...l1(D.unwrap())];else if(D instanceof a7)return l1(D.unwrap());else if(D instanceof FF)return l1(D.unwrap());else if(D instanceof DF)return l1(D._def.innerType);else return[]};class i7 extends i{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==L.object)return I(F,{code:C.invalid_type,expected:L.object,received:F.parsedType}),f;let $=this.discriminator,B=F.data[$],J=this.optionsMap.get(B);if(!J)return I(F,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[$]}),f;if(F.common.async)return J._parseAsync({data:F.data,path:F.path,parent:F});else return J._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,$){let B=new Map;for(let J of F){let Y=l1(J.shape[D]);if(!Y.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let Q of Y){if(B.has(Q))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(Q)}`);B.set(Q,J)}}return new i7({typeName:_.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:B,...p($)})}}function kX(D,F){let $=Z1(D),B=Z1(F);if(D===F)return{valid:!0,data:D};else if($===L.object&&B===L.object){let J=r.objectKeys(F),Y=r.objectKeys(D).filter((X)=>J.indexOf(X)!==-1),Q={...D,...F};for(let X of Y){let E=kX(D[X],F[X]);if(!E.valid)return{valid:!1};Q[X]=E.data}return{valid:!0,data:Q}}else if($===L.array&&B===L.array){if(D.length!==F.length)return{valid:!1};let J=[];for(let Y=0;Y<D.length;Y++){let Q=D[Y],X=F[Y],E=kX(Q,X);if(!E.valid)return{valid:!1};J.push(E.data)}return{valid:!0,data:J}}else if($===L.date&&B===L.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}class o4 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D),B=(J,Y)=>{if(c7(J)||c7(Y))return f;let Q=kX(J.value,Y.value);if(!Q.valid)return I($,{code:C.invalid_intersection_types}),f;if(n7(J)||n7(Y))F.dirty();return{status:F.value,value:Q.data}};if($.common.async)return Promise.all([this._def.left._parseAsync({data:$.data,path:$.path,parent:$}),this._def.right._parseAsync({data:$.data,path:$.path,parent:$})]).then(([J,Y])=>B(J,Y));else return B(this._def.left._parseSync({data:$.data,path:$.path,parent:$}),this._def.right._parseSync({data:$.data,path:$.path,parent:$}))}}o4.create=(D,F,$)=>{return new o4({left:D,right:F,typeName:_.ZodIntersection,...p($)})};class L1 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.array)return I($,{code:C.invalid_type,expected:L.array,received:$.parsedType}),f;if($.data.length<this._def.items.length)return I($,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;if(!this._def.rest&&$.data.length>this._def.items.length)I($,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let J=[...$.data].map((Y,Q)=>{let X=this._def.items[Q]||this._def.rest;if(!X)return null;return X._parse(new s0($,Y,$.path,Q))}).filter((Y)=>!!Y);if($.common.async)return Promise.all(J).then((Y)=>{return uD.mergeArray(F,Y)});else return uD.mergeArray(F,J)}get items(){return this._def.items}rest(D){return new L1({...this._def,rest:D})}}L1.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new L1({items:D,typeName:_.ZodTuple,rest:null,...p(F)})};class c3 extends i{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.object)return I($,{code:C.invalid_type,expected:L.object,received:$.parsedType}),f;let B=[],J=this._def.keyType,Y=this._def.valueType;for(let Q in $.data)B.push({key:J._parse(new s0($,Q,$.path,Q)),value:Y._parse(new s0($,$.data[Q],$.path,Q)),alwaysSet:Q in $.data});if($.common.async)return uD.mergeObjectAsync(F,B);else return uD.mergeObjectSync(F,B)}get element(){return this._def.valueType}static create(D,F,$){if(F instanceof i)return new c3({keyType:D,valueType:F,typeName:_.ZodRecord,...p($)});return new c3({keyType:i0.create(),valueType:D,typeName:_.ZodRecord,...p(F)})}}class n3 extends i{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.map)return I($,{code:C.invalid_type,expected:L.map,received:$.parsedType}),f;let B=this._def.keyType,J=this._def.valueType,Y=[...$.data.entries()].map(([Q,X],E)=>{return{key:B._parse(new s0($,Q,$.path,[E,"key"])),value:J._parse(new s0($,X,$.path,[E,"value"]))}});if($.common.async){let Q=new Map;return Promise.resolve().then(async()=>{for(let X of Y){let E=await X.key,G=await X.value;if(E.status==="aborted"||G.status==="aborted")return f;if(E.status==="dirty"||G.status==="dirty")F.dirty();Q.set(E.value,G.value)}return{status:F.value,value:Q}})}else{let Q=new Map;for(let X of Y){let{key:E,value:G}=X;if(E.status==="aborted"||G.status==="aborted")return f;if(E.status==="dirty"||G.status==="dirty")F.dirty();Q.set(E.value,G.value)}return{status:F.value,value:Q}}}}n3.create=(D,F,$)=>{return new n3({valueType:F,keyType:D,typeName:_.ZodMap,...p($)})};class U6 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==L.set)return I($,{code:C.invalid_type,expected:L.set,received:$.parsedType}),f;let B=this._def;if(B.minSize!==null){if($.data.size<B.minSize.value)I($,{code:C.too_small,minimum:B.minSize.value,type:"set",inclusive:!0,exact:!1,message:B.minSize.message}),F.dirty()}if(B.maxSize!==null){if($.data.size>B.maxSize.value)I($,{code:C.too_big,maximum:B.maxSize.value,type:"set",inclusive:!0,exact:!1,message:B.maxSize.message}),F.dirty()}let J=this._def.valueType;function Y(X){let E=new Set;for(let G of X){if(G.status==="aborted")return f;if(G.status==="dirty")F.dirty();E.add(G.value)}return{status:F.value,value:E}}let Q=[...$.data.values()].map((X,E)=>J._parse(new s0($,X,$.path,E)));if($.common.async)return Promise.all(Q).then((X)=>Y(X));else return Y(Q)}min(D,F){return new U6({...this._def,minSize:{value:D,message:k.toString(F)}})}max(D,F){return new U6({...this._def,maxSize:{value:D,message:k.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}}U6.create=(D,F)=>{return new U6({valueType:D,minSize:null,maxSize:null,typeName:_.ZodSet,...p(F)})};class p4 extends i{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==L.function)return I(F,{code:C.invalid_type,expected:L.function,received:F.parsedType}),f;function $(Q,X){return l3({data:Q,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,m4(),m1].filter((E)=>!!E),issueData:{code:C.invalid_arguments,argumentsError:X}})}function B(Q,X){return l3({data:Q,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,m4(),m1].filter((E)=>!!E),issueData:{code:C.invalid_return_type,returnTypeError:X}})}let J={errorMap:F.common.contextualErrorMap},Y=F.data;if(this._def.returns instanceof M6){let Q=this;return cD(async function(...X){let E=new E0([]),G=await Q._def.args.parseAsync(X,J).catch((K)=>{throw E.addIssue($(X,K)),E}),H=await Reflect.apply(Y,this,G);return await Q._def.returns._def.type.parseAsync(H,J).catch((K)=>{throw E.addIssue(B(H,K)),E})})}else{let Q=this;return cD(function(...X){let E=Q._def.args.safeParse(X,J);if(!E.success)throw new E0([$(X,E.error)]);let G=Reflect.apply(Y,this,E.data),H=Q._def.returns.safeParse(G,J);if(!H.success)throw new E0([B(G,H.error)]);return H.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new p4({...this._def,args:L1.create(D).rest(y8.create())})}returns(D){return new p4({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,$){return new p4({args:D?D:L1.create([]).rest(y8.create()),returns:F||y8.create(),typeName:_.ZodFunction,...p($)})}}class s4 extends i{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}}s4.create=(D,F)=>{return new s4({getter:D,typeName:_.ZodLazy,...p(F)})};class r4 extends i{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return I(F,{received:F.data,code:C.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:D.data}}get value(){return this._def.value}}r4.create=(D,F)=>{return new r4({value:D,typeName:_.ZodLiteral,...p(F)})};function Bk(D,F){return new _8({values:D,typeName:_.ZodEnum,...p(F)})}class _8 extends i{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),$=this._def.values;return I(F,{expected:r.joinValues($),received:F.parsedType,code:C.invalid_type}),f}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),$=this._def.values;return I(F,{received:F.data,code:C.invalid_enum_value,options:$}),f}return cD(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return _8.create(D,{...this._def,...F})}exclude(D,F=this._def){return _8.create(this.options.filter(($)=>!D.includes($)),{...this._def,...F})}}_8.create=Bk;class t4 extends i{_parse(D){let F=r.getValidEnumValues(this._def.values),$=this._getOrReturnCtx(D);if($.parsedType!==L.string&&$.parsedType!==L.number){let B=r.objectValues(F);return I($,{expected:r.joinValues(B),received:$.parsedType,code:C.invalid_type}),f}if(!this._cache)this._cache=new Set(r.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let B=r.objectValues(F);return I($,{received:$.data,code:C.invalid_enum_value,options:B}),f}return cD(D.data)}get enum(){return this._def.values}}t4.create=(D,F)=>{return new t4({values:D,typeName:_.ZodNativeEnum,...p(F)})};class M6 extends i{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==L.promise&&F.common.async===!1)return I(F,{code:C.invalid_type,expected:L.promise,received:F.parsedType}),f;let $=F.parsedType===L.promise?F.data:Promise.resolve(F.data);return cD($.then((B)=>{return this._def.type.parseAsync(B,{path:F.path,errorMap:F.common.contextualErrorMap})}))}}M6.create=(D,F)=>{return new M6({type:D,typeName:_.ZodPromise,...p(F)})};class r0 extends i{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:$}=this._processInputParams(D),B=this._def.effect||null,J={addIssue:(Y)=>{if(I($,Y),Y.fatal)F.abort();else F.dirty()},get path(){return $.path}};if(J.addIssue=J.addIssue.bind(J),B.type==="preprocess"){let Y=B.transform($.data,J);if($.common.async)return Promise.resolve(Y).then(async(Q)=>{if(F.value==="aborted")return f;let X=await this._def.schema._parseAsync({data:Q,path:$.path,parent:$});if(X.status==="aborted")return f;if(X.status==="dirty")return K6(X.value);if(F.value==="dirty")return K6(X.value);return X});else{if(F.value==="aborted")return f;let Q=this._def.schema._parseSync({data:Y,path:$.path,parent:$});if(Q.status==="aborted")return f;if(Q.status==="dirty")return K6(Q.value);if(F.value==="dirty")return K6(Q.value);return Q}}if(B.type==="refinement"){let Y=(Q)=>{let X=B.refinement(Q,J);if($.common.async)return Promise.resolve(X);if(X instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Q};if($.common.async===!1){let Q=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(Q.status==="aborted")return f;if(Q.status==="dirty")F.dirty();return Y(Q.value),{status:F.value,value:Q.value}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((Q)=>{if(Q.status==="aborted")return f;if(Q.status==="dirty")F.dirty();return Y(Q.value).then(()=>{return{status:F.value,value:Q.value}})})}if(B.type==="transform")if($.common.async===!1){let Y=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(!v8(Y))return f;let Q=B.transform(Y.value,J);if(Q instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:Q}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((Y)=>{if(!v8(Y))return f;return Promise.resolve(B.transform(Y.value,J)).then((Q)=>({status:F.value,value:Q}))});r.assertNever(B)}}r0.create=(D,F,$)=>{return new r0({schema:D,typeName:_.ZodEffects,effect:F,...p($)})};r0.createWithPreprocess=(D,F,$)=>{return new r0({schema:F,effect:{type:"preprocess",transform:D},typeName:_.ZodEffects,...p($)})};class o0 extends i{_parse(D){if(this._getType(D)===L.undefined)return cD(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}o0.create=(D,F)=>{return new o0({innerType:D,typeName:_.ZodOptional,...p(F)})};class d1 extends i{_parse(D){if(this._getType(D)===L.null)return cD(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}}d1.create=(D,F)=>{return new d1({innerType:D,typeName:_.ZodNullable,...p(F)})};class e4 extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;if(F.parsedType===L.undefined)$=this._def.defaultValue();return this._def.innerType._parse({data:$,path:F.path,parent:F})}removeDefault(){return this._def.innerType}}e4.create=(D,F)=>{return new e4({innerType:D,typeName:_.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...p(F)})};class DF extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$={...F,common:{...F.common,issues:[]}},B=this._def.innerType._parse({data:$.data,path:$.path,parent:{...$}});if(l4(B))return B.then((J)=>{return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new E0($.common.issues)},input:$.data})}});else return{status:"valid",value:B.status==="valid"?B.value:this._def.catchValue({get error(){return new E0($.common.issues)},input:$.data})}}removeCatch(){return this._def.innerType}}DF.create=(D,F)=>{return new DF({innerType:D,typeName:_.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...p(F)})};class i3 extends i{_parse(D){if(this._getType(D)!==L.nan){let $=this._getOrReturnCtx(D);return I($,{code:C.invalid_type,expected:L.nan,received:$.parsedType}),f}return{status:"valid",value:D.data}}}i3.create=(D)=>{return new i3({typeName:_.ZodNaN,...p(D)})};var vQD=Symbol("zod_brand");class a7 extends i{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;return this._def.type._parse({data:$,path:F.path,parent:F})}unwrap(){return this._def.type}}class a3 extends i{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.common.async)return(async()=>{let J=await this._def.in._parseAsync({data:$.data,path:$.path,parent:$});if(J.status==="aborted")return f;if(J.status==="dirty")return F.dirty(),K6(J.value);else return this._def.out._parseAsync({data:J.value,path:$.path,parent:$})})();else{let B=this._def.in._parseSync({data:$.data,path:$.path,parent:$});if(B.status==="aborted")return f;if(B.status==="dirty")return F.dirty(),{status:"dirty",value:B.value};else return this._def.out._parseSync({data:B.value,path:$.path,parent:$})}}static create(D,F){return new a3({in:D,out:F,typeName:_.ZodPipeline})}}class FF extends i{_parse(D){let F=this._def.innerType._parse(D),$=(B)=>{if(v8(B))B.value=Object.freeze(B.value);return B};return l4(F)?F.then((B)=>$(B)):$(F)}unwrap(){return this._def.innerType}}FF.create=(D,F)=>{return new FF({innerType:D,typeName:_.ZodReadonly,...p(F)})};function eS(D,F){let $=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof $==="string"?{message:$}:$}function Jk(D,F={},$){if(D)return A6.create().superRefine((B,J)=>{let Y=D(B);if(Y instanceof Promise)return Y.then((Q)=>{if(!Q){let X=eS(F,B),E=X.fatal??$??!0;J.addIssue({code:"custom",...X,fatal:E})}});if(!Y){let Q=eS(F,B),X=Q.fatal??$??!0;J.addIssue({code:"custom",...Q,fatal:X})}return});return A6.create()}var yQD={object:LD.lazycreate},_;(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(_||(_={}));var xQD=(D,F={message:`Input not instance of ${D.name}`})=>Jk(($)=>$ instanceof D,F),Yk=i0.create,Qk=x8.create,fQD=i3.create,_QD=f8.create,Xk=c4.create,hQD=V6.create,gQD=d3.create,uQD=n4.create,bQD=i4.create,mQD=A6.create,lQD=y8.create,dQD=C1.create,pQD=p3.create,cQD=a0.create,nQD=LD.create,iQD=LD.strictCreate,aQD=a4.create,oQD=i7.create,sQD=o4.create,rQD=L1.create,tQD=c3.create,eQD=n3.create,DXD=U6.create,FXD=p4.create,$XD=s4.create,BXD=r4.create,JXD=_8.create,YXD=t4.create,QXD=M6.create,XXD=r0.create,EXD=o0.create,GXD=d1.create,HXD=r0.createWithPreprocess,WXD=a3.create,qXD=()=>Yk().optional(),zXD=()=>Qk().optional(),KXD=()=>Xk().optional(),VXD={string:(D)=>i0.create({...D,coerce:!0}),number:(D)=>x8.create({...D,coerce:!0}),boolean:(D)=>c4.create({...D,coerce:!0}),bigint:(D)=>f8.create({...D,coerce:!0}),date:(D)=>V6.create({...D,coerce:!0})};var AXD=f;var NZD=p1.object({apiKey:p1.string().optional(),apiUrl:p1.string().url().default("https://api.osc.earth/nemar"),username:p1.string().optional(),email:p1.string().email().optional(),githubUsername:p1.string().optional()}),c1=new p7({projectName:"nemar",schema:{apiKey:{type:"string"},apiUrl:{type:"string",default:"https://api.osc.earth/nemar"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"}},...process.env.NEMAR_CONFIG_DIR?{cwd:process.env.NEMAR_CONFIG_DIR}:{}});function t0(){return{apiKey:c1.get("apiKey"),apiUrl:c1.get("apiUrl"),username:c1.get("username"),email:c1.get("email"),githubUsername:c1.get("githubUsername")}}function h8(D,F){c1.set(D,F)}function Ek(){c1.clear()}function R1(){return!!c1.get("apiKey")}function Gk(){return c1.path}var UXD="https://api.osc.earth/nemar";class TD extends Error{statusCode;details;constructor(D,F,$){super(F);this.statusCode=D;this.details=$;this.name="ApiError"}}function MXD(){return t0().apiUrl||UXD}async function V0(D,F={},$=!1){let B=`${MXD()}${D}`,J={"Content-Type":"application/json",...F.headers};if($){let X=t0();if(!X.apiKey)throw new TD(401,"Not authenticated. Run 'nemar auth login' first.");J.Authorization=`Bearer ${X.apiKey}`}let Y=await fetch(B,{...F,headers:J}),Q=await Y.json();if(!Y.ok)throw new TD(Y.status,Q.error||Q.message||"Request failed",Q.details);return Q}async function Hk(D){return V0("/auth/signup",{method:"POST",body:JSON.stringify(D)})}async function Wk(D){return V0("/auth/login",{method:"POST",body:JSON.stringify({api_key:D})})}async function qk(D){return V0("/auth/resend-verification",{method:"POST",body:JSON.stringify({email:D})})}async function zk(){return V0("/users/me",{},!0)}async function Kk(D){let F=D?`?status=${D}`:"";return V0(`/admin/users${F}`,{},!0)}async function Vk(D){return V0(`/admin/approve/${D}`,{method:"POST"},!0)}async function Ak(D){return V0(`/admin/revoke/${D}`,{method:"POST"},!0)}async function Uk(){return V0("/datasets")}async function $F(D){return V0(`/datasets/${D}`)}async function Mk(D){return V0("/datasets",{method:"POST",body:JSON.stringify(D)},!0)}async function Nk(D){return V0(`/datasets/${D}/finalize`,{method:"POST"},!0)}async function Zk(D,F){return V0(`/admin/datasets/${D}/doi/concept`,{method:"POST",body:JSON.stringify(F)},!0)}async function vX(D){return V0(`/admin/datasets/${D}/doi`,{},!0)}var{spawn:NXD}=globalThis.Bun;import{existsSync as Lk}from"fs";import{join as ZXD}from"path";async function YD(D,F={}){let $=NXD({cmd:D,cwd:F.cwd,stdout:"pipe",stderr:"pipe",env:{...process.env,...F.env}}),B=await new Response($.stdout).text(),J=await new Response($.stderr).text(),Y=await $.exited;return{stdout:B,stderr:J,exitCode:Y}}function Ck(D){return D.split(".").map((F)=>{let $=parseInt(F.replace(/[^0-9]/g,""),10);return isNaN($)?0:$})}function Rk(D,F){let $=Ck(D),B=Ck(F);for(let J=0;J<Math.max($.length,B.length);J++){let Y=$[J]||0,Q=B[J]||0;if(Y>Q)return!0;if(Y<Q)return!1}return!0}async function Ik(){try{let{stdout:F,exitCode:$}=await YD(["datalad","--version"]);if($!==0)return{installed:!1,minVersion:"0.19.0"};let B=F.match(/(\d+\.\d+\.\d+)/),J=B?B[1]:void 0;return{installed:!0,version:J,minVersion:"0.19.0",compatible:J?Rk(J,"0.19.0"):void 0}}catch{return{installed:!1,minVersion:"0.19.0"}}}async function Ok(){try{let{stdout:F,exitCode:$}=await YD(["git-annex","version"]);if($!==0)return{installed:!1,minVersion:"10.0"};let B=F.match(/version:\s*(\d+\.\d+)/),J=B?B[1]:void 0;return{installed:!0,version:J,minVersion:"10.0",compatible:J?Rk(J,"10.0"):void 0}}catch{return{installed:!1,minVersion:"10.0"}}}async function CXD(){if(process.env.GH_TOKEN)return{accessible:!0,username:"token-auth",useHttps:!0};try{let{stdout:D,stderr:F,exitCode:$}=await YD(["ssh","-T","-o","BatchMode=yes","-o","StrictHostKeyChecking=accept-new","git@github.com"],{timeout:1e4}),B=D+F,J=B.match(/Hi ([^!]+)!/);if(J)return{accessible:!0,username:J[1]};if(B.includes("Permission denied"))return{accessible:!1};return{accessible:B.includes("successfully authenticated")}}catch{return{accessible:!1}}}async function LXD(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY)return{configured:!0,source:"environment"};try{let{stdout:D,exitCode:F}=await YD(["aws","configure","get","aws_access_key_id"]);if(F===0&&D.trim())return{configured:!0,source:"aws-cli"}}catch{}return{configured:!1}}async function Tk(){let[D,F,$,B]=await Promise.all([Ik(),Ok(),CXD(),LXD()]),J=[];if(!D.installed)J.push("DataLad is not installed. Install: pip install datalad");else if(D.compatible===!1)J.push(`DataLad version ${D.version} is too old. Required: >= ${D.minVersion}`);if(!F.installed)J.push("git-annex is not installed. Install: brew install git-annex (macOS) or apt install git-annex (Linux)");else if(F.compatible===!1)J.push(`git-annex version ${F.version} is too old. Required: >= ${F.minVersion}`);if(!$.accessible)J.push("GitHub SSH access not configured. Add your SSH key to GitHub: https://github.com/settings/keys");if(!B.configured)J.push("AWS credentials not found. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables");return{datalad:D,gitAnnex:F,githubSSH:$,awsCredentials:B,allPassed:J.length===0,errors:J}}async function yX(D){if(Lk(ZXD(D,".datalad")))return!0;try{let{exitCode:F}=await YD(["datalad","status"],{cwd:D});return F===0}catch{return!1}}async function Pk(D,F={}){if(!F.force&&await yX(D))return{success:!0};try{let{stderr:$,exitCode:B}=await YD(["datalad","create","--force",D]);if(B!==0)return{success:!1,error:$.trim()||"Failed to create DataLad dataset"};return{success:!0}}catch($){return{success:!1,error:$.message}}}async function wk(D,F){let B=F||"include=*.edf or include=*.bdf or include=*.set or include=*.fif or include=*.vhdr or include=*.eeg or include=*.cnt or include=*.fdt or largerthan=100kb";try{let{stderr:J,exitCode:Y}=await YD(["git","annex","config","--set","annex.largefiles",B],{cwd:D});if(Y!==0)return{success:!1,error:J.trim()||"Failed to configure largefiles"};return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function jk(D,F,$){let B=["git","annex","initremote",F.name,"type=S3","encryption=none",`bucket=${F.bucket}`,`fileprefix=${F.prefix}/`,`datacenter=${F.region}`,"signature=v4"];if(F.publicUrl)B.push(`publicurl=${F.publicUrl}`);try{let{stderr:J,exitCode:Y}=await YD(B,{cwd:D,env:{AWS_ACCESS_KEY_ID:$.accessKeyId,AWS_SECRET_ACCESS_KEY:$.secretAccessKey}});if(Y!==0){if(J.includes("already exists")){let Q=await YD(["git","annex","enableremote",F.name],{cwd:D,env:{AWS_ACCESS_KEY_ID:$.accessKeyId,AWS_SECRET_ACCESS_KEY:$.secretAccessKey}});if(Q.exitCode===0)return{success:!0};return{success:!1,error:Q.stderr.trim()}}return{success:!1,error:J.trim()||"Failed to configure S3 remote"}}return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function Sk(D,F,$="origin"){let B=F;if(process.env.GH_TOKEN&&F.startsWith("git@github.com:")){let J=F.match(/git@github\.com:(.+)/);if(J)B=`https://${process.env.GH_TOKEN}@github.com/${J[1]}`}try{let{stdout:J}=await YD(["git","remote","get-url",$],{cwd:D});if(J.trim()){let{stderr:Y,exitCode:Q}=await YD(["git","remote","set-url",$,B],{cwd:D});if(Q!==0)return{success:!1,error:Y.trim()}}else{let{stderr:Y,exitCode:Q}=await YD(["git","remote","add",$,B],{cwd:D});if(Q!==0)return{success:!1,error:Y.trim()}}return{success:!0}}catch{let{stderr:J,exitCode:Y}=await YD(["git","remote","add",$,B],{cwd:D});if(Y!==0)return{success:!1,error:J.trim()};return{success:!0}}}async function kk(D,F){try{let{stderr:$,exitCode:B}=await YD(["datalad","save","-m",F],{cwd:D});if(B!==0){if($.includes("nothing to save")||$.includes("no changes"))return{success:!0};return{success:!1,error:$.trim()||"Failed to save dataset"}}return{success:!0}}catch($){return{success:!1,error:$.message}}}async function vk(D,F,$){let B=$.jobs||8;try{let{stdout:J,stderr:Y,exitCode:Q}=await YD(["git","annex","copy","--to",F,"-J",B.toString(),"."],{cwd:D,env:{AWS_ACCESS_KEY_ID:$.credentials.accessKeyId,AWS_SECRET_ACCESS_KEY:$.credentials.secretAccessKey}});if(Q!==0)return{success:!1,error:Y.trim()||"Failed to push data to S3"};let X=J.match(/copy .+ ok/g);return{success:!0,filesUploaded:X?X.length:0}}catch(J){return{success:!1,error:J.message}}}async function yk(D,F="origin",$="main"){try{let{stderr:B,exitCode:J}=await YD(["git","push","-u",F,$],{cwd:D});if(J!==0)return{success:!1,error:B.trim()||"Failed to push to GitHub"};let{stderr:Y,exitCode:Q}=await YD(["git","push",F,"git-annex"],{cwd:D});if(Q!==0)console.warn("Warning: Could not push git-annex branch:",Y.trim());return{success:!0}}catch(B){return{success:!1,error:B.message}}}async function xk(D){try{let{stdout:B,exitCode:J}=await YD(["git","annex","info","--json"],{cwd:D});if(J===0){let Y=JSON.parse(B);return{totalFiles:Y["local annex keys"]||0,totalSize:Y["local annex size"]||0,annexedFiles:Y["local annex keys"]||0,annexedSize:Y["local annex size"]||0}}}catch{}let{stdout:F}=await YD(["find",D,"-type","f"],{cwd:D});return{totalFiles:F.trim().split(`
|
|
92
92
|
`).filter(Boolean).length,totalSize:0,annexedFiles:0,annexedSize:0}}function fk(D){if(D===0)return"0 B";let F=1024,$=["B","KB","MB","GB","TB"],B=Math.floor(Math.log(D)/Math.log(F));return`${parseFloat((D/Math.pow(F,B)).toFixed(2))} ${$[B]}`}async function o7(){let[D,F]=await Promise.all([Ik(),Ok()]),$=[];if(!D.installed)$.push("DataLad is not installed. Install: pip install datalad");else if(D.compatible===!1)$.push(`DataLad version ${D.version} is too old. Required: >= ${D.minVersion}`);if(!F.installed)$.push("git-annex is not installed. Install: brew install git-annex (macOS) or apt install git-annex (Linux)");else if(F.compatible===!1)$.push(`git-annex version ${F.version} is too old. Required: >= ${F.minVersion}`);return{datalad:D,gitAnnex:F,allPassed:$.length===0,errors:$}}async function s7(D,F){try{let{stderr:$,exitCode:B}=await YD(["datalad","clone",D,F]);if(B!==0)return{success:!1,error:$.trim()||"Failed to clone dataset"};return{success:!0}}catch($){return{success:!1,error:$.message}}}async function _k(D,F={}){let $=F.jobs||4,B=F.paths&&F.paths.length>0?F.paths:["."];try{let J=["datalad","get","-J",$.toString(),...B],{stdout:Y,stderr:Q,exitCode:X}=await YD(J,{cwd:D});if(X!==0)return{success:!1,error:Q.trim()||"Failed to get dataset data"};let E=Y.match(/get\(ok\):/g);return{success:!0,filesDownloaded:E?E.length:0}}catch(J){return{success:!1,error:J.message}}}async function hk(D){if(!Lk(D))return null;try{let{stdout:F,exitCode:$}=await YD(["git","annex","info","--json"],{cwd:D});if($===0){let B=JSON.parse(F),J=0,Y=B["local annex size"]||"0 bytes",Q=Y.match(/([\d.]+)\s*(bytes?|KB|MB|GB|TB)/i);if(Q){let G=parseFloat(Q[1]),H=Q[2].toLowerCase();J=G*({byte:1,bytes:1,kb:1024,mb:1048576,gb:1073741824,tb:1099511627776}[H]||1)}let X=B["annexed files in working tree"]||0,E=B["local annex keys"]||0;return{files:X,size:Y,sizeBytes:J,annexedFiles:X,presentFiles:E,missingFiles:X-E}}}catch{}try{let{stdout:F}=await YD(["find",".","-type","f","-not","-path","./.git/*"],{cwd:D}),$=F.trim().split(`
|
|
93
93
|
`).filter(Boolean).length;return{files:$,size:"unknown",sizeBytes:0,annexedFiles:0,presentFiles:$,missingFiles:0}}catch{return null}}async function gk(D){try{let{stdout:F,exitCode:$}=await YD(["git","tag","-l","--sort=-version:refname","--format=%(refname:short)|%(creatordate:short)|%(objectname:short)"],{cwd:D});if($!==0||!F.trim())return[];return F.trim().split(`
|
|
94
94
|
`).map((B)=>{let[J,Y,Q]=B.split("|");return{version:J,date:Y,commit:Q}})}catch{return[]}}async function uk(D,F){try{let $=F.startsWith("v")?F:`v${F}`,{stdout:B,exitCode:J}=await YD(["git","rev-parse",$],{cwd:D});if(J!==0)return null;return B.trim()}catch{return null}}async function bk(D,F,$){try{let{stderr:B,exitCode:J}=await YD(["git","checkout","-b",$],{cwd:D});if(J!==0)return{success:!1,error:B.trim()||"Failed to create branch"};let Y=F.startsWith("v")?F:`v${F}`,{stderr:Q,exitCode:X}=await YD(["git","checkout",Y,"--","."],{cwd:D});if(X!==0)return{success:!1,error:Q.trim()||"Failed to checkout files from target version"};return{success:!0}}catch(B){return{success:!1,error:B.message}}}async function mk(D,F,$){let B=$||`Revert to ${F}`;try{let{exitCode:J}=await YD(["git","add","-A"],{cwd:D});if(J!==0)return{success:!1,error:"Failed to stage changes"};let{stdout:Y}=await YD(["git","status","--porcelain"],{cwd:D});if(!Y.trim())return{success:!1,error:"No changes to revert (already at target version)"};let{stderr:Q,exitCode:X}=await YD(["git","commit","-m",B],{cwd:D});if(X!==0)return{success:!1,error:Q.trim()||"Failed to commit"};return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function lk(D,F,$="origin"){try{let{stderr:B,exitCode:J}=await YD(["git","push","-u",$,F],{cwd:D});if(J!==0)return{success:!1,error:B.trim()||"Failed to push branch"};return{success:!0}}catch(B){return{success:!1,error:B.message}}}var N6=new T1("admin").description("Admin commands (requires admin privileges)").addHelpText("after",`
|