nemar-cli 0.10.18 → 0.10.19-PR1769.33c3f33
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 +7 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ ${Vn.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)kS(this.rl,th
|
|
|
81
81
|
${t}`,eIe,tIe,rIe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=Q6e.bind(null,n,t.toString());Object.defineProperty(i,"name",tIe);let{writable:o,enumerable:s,configurable:a}=eIe;Object.defineProperty(e,"toString",{value:i,writable:o,enumerable:s,configurable:a})};var C1=I(()=>{eIe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),tIe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var wy,A7=(e,t={})=>{if(typeof e!=="function")throw TypeError("Expected a function");let r,n=0,i=e.displayName||e.name||"<anonymous>",o=function(...s){if(wy.set(o,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return r};return cm(o,e),wy.set(o,n),o},O7;var T7=I(()=>{C1();wy=new WeakMap;A7.callCount=(e)=>{if(!wy.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return wy.get(e)};O7=A7});var El;var F7=I(()=>{El=[];El.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")El.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")El.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class P7{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(A1[R1])return A1[R1];nIe(A1,R1,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],n=r.indexOf(t);if(n===-1)return;if(n===0&&r.length===1)r.length=0;else r.splice(n,1)}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let i of this.listeners[e])n=i(t,r)===!0||n;if(e==="exit")n=this.emit("afterExit",t,r)||n;return n}}class T1{}var vy=(e)=>!!e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function",R1,A1,nIe,iIe=(e)=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),I7,N7,O1,j7,zbt,Vbt;var M7=I(()=>{F7();R1=Symbol.for("signal-exit emitter"),A1=globalThis,nIe=Object.defineProperty.bind(Object);I7=class I7 extends T1{onExit(){return()=>{}}load(){}unload(){}};N7=class N7 extends T1{#r=O1.platform==="win32"?"SIGINT":"SIGHUP";#t=new P7;#e;#i;#f;#n={};#s=!1;constructor(e){super();this.#e=e,this.#n={};for(let t of El)this.#n[t]=()=>{let r=this.#e.listeners(t),{count:n}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==="object"&&typeof i.__signal_exit_emitter__.count==="number")n+=i.__signal_exit_emitter__.count;if(r.length===n){this.unload();let o=this.#t.emit("exit",null,t),s=t==="SIGHUP"?this.#r:t;if(!o)e.kill(e.pid,s)}};this.#f=e.reallyExit,this.#i=e.emit}onExit(e,t){if(!vy(this.#e))return()=>{};if(this.#s===!1)this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{if(this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0)this.unload()}}load(){if(this.#s)return;this.#s=!0,this.#t.count+=1;for(let e of El)try{let t=this.#n[e];if(t)this.#e.on(e,t)}catch(t){}this.#e.emit=(e,...t)=>this.#p(e,...t),this.#e.reallyExit=(e)=>this.#o(e)}unload(){if(!this.#s)return;this.#s=!1,El.forEach((e)=>{let t=this.#n[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,t)}catch(r){}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#f,this.#t.count-=1}#o(e){if(!vy(this.#e))return 0;return this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)}#p(e,...t){let r=this.#i;if(e==="exit"&&vy(this.#e)){if(typeof t[0]==="number")this.#e.exitCode=t[0];let n=r.call(this.#e,e,...t);return this.#t.emit("exit",this.#e.exitCode,null),n}else return r.call(this.#e,e,...t)}};O1=globalThis.process,{onExit:j7,load:zbt,unload:Vbt}=iIe(vy(O1)?new N7(O1):new I7)});import _y from"process";var q7,oIe,L7;var B7=I(()=>{T7();M7();q7=_y.stderr.isTTY?_y.stderr:_y.stdout.isTTY?_y.stdout:void 0,oIe=q7?O7(()=>{j7(()=>{q7.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},L7=oIe});import U7 from"process";var Dy=!1,xd,F1;var z7=I(()=>{B7();xd={};xd.show=(e=U7.stderr)=>{if(!e.isTTY)return;Dy=!1,e.write("\x1B[?25h")};xd.hide=(e=U7.stderr)=>{if(!e.isTTY)return;L7(),Dy=!0,e.write("\x1B[?25l")};xd.toggle=(e,t)=>{if(e!==void 0)Dy=e;if(Dy)xd.show(t);else xd.hide(t)};F1=xd});import Ki from"process";function P1(){if(Ki.platform!=="win32")return Ki.env.TERM!=="linux";return Boolean(Ki.env.CI)||Boolean(Ki.env.WT_SESSION)||Boolean(Ki.env.TERMINUS_SUBLIME)||Ki.env.ConEmuTask==="{cmd::Cmder}"||Ki.env.TERM_PROGRAM==="Terminus-Sublime"||Ki.env.TERM_PROGRAM==="vscode"||Ki.env.TERM==="xterm-256color"||Ki.env.TERM==="alacritty"||Ki.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var V7=()=>{};var sIe,aIe,cIe,lm;var H7=I(()=>{Ze();V7();sIe={info:l.blue("\u2139"),success:l.green("\u2714"),warning:l.yellow("\u26A0"),error:l.red("\u2716")},aIe={info:l.blue("i"),success:l.green("\u221A"),warning:l.yellow("\u203C"),error:l.red("\xD7")},cIe=P1()?sIe:aIe,lm=cIe});function I1({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}function um(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(lIe,"")}var lIe;var N1=I(()=>{lIe=I1()});function G7(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function W7(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function K7(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var J7=()=>{};function uIe(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Y7(e,{ambiguousAsWide:t=!1}={}){if(uIe(e),W7(e)||K7(e)||t&&G7(e))return 2;return 1}var X7=I(()=>{J7()});var Z7=()=>/[#*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;function j1(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(!n)e=um(e);if(e.length===0)return 0;let i=0,o={ambiguousAsWide:!r};for(let{segment:s}of dIe.segment(e)){let a=s.codePointAt(0);if(a<=31||a>=127&&a<=159)continue;if(a>=8203&&a<=8207||a===65279)continue;if(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)continue;if(a>=55296&&a<=57343)continue;if(a>=65024&&a<=65039)continue;if(fIe.test(s))continue;if(Z7().test(s)){i+=2;continue}i+=Y7(a,o)}return i}var dIe,fIe;var Q7=I(()=>{N1();X7();dIe=new Intl.Segmenter,fIe=/^\p{Default_Ignorable_Code_Point}$/u});function M1({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import eU from"process";function q1(){let{env:e}=eU,{TERM:t,TERM_PROGRAM:r}=e;if(eU.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var tU=()=>{};import So from"process";class rU{#r=0;start(){if(this.#r++,this.#r===1)this.#t()}stop(){if(this.#r<=0)throw Error("`stop` called more times than `start`");if(this.#r--,this.#r===0)this.#e()}#t(){if(So.platform==="win32"||!So.stdin.isTTY)return;So.stdin.setRawMode(!0),So.stdin.on("data",this.#i),So.stdin.resume()}#e(){if(!So.stdin.isTTY)return;So.stdin.off("data",this.#i),So.stdin.pause(),So.stdin.setRawMode(!1)}#i(e){if(e[0]===pIe)So.emit("SIGINT")}}var pIe=3,mIe,L1;var nU=I(()=>{mIe=new rU,L1=mIe});import Ey from"process";class iU{#r=0;#t=!1;#e=0;#i=-1;#f=0;#n;#s;#o;#p;#h;#l;#u;#d;#g;#a;#c;color;constructor(e){if(typeof e==="string")e={text:e};if(this.#n={color:"cyan",stream:Ey.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#n.color,this.spinner=this.#n.spinner,this.#h=this.#n.interval,this.#o=this.#n.stream,this.#l=typeof this.#n.isEnabled==="boolean"?this.#n.isEnabled:M1({stream:this.#o}),this.#u=typeof this.#n.isSilent==="boolean"?this.#n.isSilent:!1,this.text=this.#n.text,this.prefixText=this.#n.prefixText,this.suffixText=this.#n.suffixText,this.indent=this.#n.indent,Ey.env.NODE_ENV==="test")this._stream=this.#o,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#r},set(t){this.#r=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#i}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}})}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#m()}get interval(){return this.#h??this.#s.interval??100}get spinner(){return this.#s}set spinner(e){if(this.#i=-1,this.#h=void 0,typeof e==="object"){if(e.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#s=e}else if(!q1())this.#s=dm.default.line;else if(e===void 0)this.#s=dm.default.dots;else if(e!=="default"&&dm.default[e])this.#s=dm.default[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#m()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#m()}get suffixText(){return this.#c}set suffixText(e=""){this.#c=e,this.#m()}get isSpinning(){return this.#p!==void 0}#y(e=this.#a,t=" "){if(typeof e==="string"&&e!=="")return e+t;if(typeof e==="function")return e()+t;return""}#b(e=this.#c,t=" "){if(typeof e==="string"&&e!=="")return t+e;if(typeof e==="function")return t+e();return""}#m(){let e=this.#o.columns??80,t=this.#y(this.#a,"-"),r=this.#b(this.#c,"-"),n=" ".repeat(this.#d)+t+"--"+this.#g+"--"+r;this.#e=0;for(let i of um(n).split(`
|
|
82
82
|
`))this.#e+=Math.max(1,Math.ceil(j1(i,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#l&&!this.#u}set isEnabled(e){if(typeof e!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let e=Date.now();if(this.#i===-1||e-this.#f>=this.interval)this.#i=++this.#i%this.#s.frames.length,this.#f=e;let{frames:t}=this.#s,r=t[this.#i];if(this.color)r=l[this.color](r);let n=typeof this.#a==="string"&&this.#a!==""?this.#a+" ":"",i=typeof this.text==="string"?" "+this.text:"",o=typeof this.#c==="string"&&this.#c!==""?" "+this.#c:"";return n+r+i+o}clear(){if(!this.#l||!this.#o.isTTY)return this;this.#o.cursorTo(0);for(let e=0;e<this.#r;e++){if(e>0)this.#o.moveCursor(0,-1);this.#o.clearLine(1)}if(this.#d||this.lastIndent!==this.#d)this.#o.cursorTo(this.#d);return this.lastIndent=this.#d,this.#r=0,this}render(){if(this.#u)return this;return this.clear(),this.#o.write(this.frame()),this.#r=this.#e,this}start(e){if(e)this.text=e;if(this.#u)return this;if(!this.#l){if(this.text)this.#o.write(`- ${this.text}
|
|
83
83
|
`);return this}if(this.isSpinning)return this;if(this.#n.hideCursor)F1.hide(this.#o);if(this.#n.discardStdin&&Ey.stdin.isTTY)this.#t=!0,L1.start();return this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#l)return this;if(clearInterval(this.#p),this.#p=void 0,this.#i=0,this.clear(),this.#n.hideCursor)F1.show(this.#o);if(this.#n.discardStdin&&Ey.stdin.isTTY&&this.#t)L1.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:lm.success,text:e})}fail(e){return this.stopAndPersist({symbol:lm.error,text:e})}warn(e){return this.stopAndPersist({symbol:lm.warning,text:e})}info(e){return this.stopAndPersist({symbol:lm.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let t=e.prefixText??this.#a,r=this.#y(t," "),n=e.symbol??" ",i=e.text??this.text,s=typeof i==="string"?(n?" ":"")+i:"",a=e.suffixText??this.#c,c=this.#b(a," "),u=r+n+s+c+`
|
|
84
|
-
`;return this.stop(),this.#o.write(u),this}}function S(e){return new iU(e)}var dm,hIe;var Jn=I(()=>{Ze();z7();H7();N1();Q7();tU();nU();dm=Me(x0(),1),hIe=Me(x0(),1)});var ot,aU,ie,Is=(e)=>{switch(typeof e){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return Number.isNaN(e)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":if(Array.isArray(e))return ie.array;if(e===null)return ie.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return ie.promise;if(typeof Map<"u"&&e instanceof Map)return ie.map;if(typeof Set<"u"&&e instanceof Set)return ie.set;if(typeof Date<"u"&&e instanceof Date)return ie.date;return ie.object;default:return ie.unknown}};var fm=I(()=>{(function(e){e.assertEqual=(i)=>{};function t(i){}e.assertIs=t;function r(i){throw Error()}e.assertNever=r,e.arrayToEnum=(i)=>{let o={};for(let s of i)o[s]=s;return o},e.getValidEnumValues=(i)=>{let o=e.objectKeys(i).filter((a)=>typeof i[i[a]]!=="number"),s={};for(let a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=(i)=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys==="function"?(i)=>Object.keys(i):(i)=>{let o=[];for(let s in i)if(Object.prototype.hasOwnProperty.call(i,s))o.push(s);return o},e.find=(i,o)=>{for(let s of i)if(o(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(i)=>Number.isInteger(i):(i)=>typeof i==="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map((s)=>typeof s==="string"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>{if(typeof o==="bigint")return o.toString();return o}})(ot||(ot={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(aU||(aU={}));ie=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var G,Yn;var Sy=I(()=>{fm();G=ot.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"]);Yn=class Yn extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},r={_errors:[]},n=(i)=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let s=r,a=0;while(a<o.path.length){let c=o.path[a];if(a!==o.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o));s=s[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof Yn))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};Yn.create=(e)=>new Yn(e)});var gIe=(e,t)=>{let r;switch(e.code){case G.invalid_type:if(e.received===ie.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ot.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:r=`Unrecognized key(s) in object: ${ot.joinValues(e.keys,", ")}`;break;case G.invalid_union:r="Invalid input";break;case G.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ot.joinValues(e.options)}`;break;case G.invalid_enum_value:r=`Invalid enum value. Expected ${ot.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:r="Invalid function arguments";break;case G.invalid_return_type:r="Invalid function return type";break;case G.invalid_date:r="Invalid date";break;case G.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else ot.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case G.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case G.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case G.custom:r="Invalid input";break;case G.invalid_intersection_types:r="Intersection results could not be merged";break;case G.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:r="Number must be finite";break;default:r=t.defaultError,ot.assertNever(e)}return{message:r}},Va;var B1=I(()=>{Sy();fm();Va=gIe});function pm(){return yIe}var yIe;var $y=I(()=>{B1();yIe=Va});function ee(e,t){let r=pm(),n=ky({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Va?void 0:Va].filter((i)=>!!i)});e.common.issues.push(n)}class rn{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return Ae;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let i=await n.key,o=await n.value;r.push({key:i,value:o})}return rn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:i,value:o}=n;if(i.status==="aborted")return Ae;if(o.status==="aborted")return Ae;if(i.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet))r[i.value]=o.value}return{status:e.value,value:r}}}var ky=(e)=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},Ae,wd=(e)=>({status:"dirty",value:e}),hn=(e)=>({status:"valid",value:e}),U1=(e)=>e.status==="aborted",z1=(e)=>e.status==="dirty",Sl=(e)=>e.status==="valid",mm=(e)=>typeof Promise<"u"&&e instanceof Promise;var V1=I(()=>{$y();B1();Ae=Object.freeze({status:"aborted"})});var cU=()=>{};var be;var lU=I(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(be||(be={}))});class Ji{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}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}}function ze(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:i};return{errorMap:(s,a)=>{let{message:c}=e;if(s.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(s.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:i}}class et{get description(){return this._def.description}_getType(e){return Is(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Is(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rn,ctx:{common:e.parent.common,data:e.data,parsedType:Is(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(mm(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Is(e)},n=this._parseSync({data:e,path:r.path,parent:r});return uU(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Is(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Sl(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>Sl(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Is(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await(mm(n)?n:Promise.resolve(n));return uU(r,i)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,i)=>{let o=e(n),s=()=>i.addIssue({code:G.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((a)=>{if(!a)return s(),!1;else return!0});if(!o)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new Co({schema:this,typeName:Oe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:(t)=>this["~validate"](t)}}optional(){return ko.create(this,this._def)}nullable(){return Ha.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $o.create(this)}promise(){return Sd.create(this,this._def)}or(e){return xm.create([this,e],this._def)}and(e){return wm.create(this,e,this._def)}transform(e){return new Co({...ze(this._def),schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Em({...ze(this._def),innerType:this,defaultValue:t,typeName:Oe.ZodDefault})}brand(){return new K1({typeName:Oe.ZodBranded,type:this,...ze(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Sm({...ze(this._def),innerType:this,catchValue:t,typeName:Oe.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Iy.create(this,e)}readonly(){return $m.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function fU(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function PIe(e){return new RegExp(`^${fU(e)}$`)}function IIe(e){let t=`${dU}T${fU(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function NIe(e,t){if((t==="v4"||!t)&&kIe.test(e))return!0;if((t==="v6"||!t)&&RIe.test(e))return!0;return!1}function jIe(e,t){if(!DIe.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if(typeof i!=="object"||i===null)return!1;if("typ"in i&&i?.typ!=="JWT")return!1;if(!i.alg)return!1;if(t&&i.alg!==t)return!1;return!0}catch{return!1}}function MIe(e,t){if((t==="v4"||!t)&&CIe.test(e))return!0;if((t==="v6"||!t)&&AIe.test(e))return!0;return!1}function qIe(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}function vd(e){if(e instanceof nr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ko.create(vd(n))}return new nr({...e._def,shape:()=>t})}else if(e instanceof $o)return new $o({...e._def,type:vd(e.element)});else if(e instanceof ko)return ko.create(vd(e.unwrap()));else if(e instanceof Ha)return Ha.create(vd(e.unwrap()));else if(e instanceof qs)return qs.create(e.items.map((t)=>vd(t)));else return e}function G1(e,t){let r=Is(e),n=Is(t);if(e===t)return{valid:!0,data:e};else if(r===ie.object&&n===ie.object){let i=ot.objectKeys(t),o=ot.objectKeys(e).filter((a)=>i.indexOf(a)!==-1),s={...e,...t};for(let a of o){let c=G1(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===ie.array&&n===ie.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],c=G1(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else if(r===ie.date&&n===ie.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function pU(e,t){return new kl({values:e,typeName:Oe.ZodEnum,...ze(t)})}var uU=(e,t)=>{if(Sl(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Yn(e.common.issues);return this._error=r,this._error}}}},bIe,xIe,wIe,vIe,_Ie,DIe,EIe,SIe,$Ie="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",H1,kIe,CIe,RIe,AIe,OIe,TIe,dU="((\\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])))",FIe,js,_d,Dd,Cy,gm,Ry,ym,bm,Ay,$l,Ms,Oy,$o,nr,xm,Ns=(e)=>{if(e instanceof vm)return Ns(e.schema);else if(e instanceof Co)return Ns(e.innerType());else if(e instanceof _m)return[e.value];else if(e instanceof kl)return e.options;else if(e instanceof Dm)return ot.objectValues(e.enum);else if(e instanceof Em)return Ns(e._def.innerType);else if(e instanceof ym)return[void 0];else if(e instanceof bm)return[null];else if(e instanceof ko)return[void 0,...Ns(e.unwrap())];else if(e instanceof Ha)return[null,...Ns(e.unwrap())];else if(e instanceof K1)return Ns(e.unwrap());else if(e instanceof $m)return Ns(e.unwrap());else if(e instanceof Sm)return Ns(e._def.innerType);else return[]},W1,wm,qs,Ty,Fy,Ed,hm,vm,_m,kl,Dm,Sd,Co,ko,Ha,Em,Sm,Py,Jxt,K1,Iy,$m,Yxt,Oe,_,R,Xxt,Zxt,je,Qxt,ewt,twt,rwt,nwt,Ga,iwt,owt,le,K,swt,$d,J1,awt,cwt,yi,lwt,uwt,dwt,fwt,ut,yt,pwt,mwt,hwt,gwt,ywt,bwt,xwt;var mU=I(()=>{Sy();$y();lU();V1();fm();bIe=/^c[^\s-]{8,}$/i,xIe=/^[0-9a-z]+$/,wIe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vIe=/^[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,_Ie=/^[a-z0-9_-]{21}$/i,DIe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,EIe=/^[-+]?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)?)??$/,SIe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kIe=/^(?:(?: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])$/,CIe=/^(?:(?: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])$/,RIe=/^(([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]))$/,AIe=/^(([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])$/,OIe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TIe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,FIe=new RegExp(`^${dU}$`);js=class js extends et{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==ie.string){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_type,expected:ie.string,received:i.parsedType}),Ae}let r=new rn,n=void 0;for(let i of this._def.checks)if(i.kind==="min"){if(e.data.length<i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty()}else if(i.kind==="max"){if(e.data.length>i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty()}else if(i.kind==="length"){let o=e.data.length>i.value,s=e.data.length<i.value;if(o||s){if(n=this._getOrReturnCtx(e,n),o)ee(n,{code:G.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message});else if(s)ee(n,{code:G.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message});r.dirty()}}else if(i.kind==="email"){if(!SIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"email",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="emoji"){if(!H1)H1=new RegExp($Ie,"u");if(!H1.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"emoji",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="uuid"){if(!vIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"uuid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="nanoid"){if(!_Ie.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"nanoid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="cuid"){if(!bIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"cuid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="cuid2"){if(!xIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"cuid2",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="ulid"){if(!wIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"ulid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ee(n,{validation:"url",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="regex"){if(i.regex.lastIndex=0,!i.regex.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"regex",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="trim")e.data=e.data.trim();else if(i.kind==="includes"){if(!e.data.includes(i.value,i.position))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()}else if(i.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(i.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(i.kind==="startsWith"){if(!e.data.startsWith(i.value))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()}else if(i.kind==="endsWith"){if(!e.data.endsWith(i.value))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()}else if(i.kind==="datetime"){if(!IIe(i).test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:"datetime",message:i.message}),r.dirty()}else if(i.kind==="date"){if(!FIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:"date",message:i.message}),r.dirty()}else if(i.kind==="time"){if(!PIe(i).test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:"time",message:i.message}),r.dirty()}else if(i.kind==="duration"){if(!EIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"duration",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="ip"){if(!NIe(e.data,i.version))n=this._getOrReturnCtx(e,n),ee(n,{validation:"ip",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="jwt"){if(!jIe(e.data,i.alg))n=this._getOrReturnCtx(e,n),ee(n,{validation:"jwt",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="cidr"){if(!MIe(e.data,i.version))n=this._getOrReturnCtx(e,n),ee(n,{validation:"cidr",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="base64"){if(!OIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"base64",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="base64url"){if(!TIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"base64url",code:G.invalid_string,message:i.message}),r.dirty()}else ot.assertNever(i);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:G.invalid_string,...be.errToObj(r)})}_addCheck(e){return new js({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...be.errToObj(e)})}url(e){return this._addCheck({kind:"url",...be.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...be.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...be.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...be.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...be.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...be.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...be.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...be.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...be.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...be.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...be.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...be.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...be.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...be.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...be.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...be.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...be.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...be.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...be.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...be.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...be.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...be.errToObj(t)})}nonempty(e){return this.min(1,be.errToObj(e))}trim(){return new js({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new js({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new js({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};js.create=(e)=>new js({checks:[],typeName:Oe.ZodString,coerce:e?.coerce??!1,...ze(e)});_d=class _d extends et{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==ie.number){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_type,expected:ie.number,received:i.parsedType}),Ae}let r=void 0,n=new rn;for(let i of this._def.checks)if(i.kind==="int"){if(!ot.isInteger(e.data))r=this._getOrReturnCtx(e,r),ee(r,{code:G.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()}else if(i.kind==="min"){if(i.inclusive?e.data<i.value:e.data<=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()}else if(i.kind==="max"){if(i.inclusive?e.data>i.value:e.data>=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()}else if(i.kind==="multipleOf"){if(qIe(e.data,i.value)!==0)r=this._getOrReturnCtx(e,r),ee(r,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()}else if(i.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),ee(r,{code:G.not_finite,message:i.message}),n.dirty()}else ot.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,be.toString(t))}gt(e,t){return this.setLimit("min",e,!1,be.toString(t))}lte(e,t){return this.setLimit("max",e,!0,be.toString(t))}lt(e,t){return this.setLimit("max",e,!1,be.toString(t))}setLimit(e,t,r,n){return new _d({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:be.toString(n)}]})}_addCheck(e){return new _d({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:be.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:be.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:be.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:be.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:be.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:be.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:be.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:be.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:be.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&ot.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};_d.create=(e)=>new _d({checks:[],typeName:Oe.ZodNumber,coerce:e?.coerce||!1,...ze(e)});Dd=class Dd extends et{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ie.bigint)return this._getInvalidInput(e);let r=void 0,n=new rn;for(let i of this._def.checks)if(i.kind==="min"){if(i.inclusive?e.data<i.value:e.data<=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()}else if(i.kind==="max"){if(i.inclusive?e.data>i.value:e.data>=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()}else if(i.kind==="multipleOf"){if(e.data%i.value!==BigInt(0))r=this._getOrReturnCtx(e,r),ee(r,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()}else ot.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ie.bigint,received:t.parsedType}),Ae}gte(e,t){return this.setLimit("min",e,!0,be.toString(t))}gt(e,t){return this.setLimit("min",e,!1,be.toString(t))}lte(e,t){return this.setLimit("max",e,!0,be.toString(t))}lt(e,t){return this.setLimit("max",e,!1,be.toString(t))}setLimit(e,t,r,n){return new Dd({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:be.toString(n)}]})}_addCheck(e){return new Dd({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:be.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:be.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:be.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:be.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:be.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Dd.create=(e)=>new Dd({checks:[],typeName:Oe.ZodBigInt,coerce:e?.coerce??!1,...ze(e)});Cy=class Cy extends et{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==ie.boolean){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.boolean,received:r.parsedType}),Ae}return hn(e.data)}};Cy.create=(e)=>new Cy({typeName:Oe.ZodBoolean,coerce:e?.coerce||!1,...ze(e)});gm=class gm extends et{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==ie.date){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_type,expected:ie.date,received:i.parsedType}),Ae}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_date}),Ae}let r=new rn,n=void 0;for(let i of this._def.checks)if(i.kind==="min"){if(e.data.getTime()<i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()}else if(i.kind==="max"){if(e.data.getTime()>i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()}else ot.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new gm({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:be.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:be.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};gm.create=(e)=>new gm({checks:[],coerce:e?.coerce||!1,typeName:Oe.ZodDate,...ze(e)});Ry=class Ry extends et{_parse(e){if(this._getType(e)!==ie.symbol){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.symbol,received:r.parsedType}),Ae}return hn(e.data)}};Ry.create=(e)=>new Ry({typeName:Oe.ZodSymbol,...ze(e)});ym=class ym extends et{_parse(e){if(this._getType(e)!==ie.undefined){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.undefined,received:r.parsedType}),Ae}return hn(e.data)}};ym.create=(e)=>new ym({typeName:Oe.ZodUndefined,...ze(e)});bm=class bm extends et{_parse(e){if(this._getType(e)!==ie.null){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.null,received:r.parsedType}),Ae}return hn(e.data)}};bm.create=(e)=>new bm({typeName:Oe.ZodNull,...ze(e)});Ay=class Ay extends et{constructor(){super(...arguments);this._any=!0}_parse(e){return hn(e.data)}};Ay.create=(e)=>new Ay({typeName:Oe.ZodAny,...ze(e)});$l=class $l extends et{constructor(){super(...arguments);this._unknown=!0}_parse(e){return hn(e.data)}};$l.create=(e)=>new $l({typeName:Oe.ZodUnknown,...ze(e)});Ms=class Ms extends et{_parse(e){let t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ie.never,received:t.parsedType}),Ae}};Ms.create=(e)=>new Ms({typeName:Oe.ZodNever,...ze(e)});Oy=class Oy extends et{_parse(e){if(this._getType(e)!==ie.undefined){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.void,received:r.parsedType}),Ae}return hn(e.data)}};Oy.create=(e)=>new Oy({typeName:Oe.ZodVoid,...ze(e)});$o=class $o extends et{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==ie.array)return ee(t,{code:G.invalid_type,expected:ie.array,received:t.parsedType}),Ae;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;if(o||s)ee(t,{code:o?G.too_big:G.too_small,minimum:s?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)ee(t,{code:G.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)ee(t,{code:G.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,s)=>n.type._parseAsync(new Ji(t,o,t.path,s)))).then((o)=>rn.mergeArray(r,o));let i=[...t.data].map((o,s)=>n.type._parseSync(new Ji(t,o,t.path,s)));return rn.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new $o({...this._def,minLength:{value:e,message:be.toString(t)}})}max(e,t){return new $o({...this._def,maxLength:{value:e,message:be.toString(t)}})}length(e,t){return new $o({...this._def,exactLength:{value:e,message:be.toString(t)}})}nonempty(e){return this.min(1,e)}};$o.create=(e,t)=>new $o({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Oe.ZodArray,...ze(t)});nr=class nr extends et{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=ot.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ie.object){let c=this._getOrReturnCtx(e);return ee(c,{code:G.invalid_type,expected:ie.object,received:c.parsedType}),Ae}let{status:r,ctx:n}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ms&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))s.push(c)}let a=[];for(let c of o){let u=i[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Ji(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Ms){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(s.length>0)ee(n,{code:G.unrecognized_keys,keys:s}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Ji(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then((c)=>rn.mergeObjectSync(r,c));else return rn.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return be.errToObj,new nr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:be.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new nr({...this._def,unknownKeys:"strip"})}passthrough(){return new nr({...this._def,unknownKeys:"passthrough"})}extend(e){return new nr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Oe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new nr({...this._def,catchall:e})}pick(e){let t={};for(let r of ot.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new nr({...this._def,shape:()=>t})}omit(e){let t={};for(let r of ot.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new nr({...this._def,shape:()=>t})}deepPartial(){return vd(this)}partial(e){let t={};for(let r of ot.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new nr({...this._def,shape:()=>t})}required(e){let t={};for(let r of ot.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];while(i instanceof ko)i=i._def.innerType;t[r]=i}return new nr({...this._def,shape:()=>t})}keyof(){return pU(ot.objectKeys(this.shape))}};nr.create=(e,t)=>new nr({shape:()=>e,unknownKeys:"strip",catchall:Ms.create(),typeName:Oe.ZodObject,...ze(t)});nr.strictCreate=(e,t)=>new nr({shape:()=>e,unknownKeys:"strict",catchall:Ms.create(),typeName:Oe.ZodObject,...ze(t)});nr.lazycreate=(e,t)=>new nr({shape:e,unknownKeys:"strip",catchall:Ms.create(),typeName:Oe.ZodObject,...ze(t)});xm=class xm extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map((s)=>new Yn(s.ctx.common.issues));return ee(t,{code:G.invalid_union,unionErrors:o}),Ae}if(t.common.async)return Promise.all(r.map(async(i)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);else{let i=void 0,o=[];for(let a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!i)i={result:u,ctx:c};if(c.common.issues.length)o.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((a)=>new Yn(a));return ee(t,{code:G.invalid_union,unionErrors:s}),Ae}}get options(){return this._def.options}};xm.create=(e,t)=>new xm({options:e,typeName:Oe.ZodUnion,...ze(t)});W1=class W1 extends et{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ie.object)return ee(t,{code:G.invalid_type,expected:ie.object,received:t.parsedType}),Ae;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);if(!i)return ee(t,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ae;if(t.common.async)return i._parseAsync({data:t.data,path:t.path,parent:t});else return i._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let i of t){let o=Ns(i.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,i)}}return new W1({typeName:Oe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...ze(r)})}};wm=class wm extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(i,o)=>{if(U1(i)||U1(o))return Ae;let s=G1(i.value,o.value);if(!s.valid)return ee(r,{code:G.invalid_intersection_types}),Ae;if(z1(i)||z1(o))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>n(i,o));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};wm.create=(e,t,r)=>new wm({left:e,right:t,typeName:Oe.ZodIntersection,...ze(r)});qs=class qs extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.array)return ee(r,{code:G.invalid_type,expected:ie.array,received:r.parsedType}),Ae;if(r.data.length<this._def.items.length)return ee(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ae;if(!this._def.rest&&r.data.length>this._def.items.length)ee(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let i=[...r.data].map((o,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Ji(r,o,r.path,s))}).filter((o)=>!!o);if(r.common.async)return Promise.all(i).then((o)=>rn.mergeArray(t,o));else return rn.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new qs({...this._def,rest:e})}};qs.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new qs({items:e,typeName:Oe.ZodTuple,rest:null,...ze(t)})};Ty=class Ty extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.object)return ee(r,{code:G.invalid_type,expected:ie.object,received:r.parsedType}),Ae;let n=[],i=this._def.keyType,o=this._def.valueType;for(let s in r.data)n.push({key:i._parse(new Ji(r,s,r.path,s)),value:o._parse(new Ji(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return rn.mergeObjectAsync(t,n);else return rn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof et)return new Ty({keyType:e,valueType:t,typeName:Oe.ZodRecord,...ze(r)});return new Ty({keyType:js.create(),valueType:e,typeName:Oe.ZodRecord,...ze(t)})}};Fy=class Fy extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.map)return ee(r,{code:G.invalid_type,expected:ie.map,received:r.parsedType}),Ae;let n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,a],c)=>({key:n._parse(new Ji(r,s,r.path,[c,"key"])),value:i._parse(new Ji(r,a,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of o){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return Ae;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let a of o){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return Ae;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}}}};Fy.create=(e,t,r)=>new Fy({valueType:t,keyType:e,typeName:Oe.ZodMap,...ze(r)});Ed=class Ed extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.set)return ee(r,{code:G.invalid_type,expected:ie.set,received:r.parsedType}),Ae;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)ee(r,{code:G.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)ee(r,{code:G.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let i=this._def.valueType;function o(a){let c=new Set;for(let u of a){if(u.status==="aborted")return Ae;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let s=[...r.data.values()].map((a,c)=>i._parse(new Ji(r,a,r.path,c)));if(r.common.async)return Promise.all(s).then((a)=>o(a));else return o(s)}min(e,t){return new Ed({...this._def,minSize:{value:e,message:be.toString(t)}})}max(e,t){return new Ed({...this._def,maxSize:{value:e,message:be.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ed.create=(e,t)=>new Ed({valueType:e,minSize:null,maxSize:null,typeName:Oe.ZodSet,...ze(t)});hm=class hm extends et{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ie.function)return ee(t,{code:G.invalid_type,expected:ie.function,received:t.parsedType}),Ae;function r(s,a){return ky({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pm(),Va].filter((c)=>!!c),issueData:{code:G.invalid_arguments,argumentsError:a}})}function n(s,a){return ky({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pm(),Va].filter((c)=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:a}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Sd){let s=this;return hn(async function(...a){let c=new Yn([]),u=await s._def.args.parseAsync(a,i).catch((m)=>{throw c.addIssue(r(a,m)),c}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,i).catch((m)=>{throw c.addIssue(n(d,m)),c})})}else{let s=this;return hn(function(...a){let c=s._def.args.safeParse(a,i);if(!c.success)throw new Yn([r(a,c.error)]);let u=Reflect.apply(o,this,c.data),d=s._def.returns.safeParse(u,i);if(!d.success)throw new Yn([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new hm({...this._def,args:qs.create(e).rest($l.create())})}returns(e){return new hm({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new hm({args:e?e:qs.create([]).rest($l.create()),returns:t||$l.create(),typeName:Oe.ZodFunction,...ze(r)})}};vm=class vm extends et{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};vm.create=(e,t)=>new vm({getter:e,typeName:Oe.ZodLazy,...ze(t)});_m=class _m extends et{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return ee(t,{received:t.data,code:G.invalid_literal,expected:this._def.value}),Ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};_m.create=(e,t)=>new _m({value:e,typeName:Oe.ZodLiteral,...ze(t)});kl=class kl extends et{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return ee(t,{expected:ot.joinValues(r),received:t.parsedType,code:G.invalid_type}),Ae}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return ee(t,{received:t.data,code:G.invalid_enum_value,options:r}),Ae}return hn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return kl.create(e,{...this._def,...t})}exclude(e,t=this._def){return kl.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};kl.create=pU;Dm=class Dm extends et{_parse(e){let t=ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ie.string&&r.parsedType!==ie.number){let n=ot.objectValues(t);return ee(r,{expected:ot.joinValues(n),received:r.parsedType,code:G.invalid_type}),Ae}if(!this._cache)this._cache=new Set(ot.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=ot.objectValues(t);return ee(r,{received:r.data,code:G.invalid_enum_value,options:n}),Ae}return hn(e.data)}get enum(){return this._def.values}};Dm.create=(e,t)=>new Dm({values:e,typeName:Oe.ZodNativeEnum,...ze(t)});Sd=class Sd extends et{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ie.promise&&t.common.async===!1)return ee(t,{code:G.invalid_type,expected:ie.promise,received:t.parsedType}),Ae;let r=t.parsedType===ie.promise?t.data:Promise.resolve(t.data);return hn(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Sd.create=(e,t)=>new Sd({type:e,typeName:Oe.ZodPromise,...ze(t)});Co=class Co extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:(o)=>{if(ee(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){let o=n.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async(s)=>{if(t.value==="aborted")return Ae;let a=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(a.status==="aborted")return Ae;if(a.status==="dirty")return wd(a.value);if(t.value==="dirty")return wd(a.value);return a});else{if(t.value==="aborted")return Ae;let s=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(s.status==="aborted")return Ae;if(s.status==="dirty")return wd(s.value);if(t.value==="dirty")return wd(s.value);return s}}if(n.type==="refinement"){let o=(s)=>{let a=n.refinement(s,i);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return Ae;if(s.status==="dirty")t.dirty();return o(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return Ae;if(s.status==="dirty")t.dirty();return o(s.value).then(()=>({status:t.value,value:s.value}))})}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Sl(o))return Ae;let s=n.transform(o.value,i);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!Sl(o))return Ae;return Promise.resolve(n.transform(o.value,i)).then((s)=>({status:t.value,value:s}))});ot.assertNever(n)}};Co.create=(e,t,r)=>new Co({schema:e,typeName:Oe.ZodEffects,effect:t,...ze(r)});Co.createWithPreprocess=(e,t,r)=>new Co({schema:t,effect:{type:"preprocess",transform:e},typeName:Oe.ZodEffects,...ze(r)});ko=class ko extends et{_parse(e){if(this._getType(e)===ie.undefined)return hn(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ko.create=(e,t)=>new ko({innerType:e,typeName:Oe.ZodOptional,...ze(t)});Ha=class Ha extends et{_parse(e){if(this._getType(e)===ie.null)return hn(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ha.create=(e,t)=>new Ha({innerType:e,typeName:Oe.ZodNullable,...ze(t)});Em=class Em extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===ie.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Em.create=(e,t)=>new Em({innerType:e,typeName:Oe.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ze(t)});Sm=class Sm extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(mm(n))return n.then((i)=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Sm.create=(e,t)=>new Sm({innerType:e,typeName:Oe.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ze(t)});Py=class Py extends et{_parse(e){if(this._getType(e)!==ie.nan){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.nan,received:r.parsedType}),Ae}return{status:"valid",value:e.data}}};Py.create=(e)=>new Py({typeName:Oe.ZodNaN,...ze(e)});Jxt=Symbol("zod_brand");K1=class K1 extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};Iy=class Iy extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return Ae;if(i.status==="dirty")return t.dirty(),wd(i.value);else return this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return Ae;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new Iy({in:e,out:t,typeName:Oe.ZodPipeline})}};$m=class $m extends et{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(Sl(n))n.value=Object.freeze(n.value);return n};return mm(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};$m.create=(e,t)=>new $m({innerType:e,typeName:Oe.ZodReadonly,...ze(t)});Yxt={object:nr.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Oe||(Oe={}));_=js.create,R=_d.create,Xxt=Py.create,Zxt=Dd.create,je=Cy.create,Qxt=gm.create,ewt=Ry.create,twt=ym.create,rwt=bm.create,nwt=Ay.create,Ga=$l.create,iwt=Ms.create,owt=Oy.create,le=$o.create,K=nr.create,swt=nr.strictCreate,$d=xm.create,J1=W1.create,awt=wm.create,cwt=qs.create,yi=Ty.create,lwt=Fy.create,uwt=Ed.create,dwt=hm.create,fwt=vm.create,ut=_m.create,yt=kl.create,pwt=Dm.create,mwt=Sd.create,hwt=Co.create,gwt=ko.create,ywt=Ha.create,bwt=Co.createWithPreprocess,xwt=Iy.create});var Y1=I(()=>{$y();V1();cU();fm();mU();Sy()});var On=I(()=>{Y1();Y1()});function X1(e){return Ny.includes(e)}var LIe,Cl,Ny,hU,BIe,gU,UIe,yU,zIe,VIe,bU,HIe,xU,Awt,Owt,wU,GIe,vU,WIe,_U,Z1=20,Q1=500,KIe,Twt;var kd=I(()=>{On();LIe=yt(["pending","verified","approved","revoked"]),Cl=yt(["person","service","test"]),Ny=Cl.options;hU={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},BIe=yt(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),gU=BIe.options,UIe=yt(["active","pending","revoked"]),yU=K({field:_(),blocks:le(_()).optional(),set_on:le(_()).optional()}).passthrough(),zIe=K({id:R().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:R().int().optional(),sandbox_completed:je().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:je().optional(),status:LIe.optional(),email_verified:je().optional(),orcid_verified:je().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:le(yU).optional(),username_auto_assigned:je().optional(),account_kind:Cl.optional()}).passthrough(),VIe=K({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),bU=K({user:zIe,token:VIe.optional()}).passthrough(),HIe=K({id:R().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:R().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),orcid:_().nullable().optional(),upload_access_requested_at:_().nullable().optional(),account_kind:Cl.optional(),matched_in:le(_()).optional(),match_kind:_().optional()}).passthrough(),xU=K({users:le(HIe),count:R().int()}).passthrough(),Awt=yt(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),Owt=yt(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),wU=K({suggestion:_().nullable(),based_on:yt(["name","unavailable","exhausted"])}).passthrough(),GIe=yt(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),vU=GIe.options,WIe=yt(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),_U=WIe.options,KIe=K({id:R().int(),email:_(),username:_().nullable(),role:_(),status:UIe,email_verified:je(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:je(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:je(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:le(yU),username_auto_assigned:je()}).passthrough(),Twt=K({user:KIe.nullable()}).passthrough()});var e$,t$,Nwt,JIe,jwt,YIe,DU,EU,r$=8,n$=100,SU,$U,XIe,kU;var km=I(()=>{On();kd();e$=["given_name","family_name","affiliation","city","country"],t$=["username","github_username","email"],Nwt=[...e$,...t$],JIe={given_name:_().max(200).optional(),family_name:_().max(200).optional(),affiliation:_().max(500).optional(),city:_().max(200).optional(),country:_().max(200).optional(),username:_().max(100).optional(),github_username:_().max(100).optional(),email:_().max(320).optional()},jwt=K(JIe),YIe=yt(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","invalid_search","invalid_user_id"]),DU=YIe.options,EU=["exact","name","prefix","substring","fuzzy"],SU=K({id:R().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Cl.optional(),email_verified:R().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:R().int().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),description:_().nullable().optional(),signup_source:_().nullable().optional(),created_at:_(),updated_at:_().nullable().optional(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),deleted_at:_().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:R().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),identity_conflict:R().int().nullable().optional(),username_auto_assigned:R().int().nullable().optional(),sandbox_completed:R().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:R().int().optional(),active_tokens:R().int().optional(),linked_identities:le(_()).optional()}).passthrough(),$U=K({user:SU}).passthrough(),XIe=K({from:_().nullable(),to:_().nullable()}),kU=K({message:_(),changed:yi(_(),XIe),notes:le(_()).optional(),old_address_notified:je().optional(),user:SU}).passthrough()});function eNe(e){return e.startsWith("v")?e:`v${e}`}var ZIe,QIe,CU,Lwt;var i$=I(()=>{On();ZIe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,QIe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;CU=_().regex(ZIe,"must be a semver version, optionally v-prefixed").transform(eNe),Lwt=_().regex(QIe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function AU(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:G.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function OU(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:G.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var tNe="0.4.1",o$,Cd,RU,rNe,nNe,iNe,TU,Vwt,FU,Hwt,Ls,oNe,jy,Gwt,sNe,aNe,Wwt;var s$=I(()=>{On();i$();o$=yt(["openneuro","nemar","gin","other"]),Cd=$d([ut(0),ut(1)]).nullable(),RU=K({dataset_id:_(),id:_().optional(),name:_(),description:_().nullable().optional(),status:_(),visibility:_(),anonymous:R().int().nullable().optional(),concept_doi:_().nullable().optional(),doi:_().nullable().optional(),created_at:_(),updated_at:_().optional(),first_published_at:_().nullable().optional(),owner_username:_().nullable().optional(),source:_().nullable().optional(),modalities:_().optional(),participants:R().int().nonnegative(),tasks:_().optional(),authors:_().optional(),license:_().optional(),file_size:R().nonnegative(),file_size_formatted:_().optional(),total_files:R().nonnegative().nullable().optional(),num_citations:R().int().nonnegative().optional(),n_channels:R().int().nullable().optional(),electrode_system:_().nullable().optional(),has_hed:Cd.optional(),hed_version:_().nullable().optional(),data_complete:Cd.optional(),bytes_present:R().nonnegative().nullable().optional(),latest_version:CU.nullable().optional(),latest_version_at:_().nullable().optional(),subject_count:R().int().nullable().optional(),file_size_bytes:R().nullable().optional(),sessions_count:R().int().nullable().optional(),age_min:R().nullable().optional(),age_max:R().nullable().optional(),bids_version:_().nullable().optional(),zarr_status:yt(["pending","ready","failed"]).nullable().optional(),zarr_store_count:R().int().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:R().int().nullable().optional(),zarr_failure_count:R().int().nullable().optional(),zarr_deterministic:Cd.optional(),zarr_failed_at:_().nullable().optional(),zarr_index_url:_().nullable().optional(),zarr_verify_status:yt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),zarr_requeue_at:_().nullable().optional(),anonymity_status:yt(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:_().nullable().optional(),anonymity_findings:_().nullable().optional(),anonymity_unchecked:_().nullable().optional(),total_recording_duration:R().nullable().optional(),recording_duration_min:R().nullable().optional(),recording_duration_max:R().nullable().optional(),recording_count:R().int().nullable().optional(),recordings_unavailable:R().int().nullable().optional(),channel_count_min:R().int().nullable().optional(),channel_count_max:R().int().nullable().optional(),sampling_frequency:R().nullable().optional(),power_line_frequency:R().nullable().optional(),eeg_reference:_().nullable().optional(),placement_scheme:_().nullable().optional()}).passthrough();rNe=RU.superRefine((e,t)=>{AU(e,t),OU(e,t)}),nNe=RU.extend({file_size:R().nonnegative().nullable(),file_size_formatted:_().nullable().optional(),modalities:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),license:_().nullable().optional(),owner_github:_().nullable().optional(),attestation_deposit_type:yt(["owner","redistribution"]).nullable().optional(),attestation_key_status:yt(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Cd.optional(),attestation_no_duplicate:Cd.optional(),attestation_upstream_source:_().nullable().optional(),attestation_accepted_at:_().nullable().optional(),zarr_data_failures:K({count:R().int().nonnegative(),detail_ref:_(),compacted_by:_().optional(),pending:R().int().nonnegative().optional(),discovered:R().int().nonnegative().optional(),events_upload_failed:ut(!0).optional(),manifest_upload_failed:ut(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{AU(e,t),OU(e,t)}),iNe=K({id:_(),name:_(),modalities:_().nullable().optional(),participants:R().int().nullable().optional(),doi:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),has_hed:Cd.optional(),score:R().optional(),snippet:_().optional()}).passthrough(),TU=yi(_(),R().int().nonnegative()),Vwt=K({datasets:le(rNe),count:R().int().nonnegative(),total_count:R().int().nonnegative().optional(),limit:R().int().optional(),offset:R().int().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:TU.optional()}).passthrough(),FU=K({results:le(iNe),count:R().int().nonnegative(),returned:R().int().nonnegative().optional(),offset:R().int().nonnegative().optional(),limit:R().int().optional(),candidate_ceiling:R().int().optional(),truncated:je().optional(),method:yt(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:R().optional(),warning:_().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:TU.optional()}).passthrough(),Hwt=K({dataset:nNe}).passthrough(),Ls=K({value:_(),count:R().int().nonnegative()}),oNe=K({values:le(Ls),distinct_total:R().int().nonnegative(),truncated:je()}),jy=K({"electrode-system":le(Ls).optional(),source:le(Ls).optional(),zarr:le(Ls).optional(),powerline:le(Ls).optional(),"bids-version":le(Ls).optional(),"hed-version":le(Ls).optional(),license:le(Ls).optional(),modality:le(Ls).optional(),task:oNe.optional(),warning:_().optional()}).passthrough(),Gwt=K({schema_version:ut(tNe),doc_type:ut("dataset"),dataset_id:_().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:_(),source:o$,recording_modality:le(_()).min(1),description:_().nullable().optional(),bids_version:_().nullable().optional(),license:_().nullable().optional()}).passthrough(),sNe=K({tasks:yi(K({runs:le(_())}).passthrough())}).passthrough(),aNe=K({sessions:le(_()),modalities:yi(sNe),session_modalities:yi(le(_())).optional()}).passthrough(),Wwt=K({version:_(),subjects:yi(aNe)}).passthrough()});function My(e){return typeof e==="string"&&PU.includes(e)}var cNe,Ywt,Xwt,Zwt,PU,lNe="ci_check_unavailable",IU,NU,Qwt;var qy=I(()=>{On();cNe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Ywt=_().regex(cNe,"ORCID must be in format 0000-0000-0000-000X"),Xwt=yt(["found","no_public_name","lookup_failed"]),Zwt=yt(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),PU=["bids_validation_pending","bids_validation_in_progress"];IU=[lNe],NU=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Qwt=yt(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var uNe,jU,Cm="https://nemar.org/settings",rvt,dNe,fNe,pNe,MU,qU;var a$=I(()=>{On();uNe=yt(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),jU=uNe.options,rvt={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Cm}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Cm}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Cm}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${Cm}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${Cm}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},dNe=yt(["orcid","email","github"]),fNe=K({id:R().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:je(),dataset_count:R().int(),identity_conflict:R().int(),canonical:je()}).passthrough(),pNe=K({kind:dNe,value:_(),canonical_user_id:R().int(),accounts:le(fNe)}).passthrough(),MU=K({groups:le(pNe),group_count:R().int(),flagged_count:R().int()}).passthrough(),qU=K({ok:ut(!0),id:R().int(),cleared:je()}).passthrough()});var c$=120,LU=64,l$="unnamed machine",mNe=25,Ly,BU,Rd,UU,ovt,svt,zU,hNe,gNe,VU,u$,HU,avt,cvt,By,Uy;var zy=I(()=>{On();Ly=yt(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),BU={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},Rd=yt(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),UU=Rd.options,ovt={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${mNe} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},svt=K({error:Rd,message:_()}).passthrough(),zU=K({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:R().int(),interval:R().int()}).passthrough(),hNe=J1("error",[K({error:ut("authorization_pending"),message:_()}).passthrough(),K({error:ut("slow_down"),message:_()}).passthrough()]),gNe=J1("error",[K({error:ut("expired_token"),reason:Rd,message:_()}).passthrough(),K({error:ut("access_denied"),reason:Rd,message:_()}).passthrough(),K({error:ut("invalid_grant"),reason:Rd,message:_()}).passthrough()]),VU=$d([hNe,gNe]),u$=K({id:R().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:je()}).passthrough(),HU=K({api_key:_(),key:u$,user:K({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:je(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),avt=K({user_code:_(),machine_name:_(),requested_at:_(),expires_in:R().int(),account:K({username:_().nullable(),email_masked:_()}).passthrough(),refusal:K({code:Rd,message:_()}).passthrough().nullable()}).passthrough(),cvt=K({ok:ut(!0),machine_name:_()}).passthrough(),By=K({keys:le(u$)}).passthrough(),Uy=K({api_key:_(),key:u$}).passthrough()});function xr(e){return ir[e]}function Bs(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var ir;var Ad=I(()=>{ir={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading needs one extra grant: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function bNe(e){return e==="verified"||e==="upload_access"||e==="publication"}function Od(e){return(e??"").trim().length===0}function xNe(e){return e==="service"||e==="test"}function KU(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Vy,e)?Vy[e]:void 0;if(!n)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:ir["gap.set_on.default_web"],setOnCli:null,known:!1};let i=r&&n.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??n.blocks,label:ir[n.labelKey],setOnWeb:ir[i?n.orcidWebKey:n.webKey],setOnCli:i||n.cliKey===null?null:ir[n.cliKey],known:!0}}function GU(e){let t=d$.indexOf(e);return t===-1?d$.length:t}function JU(e,t={}){return e.map((r)=>KU(r,{orcidVerified:t.orcidVerified}))}function Hy(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(bNe):[];return KU(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>GU(r.field)-GU(n.field))}function f$(e){let t=e.blocks[0],r=t?ir[yNe[t]]:ir["gap.blocks.unknown"],n=Bs(ir["gap.sentence"],{label:"",blocks:r}).trimStart(),i=e.setOnCli?Bs(ir["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):Bs(ir["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${i}`}function YU(e){return`${e.label} ${f$(e)}`}function Gy(){let e=Bs(ir["gap.sentence"],{label:WU.label,blocks:ir["cli.gap.blocks.sandbox"]}),t=Bs(ir["cli.gap.set_on.cli_only"],{cli:WU.command});return`${e} ${t}`}function XU(){return ir["cli.gaps.sandbox_unchecked"]}var Vy,d$,fvt,yNe,WU;var Td=I(()=>{Ad();Vy={email_verified:{blocks:["verified","upload_access"],labelKey:"gap.field.email_verified.label",webKey:"gap.field.email_verified.set_on.web",cliKey:"gap.field.email_verified.set_on.cli",isMissing:(e)=>e.status==="pending"||e.email_verified===!1},username:{blocks:["upload_access"],labelKey:"gap.field.username.label",webKey:"gap.field.username.set_on.web",cliKey:"gap.field.username.set_on.cli",isMissing:(e)=>e.username!==void 0&&Od(e.username)},given_name:{blocks:["upload_access","publication"],labelKey:"gap.field.given_name.label",webKey:"gap.field.given_name.set_on.web",cliKey:"gap.field.given_name.set_on.cli",orcidWebKey:"gap.field.given_name.set_on.web.orcid",isMissing:(e)=>Od(e.given_name)},family_name:{blocks:["upload_access","publication"],labelKey:"gap.field.family_name.label",webKey:"gap.field.family_name.set_on.web",cliKey:"gap.field.family_name.set_on.cli",orcidWebKey:"gap.field.family_name.set_on.web.orcid",isMissing:(e)=>Od(e.family_name)},orcid_verified:{blocks:["upload_access"],labelKey:"gap.field.orcid_verified.label",webKey:"gap.field.orcid_verified.set_on.web",cliKey:"gap.field.orcid_verified.set_on.cli",isMissing:(e)=>e.orcid_verified!==!0&&!xNe(e.account_kind)},github_username:{blocks:["upload_access","publication"],labelKey:"gap.field.github_username.label",webKey:"gap.field.github_username.set_on.web",cliKey:"gap.field.github_username.set_on.cli",isMissing:(e)=>Od(e.github_username)},city:{blocks:["upload_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>Od(e.city)},country:{blocks:["upload_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>Od(e.country)},why:{blocks:["upload_access"],labelKey:"gap.field.why.label",webKey:"gap.field.why.set_on.web",cliKey:"gap.field.why.set_on.cli",isMissing:null}},d$=Object.keys(Vy),fvt=d$.filter((e)=>Vy[e].isMissing!==null),yNe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};WU={field:"sandbox",label:ir["cli.gap.field.sandbox.label"],command:ir["cli.gap.field.sandbox.set_on.cli"]}});function Yy(e,t){let r=e.sss!==void 0;if(e.derived!==r)t.addIssue({code:G.custom,path:["sss"],message:e.derived?"derived is true but sss is absent (ADR 0028: the two travel together)":"sss is present but derived is false (ADR 0028: the two travel together)"})}var gn,Wy,ZU,Ky,wNe,Jy,vNe,_Ne,DNe,ENe,SNe,hvt,$Ne,gvt,kNe,yvt;var p$=I(()=>{On();gn=/^[a-z]{2}[0-9]{6}$/,Wy=/^[0-9a-f]{40}$/,ZU=K({name:_(),modality:_().nullable().optional(),rate:R().nullable().optional(),n_channels:R().int().nonnegative().nullable().optional(),n_samples:R().int().nonnegative().nullable().optional(),duration_s:R().nonnegative().nullable().optional(),source_rate_hz:R().nullable().optional(),n_view_levels:R().int().nonnegative().optional(),view_chunk_columns:R().int().positive().optional(),chunk_samples:R().int().positive().optional(),shard_samples:R().int().positive().optional()}).passthrough(),Ky=K({converted:R().int().nonnegative().optional(),relabelled:R().int().nonnegative().optional(),kept_importer_unit:R().int().nonnegative().optional(),units_column_present:je().optional(),sidecar:_().optional(),sidecar_supplied:je().optional(),unmatched_channels:R().int().nonnegative().optional(),unmatched_case_only:R().int().positive().optional(),matched_case_only:R().int().positive().optional(),matched_case_only_examples:le(_()).max(5).optional(),unmatched_raw_label:R().int().positive().optional(),unmatched_examples:le(_()).max(5).optional()}).passthrough(),wNe=K({channels_tsv:R().int().positive(),in_file:R().int().nonnegative(),in_store:R().int().nonnegative()}).passthrough(),Jy=K({applied:je().optional(),method:_().optional(),calibration:_().optional(),cross_talk:_().optional(),mne_version:_().optional()}).passthrough();vNe=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),updated_utc:_().optional(),source_tree:ut("raw"),derived:je(),modalities:le(_()).optional(),groups:le(ZU).optional(),power_line_frequency:R().nullable().optional(),event_description_count:R().int().nonnegative().optional(),n_events:R().int().nonnegative().optional(),trial_types:yi(_(),R().int().nonnegative()).optional(),units_report:Ky.optional(),channels_tsv_read_error:je().optional(),channels_tsv_count_mismatch:wNe.optional(),split_members:le(_()).optional(),sss:Jy.optional()}).passthrough().superRefine(Yy),_Ne=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr").optional(),code:_(),reason:_(),detail:_().nullable().optional(),attempts:R().int().nonnegative().optional()}).passthrough(),DNe=yt(["infra_failure","memory_budget","not_attempted"]),ENe=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),reason:DNe,attempts:R().int().nonnegative(),last_error:_().nullable().optional(),last_attempt_utc:_().nullable().optional()}).passthrough(),SNe=K({level0:ut("<zarr>/<group>/0"),view:ut("<zarr>/<group>/view/<L>"),view_levels:ut("1..n_view_levels from the group attrs"),scale_offset:ut("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ut("<data_base>events.parquet").optional()}).passthrough(),hvt=K({format:ut("nemar-zarr-index"),format_version:ut(3),dataset_id:_().regex(gn,"NEMAR dataset id (nm/on/xx band)"),contract_base:_().regex(/^https:\/\//,"must be https"),data_base:_().regex(/^https:\/\//,"must be https"),data_base_kind:ut("s3-public"),s3_uri:_().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:_().min(1),s3_anonymous:je(),source_commit:_().regex(Wy,"must be a full 40-hex SHA"),engine_version:_().min(1),biosigio_version:_().nullable().optional(),updated_utc:_(),discovered_count:R().int().nonnegative(),store_count:R().int().nonnegative(),n_recordings:R().int().nonnegative(),errors:R().int().nonnegative(),failure_count:R().int().nonnegative(),pending_count:R().int().nonnegative(),stores:le(vNe),failures:le(_Ne),pending:le(ENe),doi:_().nullable().optional(),license:_().nullable().optional(),citation:_().nullable().optional(),hed_version:_().nullable().optional(),events_parquet:_().regex(/^https:\/\//,"must be https").optional(),events_row_count:R().int().nonnegative().optional(),layout:SNe}).passthrough(),$Ne=K({name:_(),configuration:yi(_(),Ga()).optional()}).passthrough(),gvt=K({zarr_format:ut(3),node_type:ut("array"),shape:le(R().int().nonnegative()),data_type:_(),chunk_grid:K({name:_(),configuration:yi(_(),Ga()).optional()}).passthrough(),codecs:le($Ne),fill_value:Ga().optional(),attributes:yi(_(),Ga()).optional(),dimension_names:le(_().nullable()).optional()}).passthrough(),kNe=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),groups:le(ZU).optional(),modalities:le(_()).optional()}).passthrough(),yvt=K({format:ut("nemar-zarr-index"),format_version:R().int(),dataset_id:_().regex(gn,"NEMAR dataset id (nm/on/xx band)"),source_commit:_(),stores:le(kNe)}).passthrough()});function QU(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var CNe,RNe,ANe,ONe,Ro,wvt;var Xy=I(()=>{s$();CNe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],RNe=["50","60"],ANe=["ready","pending","failed"],ONe=o$.options,Ro=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:RNe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:CNe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:ONe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:ANe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],wvt=new Map(Ro.map((e)=>[e.key,e]))});var TNe,Svt,FNe,iz,Rm,ez,PNe,oz,INe=20,NNe=100,jNe,sz,MNe,$vt,kvt,qNe,Cvt,Rvt,LNe,BNe,UNe,Avt,zNe=50,VNe=500,Ovt,HNe,GNe,Tvt,WNe=1000,KNe=5000,tz=8,JNe=100,YNe=32,rz,Fvt,XNe,ZNe,QNe,Pvt,e3e=800,t3e=4000,Ivt,Nvt,m$=60,h$=64,nz,r3e=86400,n3e=4096,jvt,i3e,o3e,Mvt;var az=I(()=>{On();Xy();p$();TNe=K({dataset_id:_().regex(gn),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:le(_()).optional(),tasks:le(_()).optional(),subject_count:R().int().nonnegative().nullable().optional(),has_hed:$d([ut(0),ut(1)]).nullable().optional(),hed_version:_().nullable().optional(),store_count:R().int().nonnegative().nullable().optional(),recording_count:R().int().nonnegative().nullable().optional(),recordings_unavailable:R().int().nonnegative().nullable().optional(),total_recording_duration:R().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:R().int().nonnegative().nullable().optional(),zarr_verify_status:yt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),index_url:_().nullable().optional()}).passthrough(),Svt=K({format:ut("nemar-zarr-catalog"),format_version:R().int(),generated_utc:_(),contract_base:_(),count:R().int().nonnegative(),datasets:le(TNe)}).passthrough(),FNe=["verified","failed","unverifiable"],iz=yt(FNe).nullable(),Rm=K({dataset_id:_().regex(gn),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),source_commit:_().regex(Wy),index_etag:_().nullable(),engine_version:_(),source_tree:ut("raw"),derived:je(),sss:Jy.optional(),lossy:je(),dtype:_().nullable(),effective_rate_hz:R().nullable(),source_rate_hz:R().nullable(),units_report:Ky.nullable().optional(),zarr_verify_status:iz,note:_().nullable().optional()}).passthrough().superRefine(Yy),ez=K({start:R().int().nonnegative(),end:R().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),PNe=K({python_zarr:_(),zarrita:_(),python_browser:_()}).passthrough(),oz=K({contract_base:_(),data_base:_(),s3_uri:_(),s3_region:_(),s3_anonymous:je(),zarr:_(),group:_(),level:$d([ut("0"),R().int().positive()]),array_path:_(),dtype:_().nullable(),codecs:le(Ga()).optional(),chunk_samples:R().int().positive().nullable(),shard_samples:R().int().positive().nullable(),n_channels:R().int().nonnegative().nullable(),sample_slice:ez.optional(),channel_slice:ez.optional(),scale_offset:_(),how_to:PNe}).passthrough(),jNe=Object.fromEntries(Ro.map((e)=>[e.queryParam,_().optional()])),sz={modality:_().optional(),task:_().optional(),has_hed:je().optional(),has_zarr:je().optional(),author:_().optional(),has_doi:je().optional(),has_zarr_verified:je().optional(),data_complete:je().optional(),recent:R().int().positive().optional(),license:_().optional()},MNe=Object.keys(sz),$vt=[...MNe,...Ro.map((e)=>e.queryParam)],kvt=K({query:_().optional(),...sz,include_unknown:je().optional(),...jNe,limit:R().int().positive().max(NNe).default(INe)}).passthrough(),qNe=K({dataset_id:_().regex(gn),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:le(_()).optional(),tasks:le(_()).optional(),subject_count:R().int().nullable().optional(),has_hed:je().nullable().optional(),has_zarr:je()}).passthrough(),Cvt=K({results:le(qNe),count:R().int().nonnegative(),limit:R().int(),note:_().nullable().optional(),truncated:je().optional()}).passthrough(),Rvt=K({dataset_id:_().regex(gn)}).passthrough(),LNe=["list_recordings","get_events","render_overview","read_window"],BNe=K({next_cheapest_tool:yt(LNe),reason:_()}).passthrough(),UNe=["pending","ready","failed"],Avt=K({dataset_id:_().regex(gn),name:_(),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),modalities:le(_()).optional(),tasks:le(_()).optional(),subject_count:R().int().nullable().optional(),has_hed:je().nullable().optional(),hed_version:_().nullable().optional(),recording_count:R().int().nullable().optional(),total_recording_duration_s:R().nullable().optional(),zarr_status:yt(UNe).nullable().optional(),zarr_verify_status:iz.optional(),zarr_source_commit:_().nullable().optional(),zarr_store_count:R().int().nullable().optional(),cost_hint:BNe}).passthrough(),Ovt=K({dataset_id:_().regex(gn),modality:_().optional(),min_duration_s:R().nonnegative().optional(),include_derived:je().default(!1),limit:R().int().positive().max(VNe).default(zNe),offset:R().int().nonnegative().default(0)}).passthrough(),HNe=K({name:_(),modality:_().nullable().optional(),rate:R().nullable().optional(),n_channels:R().int().nullable().optional(),duration_s:R().nullable().optional(),n_view_levels:R().int().nonnegative().nullable().optional(),n_samples:R().int().nonnegative().nullable().optional(),view_chunk_columns:R().int().positive().nullable().optional()}).passthrough(),GNe=K({path:_(),zarr:_(),source_tree:ut("raw"),derived:je(),groups:le(HNe).optional(),n_events:R().int().nonnegative().optional(),sss:Jy.optional(),units_report:Ky.optional()}).passthrough().superRefine(Yy),Tvt=K({dataset_id:_().regex(gn),source_commit:_().regex(Wy).nullable(),recordings:le(GNe),total_count:R().int().nonnegative(),excluded_derived_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),index_format_version:R().int(),discovered_count:R().int().nonnegative().nullable(),failure_count:R().int().nonnegative().nullable(),pending_count:R().int().nonnegative().nullable(),excluded_legacy_non_raw_count:R().int().nonnegative(),note:_().nullable().optional(),envelope:Rm.optional()}).passthrough(),rz=_().min(1).max(64),Fvt=K({dataset_id:_().regex(gn),recording:_(),group:_().optional(),limit:R().int().positive().max(KNe).default(WNe),offset:R().int().nonnegative().default(0),where:yi(rz,le($d([_(),R()])).min(1).max(JNe)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=tz},{message:`where names 1 to ${tz} columns`}).optional(),columns:le(rz).min(1).max(YNe).optional()}).passthrough(),XNe=K({store_path:_(),group_name:_(),onset_s:R(),duration_s:R().nullable().optional(),sample_index:R().int().nonnegative(),trial_type:_().nullable().optional(),value:$d([_(),R()]).nullable().optional(),hed:_().nullable().optional()}).passthrough(),ZNe=XNe.partial().required({onset_s:!0,sample_index:!0}),QNe=K({name:_(),distinct_count:R().int().nonnegative(),null_count:R().int().nonnegative(),values:le(K({value:_(),count:R().int().positive()}).passthrough()).nullable()}).passthrough(),Pvt=K({dataset_id:_().regex(gn),recording:_(),events:le(ZNe),source:yt(["events_parquet","events_tsv_fallback"]),estimated:je(),total_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),truncated:je(),note:_().nullable().optional(),columns_summary:le(QNe).optional(),envelope:Rm.optional()}).passthrough(),Ivt=K({dataset_id:_().regex(gn),recording:_(),group:_().optional(),width_px:R().int().positive().max(t3e).default(e3e)}).passthrough(),Nvt=K({dataset_id:_().regex(gn),recording:_(),group:_(),level:R().int().positive(),width_px:R().int().positive(),height_px:R().int().positive(),mime_type:ut("image/png"),columns_read:R().int().nonnegative(),chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),envelope:Rm.optional()}).passthrough(),nz=m$*h$,jvt=K({dataset_id:_().regex(gn),recording:_(),group:_().optional(),start_s:R().nonnegative().default(0),duration_s:R().positive().max(r3e).default(10),channels:le(R().int().nonnegative()).max(n3e).optional(),taste:je().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:G.custom,message:"taste requires channels: name the channel indices you want (list_recordings reports each group's n_channels), or omit taste for a recipe",path:["channels"]});return}if(e.duration_s>m$)t.addIssue({code:G.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${m$} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>h$)t.addIssue({code:G.custom,message:`taste channels (${e.channels.length}) exceeds the ${h$}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>nz)t.addIssue({code:G.custom,message:`taste exceeds the cap of ${nz} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),i3e=K({mode:ut("recipe"),recipe:oz,envelope:Rm}).passthrough(),o3e=K({mode:ut("taste"),start_s:R(),duration_s:R(),channels:le(R().int()),sample_rate_hz:R(),values:le(le(R())),recipe:oz,chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),filled_ranges:le(K({start_sample:R().int().nonnegative(),end_sample:R().int().nonnegative(),start_s:R(),end_s:R()}).passthrough()),note:_().nullable().optional(),envelope:Rm}).passthrough(),Mvt=J1("mode",[i3e,o3e])});var Fd=I(()=>{i$();kd();s$();qy();a$();zy();Ad();Td();p$();az()});function Qy(e){return e?l3e:Wa}var Wa,c3e,l3e,b$;var eb=I(()=>{Wa=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],c3e=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],l3e=Wa.filter((e)=>!c3e.includes(e));b$={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function nb(e){let t=[],r="",n="start",i=!1;for(let o of e)switch(o){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(i)r+=o;n="property",i=!i;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=o;break}if(S$.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=o;break}if(n==="property"){if(S$.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!h3e.has(o))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(i)i=!1,r+="\\";r+=o}}if(i)r+="\\";switch(n){case"property":{if(S$.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function $$(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function gz(e,t){if($$(e,t))throw Error("Cannot use string index")}function yz(e,t,r){if(!Ol(e)||typeof t!=="string")return r===void 0?e:r;let n=nb(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){let o=n[i];if($$(e,o))e=i===n.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function k$(e,t,r){if(!Ol(e)||typeof t!=="string")return e;let n=e,i=nb(t);for(let o=0;o<i.length;o++){let s=i[o];if(gz(e,s),o===i.length-1)e[s]=r;else if(!Ol(e[s]))e[s]=typeof i[o+1]==="number"?[]:{};e=e[s]}return n}function bz(e,t){if(!Ol(e)||typeof t!=="string")return!1;let r=nb(t);for(let n=0;n<r.length;n++){let i=r[n];if(gz(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!Ol(e))return!1}}function xz(e,t){if(!Ol(e)||typeof t!=="string")return!1;let r=nb(t);if(r.length===0)return!1;for(let n of r){if(!Ol(e)||!(n in e)||$$(e,n))return!1;e=e[n]}return!0}var Ol=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},S$,h3e;var wz=I(()=>{S$=new Set(["__proto__","prototype","constructor"]),h3e=new Set("0123456789")});import Xt from"path";import vz from"os";import C$ from"process";function A$(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(C$.platform==="darwin")return g3e(e);if(C$.platform==="win32")return y3e(e);return b3e(e)}var Ja,R$,Id,g3e=(e)=>{let t=Xt.join(Ja,"Library");return{data:Xt.join(t,"Application Support",e),config:Xt.join(t,"Preferences",e),cache:Xt.join(t,"Caches",e),log:Xt.join(t,"Logs",e),temp:Xt.join(R$,e)}},y3e=(e)=>{let t=Id.APPDATA||Xt.join(Ja,"AppData","Roaming"),r=Id.LOCALAPPDATA||Xt.join(Ja,"AppData","Local");return{data:Xt.join(r,e,"Data"),config:Xt.join(t,e,"Config"),cache:Xt.join(r,e,"Cache"),log:Xt.join(r,e,"Log"),temp:Xt.join(R$,e)}},b3e=(e)=>{let t=Xt.basename(Ja);return{data:Xt.join(Id.XDG_DATA_HOME||Xt.join(Ja,".local","share"),e),config:Xt.join(Id.XDG_CONFIG_HOME||Xt.join(Ja,".config"),e),cache:Xt.join(Id.XDG_CACHE_HOME||Xt.join(Ja,".cache"),e),log:Xt.join(Id.XDG_STATE_HOME||Xt.join(Ja,".local","state"),e),temp:Xt.join(R$,t,e)}};var _z=I(()=>{Ja=vz.homedir(),R$=vz.tmpdir(),{env:Id}=C$});var x3e=(e,t)=>{let{onError:r}=t;return function(...i){return e.apply(void 0,i).catch(r)}},Ao;var Dz=I(()=>{Ao=x3e});var w3e=(e,t)=>{let{onError:r}=t;return function(...i){try{return e.apply(void 0,i)}catch(o){return r(o)}}},Yi;var Ez=I(()=>{Yi=w3e});var Sz=250;var $z=()=>{};var v3e=(e,t)=>{let{isRetriable:r}=t;return function(i){let{timeout:o}=i,s=i.interval??Sz,a=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(s*Math.random());if(f>0)return new Promise((p)=>setTimeout(p,f)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},Oo;var kz=I(()=>{$z();Oo=v3e});var _3e=(e,t)=>{let{isRetriable:r}=t;return function(i){let{timeout:o}=i,s=Date.now()+o;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=s)throw u;continue}}}},To;var Cz=I(()=>{To=_3e});var O$=I(()=>{Dz();Ez();kz();Cz()});var Om,T$;var Rz=I(()=>{F$();Om={isChangeErrorOk:(e)=>{if(!Om.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Az&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Om.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!Om.isNodeError(e))throw e;if(Om.isChangeErrorOk(e))return;throw e}},T$=Om});import Oz from"process";var Tm,Tn,Az,Gr;var F$=I(()=>{Rz();Tm={onError:T$.onChangeError},Tn={onError:()=>{return}},Az=Oz.getuid?!Oz.getuid():!1,Gr={isRetriable:T$.isRetriableError}});import mt from"fs";import{promisify as on}from"util";var D3e,Pr;var P$=I(()=>{O$();O$();F$();D3e={attempt:{chmod:Ao(on(mt.chmod),Tm),chown:Ao(on(mt.chown),Tm),close:Ao(on(mt.close),Tn),fsync:Ao(on(mt.fsync),Tn),mkdir:Ao(on(mt.mkdir),Tn),realpath:Ao(on(mt.realpath),Tn),stat:Ao(on(mt.stat),Tn),unlink:Ao(on(mt.unlink),Tn),chmodSync:Yi(mt.chmodSync,Tm),chownSync:Yi(mt.chownSync,Tm),closeSync:Yi(mt.closeSync,Tn),existsSync:Yi(mt.existsSync,Tn),fsyncSync:Yi(mt.fsync,Tn),mkdirSync:Yi(mt.mkdirSync,Tn),realpathSync:Yi(mt.realpathSync,Tn),statSync:Yi(mt.statSync,Tn),unlinkSync:Yi(mt.unlinkSync,Tn)},retry:{close:Oo(on(mt.close),Gr),fsync:Oo(on(mt.fsync),Gr),open:Oo(on(mt.open),Gr),readFile:Oo(on(mt.readFile),Gr),rename:Oo(on(mt.rename),Gr),stat:Oo(on(mt.stat),Gr),write:Oo(on(mt.write),Gr),writeFile:Oo(on(mt.writeFile),Gr),closeSync:To(mt.closeSync,Gr),fsyncSync:To(mt.fsyncSync,Gr),openSync:To(mt.openSync,Gr),readFileSync:To(mt.readFileSync,Gr),renameSync:To(mt.renameSync,Gr),statSync:To(mt.statSync,Gr),writeSync:To(mt.writeSync,Gr),writeFileSync:To(mt.writeFileSync,Gr)}},Pr=D3e});import Tl from"process";var Tz="utf8",I$=438,Fz=511,Pz,Iz,Nz,jz=1000,Mz,M_t,N$=128;var j$=I(()=>{Pz={},Iz=Tl.geteuid?Tl.geteuid():-1,Nz=Tl.getegid?Tl.getegid():-1,Mz=!!Tl.getuid,M_t=Tl.getuid?!Tl.getuid():!1});var qz=(e)=>e instanceof Error&&("code"in e),M$=(e)=>typeof e==="string",ib=(e)=>e===void 0;var Lz=()=>{};var Bz=()=>{};import Uz from"process";var zz,ob;var q$=I(()=>{zz=Uz.platform==="linux",ob=Uz.platform==="win32"});var L$,Vz;var Hz=I(()=>{q$();L$=["SIGHUP","SIGINT","SIGTERM"];if(!ob)L$.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(zz)L$.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Vz=L$});import Nd from"process";class Gz{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(ob&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Nd.kill(Nd.pid,"SIGTERM");else Nd.kill(Nd.pid,e)},this.hook=()=>{Nd.once("exit",()=>this.exit());for(let e of Vz)try{Nd.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Wz;var Kz=I(()=>{q$();Hz();Wz=new Gz});var E3e,Jz;var Yz=I(()=>{Kz();E3e=Wz.register,Jz=E3e});import S3e from"path";var Zn,Fm;var Xz=I(()=>{P$();Yz();j$();Zn={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",i=`.tmp-${r}${t}`;return`${e}${i}`},get:(e,t,r=!0)=>{let n=Zn.truncate(t(e));if(n in Zn.store)return Zn.get(e,t,r);return Zn.store[n]=r,[n,()=>delete Zn.store[n]]},purge:(e)=>{if(!Zn.store[e])return;delete Zn.store[e],Pr.attempt.unlink(e)},purgeSync:(e)=>{if(!Zn.store[e])return;delete Zn.store[e],Pr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Zn.store)Zn.purgeSync(e)},truncate:(e)=>{let t=S3e.basename(e);if(t.length<=N$)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-N$;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Jz(Zn.purgeSyncAll);Fm=Zn});import $3e from"path";function B$(e,t,r=Pz){if(M$(r))return B$(e,t,{encoding:r});let i={timeout:r.timeout??jz},o=null,s=null,a=null;try{let c=Pr.attempt.realpathSync(e),u=!!c;e=c||e,[s,o]=Fm.get(e,r.tmpCreate||Fm.create,r.tmpPurge!==!1);let d=Mz&&ib(r.chown),f=ib(r.mode);if(u&&(d||f)){let m=Pr.attempt.statSync(e);if(m){if(r={...r},d)r.chown={uid:m.uid,gid:m.gid};if(f)r.mode=m.mode}}if(!u){let m=$3e.dirname(e);Pr.attempt.mkdirSync(m,{mode:Fz,recursive:!0})}if(a=Pr.retry.openSync(i)(s,"w",r.mode||I$),r.tmpCreated)r.tmpCreated(s);if(M$(t))Pr.retry.writeSync(i)(a,t,0,r.encoding||Tz);else if(!ib(t))Pr.retry.writeSync(i)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Pr.retry.fsyncSync(i)(a);else Pr.attempt.fsync(a);if(Pr.retry.closeSync(i)(a),a=null,r.chown&&(r.chown.uid!==Iz||r.chown.gid!==Nz))Pr.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==I$)Pr.attempt.chmodSync(s,r.mode);try{Pr.retry.renameSync(i)(s,e)}catch(m){if(!qz(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Pr.retry.renameSync(i)(s,Fm.truncate(e))}o(),s=null}finally{if(a)Pr.attempt.closeSync(a);if(s)Fm.purge(s)}}var Zz=I(()=>{P$();j$();Lz();Bz();Xz()});var Im=y(function(tV){Object.defineProperty(tV,"__esModule",{value:!0});tV.regexpCode=tV.getEsmExportName=tV.getProperty=tV.safeStringify=tV.stringify=tV.strConcat=tV.addCodeArg=tV.str=tV._=tV.nil=tV._Code=tV.Name=tV.IDENTIFIER=tV._CodeOrName=void 0;class sb{}tV._CodeOrName=sb;tV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class jd extends sb{constructor(e){super();if(!tV.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}tV.Name=jd;class Xi extends sb{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof jd)t[r.str]=(t[r.str]||0)+1;return t},{})}}tV._Code=Xi;tV.nil=new Xi("");function Qz(e,...t){let r=[e[0]],n=0;while(n<t.length)z$(r,t[n]),r.push(e[++n]);return new Xi(r)}tV._=Qz;var U$=new Xi("+");function eV(e,...t){let r=[Pm(e[0])],n=0;while(n<t.length)r.push(U$),z$(r,t[n]),r.push(U$,Pm(e[++n]));return k3e(r),new Xi(r)}tV.str=eV;function z$(e,t){if(t instanceof Xi)e.push(...t._items);else if(t instanceof jd)e.push(t);else e.push(A3e(t))}tV.addCodeArg=z$;function k3e(e){let t=1;while(t<e.length-1){if(e[t]===U$){let r=C3e(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function C3e(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof jd||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof jd))return`"${e}${t.slice(1)}`;return}function R3e(e,t){return t.emptyStr()?e:e.emptyStr()?t:eV`${e}${t}`}tV.strConcat=R3e;function A3e(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pm(Array.isArray(e)?e.join(","):e)}function O3e(e){return new Xi(Pm(e))}tV.stringify=O3e;function Pm(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}tV.safeStringify=Pm;function T3e(e){return typeof e=="string"&&tV.IDENTIFIER.test(e)?new Xi(`.${e}`):Qz`[${e}]`}tV.getProperty=T3e;function F3e(e){if(typeof e=="string"&&tV.IDENTIFIER.test(e))return new Xi(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}tV.getEsmExportName=F3e;function P3e(e){return new Xi(e.toString())}tV.regexpCode=P3e});var W$=y(function(oV){Object.defineProperty(oV,"__esModule",{value:!0});oV.ValueScope=oV.ValueScopeName=oV.Scope=oV.varKinds=oV.UsedValueState=void 0;var Rt=Im();class nV extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var cb;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(cb||(oV.UsedValueState=cb={}));oV.varKinds={const:new Rt.Name("const"),let:new Rt.Name("let"),var:new Rt.Name("var")};class H${constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Rt.Name?e:this.name(e)}name(e){return new Rt.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}oV.Scope=H$;class G$ extends Rt.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Rt._`.${new Rt.Name(t)}[${r}]`}}oV.ValueScopeName=G$;var W3e=Rt._`\n`;class iV extends H${constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?W3e:Rt.nil}}get(){return this._scope}name(e){return new G$(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[i];if(s){let u=s.get(o);if(u)return u}else s=this._values[i]=new Map;s.set(o,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return Rt._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let i=Rt.nil;for(let o in e){let s=e[o];if(!s)continue;let a=r[o]=r[o]||new Map;s.forEach((c)=>{if(a.has(c))return;a.set(c,cb.Started);let u=t(c);if(u){let d=this.opts.es5?oV.varKinds.var:oV.varKinds.const;i=Rt._`${i}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))i=Rt._`${i}${u}${this.opts._n}`;else throw new nV(c);a.set(c,cb.Completed)})}return i}}oV.ValueScope=iV});var Ve=y(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});Fn.or=Fn.and=Fn.not=Fn.CodeGen=Fn.operators=Fn.varKinds=Fn.ValueScopeName=Fn.ValueScope=Fn.Scope=Fn.Name=Fn.regexpCode=Fn.stringify=Fn.getProperty=Fn.nil=Fn.strConcat=Fn.str=Fn._=void 0;var oe=Im(),or=W$(),Ya=Im();Object.defineProperty(Fn,"_",{enumerable:!0,get:function(){return Ya._}});Object.defineProperty(Fn,"str",{enumerable:!0,get:function(){return Ya.str}});Object.defineProperty(Fn,"strConcat",{enumerable:!0,get:function(){return Ya.strConcat}});Object.defineProperty(Fn,"nil",{enumerable:!0,get:function(){return Ya.nil}});Object.defineProperty(Fn,"getProperty",{enumerable:!0,get:function(){return Ya.getProperty}});Object.defineProperty(Fn,"stringify",{enumerable:!0,get:function(){return Ya.stringify}});Object.defineProperty(Fn,"regexpCode",{enumerable:!0,get:function(){return Ya.regexpCode}});Object.defineProperty(Fn,"Name",{enumerable:!0,get:function(){return Ya.Name}});var mb=W$();Object.defineProperty(Fn,"Scope",{enumerable:!0,get:function(){return mb.Scope}});Object.defineProperty(Fn,"ValueScope",{enumerable:!0,get:function(){return mb.ValueScope}});Object.defineProperty(Fn,"ValueScopeName",{enumerable:!0,get:function(){return mb.ValueScopeName}});Object.defineProperty(Fn,"varKinds",{enumerable:!0,get:function(){return mb.varKinds}});Fn.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};class Xa{optimizeNodes(){return this}optimizeNames(e,t){return this}}class aV extends Xa{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?or.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=qd(this.rhs,e,t);return this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}}class Y$ extends Xa{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=qd(this.rhs,e,t),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return pb(e,this.rhs)}}class cV extends Y${constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class lV extends Xa{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class uV extends Xa{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class dV extends Xa{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class fV extends Xa{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=qd(this.code,e,t),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}}class hb extends Xa{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let i=r[n];if(i.optimizeNames(e,t))continue;X3e(e,i.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Fl(e,t.names),{})}}class Za extends hb{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class pV extends hb{}class Nm extends Za{}Nm.kind="else";class Us extends Za{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Nm(r):r}if(t){if(e===!1)return t instanceof Us?t:t.nodes;if(this.nodes.length)return this;return new Us(bV(e),t instanceof Us?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=qd(this.condition,e,t),this}get names(){let e=super.names;if(pb(e,this.condition),this.else)Fl(e,this.else.names);return e}}Us.kind="if";class Md extends Za{}Md.kind="for";class mV extends Md{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=qd(this.iteration,e,t),this}get names(){return Fl(super.names,this.iteration.names)}}class hV extends Md{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?or.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=pb(super.names,this.from);return pb(e,this.to)}}class K$ extends Md{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=qd(this.iterable,e,t),this}get names(){return Fl(super.names,this.iterable.names)}}class lb extends Za{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}lb.kind="func";class ub extends hb{render(e){return"return "+super.render(e)}}ub.kind="return";class gV extends Za{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Fl(e,this.catch.names);if(this.finally)Fl(e,this.finally.names);return e}}class db extends Za{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}db.kind="catch";class fb extends Za{render(e){return"finally"+super.render(e)}}fb.kind="finally";class yV{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
84
|
+
`;return this.stop(),this.#o.write(u),this}}function S(e){return new iU(e)}var dm,hIe;var Jn=I(()=>{Ze();z7();H7();N1();Q7();tU();nU();dm=Me(x0(),1),hIe=Me(x0(),1)});var ot,aU,ie,Is=(e)=>{switch(typeof e){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return Number.isNaN(e)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":if(Array.isArray(e))return ie.array;if(e===null)return ie.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return ie.promise;if(typeof Map<"u"&&e instanceof Map)return ie.map;if(typeof Set<"u"&&e instanceof Set)return ie.set;if(typeof Date<"u"&&e instanceof Date)return ie.date;return ie.object;default:return ie.unknown}};var fm=I(()=>{(function(e){e.assertEqual=(i)=>{};function t(i){}e.assertIs=t;function r(i){throw Error()}e.assertNever=r,e.arrayToEnum=(i)=>{let o={};for(let s of i)o[s]=s;return o},e.getValidEnumValues=(i)=>{let o=e.objectKeys(i).filter((a)=>typeof i[i[a]]!=="number"),s={};for(let a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=(i)=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys==="function"?(i)=>Object.keys(i):(i)=>{let o=[];for(let s in i)if(Object.prototype.hasOwnProperty.call(i,s))o.push(s);return o},e.find=(i,o)=>{for(let s of i)if(o(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(i)=>Number.isInteger(i):(i)=>typeof i==="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map((s)=>typeof s==="string"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>{if(typeof o==="bigint")return o.toString();return o}})(ot||(ot={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(aU||(aU={}));ie=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var G,Yn;var Sy=I(()=>{fm();G=ot.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"]);Yn=class Yn extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},r={_errors:[]},n=(i)=>{for(let o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let s=r,a=0;while(a<o.path.length){let c=o.path[a];if(a!==o.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o));s=s[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof Yn))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};Yn.create=(e)=>new Yn(e)});var gIe=(e,t)=>{let r;switch(e.code){case G.invalid_type:if(e.received===ie.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ot.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:r=`Unrecognized key(s) in object: ${ot.joinValues(e.keys,", ")}`;break;case G.invalid_union:r="Invalid input";break;case G.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ot.joinValues(e.options)}`;break;case G.invalid_enum_value:r=`Invalid enum value. Expected ${ot.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:r="Invalid function arguments";break;case G.invalid_return_type:r="Invalid function return type";break;case G.invalid_date:r="Invalid date";break;case G.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else ot.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case G.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case G.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case G.custom:r="Invalid input";break;case G.invalid_intersection_types:r="Intersection results could not be merged";break;case G.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:r="Number must be finite";break;default:r=t.defaultError,ot.assertNever(e)}return{message:r}},Va;var B1=I(()=>{Sy();fm();Va=gIe});function pm(){return yIe}var yIe;var $y=I(()=>{B1();yIe=Va});function ee(e,t){let r=pm(),n=ky({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Va?void 0:Va].filter((i)=>!!i)});e.common.issues.push(n)}class rn{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return Ae;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let i=await n.key,o=await n.value;r.push({key:i,value:o})}return rn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:i,value:o}=n;if(i.status==="aborted")return Ae;if(o.status==="aborted")return Ae;if(i.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(i.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet))r[i.value]=o.value}return{status:e.value,value:r}}}var ky=(e)=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},Ae,wd=(e)=>({status:"dirty",value:e}),hn=(e)=>({status:"valid",value:e}),U1=(e)=>e.status==="aborted",z1=(e)=>e.status==="dirty",Sl=(e)=>e.status==="valid",mm=(e)=>typeof Promise<"u"&&e instanceof Promise;var V1=I(()=>{$y();B1();Ae=Object.freeze({status:"aborted"})});var cU=()=>{};var be;var lU=I(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(be||(be={}))});class Ji{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}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}}function ze(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:i};return{errorMap:(s,a)=>{let{message:c}=e;if(s.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(s.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:i}}class et{get description(){return this._def.description}_getType(e){return Is(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Is(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rn,ctx:{common:e.parent.common,data:e.data,parsedType:Is(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(mm(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Is(e)},n=this._parseSync({data:e,path:r.path,parent:r});return uU(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Is(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Sl(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>Sl(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Is(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await(mm(n)?n:Promise.resolve(n));return uU(r,i)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,i)=>{let o=e(n),s=()=>i.addIssue({code:G.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((a)=>{if(!a)return s(),!1;else return!0});if(!o)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new Co({schema:this,typeName:Oe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:(t)=>this["~validate"](t)}}optional(){return ko.create(this,this._def)}nullable(){return Ha.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $o.create(this)}promise(){return Sd.create(this,this._def)}or(e){return xm.create([this,e],this._def)}and(e){return wm.create(this,e,this._def)}transform(e){return new Co({...ze(this._def),schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Em({...ze(this._def),innerType:this,defaultValue:t,typeName:Oe.ZodDefault})}brand(){return new K1({typeName:Oe.ZodBranded,type:this,...ze(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Sm({...ze(this._def),innerType:this,catchValue:t,typeName:Oe.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Iy.create(this,e)}readonly(){return $m.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function fU(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function PIe(e){return new RegExp(`^${fU(e)}$`)}function IIe(e){let t=`${dU}T${fU(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function NIe(e,t){if((t==="v4"||!t)&&kIe.test(e))return!0;if((t==="v6"||!t)&&RIe.test(e))return!0;return!1}function jIe(e,t){if(!DIe.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if(typeof i!=="object"||i===null)return!1;if("typ"in i&&i?.typ!=="JWT")return!1;if(!i.alg)return!1;if(t&&i.alg!==t)return!1;return!0}catch{return!1}}function MIe(e,t){if((t==="v4"||!t)&&CIe.test(e))return!0;if((t==="v6"||!t)&&AIe.test(e))return!0;return!1}function qIe(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}function vd(e){if(e instanceof nr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ko.create(vd(n))}return new nr({...e._def,shape:()=>t})}else if(e instanceof $o)return new $o({...e._def,type:vd(e.element)});else if(e instanceof ko)return ko.create(vd(e.unwrap()));else if(e instanceof Ha)return Ha.create(vd(e.unwrap()));else if(e instanceof qs)return qs.create(e.items.map((t)=>vd(t)));else return e}function G1(e,t){let r=Is(e),n=Is(t);if(e===t)return{valid:!0,data:e};else if(r===ie.object&&n===ie.object){let i=ot.objectKeys(t),o=ot.objectKeys(e).filter((a)=>i.indexOf(a)!==-1),s={...e,...t};for(let a of o){let c=G1(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===ie.array&&n===ie.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],c=G1(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else if(r===ie.date&&n===ie.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function pU(e,t){return new kl({values:e,typeName:Oe.ZodEnum,...ze(t)})}var uU=(e,t)=>{if(Sl(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Yn(e.common.issues);return this._error=r,this._error}}}},bIe,xIe,wIe,vIe,_Ie,DIe,EIe,SIe,$Ie="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",H1,kIe,CIe,RIe,AIe,OIe,TIe,dU="((\\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])))",FIe,js,_d,Dd,Cy,gm,Ry,ym,bm,Ay,$l,Ms,Oy,$o,nr,xm,Ns=(e)=>{if(e instanceof vm)return Ns(e.schema);else if(e instanceof Co)return Ns(e.innerType());else if(e instanceof _m)return[e.value];else if(e instanceof kl)return e.options;else if(e instanceof Dm)return ot.objectValues(e.enum);else if(e instanceof Em)return Ns(e._def.innerType);else if(e instanceof ym)return[void 0];else if(e instanceof bm)return[null];else if(e instanceof ko)return[void 0,...Ns(e.unwrap())];else if(e instanceof Ha)return[null,...Ns(e.unwrap())];else if(e instanceof K1)return Ns(e.unwrap());else if(e instanceof $m)return Ns(e.unwrap());else if(e instanceof Sm)return Ns(e._def.innerType);else return[]},W1,wm,qs,Ty,Fy,Ed,hm,vm,_m,kl,Dm,Sd,Co,ko,Ha,Em,Sm,Py,Jxt,K1,Iy,$m,Yxt,Oe,_,R,Xxt,Zxt,je,Qxt,ewt,twt,rwt,nwt,Ga,iwt,owt,le,K,swt,$d,J1,awt,cwt,yi,lwt,uwt,dwt,fwt,ut,yt,pwt,mwt,hwt,gwt,ywt,bwt,xwt;var mU=I(()=>{Sy();$y();lU();V1();fm();bIe=/^c[^\s-]{8,}$/i,xIe=/^[0-9a-z]+$/,wIe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vIe=/^[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,_Ie=/^[a-z0-9_-]{21}$/i,DIe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,EIe=/^[-+]?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)?)??$/,SIe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kIe=/^(?:(?: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])$/,CIe=/^(?:(?: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])$/,RIe=/^(([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]))$/,AIe=/^(([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])$/,OIe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TIe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,FIe=new RegExp(`^${dU}$`);js=class js extends et{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==ie.string){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_type,expected:ie.string,received:i.parsedType}),Ae}let r=new rn,n=void 0;for(let i of this._def.checks)if(i.kind==="min"){if(e.data.length<i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty()}else if(i.kind==="max"){if(e.data.length>i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty()}else if(i.kind==="length"){let o=e.data.length>i.value,s=e.data.length<i.value;if(o||s){if(n=this._getOrReturnCtx(e,n),o)ee(n,{code:G.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message});else if(s)ee(n,{code:G.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message});r.dirty()}}else if(i.kind==="email"){if(!SIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"email",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="emoji"){if(!H1)H1=new RegExp($Ie,"u");if(!H1.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"emoji",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="uuid"){if(!vIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"uuid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="nanoid"){if(!_Ie.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"nanoid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="cuid"){if(!bIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"cuid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="cuid2"){if(!xIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"cuid2",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="ulid"){if(!wIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"ulid",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ee(n,{validation:"url",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="regex"){if(i.regex.lastIndex=0,!i.regex.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"regex",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="trim")e.data=e.data.trim();else if(i.kind==="includes"){if(!e.data.includes(i.value,i.position))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()}else if(i.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(i.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(i.kind==="startsWith"){if(!e.data.startsWith(i.value))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()}else if(i.kind==="endsWith"){if(!e.data.endsWith(i.value))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()}else if(i.kind==="datetime"){if(!IIe(i).test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:"datetime",message:i.message}),r.dirty()}else if(i.kind==="date"){if(!FIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:"date",message:i.message}),r.dirty()}else if(i.kind==="time"){if(!PIe(i).test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{code:G.invalid_string,validation:"time",message:i.message}),r.dirty()}else if(i.kind==="duration"){if(!EIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"duration",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="ip"){if(!NIe(e.data,i.version))n=this._getOrReturnCtx(e,n),ee(n,{validation:"ip",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="jwt"){if(!jIe(e.data,i.alg))n=this._getOrReturnCtx(e,n),ee(n,{validation:"jwt",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="cidr"){if(!MIe(e.data,i.version))n=this._getOrReturnCtx(e,n),ee(n,{validation:"cidr",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="base64"){if(!OIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"base64",code:G.invalid_string,message:i.message}),r.dirty()}else if(i.kind==="base64url"){if(!TIe.test(e.data))n=this._getOrReturnCtx(e,n),ee(n,{validation:"base64url",code:G.invalid_string,message:i.message}),r.dirty()}else ot.assertNever(i);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:G.invalid_string,...be.errToObj(r)})}_addCheck(e){return new js({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...be.errToObj(e)})}url(e){return this._addCheck({kind:"url",...be.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...be.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...be.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...be.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...be.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...be.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...be.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...be.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...be.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...be.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...be.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...be.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...be.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...be.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...be.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...be.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...be.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...be.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...be.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...be.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...be.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...be.errToObj(t)})}nonempty(e){return this.min(1,be.errToObj(e))}trim(){return new js({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new js({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new js({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};js.create=(e)=>new js({checks:[],typeName:Oe.ZodString,coerce:e?.coerce??!1,...ze(e)});_d=class _d extends et{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==ie.number){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_type,expected:ie.number,received:i.parsedType}),Ae}let r=void 0,n=new rn;for(let i of this._def.checks)if(i.kind==="int"){if(!ot.isInteger(e.data))r=this._getOrReturnCtx(e,r),ee(r,{code:G.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()}else if(i.kind==="min"){if(i.inclusive?e.data<i.value:e.data<=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()}else if(i.kind==="max"){if(i.inclusive?e.data>i.value:e.data>=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()}else if(i.kind==="multipleOf"){if(qIe(e.data,i.value)!==0)r=this._getOrReturnCtx(e,r),ee(r,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()}else if(i.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),ee(r,{code:G.not_finite,message:i.message}),n.dirty()}else ot.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,be.toString(t))}gt(e,t){return this.setLimit("min",e,!1,be.toString(t))}lte(e,t){return this.setLimit("max",e,!0,be.toString(t))}lt(e,t){return this.setLimit("max",e,!1,be.toString(t))}setLimit(e,t,r,n){return new _d({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:be.toString(n)}]})}_addCheck(e){return new _d({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:be.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:be.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:be.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:be.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:be.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:be.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:be.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:be.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:be.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&ot.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};_d.create=(e)=>new _d({checks:[],typeName:Oe.ZodNumber,coerce:e?.coerce||!1,...ze(e)});Dd=class Dd extends et{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ie.bigint)return this._getInvalidInput(e);let r=void 0,n=new rn;for(let i of this._def.checks)if(i.kind==="min"){if(i.inclusive?e.data<i.value:e.data<=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()}else if(i.kind==="max"){if(i.inclusive?e.data>i.value:e.data>=i.value)r=this._getOrReturnCtx(e,r),ee(r,{code:G.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()}else if(i.kind==="multipleOf"){if(e.data%i.value!==BigInt(0))r=this._getOrReturnCtx(e,r),ee(r,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()}else ot.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ie.bigint,received:t.parsedType}),Ae}gte(e,t){return this.setLimit("min",e,!0,be.toString(t))}gt(e,t){return this.setLimit("min",e,!1,be.toString(t))}lte(e,t){return this.setLimit("max",e,!0,be.toString(t))}lt(e,t){return this.setLimit("max",e,!1,be.toString(t))}setLimit(e,t,r,n){return new Dd({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:be.toString(n)}]})}_addCheck(e){return new Dd({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:be.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:be.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:be.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:be.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:be.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Dd.create=(e)=>new Dd({checks:[],typeName:Oe.ZodBigInt,coerce:e?.coerce??!1,...ze(e)});Cy=class Cy extends et{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==ie.boolean){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.boolean,received:r.parsedType}),Ae}return hn(e.data)}};Cy.create=(e)=>new Cy({typeName:Oe.ZodBoolean,coerce:e?.coerce||!1,...ze(e)});gm=class gm extends et{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==ie.date){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_type,expected:ie.date,received:i.parsedType}),Ae}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return ee(i,{code:G.invalid_date}),Ae}let r=new rn,n=void 0;for(let i of this._def.checks)if(i.kind==="min"){if(e.data.getTime()<i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()}else if(i.kind==="max"){if(e.data.getTime()>i.value)n=this._getOrReturnCtx(e,n),ee(n,{code:G.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()}else ot.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new gm({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:be.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:be.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};gm.create=(e)=>new gm({checks:[],coerce:e?.coerce||!1,typeName:Oe.ZodDate,...ze(e)});Ry=class Ry extends et{_parse(e){if(this._getType(e)!==ie.symbol){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.symbol,received:r.parsedType}),Ae}return hn(e.data)}};Ry.create=(e)=>new Ry({typeName:Oe.ZodSymbol,...ze(e)});ym=class ym extends et{_parse(e){if(this._getType(e)!==ie.undefined){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.undefined,received:r.parsedType}),Ae}return hn(e.data)}};ym.create=(e)=>new ym({typeName:Oe.ZodUndefined,...ze(e)});bm=class bm extends et{_parse(e){if(this._getType(e)!==ie.null){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.null,received:r.parsedType}),Ae}return hn(e.data)}};bm.create=(e)=>new bm({typeName:Oe.ZodNull,...ze(e)});Ay=class Ay extends et{constructor(){super(...arguments);this._any=!0}_parse(e){return hn(e.data)}};Ay.create=(e)=>new Ay({typeName:Oe.ZodAny,...ze(e)});$l=class $l extends et{constructor(){super(...arguments);this._unknown=!0}_parse(e){return hn(e.data)}};$l.create=(e)=>new $l({typeName:Oe.ZodUnknown,...ze(e)});Ms=class Ms extends et{_parse(e){let t=this._getOrReturnCtx(e);return ee(t,{code:G.invalid_type,expected:ie.never,received:t.parsedType}),Ae}};Ms.create=(e)=>new Ms({typeName:Oe.ZodNever,...ze(e)});Oy=class Oy extends et{_parse(e){if(this._getType(e)!==ie.undefined){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.void,received:r.parsedType}),Ae}return hn(e.data)}};Oy.create=(e)=>new Oy({typeName:Oe.ZodVoid,...ze(e)});$o=class $o extends et{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==ie.array)return ee(t,{code:G.invalid_type,expected:ie.array,received:t.parsedType}),Ae;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;if(o||s)ee(t,{code:o?G.too_big:G.too_small,minimum:s?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)ee(t,{code:G.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)ee(t,{code:G.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,s)=>n.type._parseAsync(new Ji(t,o,t.path,s)))).then((o)=>rn.mergeArray(r,o));let i=[...t.data].map((o,s)=>n.type._parseSync(new Ji(t,o,t.path,s)));return rn.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new $o({...this._def,minLength:{value:e,message:be.toString(t)}})}max(e,t){return new $o({...this._def,maxLength:{value:e,message:be.toString(t)}})}length(e,t){return new $o({...this._def,exactLength:{value:e,message:be.toString(t)}})}nonempty(e){return this.min(1,e)}};$o.create=(e,t)=>new $o({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Oe.ZodArray,...ze(t)});nr=class nr extends et{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=ot.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ie.object){let c=this._getOrReturnCtx(e);return ee(c,{code:G.invalid_type,expected:ie.object,received:c.parsedType}),Ae}let{status:r,ctx:n}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ms&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))s.push(c)}let a=[];for(let c of o){let u=i[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Ji(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Ms){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of s)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(s.length>0)ee(n,{code:G.unrecognized_keys,keys:s}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of s){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Ji(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then((c)=>rn.mergeObjectSync(r,c));else return rn.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return be.errToObj,new nr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:be.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new nr({...this._def,unknownKeys:"strip"})}passthrough(){return new nr({...this._def,unknownKeys:"passthrough"})}extend(e){return new nr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Oe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new nr({...this._def,catchall:e})}pick(e){let t={};for(let r of ot.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new nr({...this._def,shape:()=>t})}omit(e){let t={};for(let r of ot.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new nr({...this._def,shape:()=>t})}deepPartial(){return vd(this)}partial(e){let t={};for(let r of ot.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new nr({...this._def,shape:()=>t})}required(e){let t={};for(let r of ot.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];while(i instanceof ko)i=i._def.innerType;t[r]=i}return new nr({...this._def,shape:()=>t})}keyof(){return pU(ot.objectKeys(this.shape))}};nr.create=(e,t)=>new nr({shape:()=>e,unknownKeys:"strip",catchall:Ms.create(),typeName:Oe.ZodObject,...ze(t)});nr.strictCreate=(e,t)=>new nr({shape:()=>e,unknownKeys:"strict",catchall:Ms.create(),typeName:Oe.ZodObject,...ze(t)});nr.lazycreate=(e,t)=>new nr({shape:e,unknownKeys:"strip",catchall:Ms.create(),typeName:Oe.ZodObject,...ze(t)});xm=class xm extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map((s)=>new Yn(s.ctx.common.issues));return ee(t,{code:G.invalid_union,unionErrors:o}),Ae}if(t.common.async)return Promise.all(r.map(async(i)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);else{let i=void 0,o=[];for(let a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!i)i={result:u,ctx:c};if(c.common.issues.length)o.push(c.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((a)=>new Yn(a));return ee(t,{code:G.invalid_union,unionErrors:s}),Ae}}get options(){return this._def.options}};xm.create=(e,t)=>new xm({options:e,typeName:Oe.ZodUnion,...ze(t)});W1=class W1 extends et{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ie.object)return ee(t,{code:G.invalid_type,expected:ie.object,received:t.parsedType}),Ae;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);if(!i)return ee(t,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ae;if(t.common.async)return i._parseAsync({data:t.data,path:t.path,parent:t});else return i._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let i of t){let o=Ns(i.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,i)}}return new W1({typeName:Oe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...ze(r)})}};wm=class wm extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(i,o)=>{if(U1(i)||U1(o))return Ae;let s=G1(i.value,o.value);if(!s.valid)return ee(r,{code:G.invalid_intersection_types}),Ae;if(z1(i)||z1(o))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>n(i,o));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};wm.create=(e,t,r)=>new wm({left:e,right:t,typeName:Oe.ZodIntersection,...ze(r)});qs=class qs extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.array)return ee(r,{code:G.invalid_type,expected:ie.array,received:r.parsedType}),Ae;if(r.data.length<this._def.items.length)return ee(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ae;if(!this._def.rest&&r.data.length>this._def.items.length)ee(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let i=[...r.data].map((o,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Ji(r,o,r.path,s))}).filter((o)=>!!o);if(r.common.async)return Promise.all(i).then((o)=>rn.mergeArray(t,o));else return rn.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new qs({...this._def,rest:e})}};qs.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new qs({items:e,typeName:Oe.ZodTuple,rest:null,...ze(t)})};Ty=class Ty extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.object)return ee(r,{code:G.invalid_type,expected:ie.object,received:r.parsedType}),Ae;let n=[],i=this._def.keyType,o=this._def.valueType;for(let s in r.data)n.push({key:i._parse(new Ji(r,s,r.path,s)),value:o._parse(new Ji(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return rn.mergeObjectAsync(t,n);else return rn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof et)return new Ty({keyType:e,valueType:t,typeName:Oe.ZodRecord,...ze(r)});return new Ty({keyType:js.create(),valueType:e,typeName:Oe.ZodRecord,...ze(t)})}};Fy=class Fy extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.map)return ee(r,{code:G.invalid_type,expected:ie.map,received:r.parsedType}),Ae;let n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,a],c)=>({key:n._parse(new Ji(r,s,r.path,[c,"key"])),value:i._parse(new Ji(r,a,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of o){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return Ae;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let a of o){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return Ae;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}}}};Fy.create=(e,t,r)=>new Fy({valueType:t,keyType:e,typeName:Oe.ZodMap,...ze(r)});Ed=class Ed extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.set)return ee(r,{code:G.invalid_type,expected:ie.set,received:r.parsedType}),Ae;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)ee(r,{code:G.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)ee(r,{code:G.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let i=this._def.valueType;function o(a){let c=new Set;for(let u of a){if(u.status==="aborted")return Ae;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let s=[...r.data.values()].map((a,c)=>i._parse(new Ji(r,a,r.path,c)));if(r.common.async)return Promise.all(s).then((a)=>o(a));else return o(s)}min(e,t){return new Ed({...this._def,minSize:{value:e,message:be.toString(t)}})}max(e,t){return new Ed({...this._def,maxSize:{value:e,message:be.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ed.create=(e,t)=>new Ed({valueType:e,minSize:null,maxSize:null,typeName:Oe.ZodSet,...ze(t)});hm=class hm extends et{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ie.function)return ee(t,{code:G.invalid_type,expected:ie.function,received:t.parsedType}),Ae;function r(s,a){return ky({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pm(),Va].filter((c)=>!!c),issueData:{code:G.invalid_arguments,argumentsError:a}})}function n(s,a){return ky({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,pm(),Va].filter((c)=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:a}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Sd){let s=this;return hn(async function(...a){let c=new Yn([]),u=await s._def.args.parseAsync(a,i).catch((m)=>{throw c.addIssue(r(a,m)),c}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,i).catch((m)=>{throw c.addIssue(n(d,m)),c})})}else{let s=this;return hn(function(...a){let c=s._def.args.safeParse(a,i);if(!c.success)throw new Yn([r(a,c.error)]);let u=Reflect.apply(o,this,c.data),d=s._def.returns.safeParse(u,i);if(!d.success)throw new Yn([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new hm({...this._def,args:qs.create(e).rest($l.create())})}returns(e){return new hm({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new hm({args:e?e:qs.create([]).rest($l.create()),returns:t||$l.create(),typeName:Oe.ZodFunction,...ze(r)})}};vm=class vm extends et{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};vm.create=(e,t)=>new vm({getter:e,typeName:Oe.ZodLazy,...ze(t)});_m=class _m extends et{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return ee(t,{received:t.data,code:G.invalid_literal,expected:this._def.value}),Ae}return{status:"valid",value:e.data}}get value(){return this._def.value}};_m.create=(e,t)=>new _m({value:e,typeName:Oe.ZodLiteral,...ze(t)});kl=class kl extends et{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return ee(t,{expected:ot.joinValues(r),received:t.parsedType,code:G.invalid_type}),Ae}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return ee(t,{received:t.data,code:G.invalid_enum_value,options:r}),Ae}return hn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return kl.create(e,{...this._def,...t})}exclude(e,t=this._def){return kl.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};kl.create=pU;Dm=class Dm extends et{_parse(e){let t=ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ie.string&&r.parsedType!==ie.number){let n=ot.objectValues(t);return ee(r,{expected:ot.joinValues(n),received:r.parsedType,code:G.invalid_type}),Ae}if(!this._cache)this._cache=new Set(ot.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=ot.objectValues(t);return ee(r,{received:r.data,code:G.invalid_enum_value,options:n}),Ae}return hn(e.data)}get enum(){return this._def.values}};Dm.create=(e,t)=>new Dm({values:e,typeName:Oe.ZodNativeEnum,...ze(t)});Sd=class Sd extends et{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ie.promise&&t.common.async===!1)return ee(t,{code:G.invalid_type,expected:ie.promise,received:t.parsedType}),Ae;let r=t.parsedType===ie.promise?t.data:Promise.resolve(t.data);return hn(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Sd.create=(e,t)=>new Sd({type:e,typeName:Oe.ZodPromise,...ze(t)});Co=class Co extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:(o)=>{if(ee(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){let o=n.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async(s)=>{if(t.value==="aborted")return Ae;let a=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(a.status==="aborted")return Ae;if(a.status==="dirty")return wd(a.value);if(t.value==="dirty")return wd(a.value);return a});else{if(t.value==="aborted")return Ae;let s=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(s.status==="aborted")return Ae;if(s.status==="dirty")return wd(s.value);if(t.value==="dirty")return wd(s.value);return s}}if(n.type==="refinement"){let o=(s)=>{let a=n.refinement(s,i);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return Ae;if(s.status==="dirty")t.dirty();return o(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return Ae;if(s.status==="dirty")t.dirty();return o(s.value).then(()=>({status:t.value,value:s.value}))})}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Sl(o))return Ae;let s=n.transform(o.value,i);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!Sl(o))return Ae;return Promise.resolve(n.transform(o.value,i)).then((s)=>({status:t.value,value:s}))});ot.assertNever(n)}};Co.create=(e,t,r)=>new Co({schema:e,typeName:Oe.ZodEffects,effect:t,...ze(r)});Co.createWithPreprocess=(e,t,r)=>new Co({schema:t,effect:{type:"preprocess",transform:e},typeName:Oe.ZodEffects,...ze(r)});ko=class ko extends et{_parse(e){if(this._getType(e)===ie.undefined)return hn(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ko.create=(e,t)=>new ko({innerType:e,typeName:Oe.ZodOptional,...ze(t)});Ha=class Ha extends et{_parse(e){if(this._getType(e)===ie.null)return hn(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ha.create=(e,t)=>new Ha({innerType:e,typeName:Oe.ZodNullable,...ze(t)});Em=class Em extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===ie.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Em.create=(e,t)=>new Em({innerType:e,typeName:Oe.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ze(t)});Sm=class Sm extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(mm(n))return n.then((i)=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Yn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Sm.create=(e,t)=>new Sm({innerType:e,typeName:Oe.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ze(t)});Py=class Py extends et{_parse(e){if(this._getType(e)!==ie.nan){let r=this._getOrReturnCtx(e);return ee(r,{code:G.invalid_type,expected:ie.nan,received:r.parsedType}),Ae}return{status:"valid",value:e.data}}};Py.create=(e)=>new Py({typeName:Oe.ZodNaN,...ze(e)});Jxt=Symbol("zod_brand");K1=class K1 extends et{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};Iy=class Iy extends et{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return Ae;if(i.status==="dirty")return t.dirty(),wd(i.value);else return this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return Ae;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new Iy({in:e,out:t,typeName:Oe.ZodPipeline})}};$m=class $m extends et{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(Sl(n))n.value=Object.freeze(n.value);return n};return mm(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};$m.create=(e,t)=>new $m({innerType:e,typeName:Oe.ZodReadonly,...ze(t)});Yxt={object:nr.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Oe||(Oe={}));_=js.create,R=_d.create,Xxt=Py.create,Zxt=Dd.create,je=Cy.create,Qxt=gm.create,ewt=Ry.create,twt=ym.create,rwt=bm.create,nwt=Ay.create,Ga=$l.create,iwt=Ms.create,owt=Oy.create,le=$o.create,K=nr.create,swt=nr.strictCreate,$d=xm.create,J1=W1.create,awt=wm.create,cwt=qs.create,yi=Ty.create,lwt=Fy.create,uwt=Ed.create,dwt=hm.create,fwt=vm.create,ut=_m.create,yt=kl.create,pwt=Dm.create,mwt=Sd.create,hwt=Co.create,gwt=ko.create,ywt=Ha.create,bwt=Co.createWithPreprocess,xwt=Iy.create});var Y1=I(()=>{$y();V1();cU();fm();mU();Sy()});var On=I(()=>{Y1();Y1()});function X1(e){return Ny.includes(e)}var LIe,Cl,Ny,hU,BIe,gU,UIe,yU,zIe,VIe,bU,HIe,xU,Awt,Owt,wU,GIe,vU,WIe,_U,Z1=20,Q1=500,KIe,Twt;var kd=I(()=>{On();LIe=yt(["pending","verified","approved","revoked"]),Cl=yt(["person","service","test"]),Ny=Cl.options;hU={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},BIe=yt(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),gU=BIe.options,UIe=yt(["active","pending","revoked"]),yU=K({field:_(),blocks:le(_()).optional(),set_on:le(_()).optional()}).passthrough(),zIe=K({id:R().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:R().int().optional(),sandbox_completed:je().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:je().optional(),status:LIe.optional(),email_verified:je().optional(),orcid_verified:je().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:le(yU).optional(),username_auto_assigned:je().optional(),account_kind:Cl.optional()}).passthrough(),VIe=K({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),bU=K({user:zIe,token:VIe.optional()}).passthrough(),HIe=K({id:R().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:R().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),orcid:_().nullable().optional(),upload_access_requested_at:_().nullable().optional(),account_kind:Cl.optional(),matched_in:le(_()).optional(),match_kind:_().optional()}).passthrough(),xU=K({users:le(HIe),count:R().int()}).passthrough(),Awt=yt(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),Owt=yt(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),wU=K({suggestion:_().nullable(),based_on:yt(["name","unavailable","exhausted"])}).passthrough(),GIe=yt(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),vU=GIe.options,WIe=yt(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),_U=WIe.options,KIe=K({id:R().int(),email:_(),username:_().nullable(),role:_(),status:UIe,email_verified:je(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:je(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:je(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:le(yU),username_auto_assigned:je()}).passthrough(),Twt=K({user:KIe.nullable()}).passthrough()});var e$,t$,Nwt,JIe,jwt,YIe,DU,EU,r$=8,n$=100,SU,$U,XIe,kU;var km=I(()=>{On();kd();e$=["given_name","family_name","affiliation","city","country"],t$=["username","github_username","email"],Nwt=[...e$,...t$],JIe={given_name:_().max(200).optional(),family_name:_().max(200).optional(),affiliation:_().max(500).optional(),city:_().max(200).optional(),country:_().max(200).optional(),username:_().max(100).optional(),github_username:_().max(100).optional(),email:_().max(320).optional()},jwt=K(JIe),YIe=yt(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","invalid_search","invalid_user_id"]),DU=YIe.options,EU=["exact","name","prefix","substring","fuzzy"],SU=K({id:R().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Cl.optional(),email_verified:R().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:R().int().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),description:_().nullable().optional(),signup_source:_().nullable().optional(),created_at:_(),updated_at:_().nullable().optional(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),deleted_at:_().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:R().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),identity_conflict:R().int().nullable().optional(),username_auto_assigned:R().int().nullable().optional(),sandbox_completed:R().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:R().int().optional(),active_tokens:R().int().optional(),linked_identities:le(_()).optional()}).passthrough(),$U=K({user:SU}).passthrough(),XIe=K({from:_().nullable(),to:_().nullable()}),kU=K({message:_(),changed:yi(_(),XIe),notes:le(_()).optional(),old_address_notified:je().optional(),user:SU}).passthrough()});function eNe(e){return e.startsWith("v")?e:`v${e}`}var ZIe,QIe,CU,Lwt;var i$=I(()=>{On();ZIe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,QIe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;CU=_().regex(ZIe,"must be a semver version, optionally v-prefixed").transform(eNe),Lwt=_().regex(QIe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function AU(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:G.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function OU(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:G.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var tNe="0.4.1",o$,Cd,RU,rNe,nNe,iNe,TU,Vwt,FU,Hwt,Ls,oNe,jy,Gwt,sNe,aNe,Wwt;var s$=I(()=>{On();i$();o$=yt(["openneuro","nemar","gin","other"]),Cd=$d([ut(0),ut(1)]).nullable(),RU=K({dataset_id:_(),id:_().optional(),name:_(),description:_().nullable().optional(),status:_(),visibility:_(),anonymous:R().int().nullable().optional(),concept_doi:_().nullable().optional(),doi:_().nullable().optional(),created_at:_(),updated_at:_().optional(),first_published_at:_().nullable().optional(),owner_username:_().nullable().optional(),source:_().nullable().optional(),modalities:_().optional(),participants:R().int().nonnegative(),tasks:_().optional(),authors:_().optional(),license:_().optional(),file_size:R().nonnegative(),file_size_formatted:_().optional(),total_files:R().nonnegative().nullable().optional(),num_citations:R().int().nonnegative().optional(),n_channels:R().int().nullable().optional(),electrode_system:_().nullable().optional(),has_hed:Cd.optional(),hed_version:_().nullable().optional(),data_complete:Cd.optional(),bytes_present:R().nonnegative().nullable().optional(),latest_version:CU.nullable().optional(),latest_version_at:_().nullable().optional(),subject_count:R().int().nullable().optional(),file_size_bytes:R().nullable().optional(),sessions_count:R().int().nullable().optional(),age_min:R().nullable().optional(),age_max:R().nullable().optional(),bids_version:_().nullable().optional(),zarr_status:yt(["pending","ready","failed"]).nullable().optional(),zarr_store_count:R().int().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:R().int().nullable().optional(),zarr_failure_count:R().int().nullable().optional(),zarr_deterministic:Cd.optional(),zarr_failed_at:_().nullable().optional(),zarr_index_url:_().nullable().optional(),zarr_verify_status:yt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),zarr_requeue_at:_().nullable().optional(),anonymity_status:yt(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:_().nullable().optional(),anonymity_findings:_().nullable().optional(),anonymity_unchecked:_().nullable().optional(),total_recording_duration:R().nullable().optional(),recording_duration_min:R().nullable().optional(),recording_duration_max:R().nullable().optional(),recording_count:R().int().nullable().optional(),recordings_unavailable:R().int().nullable().optional(),channel_count_min:R().int().nullable().optional(),channel_count_max:R().int().nullable().optional(),sampling_frequency:R().nullable().optional(),power_line_frequency:R().nullable().optional(),eeg_reference:_().nullable().optional(),placement_scheme:_().nullable().optional()}).passthrough();rNe=RU.superRefine((e,t)=>{AU(e,t),OU(e,t)}),nNe=RU.extend({file_size:R().nonnegative().nullable(),file_size_formatted:_().nullable().optional(),modalities:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),license:_().nullable().optional(),owner_github:_().nullable().optional(),attestation_deposit_type:yt(["owner","redistribution"]).nullable().optional(),attestation_key_status:yt(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Cd.optional(),attestation_no_duplicate:Cd.optional(),attestation_upstream_source:_().nullable().optional(),attestation_accepted_at:_().nullable().optional(),zarr_data_failures:K({count:R().int().nonnegative(),detail_ref:_(),compacted_by:_().optional(),pending:R().int().nonnegative().optional(),discovered:R().int().nonnegative().optional(),events_upload_failed:ut(!0).optional(),manifest_upload_failed:ut(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{AU(e,t),OU(e,t)}),iNe=K({id:_(),name:_(),modalities:_().nullable().optional(),participants:R().int().nullable().optional(),doi:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),has_hed:Cd.optional(),score:R().optional(),snippet:_().optional()}).passthrough(),TU=yi(_(),R().int().nonnegative()),Vwt=K({datasets:le(rNe),count:R().int().nonnegative(),total_count:R().int().nonnegative().optional(),limit:R().int().optional(),offset:R().int().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:TU.optional()}).passthrough(),FU=K({results:le(iNe),count:R().int().nonnegative(),returned:R().int().nonnegative().optional(),offset:R().int().nonnegative().optional(),limit:R().int().optional(),candidate_ceiling:R().int().optional(),truncated:je().optional(),method:yt(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:R().optional(),warning:_().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:TU.optional()}).passthrough(),Hwt=K({dataset:nNe}).passthrough(),Ls=K({value:_(),count:R().int().nonnegative()}),oNe=K({values:le(Ls),distinct_total:R().int().nonnegative(),truncated:je()}),jy=K({"electrode-system":le(Ls).optional(),source:le(Ls).optional(),zarr:le(Ls).optional(),powerline:le(Ls).optional(),"bids-version":le(Ls).optional(),"hed-version":le(Ls).optional(),license:le(Ls).optional(),modality:le(Ls).optional(),task:oNe.optional(),warning:_().optional()}).passthrough(),Gwt=K({schema_version:ut(tNe),doc_type:ut("dataset"),dataset_id:_().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:_(),source:o$,recording_modality:le(_()).min(1),description:_().nullable().optional(),bids_version:_().nullable().optional(),license:_().nullable().optional()}).passthrough(),sNe=K({tasks:yi(K({runs:le(_())}).passthrough())}).passthrough(),aNe=K({sessions:le(_()),modalities:yi(sNe),session_modalities:yi(le(_())).optional()}).passthrough(),Wwt=K({version:_(),subjects:yi(aNe)}).passthrough()});function My(e){return typeof e==="string"&&PU.includes(e)}var cNe,Ywt,Xwt,Zwt,PU,lNe="ci_check_unavailable",IU,NU,Qwt;var qy=I(()=>{On();cNe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Ywt=_().regex(cNe,"ORCID must be in format 0000-0000-0000-000X"),Xwt=yt(["found","no_public_name","lookup_failed"]),Zwt=yt(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),PU=["bids_validation_pending","bids_validation_in_progress"];IU=[lNe],NU=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Qwt=yt(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var uNe,jU,Cm="https://nemar.org/settings",rvt,dNe,fNe,pNe,MU,qU;var a$=I(()=>{On();uNe=yt(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),jU=uNe.options,rvt={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Cm}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Cm}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Cm}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${Cm}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${Cm}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},dNe=yt(["orcid","email","github"]),fNe=K({id:R().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:je(),dataset_count:R().int(),identity_conflict:R().int(),canonical:je()}).passthrough(),pNe=K({kind:dNe,value:_(),canonical_user_id:R().int(),accounts:le(fNe)}).passthrough(),MU=K({groups:le(pNe),group_count:R().int(),flagged_count:R().int()}).passthrough(),qU=K({ok:ut(!0),id:R().int(),cleared:je()}).passthrough()});var c$=120,LU=64,l$="unnamed machine",mNe=25,Ly,BU,Rd,UU,ovt,svt,zU,hNe,gNe,VU,u$,HU,avt,cvt,By,Uy;var zy=I(()=>{On();Ly=yt(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),BU={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},Rd=yt(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),UU=Rd.options,ovt={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${mNe} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},svt=K({error:Rd,message:_()}).passthrough(),zU=K({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:R().int(),interval:R().int()}).passthrough(),hNe=J1("error",[K({error:ut("authorization_pending"),message:_()}).passthrough(),K({error:ut("slow_down"),message:_()}).passthrough()]),gNe=J1("error",[K({error:ut("expired_token"),reason:Rd,message:_()}).passthrough(),K({error:ut("access_denied"),reason:Rd,message:_()}).passthrough(),K({error:ut("invalid_grant"),reason:Rd,message:_()}).passthrough()]),VU=$d([hNe,gNe]),u$=K({id:R().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:je()}).passthrough(),HU=K({api_key:_(),key:u$,user:K({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:je(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),avt=K({user_code:_(),machine_name:_(),requested_at:_(),expires_in:R().int(),account:K({username:_().nullable(),email_masked:_()}).passthrough(),refusal:K({code:Rd,message:_()}).passthrough().nullable()}).passthrough(),cvt=K({ok:ut(!0),machine_name:_()}).passthrough(),By=K({keys:le(u$)}).passthrough(),Uy=K({api_key:_(),key:u$}).passthrough()});function xr(e){return ir[e]}function Bs(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var ir;var Ad=I(()=>{ir={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function bNe(e){return e==="verified"||e==="upload_access"||e==="publication"}function Od(e){return(e??"").trim().length===0}function xNe(e){return e==="service"||e==="test"}function KU(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Vy,e)?Vy[e]:void 0;if(!n)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:ir["gap.set_on.default_web"],setOnCli:null,known:!1};let i=r&&n.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??n.blocks,label:ir[n.labelKey],setOnWeb:ir[i?n.orcidWebKey:n.webKey],setOnCli:i||n.cliKey===null?null:ir[n.cliKey],known:!0}}function GU(e){let t=d$.indexOf(e);return t===-1?d$.length:t}function JU(e,t={}){return e.map((r)=>KU(r,{orcidVerified:t.orcidVerified}))}function Hy(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(bNe):[];return KU(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>GU(r.field)-GU(n.field))}function f$(e){let t=e.blocks[0],r=t?ir[yNe[t]]:ir["gap.blocks.unknown"],n=Bs(ir["gap.sentence"],{label:"",blocks:r}).trimStart(),i=e.setOnCli?Bs(ir["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):Bs(ir["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${i}`}function YU(e){return`${e.label} ${f$(e)}`}function Gy(){let e=Bs(ir["gap.sentence"],{label:WU.label,blocks:ir["cli.gap.blocks.sandbox"]}),t=Bs(ir["cli.gap.set_on.cli_only"],{cli:WU.command});return`${e} ${t}`}function XU(){return ir["cli.gaps.sandbox_unchecked"]}var Vy,d$,fvt,yNe,WU;var Td=I(()=>{Ad();Vy={email_verified:{blocks:["verified","upload_access"],labelKey:"gap.field.email_verified.label",webKey:"gap.field.email_verified.set_on.web",cliKey:"gap.field.email_verified.set_on.cli",isMissing:(e)=>e.status==="pending"||e.email_verified===!1},username:{blocks:["upload_access"],labelKey:"gap.field.username.label",webKey:"gap.field.username.set_on.web",cliKey:"gap.field.username.set_on.cli",isMissing:(e)=>e.username!==void 0&&Od(e.username)},given_name:{blocks:["upload_access","publication"],labelKey:"gap.field.given_name.label",webKey:"gap.field.given_name.set_on.web",cliKey:"gap.field.given_name.set_on.cli",orcidWebKey:"gap.field.given_name.set_on.web.orcid",isMissing:(e)=>Od(e.given_name)},family_name:{blocks:["upload_access","publication"],labelKey:"gap.field.family_name.label",webKey:"gap.field.family_name.set_on.web",cliKey:"gap.field.family_name.set_on.cli",orcidWebKey:"gap.field.family_name.set_on.web.orcid",isMissing:(e)=>Od(e.family_name)},orcid_verified:{blocks:["upload_access"],labelKey:"gap.field.orcid_verified.label",webKey:"gap.field.orcid_verified.set_on.web",cliKey:"gap.field.orcid_verified.set_on.cli",isMissing:(e)=>e.orcid_verified!==!0&&!xNe(e.account_kind)},github_username:{blocks:["upload_access","publication"],labelKey:"gap.field.github_username.label",webKey:"gap.field.github_username.set_on.web",cliKey:"gap.field.github_username.set_on.cli",isMissing:(e)=>Od(e.github_username)},city:{blocks:["upload_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>Od(e.city)},country:{blocks:["upload_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>Od(e.country)},why:{blocks:["upload_access"],labelKey:"gap.field.why.label",webKey:"gap.field.why.set_on.web",cliKey:"gap.field.why.set_on.cli",isMissing:null}},d$=Object.keys(Vy),fvt=d$.filter((e)=>Vy[e].isMissing!==null),yNe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};WU={field:"sandbox",label:ir["cli.gap.field.sandbox.label"],command:ir["cli.gap.field.sandbox.set_on.cli"]}});function Yy(e,t){let r=e.sss!==void 0;if(e.derived!==r)t.addIssue({code:G.custom,path:["sss"],message:e.derived?"derived is true but sss is absent (ADR 0028: the two travel together)":"sss is present but derived is false (ADR 0028: the two travel together)"})}var gn,Wy,ZU,Ky,wNe,Jy,vNe,_Ne,DNe,ENe,SNe,hvt,$Ne,gvt,kNe,yvt;var p$=I(()=>{On();gn=/^[a-z]{2}[0-9]{6}$/,Wy=/^[0-9a-f]{40}$/,ZU=K({name:_(),modality:_().nullable().optional(),rate:R().nullable().optional(),n_channels:R().int().nonnegative().nullable().optional(),n_samples:R().int().nonnegative().nullable().optional(),duration_s:R().nonnegative().nullable().optional(),source_rate_hz:R().nullable().optional(),n_view_levels:R().int().nonnegative().optional(),view_chunk_columns:R().int().positive().optional(),chunk_samples:R().int().positive().optional(),shard_samples:R().int().positive().optional()}).passthrough(),Ky=K({converted:R().int().nonnegative().optional(),relabelled:R().int().nonnegative().optional(),kept_importer_unit:R().int().nonnegative().optional(),units_column_present:je().optional(),sidecar:_().optional(),sidecar_supplied:je().optional(),unmatched_channels:R().int().nonnegative().optional(),unmatched_case_only:R().int().positive().optional(),matched_case_only:R().int().positive().optional(),matched_case_only_examples:le(_()).max(5).optional(),unmatched_raw_label:R().int().positive().optional(),unmatched_examples:le(_()).max(5).optional()}).passthrough(),wNe=K({channels_tsv:R().int().positive(),in_file:R().int().nonnegative(),in_store:R().int().nonnegative()}).passthrough(),Jy=K({applied:je().optional(),method:_().optional(),calibration:_().optional(),cross_talk:_().optional(),mne_version:_().optional()}).passthrough();vNe=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),updated_utc:_().optional(),source_tree:ut("raw"),derived:je(),modalities:le(_()).optional(),groups:le(ZU).optional(),power_line_frequency:R().nullable().optional(),event_description_count:R().int().nonnegative().optional(),n_events:R().int().nonnegative().optional(),trial_types:yi(_(),R().int().nonnegative()).optional(),units_report:Ky.optional(),channels_tsv_read_error:je().optional(),channels_tsv_count_mismatch:wNe.optional(),split_members:le(_()).optional(),sss:Jy.optional()}).passthrough().superRefine(Yy),_Ne=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr").optional(),code:_(),reason:_(),detail:_().nullable().optional(),attempts:R().int().nonnegative().optional()}).passthrough(),DNe=yt(["infra_failure","memory_budget","not_attempted"]),ENe=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),reason:DNe,attempts:R().int().nonnegative(),last_error:_().nullable().optional(),last_attempt_utc:_().nullable().optional()}).passthrough(),SNe=K({level0:ut("<zarr>/<group>/0"),view:ut("<zarr>/<group>/view/<L>"),view_levels:ut("1..n_view_levels from the group attrs"),scale_offset:ut("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ut("<data_base>events.parquet").optional()}).passthrough(),hvt=K({format:ut("nemar-zarr-index"),format_version:ut(3),dataset_id:_().regex(gn,"NEMAR dataset id (nm/on/xx band)"),contract_base:_().regex(/^https:\/\//,"must be https"),data_base:_().regex(/^https:\/\//,"must be https"),data_base_kind:ut("s3-public"),s3_uri:_().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:_().min(1),s3_anonymous:je(),source_commit:_().regex(Wy,"must be a full 40-hex SHA"),engine_version:_().min(1),biosigio_version:_().nullable().optional(),updated_utc:_(),discovered_count:R().int().nonnegative(),store_count:R().int().nonnegative(),n_recordings:R().int().nonnegative(),errors:R().int().nonnegative(),failure_count:R().int().nonnegative(),pending_count:R().int().nonnegative(),stores:le(vNe),failures:le(_Ne),pending:le(ENe),doi:_().nullable().optional(),license:_().nullable().optional(),citation:_().nullable().optional(),hed_version:_().nullable().optional(),events_parquet:_().regex(/^https:\/\//,"must be https").optional(),events_row_count:R().int().nonnegative().optional(),layout:SNe}).passthrough(),$Ne=K({name:_(),configuration:yi(_(),Ga()).optional()}).passthrough(),gvt=K({zarr_format:ut(3),node_type:ut("array"),shape:le(R().int().nonnegative()),data_type:_(),chunk_grid:K({name:_(),configuration:yi(_(),Ga()).optional()}).passthrough(),codecs:le($Ne),fill_value:Ga().optional(),attributes:yi(_(),Ga()).optional(),dimension_names:le(_().nullable()).optional()}).passthrough(),kNe=K({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),groups:le(ZU).optional(),modalities:le(_()).optional()}).passthrough(),yvt=K({format:ut("nemar-zarr-index"),format_version:R().int(),dataset_id:_().regex(gn,"NEMAR dataset id (nm/on/xx band)"),source_commit:_(),stores:le(kNe)}).passthrough()});function QU(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var CNe,RNe,ANe,ONe,Ro,wvt;var Xy=I(()=>{s$();CNe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],RNe=["50","60"],ANe=["ready","pending","failed"],ONe=o$.options,Ro=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:RNe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:CNe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:ONe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:ANe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],wvt=new Map(Ro.map((e)=>[e.key,e]))});var TNe,Svt,FNe,iz,Rm,ez,PNe,oz,INe=20,NNe=100,jNe,sz,MNe,$vt,kvt,qNe,Cvt,Rvt,LNe,BNe,UNe,Avt,zNe=50,VNe=500,Ovt,HNe,GNe,Tvt,WNe=1000,KNe=5000,tz=8,JNe=100,YNe=32,rz,Fvt,XNe,ZNe,QNe,Pvt,e3e=800,t3e=4000,Ivt,Nvt,m$=60,h$=64,nz,r3e=86400,n3e=4096,jvt,i3e,o3e,Mvt;var az=I(()=>{On();Xy();p$();TNe=K({dataset_id:_().regex(gn),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:le(_()).optional(),tasks:le(_()).optional(),subject_count:R().int().nonnegative().nullable().optional(),has_hed:$d([ut(0),ut(1)]).nullable().optional(),hed_version:_().nullable().optional(),store_count:R().int().nonnegative().nullable().optional(),recording_count:R().int().nonnegative().nullable().optional(),recordings_unavailable:R().int().nonnegative().nullable().optional(),total_recording_duration:R().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:R().int().nonnegative().nullable().optional(),zarr_verify_status:yt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),index_url:_().nullable().optional()}).passthrough(),Svt=K({format:ut("nemar-zarr-catalog"),format_version:R().int(),generated_utc:_(),contract_base:_(),count:R().int().nonnegative(),datasets:le(TNe)}).passthrough(),FNe=["verified","failed","unverifiable"],iz=yt(FNe).nullable(),Rm=K({dataset_id:_().regex(gn),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),source_commit:_().regex(Wy),index_etag:_().nullable(),engine_version:_(),source_tree:ut("raw"),derived:je(),sss:Jy.optional(),lossy:je(),dtype:_().nullable(),effective_rate_hz:R().nullable(),source_rate_hz:R().nullable(),units_report:Ky.nullable().optional(),zarr_verify_status:iz,note:_().nullable().optional()}).passthrough().superRefine(Yy),ez=K({start:R().int().nonnegative(),end:R().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),PNe=K({python_zarr:_(),zarrita:_(),python_browser:_()}).passthrough(),oz=K({contract_base:_(),data_base:_(),s3_uri:_(),s3_region:_(),s3_anonymous:je(),zarr:_(),group:_(),level:$d([ut("0"),R().int().positive()]),array_path:_(),dtype:_().nullable(),codecs:le(Ga()).optional(),chunk_samples:R().int().positive().nullable(),shard_samples:R().int().positive().nullable(),n_channels:R().int().nonnegative().nullable(),sample_slice:ez.optional(),channel_slice:ez.optional(),scale_offset:_(),how_to:PNe}).passthrough(),jNe=Object.fromEntries(Ro.map((e)=>[e.queryParam,_().optional()])),sz={modality:_().optional(),task:_().optional(),has_hed:je().optional(),has_zarr:je().optional(),author:_().optional(),has_doi:je().optional(),has_zarr_verified:je().optional(),data_complete:je().optional(),recent:R().int().positive().optional(),license:_().optional()},MNe=Object.keys(sz),$vt=[...MNe,...Ro.map((e)=>e.queryParam)],kvt=K({query:_().optional(),...sz,include_unknown:je().optional(),...jNe,limit:R().int().positive().max(NNe).default(INe)}).passthrough(),qNe=K({dataset_id:_().regex(gn),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:le(_()).optional(),tasks:le(_()).optional(),subject_count:R().int().nullable().optional(),has_hed:je().nullable().optional(),has_zarr:je()}).passthrough(),Cvt=K({results:le(qNe),count:R().int().nonnegative(),limit:R().int(),note:_().nullable().optional(),truncated:je().optional()}).passthrough(),Rvt=K({dataset_id:_().regex(gn)}).passthrough(),LNe=["list_recordings","get_events","render_overview","read_window"],BNe=K({next_cheapest_tool:yt(LNe),reason:_()}).passthrough(),UNe=["pending","ready","failed"],Avt=K({dataset_id:_().regex(gn),name:_(),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),modalities:le(_()).optional(),tasks:le(_()).optional(),subject_count:R().int().nullable().optional(),has_hed:je().nullable().optional(),hed_version:_().nullable().optional(),recording_count:R().int().nullable().optional(),total_recording_duration_s:R().nullable().optional(),zarr_status:yt(UNe).nullable().optional(),zarr_verify_status:iz.optional(),zarr_source_commit:_().nullable().optional(),zarr_store_count:R().int().nullable().optional(),cost_hint:BNe}).passthrough(),Ovt=K({dataset_id:_().regex(gn),modality:_().optional(),min_duration_s:R().nonnegative().optional(),include_derived:je().default(!1),limit:R().int().positive().max(VNe).default(zNe),offset:R().int().nonnegative().default(0)}).passthrough(),HNe=K({name:_(),modality:_().nullable().optional(),rate:R().nullable().optional(),n_channels:R().int().nullable().optional(),duration_s:R().nullable().optional(),n_view_levels:R().int().nonnegative().nullable().optional(),n_samples:R().int().nonnegative().nullable().optional(),view_chunk_columns:R().int().positive().nullable().optional()}).passthrough(),GNe=K({path:_(),zarr:_(),source_tree:ut("raw"),derived:je(),groups:le(HNe).optional(),n_events:R().int().nonnegative().optional(),sss:Jy.optional(),units_report:Ky.optional()}).passthrough().superRefine(Yy),Tvt=K({dataset_id:_().regex(gn),source_commit:_().regex(Wy).nullable(),recordings:le(GNe),total_count:R().int().nonnegative(),excluded_derived_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),index_format_version:R().int(),discovered_count:R().int().nonnegative().nullable(),failure_count:R().int().nonnegative().nullable(),pending_count:R().int().nonnegative().nullable(),excluded_legacy_non_raw_count:R().int().nonnegative(),note:_().nullable().optional(),envelope:Rm.optional()}).passthrough(),rz=_().min(1).max(64),Fvt=K({dataset_id:_().regex(gn),recording:_(),group:_().optional(),limit:R().int().positive().max(KNe).default(WNe),offset:R().int().nonnegative().default(0),where:yi(rz,le($d([_(),R()])).min(1).max(JNe)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=tz},{message:`where names 1 to ${tz} columns`}).optional(),columns:le(rz).min(1).max(YNe).optional()}).passthrough(),XNe=K({store_path:_(),group_name:_(),onset_s:R(),duration_s:R().nullable().optional(),sample_index:R().int().nonnegative(),trial_type:_().nullable().optional(),value:$d([_(),R()]).nullable().optional(),hed:_().nullable().optional()}).passthrough(),ZNe=XNe.partial().required({onset_s:!0,sample_index:!0}),QNe=K({name:_(),distinct_count:R().int().nonnegative(),null_count:R().int().nonnegative(),values:le(K({value:_(),count:R().int().positive()}).passthrough()).nullable()}).passthrough(),Pvt=K({dataset_id:_().regex(gn),recording:_(),events:le(ZNe),source:yt(["events_parquet","events_tsv_fallback"]),estimated:je(),total_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),truncated:je(),note:_().nullable().optional(),columns_summary:le(QNe).optional(),envelope:Rm.optional()}).passthrough(),Ivt=K({dataset_id:_().regex(gn),recording:_(),group:_().optional(),width_px:R().int().positive().max(t3e).default(e3e)}).passthrough(),Nvt=K({dataset_id:_().regex(gn),recording:_(),group:_(),level:R().int().positive(),width_px:R().int().positive(),height_px:R().int().positive(),mime_type:ut("image/png"),columns_read:R().int().nonnegative(),chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),envelope:Rm.optional()}).passthrough(),nz=m$*h$,jvt=K({dataset_id:_().regex(gn),recording:_(),group:_().optional(),start_s:R().nonnegative().default(0),duration_s:R().positive().max(r3e).default(10),channels:le(R().int().nonnegative()).max(n3e).optional(),taste:je().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:G.custom,message:"taste requires channels: name the channel indices you want (list_recordings reports each group's n_channels), or omit taste for a recipe",path:["channels"]});return}if(e.duration_s>m$)t.addIssue({code:G.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${m$} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>h$)t.addIssue({code:G.custom,message:`taste channels (${e.channels.length}) exceeds the ${h$}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>nz)t.addIssue({code:G.custom,message:`taste exceeds the cap of ${nz} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),i3e=K({mode:ut("recipe"),recipe:oz,envelope:Rm}).passthrough(),o3e=K({mode:ut("taste"),start_s:R(),duration_s:R(),channels:le(R().int()),sample_rate_hz:R(),values:le(le(R())),recipe:oz,chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),filled_ranges:le(K({start_sample:R().int().nonnegative(),end_sample:R().int().nonnegative(),start_s:R(),end_s:R()}).passthrough()),note:_().nullable().optional(),envelope:Rm}).passthrough(),Mvt=J1("mode",[i3e,o3e])});var Fd=I(()=>{i$();kd();s$();qy();a$();zy();Ad();Td();p$();az()});function Qy(e){return e?l3e:Wa}var Wa,c3e,l3e,b$;var eb=I(()=>{Wa=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],c3e=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],l3e=Wa.filter((e)=>!c3e.includes(e));b$={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function nb(e){let t=[],r="",n="start",i=!1;for(let o of e)switch(o){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(i)r+=o;n="property",i=!i;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=o;break}if(S$.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=o;break}if(n==="property"){if(S$.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!h3e.has(o))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(i)i=!1,r+="\\";r+=o}}if(i)r+="\\";switch(n){case"property":{if(S$.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function $$(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function gz(e,t){if($$(e,t))throw Error("Cannot use string index")}function yz(e,t,r){if(!Ol(e)||typeof t!=="string")return r===void 0?e:r;let n=nb(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){let o=n[i];if($$(e,o))e=i===n.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function k$(e,t,r){if(!Ol(e)||typeof t!=="string")return e;let n=e,i=nb(t);for(let o=0;o<i.length;o++){let s=i[o];if(gz(e,s),o===i.length-1)e[s]=r;else if(!Ol(e[s]))e[s]=typeof i[o+1]==="number"?[]:{};e=e[s]}return n}function bz(e,t){if(!Ol(e)||typeof t!=="string")return!1;let r=nb(t);for(let n=0;n<r.length;n++){let i=r[n];if(gz(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!Ol(e))return!1}}function xz(e,t){if(!Ol(e)||typeof t!=="string")return!1;let r=nb(t);if(r.length===0)return!1;for(let n of r){if(!Ol(e)||!(n in e)||$$(e,n))return!1;e=e[n]}return!0}var Ol=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},S$,h3e;var wz=I(()=>{S$=new Set(["__proto__","prototype","constructor"]),h3e=new Set("0123456789")});import Xt from"path";import vz from"os";import C$ from"process";function A$(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(C$.platform==="darwin")return g3e(e);if(C$.platform==="win32")return y3e(e);return b3e(e)}var Ja,R$,Id,g3e=(e)=>{let t=Xt.join(Ja,"Library");return{data:Xt.join(t,"Application Support",e),config:Xt.join(t,"Preferences",e),cache:Xt.join(t,"Caches",e),log:Xt.join(t,"Logs",e),temp:Xt.join(R$,e)}},y3e=(e)=>{let t=Id.APPDATA||Xt.join(Ja,"AppData","Roaming"),r=Id.LOCALAPPDATA||Xt.join(Ja,"AppData","Local");return{data:Xt.join(r,e,"Data"),config:Xt.join(t,e,"Config"),cache:Xt.join(r,e,"Cache"),log:Xt.join(r,e,"Log"),temp:Xt.join(R$,e)}},b3e=(e)=>{let t=Xt.basename(Ja);return{data:Xt.join(Id.XDG_DATA_HOME||Xt.join(Ja,".local","share"),e),config:Xt.join(Id.XDG_CONFIG_HOME||Xt.join(Ja,".config"),e),cache:Xt.join(Id.XDG_CACHE_HOME||Xt.join(Ja,".cache"),e),log:Xt.join(Id.XDG_STATE_HOME||Xt.join(Ja,".local","state"),e),temp:Xt.join(R$,t,e)}};var _z=I(()=>{Ja=vz.homedir(),R$=vz.tmpdir(),{env:Id}=C$});var x3e=(e,t)=>{let{onError:r}=t;return function(...i){return e.apply(void 0,i).catch(r)}},Ao;var Dz=I(()=>{Ao=x3e});var w3e=(e,t)=>{let{onError:r}=t;return function(...i){try{return e.apply(void 0,i)}catch(o){return r(o)}}},Yi;var Ez=I(()=>{Yi=w3e});var Sz=250;var $z=()=>{};var v3e=(e,t)=>{let{isRetriable:r}=t;return function(i){let{timeout:o}=i,s=i.interval??Sz,a=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(s*Math.random());if(f>0)return new Promise((p)=>setTimeout(p,f)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},Oo;var kz=I(()=>{$z();Oo=v3e});var _3e=(e,t)=>{let{isRetriable:r}=t;return function(i){let{timeout:o}=i,s=Date.now()+o;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=s)throw u;continue}}}},To;var Cz=I(()=>{To=_3e});var O$=I(()=>{Dz();Ez();kz();Cz()});var Om,T$;var Rz=I(()=>{F$();Om={isChangeErrorOk:(e)=>{if(!Om.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Az&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Om.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!Om.isNodeError(e))throw e;if(Om.isChangeErrorOk(e))return;throw e}},T$=Om});import Oz from"process";var Tm,Tn,Az,Gr;var F$=I(()=>{Rz();Tm={onError:T$.onChangeError},Tn={onError:()=>{return}},Az=Oz.getuid?!Oz.getuid():!1,Gr={isRetriable:T$.isRetriableError}});import mt from"fs";import{promisify as on}from"util";var D3e,Pr;var P$=I(()=>{O$();O$();F$();D3e={attempt:{chmod:Ao(on(mt.chmod),Tm),chown:Ao(on(mt.chown),Tm),close:Ao(on(mt.close),Tn),fsync:Ao(on(mt.fsync),Tn),mkdir:Ao(on(mt.mkdir),Tn),realpath:Ao(on(mt.realpath),Tn),stat:Ao(on(mt.stat),Tn),unlink:Ao(on(mt.unlink),Tn),chmodSync:Yi(mt.chmodSync,Tm),chownSync:Yi(mt.chownSync,Tm),closeSync:Yi(mt.closeSync,Tn),existsSync:Yi(mt.existsSync,Tn),fsyncSync:Yi(mt.fsync,Tn),mkdirSync:Yi(mt.mkdirSync,Tn),realpathSync:Yi(mt.realpathSync,Tn),statSync:Yi(mt.statSync,Tn),unlinkSync:Yi(mt.unlinkSync,Tn)},retry:{close:Oo(on(mt.close),Gr),fsync:Oo(on(mt.fsync),Gr),open:Oo(on(mt.open),Gr),readFile:Oo(on(mt.readFile),Gr),rename:Oo(on(mt.rename),Gr),stat:Oo(on(mt.stat),Gr),write:Oo(on(mt.write),Gr),writeFile:Oo(on(mt.writeFile),Gr),closeSync:To(mt.closeSync,Gr),fsyncSync:To(mt.fsyncSync,Gr),openSync:To(mt.openSync,Gr),readFileSync:To(mt.readFileSync,Gr),renameSync:To(mt.renameSync,Gr),statSync:To(mt.statSync,Gr),writeSync:To(mt.writeSync,Gr),writeFileSync:To(mt.writeFileSync,Gr)}},Pr=D3e});import Tl from"process";var Tz="utf8",I$=438,Fz=511,Pz,Iz,Nz,jz=1000,Mz,M_t,N$=128;var j$=I(()=>{Pz={},Iz=Tl.geteuid?Tl.geteuid():-1,Nz=Tl.getegid?Tl.getegid():-1,Mz=!!Tl.getuid,M_t=Tl.getuid?!Tl.getuid():!1});var qz=(e)=>e instanceof Error&&("code"in e),M$=(e)=>typeof e==="string",ib=(e)=>e===void 0;var Lz=()=>{};var Bz=()=>{};import Uz from"process";var zz,ob;var q$=I(()=>{zz=Uz.platform==="linux",ob=Uz.platform==="win32"});var L$,Vz;var Hz=I(()=>{q$();L$=["SIGHUP","SIGINT","SIGTERM"];if(!ob)L$.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(zz)L$.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Vz=L$});import Nd from"process";class Gz{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(ob&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Nd.kill(Nd.pid,"SIGTERM");else Nd.kill(Nd.pid,e)},this.hook=()=>{Nd.once("exit",()=>this.exit());for(let e of Vz)try{Nd.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Wz;var Kz=I(()=>{q$();Hz();Wz=new Gz});var E3e,Jz;var Yz=I(()=>{Kz();E3e=Wz.register,Jz=E3e});import S3e from"path";var Zn,Fm;var Xz=I(()=>{P$();Yz();j$();Zn={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",i=`.tmp-${r}${t}`;return`${e}${i}`},get:(e,t,r=!0)=>{let n=Zn.truncate(t(e));if(n in Zn.store)return Zn.get(e,t,r);return Zn.store[n]=r,[n,()=>delete Zn.store[n]]},purge:(e)=>{if(!Zn.store[e])return;delete Zn.store[e],Pr.attempt.unlink(e)},purgeSync:(e)=>{if(!Zn.store[e])return;delete Zn.store[e],Pr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Zn.store)Zn.purgeSync(e)},truncate:(e)=>{let t=S3e.basename(e);if(t.length<=N$)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-N$;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Jz(Zn.purgeSyncAll);Fm=Zn});import $3e from"path";function B$(e,t,r=Pz){if(M$(r))return B$(e,t,{encoding:r});let i={timeout:r.timeout??jz},o=null,s=null,a=null;try{let c=Pr.attempt.realpathSync(e),u=!!c;e=c||e,[s,o]=Fm.get(e,r.tmpCreate||Fm.create,r.tmpPurge!==!1);let d=Mz&&ib(r.chown),f=ib(r.mode);if(u&&(d||f)){let m=Pr.attempt.statSync(e);if(m){if(r={...r},d)r.chown={uid:m.uid,gid:m.gid};if(f)r.mode=m.mode}}if(!u){let m=$3e.dirname(e);Pr.attempt.mkdirSync(m,{mode:Fz,recursive:!0})}if(a=Pr.retry.openSync(i)(s,"w",r.mode||I$),r.tmpCreated)r.tmpCreated(s);if(M$(t))Pr.retry.writeSync(i)(a,t,0,r.encoding||Tz);else if(!ib(t))Pr.retry.writeSync(i)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Pr.retry.fsyncSync(i)(a);else Pr.attempt.fsync(a);if(Pr.retry.closeSync(i)(a),a=null,r.chown&&(r.chown.uid!==Iz||r.chown.gid!==Nz))Pr.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==I$)Pr.attempt.chmodSync(s,r.mode);try{Pr.retry.renameSync(i)(s,e)}catch(m){if(!qz(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Pr.retry.renameSync(i)(s,Fm.truncate(e))}o(),s=null}finally{if(a)Pr.attempt.closeSync(a);if(s)Fm.purge(s)}}var Zz=I(()=>{P$();j$();Lz();Bz();Xz()});var Im=y(function(tV){Object.defineProperty(tV,"__esModule",{value:!0});tV.regexpCode=tV.getEsmExportName=tV.getProperty=tV.safeStringify=tV.stringify=tV.strConcat=tV.addCodeArg=tV.str=tV._=tV.nil=tV._Code=tV.Name=tV.IDENTIFIER=tV._CodeOrName=void 0;class sb{}tV._CodeOrName=sb;tV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class jd extends sb{constructor(e){super();if(!tV.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}tV.Name=jd;class Xi extends sb{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof jd)t[r.str]=(t[r.str]||0)+1;return t},{})}}tV._Code=Xi;tV.nil=new Xi("");function Qz(e,...t){let r=[e[0]],n=0;while(n<t.length)z$(r,t[n]),r.push(e[++n]);return new Xi(r)}tV._=Qz;var U$=new Xi("+");function eV(e,...t){let r=[Pm(e[0])],n=0;while(n<t.length)r.push(U$),z$(r,t[n]),r.push(U$,Pm(e[++n]));return k3e(r),new Xi(r)}tV.str=eV;function z$(e,t){if(t instanceof Xi)e.push(...t._items);else if(t instanceof jd)e.push(t);else e.push(A3e(t))}tV.addCodeArg=z$;function k3e(e){let t=1;while(t<e.length-1){if(e[t]===U$){let r=C3e(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function C3e(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof jd||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof jd))return`"${e}${t.slice(1)}`;return}function R3e(e,t){return t.emptyStr()?e:e.emptyStr()?t:eV`${e}${t}`}tV.strConcat=R3e;function A3e(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pm(Array.isArray(e)?e.join(","):e)}function O3e(e){return new Xi(Pm(e))}tV.stringify=O3e;function Pm(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}tV.safeStringify=Pm;function T3e(e){return typeof e=="string"&&tV.IDENTIFIER.test(e)?new Xi(`.${e}`):Qz`[${e}]`}tV.getProperty=T3e;function F3e(e){if(typeof e=="string"&&tV.IDENTIFIER.test(e))return new Xi(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}tV.getEsmExportName=F3e;function P3e(e){return new Xi(e.toString())}tV.regexpCode=P3e});var W$=y(function(oV){Object.defineProperty(oV,"__esModule",{value:!0});oV.ValueScope=oV.ValueScopeName=oV.Scope=oV.varKinds=oV.UsedValueState=void 0;var Rt=Im();class nV extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var cb;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(cb||(oV.UsedValueState=cb={}));oV.varKinds={const:new Rt.Name("const"),let:new Rt.Name("let"),var:new Rt.Name("var")};class H${constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Rt.Name?e:this.name(e)}name(e){return new Rt.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}oV.Scope=H$;class G$ extends Rt.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Rt._`.${new Rt.Name(t)}[${r}]`}}oV.ValueScopeName=G$;var W3e=Rt._`\n`;class iV extends H${constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?W3e:Rt.nil}}get(){return this._scope}name(e){return new G$(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[i];if(s){let u=s.get(o);if(u)return u}else s=this._values[i]=new Map;s.set(o,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return Rt._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let i=Rt.nil;for(let o in e){let s=e[o];if(!s)continue;let a=r[o]=r[o]||new Map;s.forEach((c)=>{if(a.has(c))return;a.set(c,cb.Started);let u=t(c);if(u){let d=this.opts.es5?oV.varKinds.var:oV.varKinds.const;i=Rt._`${i}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))i=Rt._`${i}${u}${this.opts._n}`;else throw new nV(c);a.set(c,cb.Completed)})}return i}}oV.ValueScope=iV});var Ve=y(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});Fn.or=Fn.and=Fn.not=Fn.CodeGen=Fn.operators=Fn.varKinds=Fn.ValueScopeName=Fn.ValueScope=Fn.Scope=Fn.Name=Fn.regexpCode=Fn.stringify=Fn.getProperty=Fn.nil=Fn.strConcat=Fn.str=Fn._=void 0;var oe=Im(),or=W$(),Ya=Im();Object.defineProperty(Fn,"_",{enumerable:!0,get:function(){return Ya._}});Object.defineProperty(Fn,"str",{enumerable:!0,get:function(){return Ya.str}});Object.defineProperty(Fn,"strConcat",{enumerable:!0,get:function(){return Ya.strConcat}});Object.defineProperty(Fn,"nil",{enumerable:!0,get:function(){return Ya.nil}});Object.defineProperty(Fn,"getProperty",{enumerable:!0,get:function(){return Ya.getProperty}});Object.defineProperty(Fn,"stringify",{enumerable:!0,get:function(){return Ya.stringify}});Object.defineProperty(Fn,"regexpCode",{enumerable:!0,get:function(){return Ya.regexpCode}});Object.defineProperty(Fn,"Name",{enumerable:!0,get:function(){return Ya.Name}});var mb=W$();Object.defineProperty(Fn,"Scope",{enumerable:!0,get:function(){return mb.Scope}});Object.defineProperty(Fn,"ValueScope",{enumerable:!0,get:function(){return mb.ValueScope}});Object.defineProperty(Fn,"ValueScopeName",{enumerable:!0,get:function(){return mb.ValueScopeName}});Object.defineProperty(Fn,"varKinds",{enumerable:!0,get:function(){return mb.varKinds}});Fn.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};class Xa{optimizeNodes(){return this}optimizeNames(e,t){return this}}class aV extends Xa{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?or.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=qd(this.rhs,e,t);return this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}}class Y$ extends Xa{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=qd(this.rhs,e,t),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return pb(e,this.rhs)}}class cV extends Y${constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class lV extends Xa{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class uV extends Xa{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class dV extends Xa{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class fV extends Xa{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=qd(this.code,e,t),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}}class hb extends Xa{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let i=r[n];if(i.optimizeNames(e,t))continue;X3e(e,i.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Fl(e,t.names),{})}}class Za extends hb{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class pV extends hb{}class Nm extends Za{}Nm.kind="else";class Us extends Za{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Nm(r):r}if(t){if(e===!1)return t instanceof Us?t:t.nodes;if(this.nodes.length)return this;return new Us(bV(e),t instanceof Us?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=qd(this.condition,e,t),this}get names(){let e=super.names;if(pb(e,this.condition),this.else)Fl(e,this.else.names);return e}}Us.kind="if";class Md extends Za{}Md.kind="for";class mV extends Md{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=qd(this.iteration,e,t),this}get names(){return Fl(super.names,this.iteration.names)}}class hV extends Md{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?or.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=pb(super.names,this.from);return pb(e,this.to)}}class K$ extends Md{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=qd(this.iterable,e,t),this}get names(){return Fl(super.names,this.iterable.names)}}class lb extends Za{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}lb.kind="func";class ub extends hb{render(e){return"return "+super.render(e)}}ub.kind="return";class gV extends Za{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Fl(e,this.catch.names);if(this.finally)Fl(e,this.finally.names);return e}}class db extends Za{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}db.kind="catch";class fb extends Za{render(e){return"finally"+super.render(e)}}fb.kind="finally";class yV{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
85
85
|
`:""},this._extScope=e,this._scope=new or.Scope({parent:e}),this._nodes=[new pV]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);if(r!==void 0&&n)this._constants[i.str]=r;return this._leafNode(new aV(e,i,r)),i}const(e,t,r){return this._def(or.varKinds.const,e,t,r)}let(e,t,r){return this._def(or.varKinds.let,e,t,r)}var(e,t,r){return this._def(or.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Y$(e,t,r))}add(e,t){return this._leafNode(new cV(e,Fn.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==oe.nil)this._leafNode(new fV(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),oe.addCodeArg(t,n)}return t.push("}"),new oe._Code(t)}if(e,t,r){if(this._blockNode(new Us(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Us(e))}else(){return this._elseNode(new Nm)}endIf(){return this._endBlockNode(Us,Nm)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new mV(e),t)}forRange(e,t,r,n,i=this.opts.es5?or.varKinds.var:or.varKinds.let){let o=this._scope.toName(e);return this._for(new hV(i,o,t,r),()=>n(o))}forOf(e,t,r,n=or.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof oe.Name?t:this.var("_arr",t);return this.forRange("_i",0,oe._`${o}.length`,(s)=>{this.var(i,oe._`${o}[${s}]`),r(i)})}return this._for(new K$("of",n,i,t),()=>r(i))}forIn(e,t,r,n=this.opts.es5?or.varKinds.var:or.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,oe._`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new K$("in",n,i,t),()=>r(i))}endFor(){return this._endBlockNode(Md)}label(e){return this._leafNode(new lV(e))}break(e){return this._leafNode(new uV(e))}return(e){let t=new ub;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ub)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new gV;if(this._blockNode(n),this.code(e),t){let i=this.name("e");this._currNode=n.catch=new db(i),t(i)}if(r)this._currNode=n.finally=new fb,this.code(r);return this._endBlockNode(db,fb)}throw(e){return this._leafNode(new dV(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=oe.nil,r,n){if(this._blockNode(new lb(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(lb)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Us))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}Fn.CodeGen=yV;function Fl(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function pb(e,t){return t instanceof oe._CodeOrName?Fl(e,t.names):e}function qd(e,t,r){if(e instanceof oe.Name)return n(e);if(!i(e))return e;return new oe._Code(e._items.reduce((o,s)=>{if(s instanceof oe.Name)s=n(s);if(s instanceof oe._Code)o.push(...s._items);else o.push(s);return o},[]));function n(o){let s=r[o.str];if(s===void 0||t[o.str]!==1)return o;return delete t[o.str],s}function i(o){return o instanceof oe._Code&&o._items.some((s)=>s instanceof oe.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function X3e(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function bV(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:oe._`!${J$(e)}`}Fn.not=bV;var Z3e=xV(Fn.operators.AND);function Q3e(...e){return e.reduce(Z3e)}Fn.and=Q3e;var e4e=xV(Fn.operators.OR);function t4e(...e){return e.reduce(e4e)}Fn.or=t4e;function xV(e){return(t,r)=>t===oe.nil?r:r===oe.nil?t:oe._`${J$(t)} ${e} ${J$(r)}`}function J$(e){return e instanceof oe.Name?e:oe._`(${e})`}});var nt=y(function(RV){Object.defineProperty(RV,"__esModule",{value:!0});RV.checkStrictMode=RV.getErrorPath=RV.Type=RV.useFunc=RV.setEvaluated=RV.evaluatedPropsToName=RV.mergeEvaluated=RV.eachItem=RV.unescapeJsonPointer=RV.escapeJsonPointer=RV.escapeFragment=RV.unescapeFragment=RV.schemaRefOrVal=RV.schemaHasRulesButRef=RV.schemaHasRules=RV.checkUnknownRules=RV.alwaysValidSchema=RV.toHash=void 0;var we=Ve(),DV=Im();function o4e(e){let t={};for(let r of e)t[r]=!0;return t}RV.toHash=o4e;function s4e(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return EV(e,t),!SV(t,e.self.RULES.all)}RV.alwaysValidSchema=s4e;function EV(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let i=n.RULES.keywords;for(let o in t)if(!i[o])CV(e,`unknown keyword: "${o}"`)}RV.checkUnknownRules=EV;function SV(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}RV.schemaHasRules=SV;function a4e(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}RV.schemaHasRulesButRef=a4e;function c4e({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return we._`${r}`}return we._`${e}${t}${we.getProperty(n)}`}RV.schemaRefOrVal=c4e;function l4e(e){return $V(decodeURIComponent(e))}RV.unescapeFragment=l4e;function u4e(e){return encodeURIComponent(Z$(e))}RV.escapeFragment=u4e;function Z$(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}RV.escapeJsonPointer=Z$;function $V(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}RV.unescapeJsonPointer=$V;function d4e(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}RV.eachItem=d4e;function vV({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof we.Name?(o instanceof we.Name?e(i,o,s):t(i,o,s),s):o instanceof we.Name?(t(i,s,o),o):r(o,s);return a===we.Name&&!(c instanceof we.Name)?n(i,c):c}}RV.mergeEvaluated={props:vV({mergeNames:(e,t,r)=>e.if(we._`${r} !== true && ${t} !== undefined`,()=>{e.if(we._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,we._`${r} || {}`).code(we._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(we._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,we._`${r} || {}`),Q$(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:kV}),items:vV({mergeNames:(e,t,r)=>e.if(we._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,we._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(we._`${r} !== true`,()=>e.assign(r,t===!0?!0:we._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function kV(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",we._`{}`);if(t!==void 0)Q$(e,r,t);return r}RV.evaluatedPropsToName=kV;function Q$(e,t,r){Object.keys(r).forEach((n)=>e.assign(we._`${t}${we.getProperty(n)}`,!0))}RV.setEvaluated=Q$;var _V={};function f4e(e,t){return e.scopeValue("func",{ref:t,code:_V[t.code]||(_V[t.code]=new DV._Code(t.code))})}RV.useFunc=f4e;var X$;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(X$||(RV.Type=X$={}));function p4e(e,t,r){if(e instanceof we.Name){let n=t===X$.Num;return r?n?we._`"[" + ${e} + "]"`:we._`"['" + ${e} + "']"`:n?we._`"/" + ${e}`:we._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?we.getProperty(e).toString():"/"+Z$(e)}RV.getErrorPath=p4e;function CV(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}RV.checkStrictMode=CV});var bi=y(function(OV){Object.defineProperty(OV,"__esModule",{value:!0});var bt=Ve(),O4e={data:new bt.Name("data"),valCxt:new bt.Name("valCxt"),instancePath:new bt.Name("instancePath"),parentData:new bt.Name("parentData"),parentDataProperty:new bt.Name("parentDataProperty"),rootData:new bt.Name("rootData"),dynamicAnchors:new bt.Name("dynamicAnchors"),vErrors:new bt.Name("vErrors"),errors:new bt.Name("errors"),this:new bt.Name("this"),self:new bt.Name("self"),scope:new bt.Name("scope"),json:new bt.Name("json"),jsonPos:new bt.Name("jsonPos"),jsonLen:new bt.Name("jsonLen"),jsonPart:new bt.Name("jsonPart")};OV.default=O4e});var jm=y(function(IV){Object.defineProperty(IV,"__esModule",{value:!0});IV.extendErrors=IV.resetErrorsCount=IV.reportExtraError=IV.reportError=IV.keyword$DataError=IV.keywordError=void 0;var ue=Ve(),Qa=nt(),yn=bi();IV.keywordError={message:({keyword:e})=>ue.str`must pass "${e}" keyword validation`};IV.keyword$DataError={message:({keyword:e,schemaType:t})=>t?ue.str`"${e}" keyword must be ${t} ($data)`:ue.str`"${e}" keyword is invalid ($data)`};function F4e(e,t=IV.keywordError,r,n){let{it:i}=e,{gen:o,compositeRule:s,allErrors:a}=i,c=PV(e,t,r);if(n!==null&&n!==void 0?n:s||a)TV(o,c);else FV(i,ue._`[${c}]`)}IV.reportError=F4e;function P4e(e,t=IV.keywordError,r){let{it:n}=e,{gen:i,compositeRule:o,allErrors:s}=n,a=PV(e,t,r);if(TV(i,a),!(o||s))FV(n,yn.default.vErrors)}IV.reportExtraError=P4e;function I4e(e,t){e.assign(yn.default.errors,t),e.if(ue._`${yn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(ue._`${yn.default.vErrors}.length`,t),()=>e.assign(yn.default.vErrors,null)))}IV.resetErrorsCount=I4e;function N4e({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw Error("ajv implementation error");let s=e.name("err");e.forRange("i",i,yn.default.errors,(a)=>{if(e.const(s,ue._`${yn.default.vErrors}[${a}]`),e.if(ue._`${s}.instancePath === undefined`,()=>e.assign(ue._`${s}.instancePath`,ue.strConcat(yn.default.instancePath,o.errorPath))),e.assign(ue._`${s}.schemaPath`,ue.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(ue._`${s}.schema`,r),e.assign(ue._`${s}.data`,n)})}IV.extendErrors=N4e;function TV(e,t){let r=e.const("err",t);e.if(ue._`${yn.default.vErrors} === null`,()=>e.assign(yn.default.vErrors,ue._`[${r}]`),ue._`${yn.default.vErrors}.push(${r})`),e.code(ue._`${yn.default.errors}++`)}function FV(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;if(i.$async)r.throw(ue._`new ${e.ValidationError}(${t})`);else r.assign(ue._`${n}.errors`,t),r.return(!1)}var Pl={keyword:new ue.Name("keyword"),schemaPath:new ue.Name("schemaPath"),params:new ue.Name("params"),propertyName:new ue.Name("propertyName"),message:new ue.Name("message"),schema:new ue.Name("schema"),parentSchema:new ue.Name("parentSchema")};function PV(e,t,r){let{createErrors:n}=e.it;if(n===!1)return ue._`{}`;return j4e(e,t,r)}function j4e(e,t,r={}){let{gen:n,it:i}=e,o=[M4e(i,r),q4e(e,r)];return L4e(e,t,o),n.object(...o)}function M4e({errorPath:e},{instancePath:t}){let r=t?ue.str`${e}${Qa.getErrorPath(t,Qa.Type.Str)}`:e;return[yn.default.instancePath,ue.strConcat(yn.default.instancePath,r)]}function q4e({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:ue.str`${t}/${e}`;if(r)i=ue.str`${i}${Qa.getErrorPath(r,Qa.Type.Str)}`;return[Pl.schemaPath,i]}function L4e(e,{params:t,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:f}=a;if(n.push([Pl.keyword,i],[Pl.params,typeof t=="function"?t(e):t||ue._`{}`]),c.messages)n.push([Pl.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([Pl.schema,s],[Pl.parentSchema,ue._`${d}${f}`],[yn.default.data,o]);if(u)n.push([Pl.propertyName,u])}});var UV=y(function(LV){Object.defineProperty(LV,"__esModule",{value:!0});LV.boolOrEmptySchema=LV.topBoolOrEmptySchema=void 0;var jV=jm(),MV=Ve(),H4e=bi(),G4e={message:"boolean schema is false"};function W4e(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)qV(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(H4e.default.data);else t.assign(MV._`${n}.errors`,null),t.return(!0)}LV.topBoolOrEmptySchema=W4e;function K4e(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),qV(e);else r.var(t,!0)}LV.boolOrEmptySchema=K4e;function qV(e,t){let{gen:r,data:n}=e;jV.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},G4e,void 0,t)}});var tk=y(function(zV){Object.defineProperty(zV,"__esModule",{value:!0});zV.getRules=zV.isJSONType=void 0;var Y4e=["string","number","integer","boolean","null","object","array"],X4e=new Set(Y4e);function Z4e(e){return typeof e=="string"&&X4e.has(e)}zV.isJSONType=Z4e;function Q4e(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}zV.getRules=Q4e});var rk=y(function(WV){Object.defineProperty(WV,"__esModule",{value:!0});WV.shouldUseRule=WV.shouldUseGroup=WV.schemaHasRulesForType=void 0;function t8e({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&HV(e,n)}WV.schemaHasRulesForType=t8e;function HV(e,t){return t.rules.some((r)=>GV(e,r))}WV.shouldUseGroup=HV;function GV(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}WV.shouldUseRule=GV});var Mm=y(function(eH){Object.defineProperty(eH,"__esModule",{value:!0});eH.reportTypeError=eH.checkDataTypes=eH.checkDataType=eH.coerceAndCheckDataType=eH.getJSONTypes=eH.getSchemaTypes=eH.DataType=void 0;var JV=tk(),YV=rk(),XV=jm(),Y=Ve(),yb=nt(),Ld;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ld||(eH.DataType=Ld={}));function i8e(e){let t=ZV(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}eH.getSchemaTypes=i8e;function ZV(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(JV.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}eH.getJSONTypes=ZV;function o8e(e,t){let{gen:r,data:n,opts:i}=e,o=s8e(t,i.coerceTypes),s=t.length>0&&!(o.length===0&&t.length===1&&YV.schemaHasRulesForType(e,t[0]));if(s){let a=ik(t,n,i.strictNumbers,Ld.Wrong);r.if(a,()=>{if(o.length)a8e(e,t,o);else ok(e)})}return s}eH.coerceAndCheckDataType=o8e;var QV=new Set(["string","number","integer","boolean","null"]);function s8e(e,t){return t?e.filter((r)=>QV.has(r)||t==="array"&&r==="array"):[]}function a8e(e,t,r){let{gen:n,data:i,opts:o}=e,s=n.let("dataType",Y._`typeof ${i}`),a=n.let("coerced",Y._`undefined`);if(o.coerceTypes==="array")n.if(Y._`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,Y._`${i}[0]`).assign(s,Y._`typeof ${i}`).if(ik(t,i,o.strictNumbers),()=>n.assign(a,i)));n.if(Y._`${a} !== undefined`);for(let u of r)if(QV.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),ok(e),n.endIf(),n.if(Y._`${a} !== undefined`,()=>{n.assign(i,a),c8e(e,a)});function c(u){switch(u){case"string":n.elseIf(Y._`${s} == "number" || ${s} == "boolean"`).assign(a,Y._`"" + ${i}`).elseIf(Y._`${i} === null`).assign(a,Y._`""`);return;case"number":n.elseIf(Y._`${s} == "boolean" || ${i} === null
|
|
86
86
|
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,Y._`+${i}`);return;case"integer":n.elseIf(Y._`${s} === "boolean" || ${i} === null
|
|
87
87
|
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,Y._`+${i}`);return;case"boolean":n.elseIf(Y._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf(Y._`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf(Y._`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf(Y._`${s} === "string" || ${s} === "number"
|
|
@@ -99,7 +99,7 @@ ${t}`,eIe,tIe,rIe=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=Q6e.bind(nul
|
|
|
99
99
|
`)}var R2=!1;var{spawn:jJe}=globalThis.Bun;function Vl(e,t=[]){let r=e.replace(MJe,'("$1","<redacted>")');for(let n of t)if(n.length>=qJe)r=r.split(n).join("<redacted>");return r}function rw(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],r=new Set;for(let n of[process.env,e??{}])for(let i of t){let o=n[i];if(typeof o==="string"&&o.length>0)r.add(o)}return[...r]}async function Xte(e,t){let r=e.getReader(),n=new TextDecoder,i="";while(!0){let{done:o,value:s}=await r.read();if(o)break;if(s.byteLength===0)continue;t(),i+=n.decode(s,{stream:!0})}return i+n.decode()}async function k(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let b of t.unsetEnv??[])delete r[b];let n=jJe({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),i=!1,o,s,a=performance.now(),c=()=>{if(s!==void 0)clearTimeout(s),s=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),s=setTimeout(()=>{s=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??LJe)};if(u(),t.timeout)o=setTimeout(()=>{i=!0,c(),n.kill()},t.timeout);let d=tw()?[...rw(r),...t.redact??[]]:[];if(tw()){let b=t.cwd?` (cwd=${t.cwd})`:"";Ic(l.dim(Vl(`$ ${e.join(" ")}${b}`,d)))}let f=()=>{a=performance.now(),u()},m,p,g,h=n.exited.then((b)=>(c(),b));try{[m,p,g]=await Promise.all([Xte(n.stdout,f),Xte(n.stderr,f),h])}finally{if(c(),o)clearTimeout(o)}if(tw()){if(t.sensitiveOutput)Ic(l.dim("[sensitive subprocess output suppressed]"));else{if(m.trim())Ic(l.dim(Vl(m.trimEnd(),d)));if(p.trim())Ic(l.yellow(Vl(p.trimEnd(),d)))}Ic(l.dim(`(exit ${g})`))}if(i)return{stdout:m,stderr:p||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:g??1,timedOut:!0};return{stdout:m,stderr:p,exitCode:g,timedOut:!1}}var MJe,qJe=8,LJe=120000;var It=I(()=>{Ze();MJe=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function UJe(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function Qte(e,t=UJe()){return e.installInstructions[t]}function zJe(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function HJe(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:VJe}async function ere(e){try{let{exitCode:t,stdout:r,timedOut:n}=await k(e.cmd,{timeout:HJe()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:zJe(r)}}catch(t){let r=t instanceof Error?t.message:String(t);if(!r.includes("ENOENT")&&!r.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${r}`);return{available:!1}}}async function ph(){let e=Object.entries(Zte);return Promise.all(e.map(async([t,r])=>{let{available:n,version:i,timedOut:o}=await ere(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:i,timedOut:o,installInstruction:Qte(r)}}))}async function tre(){let t=(await ph()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
|
|
100
100
|
Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let r of t)console.warn(` - ${r.name} (${r.purpose})`),console.warn(` Install: ${r.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function Hl(e){let r=BJe[e].map((s)=>Zte[s]).filter(Boolean),n=await Promise.all(r.map(async(s)=>{let a=await ere(s);return{check:s,available:a.available,timedOut:a.timedOut}}));for(let s of n)if(s.timedOut&&s.check.required)console.warn(`Warning: ${s.check.name} did not respond to a version check in time; continuing anyway.`);let i=n.filter((s)=>!s.available&&!s.timedOut&&s.check.required).map((s)=>({tool:s.check.name,installInstruction:Qte(s.check)}));if(i.length===0)return;let o=[`
|
|
101
101
|
Missing required tools:`];for(let s of i)o.push(` ${s.tool} not installed`),o.push(` Install: ${s.installInstruction}`);throw Error(o.join(`
|
|
102
|
-
`))}var Zte,BJe,VJe=4000;var mh=I(()=>{It();Zte={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},BJe={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var nre;var rre=I(()=>{nre={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.
|
|
102
|
+
`))}var Zte,BJe,VJe=4000;var mh=I(()=>{It();Zte={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},BJe={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var nre;var rre=I(()=>{nre={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.19-PR1769.33c3f33",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var eo;var kf=I(()=>{rre();eo=nre.version});import{mkdirSync as WJe,readdirSync as KJe,unlinkSync as JJe,writeFileSync as YJe}from"fs";import{join as A2}from"path";function lre(){Cf=!0}function Gl(){return Cf}function ure(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function gh(e){cre=e,Zt(`Step: ${e}`)}function yh(){sre=!0}function dre(){return sre}function Qt(){are=!0}function fre(){return are}function Zt(e){if(Cf)process.stderr.write(`[debug] ${e}
|
|
103
103
|
`)}function eYe(e){let t={};for(let[r,n]of Object.entries(e))t[r]=QJe.has(r.toLowerCase())?"[REDACTED]":n;return t}function mre(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function O2(e,t,r=0){if(r>rYe)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>O2(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[i,o]of Object.entries(t))n[i]=O2(i,o,r+1);return n}if(typeof t==="string"){if(tYe.test(e))return"[REDACTED]";return t.replace(pre,mre)}return t}function T2(e){return e.replace(nYe,"Bearer [REDACTED]").replace(iYe,"[REDACTED_AWS_KEY]").replace(oYe,"$1[REDACTED]").replace(sYe,"$1$2=[REDACTED]").replace(pre,mre)}function aYe(e){return T2(e)}function ire(e,t=ZJe){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(O2("",n))}catch{}if(r=T2(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function ow(e){if(!Cf)return;let t=aYe(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?eYe(e.requestHeaders):void 0,requestBody:ire(e.requestBody),responseBody:ire(e.responseBody)};iw.push(r),Zt(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=q(r);iw.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),Zt(`redaction failed for ${e.method} ${t}: ${n}`)}}async function cYe(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${eo}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${q(t)})`)}e.push(""),e.push("Active account:");try{let t=Ft();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${q(t)})`)}e.push(""),e.push("External tools:");try{let t=await ph();for(let r of t){let n=r.available?r.version??"installed":r.timedOut?"(timed out)":"not installed";e.push(` ${r.name}: ${n}`)}}catch(t){e.push(` (could not probe external tools: ${q(t)})`)}return e}async function F2(){return(await cYe()).join(`
|
|
104
104
|
`)}async function hre(){if(!Cf||nw!==void 0)return;try{nw=await F2()}catch(e){let t=q(e);nw=`(could not build environment report: ${t})`,Zt(`environment snapshot failed: ${t}`)}}function gre(e){if(ore.has(e))return{flag:e};for(let t of ore){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function lYe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=gre(n);if(!i){t.push(n);continue}if(i.kind==="long-eq")t.push(`${i.flag}=[REDACTED]`);else if(i.kind==="short-attached")t.push(`${i.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function uYe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=gre(n);if(!i){t.push(n);continue}if(!i.kind&&r+1<e.length)r++}return t}function dYe(e){let t=[];for(let n of uYe(e)){if(n.startsWith("-"))continue;if(t.push(n),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function fYe(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${T2(lYe(e).join(" "))}`),r.push(""),r.push(nw??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),iw.length===0)r.push(" (none)");else iw.forEach((n,i)=>{if(r.push(` [${i+1}] ${n.method} ${n.url} -> ${n.status??"ERROR"} (${n.durationMs}ms)`),n.error)r.push(` Error: ${n.error}`);if(n.note)r.push(` Note: ${n.note}`);if(n.requestHeaders)r.push(` Request headers: ${JSON.stringify(n.requestHeaders)}`);if(n.requestBody)r.push(` Request body: ${n.requestBody}`);if(n.responseBody)r.push(` Response body: ${n.responseBody}`)});return r.push(""),r.push(`Failing step: ${cre??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
|
|
105
105
|
`)}
|
|
@@ -1054,9 +1054,11 @@ Examples:
|
|
|
1054
1054
|
$ nemar auth regenerate-key`);function ife(e){if(e.email_sent!==!1)return;console.log(),console.log(l.yellow(` Warning: your request is recorded but admins could not be notified;
|
|
1055
1055
|
it will be retried when you run this command again.`))}function afe(e){let t=(e??"").trim();if(t.length<Z1)return`Please write at least ${Z1} characters`;if(t.length>Q1)return`Please keep it under ${Q1} characters`;return!0}async function cfe(e){let t=S("Submitting upload access request...").start();try{let r=await lie(e);if(r.already_requested){t.info(xr("upload_access.requested.title")),console.log(l.dim(` ${xr("upload_access.requested.lede")}`)),ife(r);return}t.succeed(xr("upload_access.requested.title")),console.log(),console.log(` ${xr("upload_access.requested.body")}`),console.log(l.dim(" Check any time with 'nemar auth status --refresh'.")),ife(r)}catch(r){if(!(r instanceof V)){t.fail("Failed to submit upload access request"),console.log(l.dim(" Check your internet connection")),process.exitCode=1;return}if(t.fail(r.message),r.missing&&r.missing.length>0)g_(xr("gaps.request.title"),JU(r.missing,{orcidVerified:Ft().orcidVerified===!0})),console.log(),console.log(l.dim(" Settings: https://nemar.org/settings"));process.exitCode=1}}var zat=pn.command("request-upload-access").description("Ask an admin for upload access (one-time)").option("--why <text>","What you intend to upload (20-500 characters)").action(async(e)=>{if(!tt()){console.log(l.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' to authenticate"),process.exitCode=1;return}let t=(e.why??"").trim();if(!t){if(!process.stdin.isTTY){console.log(l.yellow("Provide --why (this terminal cannot prompt).")),process.exitCode=1;return}let r=await De.prompt([{type:"input",name:"why",message:"What do you intend to upload to NEMAR?",validate:afe}]);t=String(r.why).trim()}await cfe(t)});Or(zat,`
|
|
1056
1056
|
Description:
|
|
1057
|
-
Uploading datasets
|
|
1058
|
-
|
|
1059
|
-
|
|
1057
|
+
Uploading datasets, or being added as a collaborator on someone else's
|
|
1058
|
+
dataset, needs upload access: a one-time grant an admin makes after
|
|
1059
|
+
reviewing who you are and where you are. Your email must be verified
|
|
1060
|
+
first, but verifying it is not enough on its own, and nothing grants
|
|
1061
|
+
access automatically.
|
|
1060
1062
|
|
|
1061
1063
|
Before asking, your account needs a username, your given and family name,
|
|
1062
1064
|
a GitHub username that exists, and your city and country. Set them in
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nemar-cli",
|
|
3
3
|
"packageManager": "bun@1.4.3",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.19-PR1769.33c3f33",
|
|
5
5
|
"description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|