nemar-cli 0.10.5 → 0.10.6-PR1478.bcf65a4
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 +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ ${Wr.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)X_(this.rl,th
|
|
|
81
81
|
${t}`,ESe,SSe,$Se=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=DSe.bind(null,n,t.toString());Object.defineProperty(o,"name",SSe);let{writable:i,enumerable:s,configurable:a}=ESe;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})};var Zv=O(()=>{ESe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),SSe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var bh,Nj=(e,t={})=>{if(typeof e!=="function")throw TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(bh.set(i,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return r};return id(i,e),bh.set(i,n),i},jj;var qj=O(()=>{Zv();bh=new WeakMap;Nj.callCount=(e)=>{if(!bh.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return bh.get(e)};jj=Nj});var la;var Mj=O(()=>{la=[];la.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")la.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")la.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class Lj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ew[Qv])return ew[Qv];CSe(ew,Qv,{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 o of this.listeners[e])n=o(t,r)===!0||n;if(e==="exit")n=this.emit("afterExit",t,r)||n;return n}}class rw{}var xh=(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",Qv,ew,CSe,kSe=(e)=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Bj,Uj,tw,zj,yit,bit;var Vj=O(()=>{Mj();Qv=Symbol.for("signal-exit emitter"),ew=globalThis,CSe=Object.defineProperty.bind(Object);Bj=class Bj extends rw{onExit(){return()=>{}}load(){}unload(){}};Uj=class Uj extends rw{#r=tw.platform==="win32"?"SIGINT":"SIGHUP";#t=new Lj;#e;#o;#f;#n={};#s=!1;constructor(e){super();this.#e=e,this.#n={};for(let t of la)this.#n[t]=()=>{let r=this.#e.listeners(t),{count:n}=this.#t,o=e;if(typeof o.__signal_exit_emitter__==="object"&&typeof o.__signal_exit_emitter__.count==="number")n+=o.__signal_exit_emitter__.count;if(r.length===n){this.unload();let i=this.#t.emit("exit",null,t),s=t==="SIGHUP"?this.#r:t;if(!i)e.kill(e.pid,s)}};this.#f=e.reallyExit,this.#o=e.emit}onExit(e,t){if(!xh(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 la)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.#i(e)}unload(){if(!this.#s)return;this.#s=!1,la.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.#o,this.#e.reallyExit=this.#f,this.#t.count-=1}#i(e){if(!xh(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.#o;if(e==="exit"&&xh(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)}};tw=globalThis.process,{onExit:zj,load:yit,unload:bit}=kSe(xh(tw)?new Uj(tw):new Bj)});import _h from"process";var Gj,RSe,Hj;var Wj=O(()=>{qj();Vj();Gj=_h.stderr.isTTY?_h.stderr:_h.stdout.isTTY?_h.stdout:void 0,RSe=Gj?jj(()=>{zj(()=>{Gj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Hj=RSe});import Kj from"process";var vh=!1,Hc,nw;var Yj=O(()=>{Wj();Hc={};Hc.show=(e=Kj.stderr)=>{if(!e.isTTY)return;vh=!1,e.write("\x1B[?25h")};Hc.hide=(e=Kj.stderr)=>{if(!e.isTTY)return;Hj(),vh=!0,e.write("\x1B[?25l")};Hc.toggle=(e,t)=>{if(e!==void 0)vh=e;if(vh)Hc.show(t);else Hc.hide(t)};nw=Hc});import qn from"process";function ow(){if(qn.platform!=="win32")return qn.env.TERM!=="linux";return Boolean(qn.env.CI)||Boolean(qn.env.WT_SESSION)||Boolean(qn.env.TERMINUS_SUBLIME)||qn.env.ConEmuTask==="{cmd::Cmder}"||qn.env.TERM_PROGRAM==="Terminus-Sublime"||qn.env.TERM_PROGRAM==="vscode"||qn.env.TERM==="xterm-256color"||qn.env.TERM==="alacritty"||qn.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Jj=()=>{};var ASe,OSe,FSe,sd;var Xj=O(()=>{Xe();Jj();ASe={info:l.blue("\u2139"),success:l.green("\u2714"),warning:l.yellow("\u26A0"),error:l.red("\u2716")},OSe={info:l.blue("i"),success:l.green("\u221A"),warning:l.yellow("\u203C"),error:l.red("\xD7")},FSe=ow()?ASe:OSe,sd=FSe});function iw({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 ad(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(PSe,"")}var PSe;var sw=O(()=>{PSe=iw()});function Zj(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 Qj(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function eq(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 tq=()=>{};function ISe(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function rq(e,{ambiguousAsWide:t=!1}={}){if(ISe(e),Qj(e)||eq(e)||t&&Zj(e))return 2;return 1}var nq=O(()=>{tq()});var oq=()=>/[#*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 aw(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(!n)e=ad(e);if(e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of TSe.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(NSe.test(s))continue;if(oq().test(s)){o+=2;continue}o+=rq(a,i)}return o}var TSe,NSe;var iq=O(()=>{sw();nq();TSe=new Intl.Segmenter,NSe=/^\p{Default_Ignorable_Code_Point}$/u});function cw({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import sq from"process";function lw(){let{env:e}=sq,{TERM:t,TERM_PROGRAM:r}=e;if(sq.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 aq=()=>{};import Eo from"process";class cq{#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(Eo.platform==="win32"||!Eo.stdin.isTTY)return;Eo.stdin.setRawMode(!0),Eo.stdin.on("data",this.#o),Eo.stdin.resume()}#e(){if(!Eo.stdin.isTTY)return;Eo.stdin.off("data",this.#o),Eo.stdin.pause(),Eo.stdin.setRawMode(!1)}#o(e){if(e[0]===jSe)Eo.emit("SIGINT")}}var jSe=3,qSe,uw;var lq=O(()=>{qSe=new cq,uw=qSe});import wh from"process";class uq{#r=0;#t=!1;#e=0;#o=-1;#f=0;#n;#s;#i;#p;#h;#l;#u;#d;#g;#a;#c;color;constructor(e){if(typeof e==="string")e={text:e};if(this.#n={color:"cyan",stream:wh.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#n.color,this.spinner=this.#n.spinner,this.#h=this.#n.interval,this.#i=this.#n.stream,this.#l=typeof this.#n.isEnabled==="boolean"?this.#n.isEnabled:cw({stream:this.#i}),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,wh.env.NODE_ENV==="test")this._stream=this.#i,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#r},set(t){this.#r=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),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.#o=-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(!lw())this.#s=cd.default.line;else if(e===void 0)this.#s=cd.default.dots;else if(e!=="default"&&cd.default[e])this.#s=cd.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.#i.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 o of ad(n).split(`
|
|
82
82
|
`))this.#e+=Math.max(1,Math.ceil(aw(o,{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.#o===-1||e-this.#f>=this.interval)this.#o=++this.#o%this.#s.frames.length,this.#f=e;let{frames:t}=this.#s,r=t[this.#o];if(this.color)r=l[this.color](r);let n=typeof this.#a==="string"&&this.#a!==""?this.#a+" ":"",o=typeof this.text==="string"?" "+this.text:"",i=typeof this.#c==="string"&&this.#c!==""?" "+this.#c:"";return n+r+o+i}clear(){if(!this.#l||!this.#i.isTTY)return this;this.#i.cursorTo(0);for(let e=0;e<this.#r;e++){if(e>0)this.#i.moveCursor(0,-1);this.#i.clearLine(1)}if(this.#d||this.lastIndent!==this.#d)this.#i.cursorTo(this.#d);return this.lastIndent=this.#d,this.#r=0,this}render(){if(this.#u)return this;return this.clear(),this.#i.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.#i.write(`- ${this.text}
|
|
83
83
|
`);return this}if(this.isSpinning)return this;if(this.#n.hideCursor)nw.hide(this.#i);if(this.#n.discardStdin&&wh.stdin.isTTY)this.#t=!0,uw.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.#o=0,this.clear(),this.#n.hideCursor)nw.show(this.#i);if(this.#n.discardStdin&&wh.stdin.isTTY&&this.#t)uw.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:sd.success,text:e})}fail(e){return this.stopAndPersist({symbol:sd.error,text:e})}warn(e){return this.stopAndPersist({symbol:sd.warning,text:e})}info(e){return this.stopAndPersist({symbol:sd.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let t=e.prefixText??this.#a,r=this.#y(t," "),n=e.symbol??" ",o=e.text??this.text,s=typeof o==="string"?(n?" ":"")+o:"",a=e.suffixText??this.#c,c=this.#b(a," "),u=r+n+s+c+`
|
|
84
|
-
`;return this.stop(),this.#i.write(u),this}}function D(e){return new uq(e)}var cd,MSe;var Mn=O(()=>{Xe();Yj();Xj();sw();iq();aq();lq();cd=he(gm(),1),MSe=he(gm(),1)});var Te,pq,W,li=(e)=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return Number.isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":if(Array.isArray(e))return W.array;if(e===null)return W.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return W.promise;if(typeof Map<"u"&&e instanceof Map)return W.map;if(typeof Set<"u"&&e instanceof Set)return W.set;if(typeof Date<"u"&&e instanceof Date)return W.date;return W.object;default:return W.unknown}};var ld=O(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function r(o){throw Error()}e.assertNever=r,e.arrayToEnum=(o)=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=(o)=>{let i=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=(o)=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let i=[];for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s))i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map((s)=>typeof s==="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>{if(typeof i==="bigint")return i.toString();return i}})(Te||(Te={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(pq||(pq={}));W=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var j,Zr;var Dh=O(()=>{ld();j=Te.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"]);Zr=class Zr 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(o){return o.message},r={_errors:[]},n=(o)=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let s=r,a=0;while(a<i.path.length){let c=i.path[a];if(a!==i.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i));s=s[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof Zr))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.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 o=n.path[0];t[o]=t[o]||[],t[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};Zr.create=(e)=>new Zr(e)});var LSe=(e,t)=>{let r;switch(e.code){case j.invalid_type:if(e.received===W.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case j.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Te.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(e.keys,", ")}`;break;case j.invalid_union:r="Invalid input";break;case j.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(e.options)}`;break;case j.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(e.options)}, received '${e.received}'`;break;case j.invalid_arguments:r="Invalid function arguments";break;case j.invalid_return_type:r="Invalid function return type";break;case j.invalid_date:r="Invalid date";break;case j.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 Te.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case j.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 j.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 j.custom:r="Invalid input";break;case j.invalid_intersection_types:r="Intersection results could not be merged";break;case j.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case j.not_finite:r="Number must be finite";break;default:r=t.defaultError,Te.assertNever(e)}return{message:r}},gs;var dw=O(()=>{Dh();ld();gs=LSe});function ud(){return BSe}var BSe;var Eh=O(()=>{dw();BSe=gs});function V(e,t){let r=ud(),n=Sh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===gs?void 0:gs].filter((o)=>!!o)});e.common.issues.push(n)}class ir{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 ce;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 o=await n.key,i=await n.value;r.push({key:o,value:i})}return ir.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:o,value:i}=n;if(o.status==="aborted")return ce;if(i.status==="aborted")return ce;if(o.status==="dirty")e.dirty();if(i.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet))r[o.value]=i.value}return{status:e.value,value:r}}}var Sh=(e)=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},ce,Wc=(e)=>({status:"dirty",value:e}),br=(e)=>({status:"valid",value:e}),fw=(e)=>e.status==="aborted",pw=(e)=>e.status==="dirty",ua=(e)=>e.status==="valid",dd=(e)=>typeof Promise<"u"&&e instanceof Promise;var mw=O(()=>{Eh();dw();ce=Object.freeze({status:"aborted"})});var mq=()=>{};var ee;var hq=O(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(ee||(ee={}))});class Ln{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 ve(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=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:o};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:o}}class Re{get description(){return this._def.description}_getType(e){return li(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(dd(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:li(e)},n=this._parseSync({data:e,path:r.path,parent:r});return gq(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return ua(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)=>ua(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:li(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(dd(n)?n:Promise.resolve(n));return gq(r,o)}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,o)=>{let i=e(n),s=()=>o.addIssue({code:j.custom,...r(n)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((a)=>{if(!a)return s(),!1;else return!0});if(!i)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:le.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 $o.create(this,this._def)}nullable(){return ys.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return So.create(this)}promise(){return Zc.create(this,this._def)}or(e){return gd.create([this,e],this._def)}and(e){return yd.create(this,e,this._def)}transform(e){return new Co({...ve(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new vd({...ve(this._def),innerType:this,defaultValue:t,typeName:le.ZodDefault})}brand(){return new bw({typeName:le.ZodBranded,type:this,...ve(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new wd({...ve(this._def),innerType:this,catchValue:t,typeName:le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Ph.create(this,e)}readonly(){return Dd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function bq(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 o$e(e){return new RegExp(`^${bq(e)}$`)}function i$e(e){let t=`${yq}T${bq(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 s$e(e,t){if((t==="v4"||!t)&&XSe.test(e))return!0;if((t==="v6"||!t)&&QSe.test(e))return!0;return!1}function a$e(e,t){if(!WSe.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,"="),o=JSON.parse(atob(n));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function c$e(e,t){if((t==="v4"||!t)&&ZSe.test(e))return!0;if((t==="v6"||!t)&&e$e.test(e))return!0;return!1}function l$e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Kc(e){if(e instanceof $t){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=$o.create(Kc(n))}return new $t({...e._def,shape:()=>t})}else if(e instanceof So)return new So({...e._def,type:Kc(e.element)});else if(e instanceof $o)return $o.create(Kc(e.unwrap()));else if(e instanceof ys)return ys.create(Kc(e.unwrap()));else if(e instanceof pi)return pi.create(e.items.map((t)=>Kc(t)));else return e}function gw(e,t){let r=li(e),n=li(t);if(e===t)return{valid:!0,data:e};else if(r===W.object&&n===W.object){let o=Te.objectKeys(t),i=Te.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=gw(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===W.array&&n===W.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=gw(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(r===W.date&&n===W.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function xq(e,t){return new fa({values:e,typeName:le.ZodEnum,...ve(t)})}var gq=(e,t)=>{if(ua(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 Zr(e.common.issues);return this._error=r,this._error}}}},USe,zSe,VSe,GSe,HSe,WSe,KSe,YSe,JSe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hw,XSe,ZSe,QSe,e$e,t$e,r$e,yq="((\\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])))",n$e,di,Yc,Jc,$h,pd,Ch,md,hd,kh,da,fi,Rh,So,$t,gd,ui=(e)=>{if(e instanceof bd)return ui(e.schema);else if(e instanceof Co)return ui(e.innerType());else if(e instanceof xd)return[e.value];else if(e instanceof fa)return e.options;else if(e instanceof _d)return Te.objectValues(e.enum);else if(e instanceof vd)return ui(e._def.innerType);else if(e instanceof md)return[void 0];else if(e instanceof hd)return[null];else if(e instanceof $o)return[void 0,...ui(e.unwrap())];else if(e instanceof ys)return[null,...ui(e.unwrap())];else if(e instanceof bw)return ui(e.unwrap());else if(e instanceof Dd)return ui(e.unwrap());else if(e instanceof wd)return ui(e._def.innerType);else return[]},yw,yd,pi,Ah,Oh,Xc,fd,bd,xd,fa,_d,Zc,Co,$o,ys,vd,wd,Fh,Dst,bw,Ph,Dd,Est,le,w,R,Sst,$st,ge,Cst,kst,Rst,Ast,Ost,Ed,Fst,Pst,oe,U,Ist,Sd,xw,Tst,Nst,Qc,jst,qst,Mst,Lst,ze,Ze,Bst,Ust,zst,Vst,Gst,Hst,Wst;var _q=O(()=>{Dh();Eh();hq();mw();ld();USe=/^c[^\s-]{8,}$/i,zSe=/^[0-9a-z]+$/,VSe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GSe=/^[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,HSe=/^[a-z0-9_-]{21}$/i,WSe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KSe=/^[-+]?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)?)??$/,YSe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XSe=/^(?:(?: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])$/,ZSe=/^(?:(?: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])$/,QSe=/^(([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]))$/,e$e=/^(([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])$/,t$e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r$e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n$e=new RegExp(`^${yq}$`);di=class di extends Re{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==W.string){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_type,expected:W.string,received:o.parsedType}),ce}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;if(i||s){if(n=this._getOrReturnCtx(e,n),i)V(n,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(s)V(n,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});r.dirty()}}else if(o.kind==="email"){if(!YSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"email",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="emoji"){if(!hw)hw=new RegExp(JSe,"u");if(!hw.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"emoji",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="uuid"){if(!GSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"uuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="nanoid"){if(!HSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"nanoid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid"){if(!USe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"cuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid2"){if(!zSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"cuid2",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ulid"){if(!VSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"ulid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),V(n,{validation:"url",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"regex",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="datetime"){if(!i$e(o).test(e.data))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:"datetime",message:o.message}),r.dirty()}else if(o.kind==="date"){if(!n$e.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:"date",message:o.message}),r.dirty()}else if(o.kind==="time"){if(!o$e(o).test(e.data))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:"time",message:o.message}),r.dirty()}else if(o.kind==="duration"){if(!KSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"duration",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ip"){if(!s$e(e.data,o.version))n=this._getOrReturnCtx(e,n),V(n,{validation:"ip",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="jwt"){if(!a$e(e.data,o.alg))n=this._getOrReturnCtx(e,n),V(n,{validation:"jwt",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cidr"){if(!c$e(e.data,o.version))n=this._getOrReturnCtx(e,n),V(n,{validation:"cidr",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64"){if(!t$e.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"base64",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64url"){if(!r$e.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"base64url",code:j.invalid_string,message:o.message}),r.dirty()}else Te.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:j.invalid_string,...ee.errToObj(r)})}_addCheck(e){return new di({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ee.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ee.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ee.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ee.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ee.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ee.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ee.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ee.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ee.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ee.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ee.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ee.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ee.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,...ee.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,...ee.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ee.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ee.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...ee.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ee.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ee.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ee.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ee.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ee.errToObj(t)})}nonempty(e){return this.min(1,ee.errToObj(e))}trim(){return new di({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new di({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new di({...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}};di.create=(e)=>new di({checks:[],typeName:le.ZodString,coerce:e?.coerce??!1,...ve(e)});Yc=class Yc extends Re{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)!==W.number){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_type,expected:W.number,received:o.parsedType}),ce}let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="int"){if(!Te.isInteger(e.data))r=this._getOrReturnCtx(e,r),V(r,{code:j.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(l$e(e.data,o.value)!==0)r=this._getOrReturnCtx(e,r),V(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),V(r,{code:j.not_finite,message:o.message}),n.dirty()}else Te.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ee.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ee.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ee.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ee.toString(t))}setLimit(e,t,r,n){return new Yc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new Yc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ee.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ee.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ee.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ee.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ee.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ee.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"&&Te.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)}};Yc.create=(e)=>new Yc({checks:[],typeName:le.ZodNumber,coerce:e?.coerce||!1,...ve(e)});Jc=class Jc extends Re{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)!==W.bigint)return this._getInvalidInput(e);let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))r=this._getOrReturnCtx(e,r),V(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else Te.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return V(t,{code:j.invalid_type,expected:W.bigint,received:t.parsedType}),ce}gte(e,t){return this.setLimit("min",e,!0,ee.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ee.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ee.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ee.toString(t))}setLimit(e,t,r,n){return new Jc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new Jc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ee.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}};Jc.create=(e)=>new Jc({checks:[],typeName:le.ZodBigInt,coerce:e?.coerce??!1,...ve(e)});$h=class $h extends Re{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==W.boolean){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.boolean,received:r.parsedType}),ce}return br(e.data)}};$h.create=(e)=>new $h({typeName:le.ZodBoolean,coerce:e?.coerce||!1,...ve(e)});pd=class pd extends Re{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==W.date){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_type,expected:W.date,received:o.parsedType}),ce}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_date}),ce}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()}else Te.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pd({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ee.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ee.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}};pd.create=(e)=>new pd({checks:[],coerce:e?.coerce||!1,typeName:le.ZodDate,...ve(e)});Ch=class Ch extends Re{_parse(e){if(this._getType(e)!==W.symbol){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.symbol,received:r.parsedType}),ce}return br(e.data)}};Ch.create=(e)=>new Ch({typeName:le.ZodSymbol,...ve(e)});md=class md extends Re{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.undefined,received:r.parsedType}),ce}return br(e.data)}};md.create=(e)=>new md({typeName:le.ZodUndefined,...ve(e)});hd=class hd extends Re{_parse(e){if(this._getType(e)!==W.null){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.null,received:r.parsedType}),ce}return br(e.data)}};hd.create=(e)=>new hd({typeName:le.ZodNull,...ve(e)});kh=class kh extends Re{constructor(){super(...arguments);this._any=!0}_parse(e){return br(e.data)}};kh.create=(e)=>new kh({typeName:le.ZodAny,...ve(e)});da=class da extends Re{constructor(){super(...arguments);this._unknown=!0}_parse(e){return br(e.data)}};da.create=(e)=>new da({typeName:le.ZodUnknown,...ve(e)});fi=class fi extends Re{_parse(e){let t=this._getOrReturnCtx(e);return V(t,{code:j.invalid_type,expected:W.never,received:t.parsedType}),ce}};fi.create=(e)=>new fi({typeName:le.ZodNever,...ve(e)});Rh=class Rh extends Re{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.void,received:r.parsedType}),ce}return br(e.data)}};Rh.create=(e)=>new Rh({typeName:le.ZodVoid,...ve(e)});So=class So extends Re{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==W.array)return V(t,{code:j.invalid_type,expected:W.array,received:t.parsedType}),ce;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;if(i||s)V(t,{code:i?j.too_big:j.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?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)V(t,{code:j.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)V(t,{code:j.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((i,s)=>n.type._parseAsync(new Ln(t,i,t.path,s)))).then((i)=>ir.mergeArray(r,i));let o=[...t.data].map((i,s)=>n.type._parseSync(new Ln(t,i,t.path,s)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new So({...this._def,minLength:{value:e,message:ee.toString(t)}})}max(e,t){return new So({...this._def,maxLength:{value:e,message:ee.toString(t)}})}length(e,t){return new So({...this._def,exactLength:{value:e,message:ee.toString(t)}})}nonempty(e){return this.min(1,e)}};So.create=(e,t)=>new So({type:e,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...ve(t)});$t=class $t extends Re{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=Te.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==W.object){let c=this._getOrReturnCtx(e);return V(c,{code:j.invalid_type,expected:W.object,received:c.parsedType}),ce}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof fi&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!i.includes(c))s.push(c)}let a=[];for(let c of i){let u=o[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Ln(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof fi){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)V(n,{code:j.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 Ln(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)=>ir.mergeObjectSync(r,c));else return ir.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return ee.errToObj,new $t({...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:ee.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new $t({...this._def,unknownKeys:"strip"})}passthrough(){return new $t({...this._def,unknownKeys:"passthrough"})}extend(e){return new $t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $t({...this._def,catchall:e})}pick(e){let t={};for(let r of Te.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}omit(e){let t={};for(let r of Te.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}deepPartial(){return Kc(this)}partial(e){let t={};for(let r of Te.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new $t({...this._def,shape:()=>t})}required(e){let t={};for(let r of Te.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];while(o instanceof $o)o=o._def.innerType;t[r]=o}return new $t({...this._def,shape:()=>t})}keyof(){return xq(Te.objectKeys(this.shape))}};$t.create=(e,t)=>new $t({shape:()=>e,unknownKeys:"strip",catchall:fi.create(),typeName:le.ZodObject,...ve(t)});$t.strictCreate=(e,t)=>new $t({shape:()=>e,unknownKeys:"strict",catchall:fi.create(),typeName:le.ZodObject,...ve(t)});$t.lazycreate=(e,t)=>new $t({shape:e,unknownKeys:"strip",catchall:fi.create(),typeName:le.ZodObject,...ve(t)});gd=class gd extends Re{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map((s)=>new Zr(s.ctx.common.issues));return V(t,{code:j.invalid_union,unionErrors:i}),ce}if(t.common.async)return Promise.all(r.map(async(o)=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);else{let o=void 0,i=[];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"&&!o)o={result:u,ctx:c};if(c.common.issues.length)i.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map((a)=>new Zr(a));return V(t,{code:j.invalid_union,unionErrors:s}),ce}}get options(){return this._def.options}};gd.create=(e,t)=>new gd({options:e,typeName:le.ZodUnion,...ve(t)});yw=class yw extends Re{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.object)return V(t,{code:j.invalid_type,expected:W.object,received:t.parsedType}),ce;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);if(!o)return V(t,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ce;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._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 o of t){let i=ui(o.shape[e]);if(!i.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new yw({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...ve(r)})}};yd=class yd extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(fw(o)||fw(i))return ce;let s=gw(o.value,i.value);if(!s.valid)return V(r,{code:j.invalid_intersection_types}),ce;if(pw(o)||pw(i))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(([o,i])=>n(o,i));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}))}};yd.create=(e,t,r)=>new yd({left:e,right:t,typeName:le.ZodIntersection,...ve(r)});pi=class pi extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.array)return V(r,{code:j.invalid_type,expected:W.array,received:r.parsedType}),ce;if(r.data.length<this._def.items.length)return V(r,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ce;if(!this._def.rest&&r.data.length>this._def.items.length)V(r,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...r.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Ln(r,i,r.path,s))}).filter((i)=>!!i);if(r.common.async)return Promise.all(o).then((i)=>ir.mergeArray(t,i));else return ir.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new pi({...this._def,rest:e})}};pi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new pi({items:e,typeName:le.ZodTuple,rest:null,...ve(t)})};Ah=class Ah extends Re{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!==W.object)return V(r,{code:j.invalid_type,expected:W.object,received:r.parsedType}),ce;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ln(r,s,r.path,s)),value:i._parse(new Ln(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return ir.mergeObjectAsync(t,n);else return ir.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof Re)return new Ah({keyType:e,valueType:t,typeName:le.ZodRecord,...ve(r)});return new Ah({keyType:di.create(),valueType:e,typeName:le.ZodRecord,...ve(t)})}};Oh=class Oh extends Re{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!==W.map)return V(r,{code:j.invalid_type,expected:W.map,received:r.parsedType}),ce;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,a],c)=>({key:n._parse(new Ln(r,s,r.path,[c,"key"])),value:o._parse(new Ln(r,a,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return ce;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 i){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return ce;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}}}};Oh.create=(e,t,r)=>new Oh({valueType:t,keyType:e,typeName:le.ZodMap,...ve(r)});Xc=class Xc extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.set)return V(r,{code:j.invalid_type,expected:W.set,received:r.parsedType}),ce;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)V(r,{code:j.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)V(r,{code:j.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let o=this._def.valueType;function i(a){let c=new Set;for(let u of a){if(u.status==="aborted")return ce;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let s=[...r.data.values()].map((a,c)=>o._parse(new Ln(r,a,r.path,c)));if(r.common.async)return Promise.all(s).then((a)=>i(a));else return i(s)}min(e,t){return new Xc({...this._def,minSize:{value:e,message:ee.toString(t)}})}max(e,t){return new Xc({...this._def,maxSize:{value:e,message:ee.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Xc.create=(e,t)=>new Xc({valueType:e,minSize:null,maxSize:null,typeName:le.ZodSet,...ve(t)});fd=class fd extends Re{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.function)return V(t,{code:j.invalid_type,expected:W.function,received:t.parsedType}),ce;function r(s,a){return Sh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ud(),gs].filter((c)=>!!c),issueData:{code:j.invalid_arguments,argumentsError:a}})}function n(s,a){return Sh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ud(),gs].filter((c)=>!!c),issueData:{code:j.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Zc){let s=this;return br(async function(...a){let c=new Zr([]),u=await s._def.args.parseAsync(a,o).catch((m)=>{throw c.addIssue(r(a,m)),c}),d=await Reflect.apply(i,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch((m)=>{throw c.addIssue(n(d,m)),c})})}else{let s=this;return br(function(...a){let c=s._def.args.safeParse(a,o);if(!c.success)throw new Zr([r(a,c.error)]);let u=Reflect.apply(i,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Zr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new fd({...this._def,args:pi.create(e).rest(da.create())})}returns(e){return new fd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new fd({args:e?e:pi.create([]).rest(da.create()),returns:t||da.create(),typeName:le.ZodFunction,...ve(r)})}};bd=class bd extends Re{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})}};bd.create=(e,t)=>new bd({getter:e,typeName:le.ZodLazy,...ve(t)});xd=class xd extends Re{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return V(t,{received:t.data,code:j.invalid_literal,expected:this._def.value}),ce}return{status:"valid",value:e.data}}get value(){return this._def.value}};xd.create=(e,t)=>new xd({value:e,typeName:le.ZodLiteral,...ve(t)});fa=class fa extends Re{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return V(t,{expected:Te.joinValues(r),received:t.parsedType,code:j.invalid_type}),ce}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 V(t,{received:t.data,code:j.invalid_enum_value,options:r}),ce}return br(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 fa.create(e,{...this._def,...t})}exclude(e,t=this._def){return fa.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};fa.create=xq;_d=class _d extends Re{_parse(e){let t=Te.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==W.string&&r.parsedType!==W.number){let n=Te.objectValues(t);return V(r,{expected:Te.joinValues(n),received:r.parsedType,code:j.invalid_type}),ce}if(!this._cache)this._cache=new Set(Te.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=Te.objectValues(t);return V(r,{received:r.data,code:j.invalid_enum_value,options:n}),ce}return br(e.data)}get enum(){return this._def.values}};_d.create=(e,t)=>new _d({values:e,typeName:le.ZodNativeEnum,...ve(t)});Zc=class Zc extends Re{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.promise&&t.common.async===!1)return V(t,{code:j.invalid_type,expected:W.promise,received:t.parsedType}),ce;let r=t.parsedType===W.promise?t.data:Promise.resolve(t.data);return br(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Zc.create=(e,t)=>new Zc({type:e,typeName:le.ZodPromise,...ve(t)});Co=class Co extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:(i)=>{if(V(r,i),i.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return ce;let a=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(a.status==="aborted")return ce;if(a.status==="dirty")return Wc(a.value);if(t.value==="dirty")return Wc(a.value);return a});else{if(t.value==="aborted")return ce;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});if(s.status==="aborted")return ce;if(s.status==="dirty")return Wc(s.value);if(t.value==="dirty")return Wc(s.value);return s}}if(n.type==="refinement"){let i=(s)=>{let a=n.refinement(s,o);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 ce;if(s.status==="dirty")t.dirty();return i(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 ce;if(s.status==="dirty")t.dirty();return i(s.value).then(()=>({status:t.value,value:s.value}))})}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ua(i))return ce;let s=n.transform(i.value,o);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((i)=>{if(!ua(i))return ce;return Promise.resolve(n.transform(i.value,o)).then((s)=>({status:t.value,value:s}))});Te.assertNever(n)}};Co.create=(e,t,r)=>new Co({schema:e,typeName:le.ZodEffects,effect:t,...ve(r)});Co.createWithPreprocess=(e,t,r)=>new Co({schema:t,effect:{type:"preprocess",transform:e},typeName:le.ZodEffects,...ve(r)});$o=class $o extends Re{_parse(e){if(this._getType(e)===W.undefined)return br(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$o.create=(e,t)=>new $o({innerType:e,typeName:le.ZodOptional,...ve(t)});ys=class ys extends Re{_parse(e){if(this._getType(e)===W.null)return br(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ys.create=(e,t)=>new ys({innerType:e,typeName:le.ZodNullable,...ve(t)});vd=class vd extends Re{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===W.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};vd.create=(e,t)=>new vd({innerType:e,typeName:le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ve(t)});wd=class wd extends Re{_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(dd(n))return n.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};wd.create=(e,t)=>new wd({innerType:e,typeName:le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ve(t)});Fh=class Fh extends Re{_parse(e){if(this._getType(e)!==W.nan){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.nan,received:r.parsedType}),ce}return{status:"valid",value:e.data}}};Fh.create=(e)=>new Fh({typeName:le.ZodNaN,...ve(e)});Dst=Symbol("zod_brand");bw=class bw extends Re{_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}};Ph=class Ph extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return ce;if(o.status==="dirty")return t.dirty(),Wc(o.value);else return this._def.out._parseAsync({data:o.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 ce;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 Ph({in:e,out:t,typeName:le.ZodPipeline})}};Dd=class Dd extends Re{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(ua(n))n.value=Object.freeze(n.value);return n};return dd(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Dd.create=(e,t)=>new Dd({innerType:e,typeName:le.ZodReadonly,...ve(t)});Est={object:$t.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"})(le||(le={}));w=di.create,R=Yc.create,Sst=Fh.create,$st=Jc.create,ge=$h.create,Cst=pd.create,kst=Ch.create,Rst=md.create,Ast=hd.create,Ost=kh.create,Ed=da.create,Fst=fi.create,Pst=Rh.create,oe=So.create,U=$t.create,Ist=$t.strictCreate,Sd=gd.create,xw=yw.create,Tst=yd.create,Nst=pi.create,Qc=Ah.create,jst=Oh.create,qst=Xc.create,Mst=fd.create,Lst=bd.create,ze=xd.create,Ze=fa.create,Bst=_d.create,Ust=Zc.create,zst=Co.create,Vst=$o.create,Gst=ys.create,Hst=Co.createWithPreprocess,Wst=Ph.create});var _w=O(()=>{Eh();mw();mq();ld();_q();Dh()});var en=O(()=>{_w();_w()});function f$e(e){return e.startsWith("v")?e:`v${e}`}var u$e,d$e,vq,oat;var vw=O(()=>{en();u$e=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,d$e=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;vq=w().regex(u$e,"must be a semver version, optionally v-prefixed").transform(f$e),oat=w().regex(d$e,"must be the canonical v-prefixed tag (vX.Y.Z)")});function ww(e){return Ih.includes(e)}var p$e,$d,Ih,wq,m$e,Dq,h$e,Eq,g$e,y$e,Sq,b$e,$q,aat,cat,Cq,x$e,kq,_$e,Rq,Dw=20,Ew=500,v$e,lat;var Cd=O(()=>{en();p$e=Ze(["pending","verified","approved","revoked"]),$d=Ze(["person","service","test"]),Ih=$d.options;wq={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"},m$e=Ze(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Dq=m$e.options,h$e=Ze(["active","pending","revoked"]),Eq=U({field:w(),blocks:oe(w()).optional(),set_on:oe(w()).optional()}).passthrough(),g$e=U({id:R().int(),username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),orcid:w().nullable().optional(),created_at:w().optional(),approved_at:w().nullable().optional(),dataset_count:R().int().optional(),sandbox_completed:ge().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),service_access:ge().optional(),status:p$e.optional(),email_verified:ge().optional(),orcid_verified:ge().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),profile_gaps:oe(Eq).optional(),username_auto_assigned:ge().optional(),account_kind:$d.optional()}).passthrough(),y$e=U({prefix:w(),created_at:w(),last_used_at:w().nullable()}).passthrough().nullable(),Sq=U({user:g$e,token:y$e.optional()}).passthrough(),b$e=U({id:R().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),email_verified:R().int().nullable().optional(),role:w().nullable(),created_at:w(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),signup_source:w().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),orcid:w().nullable().optional(),upload_access_requested_at:w().nullable().optional(),account_kind:$d.optional()}).passthrough(),$q=U({users:oe(b$e),count:R().int()}).passthrough(),aat=Ze(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),cat=Ze(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Cq=U({suggestion:w().nullable(),based_on:Ze(["name","unavailable","exhausted"])}).passthrough(),x$e=Ze(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),kq=x$e.options,_$e=Ze(["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"]),Rq=_$e.options,v$e=U({id:R().int(),email:w(),username:w().nullable(),role:w(),status:h$e,email_verified:ge(),given_name:w().nullable(),family_name:w().nullable(),orcid:w().nullable(),orcid_verified:ge(),github_username:w().nullable(),city:w().nullable(),country:w().nullable(),affiliation:w().nullable(),service_access:ge(),service_access_granted_at:w().nullable(),upload_access_requested_at:w().nullable(),profile_gaps:oe(Eq),username_auto_assigned:ge()}).passthrough(),lat=U({user:v$e.nullable()}).passthrough()});function Oq(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:j.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function Fq(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:j.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var w$e="0.4.0",Sw,el,Aq,D$e,E$e,S$e,Pq,pat,Iq,mat,mi,$$e,Th,hat;var $w=O(()=>{en();vw();Sw=Ze(["openneuro","nemar","gin","other"]),el=Sd([ze(0),ze(1)]).nullable(),Aq=U({dataset_id:w(),id:w().optional(),name:w(),description:w().nullable().optional(),status:w(),visibility:w(),anonymous:R().int().nullable().optional(),concept_doi:w().nullable().optional(),doi:w().nullable().optional(),created_at:w(),updated_at:w().optional(),owner_username:w().nullable().optional(),source:w().nullable().optional(),modalities:w().optional(),participants:R().int().nonnegative(),tasks:w().optional(),authors:w().optional(),license:w().optional(),file_size:R().nonnegative(),file_size_formatted:w().optional(),total_files:R().nonnegative().nullable().optional(),num_citations:R().int().nonnegative().optional(),n_channels:R().int().nullable().optional(),electrode_system:w().nullable().optional(),has_hed:el.optional(),hed_version:w().nullable().optional(),data_complete:el.optional(),bytes_present:R().nonnegative().nullable().optional(),latest_version:vq.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:w().nullable().optional(),zarr_status:Ze(["pending","ready","failed"]).nullable().optional(),zarr_store_count:R().int().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:R().int().nullable().optional(),zarr_failure_count:R().int().nullable().optional(),zarr_deterministic:el.optional(),zarr_failed_at:w().nullable().optional(),zarr_index_url:w().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),zarr_requeue_at:w().nullable().optional(),anonymity_status:Ze(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:w().nullable().optional(),anonymity_findings:w().nullable().optional(),anonymity_unchecked:w().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:w().nullable().optional(),placement_scheme:w().nullable().optional()}).passthrough();D$e=Aq.superRefine((e,t)=>{Oq(e,t),Fq(e,t)}),E$e=Aq.extend({file_size:R().nonnegative().nullable(),file_size_formatted:w().nullable().optional(),modalities:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),license:w().nullable().optional(),owner_github:w().nullable().optional(),attestation_deposit_type:Ze(["owner","redistribution"]).nullable().optional(),attestation_key_status:Ze(["destroyed","retained"]).nullable().optional(),attestation_deidentified:el.optional(),attestation_no_duplicate:el.optional(),attestation_upstream_source:w().nullable().optional(),attestation_accepted_at:w().nullable().optional(),zarr_data_failures:U({count:R().int().nonnegative(),detail_ref:w(),compacted_by:w().optional(),pending:R().int().nonnegative().optional(),discovered:R().int().nonnegative().optional(),events_upload_failed:ze(!0).optional(),manifest_upload_failed:ze(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Oq(e,t),Fq(e,t)}),S$e=U({id:w(),name:w(),modalities:w().nullable().optional(),participants:R().int().nullable().optional(),doi:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),has_hed:el.optional(),score:R().optional(),snippet:w().optional()}).passthrough(),Pq=Qc(w(),R().int().nonnegative()),pat=U({datasets:oe(D$e),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:Pq.optional()}).passthrough(),Iq=U({results:oe(S$e),count:R().int().nonnegative(),returned:R().int().nonnegative().optional(),offset:R().int().nonnegative().optional(),limit:R().int().optional(),candidate_ceiling:R().int().optional(),truncated:ge().optional(),method:Ze(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:R().optional(),warning:w().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:Pq.optional()}).passthrough(),mat=U({dataset:E$e}).passthrough(),mi=U({value:w(),count:R().int().nonnegative()}),$$e=U({values:oe(mi),distinct_total:R().int().nonnegative(),truncated:ge()}),Th=U({"electrode-system":oe(mi).optional(),source:oe(mi).optional(),zarr:oe(mi).optional(),powerline:oe(mi).optional(),"bids-version":oe(mi).optional(),"hed-version":oe(mi).optional(),license:oe(mi).optional(),modality:oe(mi).optional(),task:$$e.optional(),warning:w().optional()}).passthrough(),hat=U({schema_version:ze(w$e),doc_type:ze("dataset"),dataset_id:w().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:w(),source:Sw,recording_modality:oe(w()).min(1),description:w().nullable().optional(),bids_version:w().nullable().optional(),license:w().nullable().optional()}).passthrough()});var C$e,bat,xat,_at,vat;var Tq=O(()=>{en();C$e=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,bat=w().regex(C$e,"ORCID must be in format 0000-0000-0000-000X"),xat=Ze(["found","no_public_name","lookup_failed"]),_at=Ze(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing"]),vat=Ze(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var k$e,Nq,kd="https://nemar.org/settings",Eat,R$e,A$e,O$e,jq,qq;var Cw=O(()=>{en();k$e=Ze(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Nq=k$e.options,Eat={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, ${kd}).`,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, ${kd}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${kd}), 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, ${kd}).`,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, ${kd}).`,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."},R$e=Ze(["orcid","email","github"]),A$e=U({id:R().int(),username:w().nullable(),email:w(),created_at:w(),has_oauth_identity:ge(),dataset_count:R().int(),identity_conflict:R().int(),canonical:ge()}).passthrough(),O$e=U({kind:R$e,value:w(),canonical_user_id:R().int(),accounts:oe(A$e)}).passthrough(),jq=U({groups:oe(O$e),group_count:R().int(),flagged_count:R().int()}).passthrough(),qq=U({ok:ze(!0),id:R().int(),cleared:ge()}).passthrough()});var kw=120,Mq=64,Rw="unnamed machine",F$e=25,Nh,Lq,tl,Bq,Cat,kat,Uq,P$e,I$e,zq,Aw,Vq,Rat,Aat,jh,qh;var Mh=O(()=>{en();Nh=Ze(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Lq={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."},tl=Ze(["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"]),Bq=tl.options,Cat={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 ${F$e} 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."},kat=U({error:tl,message:w()}).passthrough(),Uq=U({device_code:w(),user_code:w(),verification_uri:w(),verification_uri_complete:w(),expires_in:R().int(),interval:R().int()}).passthrough(),P$e=xw("error",[U({error:ze("authorization_pending"),message:w()}).passthrough(),U({error:ze("slow_down"),message:w()}).passthrough()]),I$e=xw("error",[U({error:ze("expired_token"),reason:tl,message:w()}).passthrough(),U({error:ze("access_denied"),reason:tl,message:w()}).passthrough(),U({error:ze("invalid_grant"),reason:tl,message:w()}).passthrough()]),zq=Sd([P$e,I$e]),Aw=U({id:R().int(),name:w().nullable(),prefix:w(),created_at:w(),last_used_at:w().nullable(),current:ge()}).passthrough(),Vq=U({api_key:w(),key:Aw,user:U({username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),sandbox_completed:ge(),sandbox_dataset_id:w().nullable()}).passthrough()}).passthrough(),Rat=U({user_code:w(),machine_name:w(),requested_at:w(),expires_in:R().int(),account:U({username:w().nullable(),email_masked:w()}).passthrough(),refusal:U({code:tl,message:w()}).passthrough().nullable()}).passthrough(),Aat=U({ok:ze(!0),machine_name:w()}).passthrough(),jh=U({keys:oe(Aw)}).passthrough(),qh=U({api_key:w(),key:Aw}).passthrough()});function Ft(e){return Ct[e]}function hi(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Ct;var rl=O(()=>{Ct={"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 N$e(e){return e==="verified"||e==="upload_access"||e==="publication"}function nl(e){return(e??"").trim().length===0}function j$e(e){return e==="service"||e==="test"}function Wq(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Lh,e)?Lh[e]:void 0;if(!n)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:Ct["gap.set_on.default_web"],setOnCli:null,known:!1};let o=r&&n.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??n.blocks,label:Ct[n.labelKey],setOnWeb:Ct[o?n.orcidWebKey:n.webKey],setOnCli:o||n.cliKey===null?null:Ct[n.cliKey],known:!0}}function Gq(e){let t=Ow.indexOf(e);return t===-1?Ow.length:t}function Kq(e,t={}){return e.map((r)=>Wq(r,{orcidVerified:t.orcidVerified}))}function Bh(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(N$e):[];return Wq(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>Gq(r.field)-Gq(n.field))}function Fw(e){let t=e.blocks[0],r=t?Ct[T$e[t]]:Ct["gap.blocks.unknown"],n=hi(Ct["gap.sentence"],{label:"",blocks:r}).trimStart(),o=e.setOnCli?hi(Ct["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):hi(Ct["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${o}`}function Yq(e){return`${e.label} ${Fw(e)}`}function Uh(){let e=hi(Ct["gap.sentence"],{label:Hq.label,blocks:Ct["cli.gap.blocks.sandbox"]}),t=hi(Ct["cli.gap.set_on.cli_only"],{cli:Hq.command});return`${e} ${t}`}function Jq(){return Ct["cli.gaps.sandbox_unchecked"]}var Lh,Ow,Iat,T$e,Hq;var ol=O(()=>{rl();Lh={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&&nl(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)=>nl(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)=>nl(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&&!j$e(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)=>nl(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)=>nl(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)=>nl(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}},Ow=Object.keys(Lh),Iat=Ow.filter((e)=>Lh[e].isMissing!==null),T$e={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Hq={field:"sandbox",label:Ct["cli.gap.field.sandbox.label"],command:Ct["cli.gap.field.sandbox.set_on.cli"]}});function Hh(e,t){let r=e.sss!==void 0;if(e.derived!==r)t.addIssue({code:j.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 xr,zh,Xq,Vh,Gh,q$e,M$e,L$e,B$e,U$e,jat,z$e,qat,V$e,Mat;var Pw=O(()=>{en();xr=/^[a-z]{2}[0-9]{6}$/,zh=/^[0-9a-f]{40}$/,Xq=U({name:w(),modality:w().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(),Vh=U({converted:R().int().nonnegative().optional(),relabelled:R().int().nonnegative().optional(),kept_importer_unit:R().int().nonnegative().optional(),units_column_present:ge().optional(),sidecar:w().optional(),sidecar_supplied:ge().optional()}).passthrough(),Gh=U({applied:ge().optional(),method:w().optional(),calibration:w().optional(),cross_talk:w().optional(),mne_version:w().optional()}).passthrough();q$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),updated_utc:w().optional(),source_tree:ze("raw"),derived:ge(),modalities:oe(w()).optional(),groups:oe(Xq).optional(),power_line_frequency:R().nullable().optional(),event_description_count:R().int().nonnegative().optional(),n_events:R().int().nonnegative().optional(),trial_types:Qc(w(),R().int().nonnegative()).optional(),units_report:Vh.optional(),channels_tsv_read_error:ge().optional(),split_members:oe(w()).optional(),sss:Gh.optional()}).passthrough().superRefine(Hh),M$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr").optional(),code:w(),reason:w(),detail:w().nullable().optional(),attempts:R().int().nonnegative().optional()}).passthrough(),L$e=Ze(["infra_failure","memory_budget","not_attempted"]),B$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),reason:L$e,attempts:R().int().nonnegative(),last_error:w().nullable().optional(),last_attempt_utc:w().nullable().optional()}).passthrough(),U$e=U({level0:ze("<zarr>/<group>/0"),view:ze("<zarr>/<group>/view/<L>"),view_levels:ze("1..n_view_levels from the group attrs"),scale_offset:ze("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ze("<data_base>events.parquet").optional()}).passthrough(),jat=U({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),contract_base:w().regex(/^https:\/\//,"must be https"),data_base:w().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:w().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:w().min(1),s3_anonymous:ge(),source_commit:w().regex(zh,"must be a full 40-hex SHA"),engine_version:w().min(1),biosigio_version:w().nullable().optional(),updated_utc:w(),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:oe(q$e),failures:oe(M$e),pending:oe(B$e),doi:w().nullable().optional(),license:w().nullable().optional(),citation:w().nullable().optional(),hed_version:w().nullable().optional(),events_parquet:w().regex(/^https:\/\//,"must be https").optional(),events_row_count:R().int().nonnegative().optional(),layout:U$e}).passthrough(),z$e=U({name:w(),configuration:Qc(w(),Ed()).optional()}).passthrough(),qat=U({zarr_format:ze(3),node_type:ze("array"),shape:oe(R().int().nonnegative()),data_type:w(),chunk_grid:U({name:w(),configuration:Qc(w(),Ed()).optional()}).passthrough(),codecs:oe(z$e),fill_value:Ed().optional(),attributes:Qc(w(),Ed()).optional(),dimension_names:oe(w().nullable()).optional()}).passthrough(),V$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),groups:oe(Xq).optional(),modalities:oe(w()).optional()}).passthrough(),Mat=U({format:ze("nemar-zarr-index"),format_version:R().int(),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),source_commit:w(),stores:oe(V$e)}).passthrough()});function Zq(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 G$e,H$e,W$e,K$e,ko,Uat;var Wh=O(()=>{$w();G$e=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],H$e=["50","60"],W$e=["ready","pending","failed"],K$e=Sw.options,ko=[{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:H$e},{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:G$e},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:K$e},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:W$e},{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"}],Uat=new Map(ko.map((e)=>[e.key,e]))});var Y$e,Wat,J$e,t9,Rd,Qq,X$e,r9,Z$e=20,Q$e=100,eCe,n9,tCe,Kat,Yat,rCe,Jat,Xat,nCe,oCe,iCe,Zat,sCe=50,aCe=500,Qat,cCe,lCe,ect,uCe=1000,dCe=5000,tct,fCe,rct,pCe=800,mCe=4000,nct,oct,Iw=60,Tw=64,e9,hCe=86400,gCe=4096,ict,yCe,bCe,sct;var o9=O(()=>{en();Wh();Pw();Y$e=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:oe(w()).optional(),tasks:oe(w()).optional(),subject_count:R().int().nonnegative().nullable().optional(),has_hed:Sd([ze(0),ze(1)]).nullable().optional(),hed_version:w().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:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:R().int().nonnegative().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),index_url:w().nullable().optional()}).passthrough(),Wat=U({format:ze("nemar-zarr-catalog"),format_version:R().int(),generated_utc:w(),contract_base:w(),count:R().int().nonnegative(),datasets:oe(Y$e)}).passthrough(),J$e=["verified","failed","unverifiable"],t9=Ze(J$e).nullable(),Rd=U({dataset_id:w().regex(xr),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),source_commit:w().regex(zh),index_etag:w().nullable(),engine_version:w(),source_tree:ze("raw"),derived:ge(),sss:Gh.optional(),lossy:ge(),dtype:w().nullable(),effective_rate_hz:R().nullable(),source_rate_hz:R().nullable(),units_report:Vh.nullable().optional(),zarr_verify_status:t9,note:w().nullable().optional()}).passthrough().superRefine(Hh),Qq=U({start:R().int().nonnegative(),end:R().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),X$e=U({python_zarr:w(),zarrita:w(),python_browser:w()}).passthrough(),r9=U({contract_base:w(),data_base:w(),s3_uri:w(),s3_region:w(),s3_anonymous:ge(),zarr:w(),group:w(),level:Sd([ze("0"),R().int().positive()]),array_path:w(),dtype:w().nullable(),codecs:oe(Ed()).optional(),chunk_samples:R().int().positive().nullable(),shard_samples:R().int().positive().nullable(),n_channels:R().int().nonnegative().nullable(),sample_slice:Qq.optional(),channel_slice:Qq.optional(),scale_offset:w(),how_to:X$e}).passthrough(),eCe=Object.fromEntries(ko.map((e)=>[e.queryParam,w().optional()])),n9={modality:w().optional(),task:w().optional(),has_hed:ge().optional(),has_zarr:ge().optional(),author:w().optional(),has_doi:ge().optional(),has_zarr_verified:ge().optional(),data_complete:ge().optional(),recent:R().int().positive().optional(),license:w().optional()},tCe=Object.keys(n9),Kat=[...tCe,...ko.map((e)=>e.queryParam)],Yat=U({query:w().optional(),...n9,include_unknown:ge().optional(),...eCe,limit:R().int().positive().max(Q$e).default(Z$e)}).passthrough(),rCe=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:oe(w()).optional(),tasks:oe(w()).optional(),subject_count:R().int().nullable().optional(),has_hed:ge().nullable().optional(),has_zarr:ge()}).passthrough(),Jat=U({results:oe(rCe),count:R().int().nonnegative(),limit:R().int(),note:w().nullable().optional(),truncated:ge().optional()}).passthrough(),Xat=U({dataset_id:w().regex(xr)}).passthrough(),nCe=["list_recordings","get_events","render_overview","read_window"],oCe=U({next_cheapest_tool:Ze(nCe),reason:w()}).passthrough(),iCe=["pending","ready","failed"],Zat=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),modalities:oe(w()).optional(),tasks:oe(w()).optional(),subject_count:R().int().nullable().optional(),has_hed:ge().nullable().optional(),hed_version:w().nullable().optional(),recording_count:R().int().nullable().optional(),total_recording_duration_s:R().nullable().optional(),zarr_status:Ze(iCe).nullable().optional(),zarr_verify_status:t9.optional(),zarr_source_commit:w().nullable().optional(),zarr_store_count:R().int().nullable().optional(),cost_hint:oCe}).passthrough(),Qat=U({dataset_id:w().regex(xr),modality:w().optional(),min_duration_s:R().nonnegative().optional(),include_derived:ge().default(!1),limit:R().int().positive().max(aCe).default(sCe),offset:R().int().nonnegative().default(0)}).passthrough(),cCe=U({name:w(),modality:w().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(),lCe=U({path:w(),zarr:w(),source_tree:ze("raw"),derived:ge(),groups:oe(cCe).optional(),n_events:R().int().nonnegative().optional(),sss:Gh.optional(),units_report:Vh.optional()}).passthrough().superRefine(Hh),ect=U({dataset_id:w().regex(xr),source_commit:w().regex(zh).nullable(),recordings:oe(lCe),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:w().nullable().optional(),envelope:Rd.optional()}).passthrough(),tct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),limit:R().int().positive().max(dCe).default(uCe),offset:R().int().nonnegative().default(0)}).passthrough(),fCe=U({store_path:w(),group_name:w(),onset_s:R(),duration_s:R().nullable().optional(),sample_index:R().int().nonnegative(),trial_type:w().nullable().optional(),value:Sd([w(),R()]).nullable().optional(),hed:w().nullable().optional()}).passthrough(),rct=U({dataset_id:w().regex(xr),recording:w(),events:oe(fCe),source:Ze(["events_parquet","events_tsv_fallback"]),estimated:ge(),total_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),truncated:ge(),note:w().nullable().optional(),envelope:Rd.optional()}).passthrough(),nct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),width_px:R().int().positive().max(mCe).default(pCe)}).passthrough(),oct=U({dataset_id:w().regex(xr),recording:w(),group:w(),level:R().int().positive(),width_px:R().int().positive(),height_px:R().int().positive(),mime_type:ze("image/png"),columns_read:R().int().nonnegative(),chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),envelope:Rd.optional()}).passthrough(),e9=Iw*Tw,ict=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),start_s:R().nonnegative().default(0),duration_s:R().positive().max(hCe).default(10),channels:oe(R().int().nonnegative()).max(gCe).optional(),taste:ge().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:j.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>Iw)t.addIssue({code:j.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${Iw} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>Tw)t.addIssue({code:j.custom,message:`taste channels (${e.channels.length}) exceeds the ${Tw}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>e9)t.addIssue({code:j.custom,message:`taste exceeds the cap of ${e9} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),yCe=U({mode:ze("recipe"),recipe:r9,envelope:Rd}).passthrough(),bCe=U({mode:ze("taste"),start_s:R(),duration_s:R(),channels:oe(R().int()),sample_rate_hz:R(),values:oe(oe(R())),recipe:r9,chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),filled_ranges:oe(U({start_sample:R().int().nonnegative(),end_sample:R().int().nonnegative(),start_s:R(),end_s:R()}).passthrough()),note:w().nullable().optional(),envelope:Rd}).passthrough(),sct=xw("mode",[yCe,bCe])});var il=O(()=>{vw();Cd();$w();Tq();Cw();Mh();rl();ol();Pw();o9()});function Kh(e){return e?_Ce:bs}var bs,xCe,_Ce,Nw;var Yh=O(()=>{bs=["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"],xCe=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],_Ce=bs.filter((e)=>!xCe.includes(e));Nw={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 Jh(e){let t=[],r="",n="start",o=!1;for(let i of e)switch(i){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(o)r+=i;n="property",o=!o;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(o){o=!1,r+=i;break}if(jw.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(o){o=!1,r+=i;break}if(n==="property"){if(jw.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"&&!vCe.has(i))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(o)o=!1,r+="\\";r+=i}}if(o)r+="\\";switch(n){case"property":{if(jw.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function qw(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 i9(e,t){if(qw(e,t))throw Error("Cannot use string index")}function s9(e,t,r){if(!pa(e)||typeof t!=="string")return r===void 0?e:r;let n=Jh(t);if(n.length===0)return r;for(let o=0;o<n.length;o++){let i=n[o];if(qw(e,i))e=o===n.length-1?void 0:null;else e=e[i];if(e===void 0||e===null){if(o!==n.length-1)return r;break}}return e===void 0?r:e}function Mw(e,t,r){if(!pa(e)||typeof t!=="string")return e;let n=e,o=Jh(t);for(let i=0;i<o.length;i++){let s=o[i];if(i9(e,s),i===o.length-1)e[s]=r;else if(!pa(e[s]))e[s]=typeof o[i+1]==="number"?[]:{};e=e[s]}return n}function a9(e,t){if(!pa(e)||typeof t!=="string")return!1;let r=Jh(t);for(let n=0;n<r.length;n++){let o=r[n];if(i9(e,o),n===r.length-1)return delete e[o],!0;if(e=e[o],!pa(e))return!1}}function c9(e,t){if(!pa(e)||typeof t!=="string")return!1;let r=Jh(t);if(r.length===0)return!1;for(let n of r){if(!pa(e)||!(n in e)||qw(e,n))return!1;e=e[n]}return!0}var pa=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},jw,vCe;var l9=O(()=>{jw=new Set(["__proto__","prototype","constructor"]),vCe=new Set("0123456789")});import _t from"path";import u9 from"os";import Lw from"process";function Uw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Lw.platform==="darwin")return wCe(e);if(Lw.platform==="win32")return DCe(e);return ECe(e)}var xs,Bw,sl,wCe=(e)=>{let t=_t.join(xs,"Library");return{data:_t.join(t,"Application Support",e),config:_t.join(t,"Preferences",e),cache:_t.join(t,"Caches",e),log:_t.join(t,"Logs",e),temp:_t.join(Bw,e)}},DCe=(e)=>{let t=sl.APPDATA||_t.join(xs,"AppData","Roaming"),r=sl.LOCALAPPDATA||_t.join(xs,"AppData","Local");return{data:_t.join(r,e,"Data"),config:_t.join(t,e,"Config"),cache:_t.join(r,e,"Cache"),log:_t.join(r,e,"Log"),temp:_t.join(Bw,e)}},ECe=(e)=>{let t=_t.basename(xs);return{data:_t.join(sl.XDG_DATA_HOME||_t.join(xs,".local","share"),e),config:_t.join(sl.XDG_CONFIG_HOME||_t.join(xs,".config"),e),cache:_t.join(sl.XDG_CACHE_HOME||_t.join(xs,".cache"),e),log:_t.join(sl.XDG_STATE_HOME||_t.join(xs,".local","state"),e),temp:_t.join(Bw,t,e)}};var d9=O(()=>{xs=u9.homedir(),Bw=u9.tmpdir(),{env:sl}=Lw});var SCe=(e,t)=>{let{onError:r}=t;return function(...o){return e.apply(void 0,o).catch(r)}},Ro;var f9=O(()=>{Ro=SCe});var $Ce=(e,t)=>{let{onError:r}=t;return function(...o){try{return e.apply(void 0,o)}catch(i){return r(i)}}},Bn;var p9=O(()=>{Bn=$Ce});var m9=250;var h9=()=>{};var CCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=o.interval??m9,a=Date.now()+i;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)})}}},Ao;var g9=O(()=>{h9();Ao=CCe});var kCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=Date.now()+i;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}}}},Oo;var y9=O(()=>{Oo=kCe});var zw=O(()=>{f9();p9();g9();y9()});var Ad,Vw;var b9=O(()=>{Gw();Ad={isChangeErrorOk:(e)=>{if(!Ad.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!x9&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Ad.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(!Ad.isNodeError(e))throw e;if(Ad.isChangeErrorOk(e))return;throw e}},Vw=Ad});import _9 from"process";var Od,Tr,x9,Zt;var Gw=O(()=>{b9();Od={onError:Vw.onChangeError},Tr={onError:()=>{return}},x9=_9.getuid?!_9.getuid():!1,Zt={isRetriable:Vw.isRetriableError}});import Ke from"fs";import{promisify as sr}from"util";var RCe,Gt;var Hw=O(()=>{zw();zw();Gw();RCe={attempt:{chmod:Ro(sr(Ke.chmod),Od),chown:Ro(sr(Ke.chown),Od),close:Ro(sr(Ke.close),Tr),fsync:Ro(sr(Ke.fsync),Tr),mkdir:Ro(sr(Ke.mkdir),Tr),realpath:Ro(sr(Ke.realpath),Tr),stat:Ro(sr(Ke.stat),Tr),unlink:Ro(sr(Ke.unlink),Tr),chmodSync:Bn(Ke.chmodSync,Od),chownSync:Bn(Ke.chownSync,Od),closeSync:Bn(Ke.closeSync,Tr),existsSync:Bn(Ke.existsSync,Tr),fsyncSync:Bn(Ke.fsync,Tr),mkdirSync:Bn(Ke.mkdirSync,Tr),realpathSync:Bn(Ke.realpathSync,Tr),statSync:Bn(Ke.statSync,Tr),unlinkSync:Bn(Ke.unlinkSync,Tr)},retry:{close:Ao(sr(Ke.close),Zt),fsync:Ao(sr(Ke.fsync),Zt),open:Ao(sr(Ke.open),Zt),readFile:Ao(sr(Ke.readFile),Zt),rename:Ao(sr(Ke.rename),Zt),stat:Ao(sr(Ke.stat),Zt),write:Ao(sr(Ke.write),Zt),writeFile:Ao(sr(Ke.writeFile),Zt),closeSync:Oo(Ke.closeSync,Zt),fsyncSync:Oo(Ke.fsyncSync,Zt),openSync:Oo(Ke.openSync,Zt),readFileSync:Oo(Ke.readFileSync,Zt),renameSync:Oo(Ke.renameSync,Zt),statSync:Oo(Ke.statSync,Zt),writeSync:Oo(Ke.writeSync,Zt),writeFileSync:Oo(Ke.writeFileSync,Zt)}},Gt=RCe});import ma from"process";var v9="utf8",Ww=438,w9=511,D9,E9,S9,$9=1000,C9,Kct,Kw=128;var Yw=O(()=>{D9={},E9=ma.geteuid?ma.geteuid():-1,S9=ma.getegid?ma.getegid():-1,C9=!!ma.getuid,Kct=ma.getuid?!ma.getuid():!1});var k9=(e)=>e instanceof Error&&("code"in e),Jw=(e)=>typeof e==="string",Xh=(e)=>e===void 0;var R9=()=>{};var A9=()=>{};import O9 from"process";var F9,Zh;var Xw=O(()=>{F9=O9.platform==="linux",Zh=O9.platform==="win32"});var Zw,P9;var I9=O(()=>{Xw();Zw=["SIGHUP","SIGINT","SIGTERM"];if(!Zh)Zw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(F9)Zw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");P9=Zw});import al from"process";class T9{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(Zh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))al.kill(al.pid,"SIGTERM");else al.kill(al.pid,e)},this.hook=()=>{al.once("exit",()=>this.exit());for(let e of P9)try{al.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var N9;var j9=O(()=>{Xw();I9();N9=new T9});var ACe,q9;var M9=O(()=>{j9();ACe=N9.register,q9=ACe});import OCe from"path";var tn,Fd;var L9=O(()=>{Hw();M9();Yw();tn={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",o=`.tmp-${r}${t}`;return`${e}${o}`},get:(e,t,r=!0)=>{let n=tn.truncate(t(e));if(n in tn.store)return tn.get(e,t,r);return tn.store[n]=r,[n,()=>delete tn.store[n]]},purge:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlink(e)},purgeSync:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in tn.store)tn.purgeSync(e)},truncate:(e)=>{let t=OCe.basename(e);if(t.length<=Kw)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Kw;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};q9(tn.purgeSyncAll);Fd=tn});import FCe from"path";function Qw(e,t,r=D9){if(Jw(r))return Qw(e,t,{encoding:r});let o={timeout:r.timeout??$9},i=null,s=null,a=null;try{let c=Gt.attempt.realpathSync(e),u=!!c;e=c||e,[s,i]=Fd.get(e,r.tmpCreate||Fd.create,r.tmpPurge!==!1);let d=C9&&Xh(r.chown),f=Xh(r.mode);if(u&&(d||f)){let m=Gt.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=FCe.dirname(e);Gt.attempt.mkdirSync(m,{mode:w9,recursive:!0})}if(a=Gt.retry.openSync(o)(s,"w",r.mode||Ww),r.tmpCreated)r.tmpCreated(s);if(Jw(t))Gt.retry.writeSync(o)(a,t,0,r.encoding||v9);else if(!Xh(t))Gt.retry.writeSync(o)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Gt.retry.fsyncSync(o)(a);else Gt.attempt.fsync(a);if(Gt.retry.closeSync(o)(a),a=null,r.chown&&(r.chown.uid!==E9||r.chown.gid!==S9))Gt.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Ww)Gt.attempt.chmodSync(s,r.mode);try{Gt.retry.renameSync(o)(s,e)}catch(m){if(!k9(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Gt.retry.renameSync(o)(s,Fd.truncate(e))}i(),s=null}finally{if(a)Gt.attempt.closeSync(a);if(s)Fd.purge(s)}}var B9=O(()=>{Hw();Yw();R9();A9();L9()});var Id=g(function(V9){Object.defineProperty(V9,"__esModule",{value:!0});V9.regexpCode=V9.getEsmExportName=V9.getProperty=V9.safeStringify=V9.stringify=V9.strConcat=V9.addCodeArg=V9.str=V9._=V9.nil=V9._Code=V9.Name=V9.IDENTIFIER=V9._CodeOrName=void 0;class Qh{}V9._CodeOrName=Qh;V9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cl extends Qh{constructor(e){super();if(!V9.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}}}V9.Name=cl;class Un extends Qh{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 cl)t[r.str]=(t[r.str]||0)+1;return t},{})}}V9._Code=Un;V9.nil=new Un("");function U9(e,...t){let r=[e[0]],n=0;while(n<t.length)t1(r,t[n]),r.push(e[++n]);return new Un(r)}V9._=U9;var e1=new Un("+");function z9(e,...t){let r=[Pd(e[0])],n=0;while(n<t.length)r.push(e1),t1(r,t[n]),r.push(e1,Pd(e[++n]));return PCe(r),new Un(r)}V9.str=z9;function t1(e,t){if(t instanceof Un)e.push(...t._items);else if(t instanceof cl)e.push(t);else e.push(NCe(t))}V9.addCodeArg=t1;function PCe(e){let t=1;while(t<e.length-1){if(e[t]===e1){let r=ICe(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function ICe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof cl||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 cl))return`"${e}${t.slice(1)}`;return}function TCe(e,t){return t.emptyStr()?e:e.emptyStr()?t:z9`${e}${t}`}V9.strConcat=TCe;function NCe(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pd(Array.isArray(e)?e.join(","):e)}function jCe(e){return new Un(Pd(e))}V9.stringify=jCe;function Pd(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V9.safeStringify=Pd;function qCe(e){return typeof e=="string"&&V9.IDENTIFIER.test(e)?new Un(`.${e}`):U9`[${e}]`}V9.getProperty=qCe;function MCe(e){if(typeof e=="string"&&V9.IDENTIFIER.test(e))return new Un(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}V9.getEsmExportName=MCe;function LCe(e){return new Un(e.toString())}V9.regexpCode=LCe});var i1=g(function(K9){Object.defineProperty(K9,"__esModule",{value:!0});K9.ValueScope=K9.ValueScopeName=K9.Scope=K9.varKinds=K9.UsedValueState=void 0;var Nr=Id();class H9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var tg;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(tg||(K9.UsedValueState=tg={}));K9.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};class n1{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Nr.Name?e:this.name(e)}name(e){return new Nr.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}}}K9.Scope=n1;class o1 extends Nr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Nr._`.${new Nr.Name(t)}[${r}]`}}K9.ValueScopeName=o1;var QCe=Nr._`\n`;class W9 extends n1{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?QCe:Nr.nil}}get(){return this._scope}name(e){return new o1(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:o}=n,i=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[o];if(s){let u=s.get(i);if(u)return u}else s=this._values[o]=new Map;s.set(i,n);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,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 Nr._`${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 o=Nr.nil;for(let i in e){let s=e[i];if(!s)continue;let a=r[i]=r[i]||new Map;s.forEach((c)=>{if(a.has(c))return;a.set(c,tg.Started);let u=t(c);if(u){let d=this.opts.es5?K9.varKinds.var:K9.varKinds.const;o=Nr._`${o}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))o=Nr._`${o}${u}${this.opts._n}`;else throw new H9(c);a.set(c,tg.Completed)})}return o}}K9.ValueScope=W9});var we=g(function(jr){Object.defineProperty(jr,"__esModule",{value:!0});jr.or=jr.and=jr.not=jr.CodeGen=jr.operators=jr.varKinds=jr.ValueScopeName=jr.ValueScope=jr.Scope=jr.Name=jr.regexpCode=jr.stringify=jr.getProperty=jr.nil=jr.strConcat=jr.str=jr._=void 0;var Le=Id(),zn=i1(),_s=Id();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(jr,"strConcat",{enumerable:!0,get:function(){return _s.strConcat}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(jr,"getProperty",{enumerable:!0,get:function(){return _s.getProperty}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(jr,"regexpCode",{enumerable:!0,get:function(){return _s.regexpCode}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return _s.Name}});var ag=i1();Object.defineProperty(jr,"Scope",{enumerable:!0,get:function(){return ag.Scope}});Object.defineProperty(jr,"ValueScope",{enumerable:!0,get:function(){return ag.ValueScope}});Object.defineProperty(jr,"ValueScopeName",{enumerable:!0,get:function(){return ag.ValueScopeName}});Object.defineProperty(jr,"varKinds",{enumerable:!0,get:function(){return ag.varKinds}});jr.operators={GT:new Le._Code(">"),GTE:new Le._Code(">="),LT:new Le._Code("<"),LTE:new Le._Code("<="),EQ:new Le._Code("==="),NEQ:new Le._Code("!=="),NOT:new Le._Code("!"),OR:new Le._Code("||"),AND:new Le._Code("&&"),ADD:new Le._Code("+")};class vs{optimizeNodes(){return this}optimizeNames(e,t){return this}}class J9 extends vs{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?zn.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=ul(this.rhs,e,t);return this}get names(){return this.rhs instanceof Le._CodeOrName?this.rhs.names:{}}}class c1 extends vs{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 Le.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ul(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Le.Name?{}:{...this.lhs.names};return sg(e,this.rhs)}}class X9 extends c1{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Z9 extends vs{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Q9 extends vs{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class eM extends vs{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class tM extends vs{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=ul(this.code,e,t),this}get names(){return this.code instanceof Le._CodeOrName?this.code.names:{}}}class cg extends vs{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 o=r[n];if(o.optimizeNames(e,t))continue;nke(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ha(e,t.names),{})}}class ws extends cg{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class rM extends cg{}class Td extends ws{}Td.kind="else";class gi extends ws{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 Td(r):r}if(t){if(e===!1)return t instanceof gi?t:t.nodes;if(this.nodes.length)return this;return new gi(aM(e),t instanceof gi?[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=ul(this.condition,e,t),this}get names(){let e=super.names;if(sg(e,this.condition),this.else)ha(e,this.else.names);return e}}gi.kind="if";class ll extends ws{}ll.kind="for";class nM extends ll{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=ul(this.iteration,e,t),this}get names(){return ha(super.names,this.iteration.names)}}class oM extends ll{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?zn.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=sg(super.names,this.from);return sg(e,this.to)}}class s1 extends ll{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=ul(this.iterable,e,t),this}get names(){return ha(super.names,this.iterable.names)}}class rg extends ws{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)}}rg.kind="func";class ng extends cg{render(e){return"return "+super.render(e)}}ng.kind="return";class iM extends ws{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)ha(e,this.catch.names);if(this.finally)ha(e,this.finally.names);return e}}class og extends ws{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}og.kind="catch";class ig extends ws{render(e){return"finally"+super.render(e)}}ig.kind="finally";class sM{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
84
|
+
`;return this.stop(),this.#i.write(u),this}}function D(e){return new uq(e)}var cd,MSe;var Mn=O(()=>{Xe();Yj();Xj();sw();iq();aq();lq();cd=he(gm(),1),MSe=he(gm(),1)});var Te,pq,W,li=(e)=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return Number.isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":if(Array.isArray(e))return W.array;if(e===null)return W.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return W.promise;if(typeof Map<"u"&&e instanceof Map)return W.map;if(typeof Set<"u"&&e instanceof Set)return W.set;if(typeof Date<"u"&&e instanceof Date)return W.date;return W.object;default:return W.unknown}};var ld=O(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function r(o){throw Error()}e.assertNever=r,e.arrayToEnum=(o)=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=(o)=>{let i=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=(o)=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let i=[];for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s))i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map((s)=>typeof s==="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>{if(typeof i==="bigint")return i.toString();return i}})(Te||(Te={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(pq||(pq={}));W=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var j,Zr;var Dh=O(()=>{ld();j=Te.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"]);Zr=class Zr 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(o){return o.message},r={_errors:[]},n=(o)=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let s=r,a=0;while(a<i.path.length){let c=i.path[a];if(a!==i.path.length-1)s[c]=s[c]||{_errors:[]};else s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i));s=s[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof Zr))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.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 o=n.path[0];t[o]=t[o]||[],t[o].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};Zr.create=(e)=>new Zr(e)});var LSe=(e,t)=>{let r;switch(e.code){case j.invalid_type:if(e.received===W.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case j.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Te.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(e.keys,", ")}`;break;case j.invalid_union:r="Invalid input";break;case j.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(e.options)}`;break;case j.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(e.options)}, received '${e.received}'`;break;case j.invalid_arguments:r="Invalid function arguments";break;case j.invalid_return_type:r="Invalid function return type";break;case j.invalid_date:r="Invalid date";break;case j.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 Te.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case j.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 j.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 j.custom:r="Invalid input";break;case j.invalid_intersection_types:r="Intersection results could not be merged";break;case j.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case j.not_finite:r="Number must be finite";break;default:r=t.defaultError,Te.assertNever(e)}return{message:r}},gs;var dw=O(()=>{Dh();ld();gs=LSe});function ud(){return BSe}var BSe;var Eh=O(()=>{dw();BSe=gs});function V(e,t){let r=ud(),n=Sh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===gs?void 0:gs].filter((o)=>!!o)});e.common.issues.push(n)}class ir{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 ce;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 o=await n.key,i=await n.value;r.push({key:o,value:i})}return ir.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:o,value:i}=n;if(o.status==="aborted")return ce;if(i.status==="aborted")return ce;if(o.status==="dirty")e.dirty();if(i.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet))r[o.value]=i.value}return{status:e.value,value:r}}}var Sh=(e)=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},ce,Wc=(e)=>({status:"dirty",value:e}),br=(e)=>({status:"valid",value:e}),fw=(e)=>e.status==="aborted",pw=(e)=>e.status==="dirty",ua=(e)=>e.status==="valid",dd=(e)=>typeof Promise<"u"&&e instanceof Promise;var mw=O(()=>{Eh();dw();ce=Object.freeze({status:"aborted"})});var mq=()=>{};var ee;var hq=O(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(ee||(ee={}))});class Ln{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 ve(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=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:o};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:o}}class Re{get description(){return this._def.description}_getType(e){return li(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ir,ctx:{common:e.parent.common,data:e.data,parsedType:li(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(dd(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:li(e)},n=this._parseSync({data:e,path:r.path,parent:r});return gq(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:li(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return ua(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)=>ua(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:li(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(dd(n)?n:Promise.resolve(n));return gq(r,o)}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,o)=>{let i=e(n),s=()=>o.addIssue({code:j.custom,...r(n)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((a)=>{if(!a)return s(),!1;else return!0});if(!i)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:le.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 $o.create(this,this._def)}nullable(){return ys.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return So.create(this)}promise(){return Zc.create(this,this._def)}or(e){return gd.create([this,e],this._def)}and(e){return yd.create(this,e,this._def)}transform(e){return new Co({...ve(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new vd({...ve(this._def),innerType:this,defaultValue:t,typeName:le.ZodDefault})}brand(){return new bw({typeName:le.ZodBranded,type:this,...ve(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new wd({...ve(this._def),innerType:this,catchValue:t,typeName:le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Ph.create(this,e)}readonly(){return Dd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function bq(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 o$e(e){return new RegExp(`^${bq(e)}$`)}function i$e(e){let t=`${yq}T${bq(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 s$e(e,t){if((t==="v4"||!t)&&XSe.test(e))return!0;if((t==="v6"||!t)&&QSe.test(e))return!0;return!1}function a$e(e,t){if(!WSe.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,"="),o=JSON.parse(atob(n));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function c$e(e,t){if((t==="v4"||!t)&&ZSe.test(e))return!0;if((t==="v6"||!t)&&e$e.test(e))return!0;return!1}function l$e(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Kc(e){if(e instanceof $t){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=$o.create(Kc(n))}return new $t({...e._def,shape:()=>t})}else if(e instanceof So)return new So({...e._def,type:Kc(e.element)});else if(e instanceof $o)return $o.create(Kc(e.unwrap()));else if(e instanceof ys)return ys.create(Kc(e.unwrap()));else if(e instanceof pi)return pi.create(e.items.map((t)=>Kc(t)));else return e}function gw(e,t){let r=li(e),n=li(t);if(e===t)return{valid:!0,data:e};else if(r===W.object&&n===W.object){let o=Te.objectKeys(t),i=Te.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=gw(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===W.array&&n===W.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],c=gw(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(r===W.date&&n===W.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function xq(e,t){return new fa({values:e,typeName:le.ZodEnum,...ve(t)})}var gq=(e,t)=>{if(ua(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 Zr(e.common.issues);return this._error=r,this._error}}}},USe,zSe,VSe,GSe,HSe,WSe,KSe,YSe,JSe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hw,XSe,ZSe,QSe,e$e,t$e,r$e,yq="((\\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])))",n$e,di,Yc,Jc,$h,pd,Ch,md,hd,kh,da,fi,Rh,So,$t,gd,ui=(e)=>{if(e instanceof bd)return ui(e.schema);else if(e instanceof Co)return ui(e.innerType());else if(e instanceof xd)return[e.value];else if(e instanceof fa)return e.options;else if(e instanceof _d)return Te.objectValues(e.enum);else if(e instanceof vd)return ui(e._def.innerType);else if(e instanceof md)return[void 0];else if(e instanceof hd)return[null];else if(e instanceof $o)return[void 0,...ui(e.unwrap())];else if(e instanceof ys)return[null,...ui(e.unwrap())];else if(e instanceof bw)return ui(e.unwrap());else if(e instanceof Dd)return ui(e.unwrap());else if(e instanceof wd)return ui(e._def.innerType);else return[]},yw,yd,pi,Ah,Oh,Xc,fd,bd,xd,fa,_d,Zc,Co,$o,ys,vd,wd,Fh,Dst,bw,Ph,Dd,Est,le,w,R,Sst,$st,ge,Cst,kst,Rst,Ast,Ost,Ed,Fst,Pst,oe,U,Ist,Sd,xw,Tst,Nst,Qc,jst,qst,Mst,Lst,ze,Ze,Bst,Ust,zst,Vst,Gst,Hst,Wst;var _q=O(()=>{Dh();Eh();hq();mw();ld();USe=/^c[^\s-]{8,}$/i,zSe=/^[0-9a-z]+$/,VSe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GSe=/^[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,HSe=/^[a-z0-9_-]{21}$/i,WSe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KSe=/^[-+]?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)?)??$/,YSe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,XSe=/^(?:(?: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])$/,ZSe=/^(?:(?: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])$/,QSe=/^(([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]))$/,e$e=/^(([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])$/,t$e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r$e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n$e=new RegExp(`^${yq}$`);di=class di extends Re{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==W.string){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_type,expected:W.string,received:o.parsedType}),ce}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="length"){let i=e.data.length>o.value,s=e.data.length<o.value;if(i||s){if(n=this._getOrReturnCtx(e,n),i)V(n,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(s)V(n,{code:j.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});r.dirty()}}else if(o.kind==="email"){if(!YSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"email",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="emoji"){if(!hw)hw=new RegExp(JSe,"u");if(!hw.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"emoji",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="uuid"){if(!GSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"uuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="nanoid"){if(!HSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"nanoid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid"){if(!USe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"cuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid2"){if(!zSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"cuid2",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ulid"){if(!VSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"ulid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),V(n,{validation:"url",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"regex",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="datetime"){if(!i$e(o).test(e.data))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:"datetime",message:o.message}),r.dirty()}else if(o.kind==="date"){if(!n$e.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:"date",message:o.message}),r.dirty()}else if(o.kind==="time"){if(!o$e(o).test(e.data))n=this._getOrReturnCtx(e,n),V(n,{code:j.invalid_string,validation:"time",message:o.message}),r.dirty()}else if(o.kind==="duration"){if(!KSe.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"duration",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ip"){if(!s$e(e.data,o.version))n=this._getOrReturnCtx(e,n),V(n,{validation:"ip",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="jwt"){if(!a$e(e.data,o.alg))n=this._getOrReturnCtx(e,n),V(n,{validation:"jwt",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cidr"){if(!c$e(e.data,o.version))n=this._getOrReturnCtx(e,n),V(n,{validation:"cidr",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64"){if(!t$e.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"base64",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64url"){if(!r$e.test(e.data))n=this._getOrReturnCtx(e,n),V(n,{validation:"base64url",code:j.invalid_string,message:o.message}),r.dirty()}else Te.assertNever(o);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:j.invalid_string,...ee.errToObj(r)})}_addCheck(e){return new di({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ee.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ee.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ee.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ee.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ee.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ee.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ee.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ee.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ee.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ee.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ee.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ee.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ee.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,...ee.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,...ee.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ee.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ee.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...ee.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ee.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ee.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ee.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ee.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ee.errToObj(t)})}nonempty(e){return this.min(1,ee.errToObj(e))}trim(){return new di({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new di({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new di({...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}};di.create=(e)=>new di({checks:[],typeName:le.ZodString,coerce:e?.coerce??!1,...ve(e)});Yc=class Yc extends Re{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)!==W.number){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_type,expected:W.number,received:o.parsedType}),ce}let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="int"){if(!Te.isInteger(e.data))r=this._getOrReturnCtx(e,r),V(r,{code:j.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(l$e(e.data,o.value)!==0)r=this._getOrReturnCtx(e,r),V(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),V(r,{code:j.not_finite,message:o.message}),n.dirty()}else Te.assertNever(o);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ee.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ee.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ee.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ee.toString(t))}setLimit(e,t,r,n){return new Yc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new Yc({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ee.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ee.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ee.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ee.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ee.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ee.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"&&Te.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)}};Yc.create=(e)=>new Yc({checks:[],typeName:le.ZodNumber,coerce:e?.coerce||!1,...ve(e)});Jc=class Jc extends Re{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)!==W.bigint)return this._getInvalidInput(e);let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)r=this._getOrReturnCtx(e,r),V(r,{code:j.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))r=this._getOrReturnCtx(e,r),V(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else Te.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return V(t,{code:j.invalid_type,expected:W.bigint,received:t.parsedType}),ce}gte(e,t){return this.setLimit("min",e,!0,ee.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ee.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ee.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ee.toString(t))}setLimit(e,t,r,n){return new Jc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new Jc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ee.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}};Jc.create=(e)=>new Jc({checks:[],typeName:le.ZodBigInt,coerce:e?.coerce??!1,...ve(e)});$h=class $h extends Re{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==W.boolean){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.boolean,received:r.parsedType}),ce}return br(e.data)}};$h.create=(e)=>new $h({typeName:le.ZodBoolean,coerce:e?.coerce||!1,...ve(e)});pd=class pd extends Re{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==W.date){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_type,expected:W.date,received:o.parsedType}),ce}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return V(o,{code:j.invalid_date}),ce}let r=new ir,n=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)n=this._getOrReturnCtx(e,n),V(n,{code:j.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()}else Te.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pd({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ee.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ee.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}};pd.create=(e)=>new pd({checks:[],coerce:e?.coerce||!1,typeName:le.ZodDate,...ve(e)});Ch=class Ch extends Re{_parse(e){if(this._getType(e)!==W.symbol){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.symbol,received:r.parsedType}),ce}return br(e.data)}};Ch.create=(e)=>new Ch({typeName:le.ZodSymbol,...ve(e)});md=class md extends Re{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.undefined,received:r.parsedType}),ce}return br(e.data)}};md.create=(e)=>new md({typeName:le.ZodUndefined,...ve(e)});hd=class hd extends Re{_parse(e){if(this._getType(e)!==W.null){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.null,received:r.parsedType}),ce}return br(e.data)}};hd.create=(e)=>new hd({typeName:le.ZodNull,...ve(e)});kh=class kh extends Re{constructor(){super(...arguments);this._any=!0}_parse(e){return br(e.data)}};kh.create=(e)=>new kh({typeName:le.ZodAny,...ve(e)});da=class da extends Re{constructor(){super(...arguments);this._unknown=!0}_parse(e){return br(e.data)}};da.create=(e)=>new da({typeName:le.ZodUnknown,...ve(e)});fi=class fi extends Re{_parse(e){let t=this._getOrReturnCtx(e);return V(t,{code:j.invalid_type,expected:W.never,received:t.parsedType}),ce}};fi.create=(e)=>new fi({typeName:le.ZodNever,...ve(e)});Rh=class Rh extends Re{_parse(e){if(this._getType(e)!==W.undefined){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.void,received:r.parsedType}),ce}return br(e.data)}};Rh.create=(e)=>new Rh({typeName:le.ZodVoid,...ve(e)});So=class So extends Re{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==W.array)return V(t,{code:j.invalid_type,expected:W.array,received:t.parsedType}),ce;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;if(i||s)V(t,{code:i?j.too_big:j.too_small,minimum:s?n.exactLength.value:void 0,maximum:i?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)V(t,{code:j.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)V(t,{code:j.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((i,s)=>n.type._parseAsync(new Ln(t,i,t.path,s)))).then((i)=>ir.mergeArray(r,i));let o=[...t.data].map((i,s)=>n.type._parseSync(new Ln(t,i,t.path,s)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new So({...this._def,minLength:{value:e,message:ee.toString(t)}})}max(e,t){return new So({...this._def,maxLength:{value:e,message:ee.toString(t)}})}length(e,t){return new So({...this._def,exactLength:{value:e,message:ee.toString(t)}})}nonempty(e){return this.min(1,e)}};So.create=(e,t)=>new So({type:e,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...ve(t)});$t=class $t extends Re{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=Te.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==W.object){let c=this._getOrReturnCtx(e);return V(c,{code:j.invalid_type,expected:W.object,received:c.parsedType}),ce}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof fi&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!i.includes(c))s.push(c)}let a=[];for(let c of i){let u=o[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Ln(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof fi){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)V(n,{code:j.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 Ln(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)=>ir.mergeObjectSync(r,c));else return ir.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return ee.errToObj,new $t({...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:ee.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new $t({...this._def,unknownKeys:"strip"})}passthrough(){return new $t({...this._def,unknownKeys:"passthrough"})}extend(e){return new $t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $t({...this._def,catchall:e})}pick(e){let t={};for(let r of Te.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}omit(e){let t={};for(let r of Te.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}deepPartial(){return Kc(this)}partial(e){let t={};for(let r of Te.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new $t({...this._def,shape:()=>t})}required(e){let t={};for(let r of Te.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];while(o instanceof $o)o=o._def.innerType;t[r]=o}return new $t({...this._def,shape:()=>t})}keyof(){return xq(Te.objectKeys(this.shape))}};$t.create=(e,t)=>new $t({shape:()=>e,unknownKeys:"strip",catchall:fi.create(),typeName:le.ZodObject,...ve(t)});$t.strictCreate=(e,t)=>new $t({shape:()=>e,unknownKeys:"strict",catchall:fi.create(),typeName:le.ZodObject,...ve(t)});$t.lazycreate=(e,t)=>new $t({shape:e,unknownKeys:"strip",catchall:fi.create(),typeName:le.ZodObject,...ve(t)});gd=class gd extends Re{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map((s)=>new Zr(s.ctx.common.issues));return V(t,{code:j.invalid_union,unionErrors:i}),ce}if(t.common.async)return Promise.all(r.map(async(o)=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);else{let o=void 0,i=[];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"&&!o)o={result:u,ctx:c};if(c.common.issues.length)i.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map((a)=>new Zr(a));return V(t,{code:j.invalid_union,unionErrors:s}),ce}}get options(){return this._def.options}};gd.create=(e,t)=>new gd({options:e,typeName:le.ZodUnion,...ve(t)});yw=class yw extends Re{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.object)return V(t,{code:j.invalid_type,expected:W.object,received:t.parsedType}),ce;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);if(!o)return V(t,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ce;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._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 o of t){let i=ui(o.shape[e]);if(!i.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of i){if(n.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,o)}}return new yw({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...ve(r)})}};yd=class yd extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(fw(o)||fw(i))return ce;let s=gw(o.value,i.value);if(!s.valid)return V(r,{code:j.invalid_intersection_types}),ce;if(pw(o)||pw(i))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(([o,i])=>n(o,i));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}))}};yd.create=(e,t,r)=>new yd({left:e,right:t,typeName:le.ZodIntersection,...ve(r)});pi=class pi extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.array)return V(r,{code:j.invalid_type,expected:W.array,received:r.parsedType}),ce;if(r.data.length<this._def.items.length)return V(r,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ce;if(!this._def.rest&&r.data.length>this._def.items.length)V(r,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...r.data].map((i,s)=>{let a=this._def.items[s]||this._def.rest;if(!a)return null;return a._parse(new Ln(r,i,r.path,s))}).filter((i)=>!!i);if(r.common.async)return Promise.all(o).then((i)=>ir.mergeArray(t,i));else return ir.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new pi({...this._def,rest:e})}};pi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new pi({items:e,typeName:le.ZodTuple,rest:null,...ve(t)})};Ah=class Ah extends Re{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!==W.object)return V(r,{code:j.invalid_type,expected:W.object,received:r.parsedType}),ce;let n=[],o=this._def.keyType,i=this._def.valueType;for(let s in r.data)n.push({key:o._parse(new Ln(r,s,r.path,s)),value:i._parse(new Ln(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return ir.mergeObjectAsync(t,n);else return ir.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof Re)return new Ah({keyType:e,valueType:t,typeName:le.ZodRecord,...ve(r)});return new Ah({keyType:di.create(),valueType:e,typeName:le.ZodRecord,...ve(t)})}};Oh=class Oh extends Re{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!==W.map)return V(r,{code:j.invalid_type,expected:W.map,received:r.parsedType}),ce;let n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([s,a],c)=>({key:n._parse(new Ln(r,s,r.path,[c,"key"])),value:o._parse(new Ln(r,a,r.path,[c,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let a of i){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return ce;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 i){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return ce;if(c.status==="dirty"||u.status==="dirty")t.dirty();s.set(c.value,u.value)}return{status:t.value,value:s}}}};Oh.create=(e,t,r)=>new Oh({valueType:t,keyType:e,typeName:le.ZodMap,...ve(r)});Xc=class Xc extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==W.set)return V(r,{code:j.invalid_type,expected:W.set,received:r.parsedType}),ce;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)V(r,{code:j.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)V(r,{code:j.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let o=this._def.valueType;function i(a){let c=new Set;for(let u of a){if(u.status==="aborted")return ce;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let s=[...r.data.values()].map((a,c)=>o._parse(new Ln(r,a,r.path,c)));if(r.common.async)return Promise.all(s).then((a)=>i(a));else return i(s)}min(e,t){return new Xc({...this._def,minSize:{value:e,message:ee.toString(t)}})}max(e,t){return new Xc({...this._def,maxSize:{value:e,message:ee.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Xc.create=(e,t)=>new Xc({valueType:e,minSize:null,maxSize:null,typeName:le.ZodSet,...ve(t)});fd=class fd extends Re{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.function)return V(t,{code:j.invalid_type,expected:W.function,received:t.parsedType}),ce;function r(s,a){return Sh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ud(),gs].filter((c)=>!!c),issueData:{code:j.invalid_arguments,argumentsError:a}})}function n(s,a){return Sh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ud(),gs].filter((c)=>!!c),issueData:{code:j.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Zc){let s=this;return br(async function(...a){let c=new Zr([]),u=await s._def.args.parseAsync(a,o).catch((m)=>{throw c.addIssue(r(a,m)),c}),d=await Reflect.apply(i,this,u);return await s._def.returns._def.type.parseAsync(d,o).catch((m)=>{throw c.addIssue(n(d,m)),c})})}else{let s=this;return br(function(...a){let c=s._def.args.safeParse(a,o);if(!c.success)throw new Zr([r(a,c.error)]);let u=Reflect.apply(i,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Zr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new fd({...this._def,args:pi.create(e).rest(da.create())})}returns(e){return new fd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new fd({args:e?e:pi.create([]).rest(da.create()),returns:t||da.create(),typeName:le.ZodFunction,...ve(r)})}};bd=class bd extends Re{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})}};bd.create=(e,t)=>new bd({getter:e,typeName:le.ZodLazy,...ve(t)});xd=class xd extends Re{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return V(t,{received:t.data,code:j.invalid_literal,expected:this._def.value}),ce}return{status:"valid",value:e.data}}get value(){return this._def.value}};xd.create=(e,t)=>new xd({value:e,typeName:le.ZodLiteral,...ve(t)});fa=class fa extends Re{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return V(t,{expected:Te.joinValues(r),received:t.parsedType,code:j.invalid_type}),ce}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 V(t,{received:t.data,code:j.invalid_enum_value,options:r}),ce}return br(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 fa.create(e,{...this._def,...t})}exclude(e,t=this._def){return fa.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};fa.create=xq;_d=class _d extends Re{_parse(e){let t=Te.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==W.string&&r.parsedType!==W.number){let n=Te.objectValues(t);return V(r,{expected:Te.joinValues(n),received:r.parsedType,code:j.invalid_type}),ce}if(!this._cache)this._cache=new Set(Te.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=Te.objectValues(t);return V(r,{received:r.data,code:j.invalid_enum_value,options:n}),ce}return br(e.data)}get enum(){return this._def.values}};_d.create=(e,t)=>new _d({values:e,typeName:le.ZodNativeEnum,...ve(t)});Zc=class Zc extends Re{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.promise&&t.common.async===!1)return V(t,{code:j.invalid_type,expected:W.promise,received:t.parsedType}),ce;let r=t.parsedType===W.promise?t.data:Promise.resolve(t.data);return br(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Zc.create=(e,t)=>new Zc({type:e,typeName:le.ZodPromise,...ve(t)});Co=class Co extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:(i)=>{if(V(r,i),i.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){let i=n.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async(s)=>{if(t.value==="aborted")return ce;let a=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(a.status==="aborted")return ce;if(a.status==="dirty")return Wc(a.value);if(t.value==="dirty")return Wc(a.value);return a});else{if(t.value==="aborted")return ce;let s=this._def.schema._parseSync({data:i,path:r.path,parent:r});if(s.status==="aborted")return ce;if(s.status==="dirty")return Wc(s.value);if(t.value==="dirty")return Wc(s.value);return s}}if(n.type==="refinement"){let i=(s)=>{let a=n.refinement(s,o);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 ce;if(s.status==="dirty")t.dirty();return i(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 ce;if(s.status==="dirty")t.dirty();return i(s.value).then(()=>({status:t.value,value:s.value}))})}if(n.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ua(i))return ce;let s=n.transform(i.value,o);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((i)=>{if(!ua(i))return ce;return Promise.resolve(n.transform(i.value,o)).then((s)=>({status:t.value,value:s}))});Te.assertNever(n)}};Co.create=(e,t,r)=>new Co({schema:e,typeName:le.ZodEffects,effect:t,...ve(r)});Co.createWithPreprocess=(e,t,r)=>new Co({schema:t,effect:{type:"preprocess",transform:e},typeName:le.ZodEffects,...ve(r)});$o=class $o extends Re{_parse(e){if(this._getType(e)===W.undefined)return br(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$o.create=(e,t)=>new $o({innerType:e,typeName:le.ZodOptional,...ve(t)});ys=class ys extends Re{_parse(e){if(this._getType(e)===W.null)return br(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ys.create=(e,t)=>new ys({innerType:e,typeName:le.ZodNullable,...ve(t)});vd=class vd extends Re{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===W.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};vd.create=(e,t)=>new vd({innerType:e,typeName:le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ve(t)});wd=class wd extends Re{_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(dd(n))return n.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Zr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};wd.create=(e,t)=>new wd({innerType:e,typeName:le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ve(t)});Fh=class Fh extends Re{_parse(e){if(this._getType(e)!==W.nan){let r=this._getOrReturnCtx(e);return V(r,{code:j.invalid_type,expected:W.nan,received:r.parsedType}),ce}return{status:"valid",value:e.data}}};Fh.create=(e)=>new Fh({typeName:le.ZodNaN,...ve(e)});Dst=Symbol("zod_brand");bw=class bw extends Re{_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}};Ph=class Ph extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return ce;if(o.status==="dirty")return t.dirty(),Wc(o.value);else return this._def.out._parseAsync({data:o.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 ce;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 Ph({in:e,out:t,typeName:le.ZodPipeline})}};Dd=class Dd extends Re{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(ua(n))n.value=Object.freeze(n.value);return n};return dd(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Dd.create=(e,t)=>new Dd({innerType:e,typeName:le.ZodReadonly,...ve(t)});Est={object:$t.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"})(le||(le={}));w=di.create,R=Yc.create,Sst=Fh.create,$st=Jc.create,ge=$h.create,Cst=pd.create,kst=Ch.create,Rst=md.create,Ast=hd.create,Ost=kh.create,Ed=da.create,Fst=fi.create,Pst=Rh.create,oe=So.create,U=$t.create,Ist=$t.strictCreate,Sd=gd.create,xw=yw.create,Tst=yd.create,Nst=pi.create,Qc=Ah.create,jst=Oh.create,qst=Xc.create,Mst=fd.create,Lst=bd.create,ze=xd.create,Ze=fa.create,Bst=_d.create,Ust=Zc.create,zst=Co.create,Vst=$o.create,Gst=ys.create,Hst=Co.createWithPreprocess,Wst=Ph.create});var _w=O(()=>{Eh();mw();mq();ld();_q();Dh()});var en=O(()=>{_w();_w()});function f$e(e){return e.startsWith("v")?e:`v${e}`}var u$e,d$e,vq,oat;var vw=O(()=>{en();u$e=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,d$e=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;vq=w().regex(u$e,"must be a semver version, optionally v-prefixed").transform(f$e),oat=w().regex(d$e,"must be the canonical v-prefixed tag (vX.Y.Z)")});function ww(e){return Ih.includes(e)}var p$e,$d,Ih,wq,m$e,Dq,h$e,Eq,g$e,y$e,Sq,b$e,$q,aat,cat,Cq,x$e,kq,_$e,Rq,Dw=20,Ew=500,v$e,lat;var Cd=O(()=>{en();p$e=Ze(["pending","verified","approved","revoked"]),$d=Ze(["person","service","test"]),Ih=$d.options;wq={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"},m$e=Ze(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Dq=m$e.options,h$e=Ze(["active","pending","revoked"]),Eq=U({field:w(),blocks:oe(w()).optional(),set_on:oe(w()).optional()}).passthrough(),g$e=U({id:R().int(),username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),orcid:w().nullable().optional(),created_at:w().optional(),approved_at:w().nullable().optional(),dataset_count:R().int().optional(),sandbox_completed:ge().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),service_access:ge().optional(),status:p$e.optional(),email_verified:ge().optional(),orcid_verified:ge().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),profile_gaps:oe(Eq).optional(),username_auto_assigned:ge().optional(),account_kind:$d.optional()}).passthrough(),y$e=U({prefix:w(),created_at:w(),last_used_at:w().nullable()}).passthrough().nullable(),Sq=U({user:g$e,token:y$e.optional()}).passthrough(),b$e=U({id:R().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),email_verified:R().int().nullable().optional(),role:w().nullable(),created_at:w(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),signup_source:w().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),orcid:w().nullable().optional(),upload_access_requested_at:w().nullable().optional(),account_kind:$d.optional()}).passthrough(),$q=U({users:oe(b$e),count:R().int()}).passthrough(),aat=Ze(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),cat=Ze(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Cq=U({suggestion:w().nullable(),based_on:Ze(["name","unavailable","exhausted"])}).passthrough(),x$e=Ze(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),kq=x$e.options,_$e=Ze(["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"]),Rq=_$e.options,v$e=U({id:R().int(),email:w(),username:w().nullable(),role:w(),status:h$e,email_verified:ge(),given_name:w().nullable(),family_name:w().nullable(),orcid:w().nullable(),orcid_verified:ge(),github_username:w().nullable(),city:w().nullable(),country:w().nullable(),affiliation:w().nullable(),service_access:ge(),service_access_granted_at:w().nullable(),upload_access_requested_at:w().nullable(),profile_gaps:oe(Eq),username_auto_assigned:ge()}).passthrough(),lat=U({user:v$e.nullable()}).passthrough()});function Oq(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:j.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function Fq(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:j.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var w$e="0.4.0",Sw,el,Aq,D$e,E$e,S$e,Pq,pat,Iq,mat,mi,$$e,Th,hat;var $w=O(()=>{en();vw();Sw=Ze(["openneuro","nemar","gin","other"]),el=Sd([ze(0),ze(1)]).nullable(),Aq=U({dataset_id:w(),id:w().optional(),name:w(),description:w().nullable().optional(),status:w(),visibility:w(),anonymous:R().int().nullable().optional(),concept_doi:w().nullable().optional(),doi:w().nullable().optional(),created_at:w(),updated_at:w().optional(),first_published_at:w().nullable().optional(),owner_username:w().nullable().optional(),source:w().nullable().optional(),modalities:w().optional(),participants:R().int().nonnegative(),tasks:w().optional(),authors:w().optional(),license:w().optional(),file_size:R().nonnegative(),file_size_formatted:w().optional(),total_files:R().nonnegative().nullable().optional(),num_citations:R().int().nonnegative().optional(),n_channels:R().int().nullable().optional(),electrode_system:w().nullable().optional(),has_hed:el.optional(),hed_version:w().nullable().optional(),data_complete:el.optional(),bytes_present:R().nonnegative().nullable().optional(),latest_version:vq.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:w().nullable().optional(),zarr_status:Ze(["pending","ready","failed"]).nullable().optional(),zarr_store_count:R().int().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:R().int().nullable().optional(),zarr_failure_count:R().int().nullable().optional(),zarr_deterministic:el.optional(),zarr_failed_at:w().nullable().optional(),zarr_index_url:w().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),zarr_requeue_at:w().nullable().optional(),anonymity_status:Ze(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:w().nullable().optional(),anonymity_findings:w().nullable().optional(),anonymity_unchecked:w().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:w().nullable().optional(),placement_scheme:w().nullable().optional()}).passthrough();D$e=Aq.superRefine((e,t)=>{Oq(e,t),Fq(e,t)}),E$e=Aq.extend({file_size:R().nonnegative().nullable(),file_size_formatted:w().nullable().optional(),modalities:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),license:w().nullable().optional(),owner_github:w().nullable().optional(),attestation_deposit_type:Ze(["owner","redistribution"]).nullable().optional(),attestation_key_status:Ze(["destroyed","retained"]).nullable().optional(),attestation_deidentified:el.optional(),attestation_no_duplicate:el.optional(),attestation_upstream_source:w().nullable().optional(),attestation_accepted_at:w().nullable().optional(),zarr_data_failures:U({count:R().int().nonnegative(),detail_ref:w(),compacted_by:w().optional(),pending:R().int().nonnegative().optional(),discovered:R().int().nonnegative().optional(),events_upload_failed:ze(!0).optional(),manifest_upload_failed:ze(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Oq(e,t),Fq(e,t)}),S$e=U({id:w(),name:w(),modalities:w().nullable().optional(),participants:R().int().nullable().optional(),doi:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),has_hed:el.optional(),score:R().optional(),snippet:w().optional()}).passthrough(),Pq=Qc(w(),R().int().nonnegative()),pat=U({datasets:oe(D$e),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:Pq.optional()}).passthrough(),Iq=U({results:oe(S$e),count:R().int().nonnegative(),returned:R().int().nonnegative().optional(),offset:R().int().nonnegative().optional(),limit:R().int().optional(),candidate_ceiling:R().int().optional(),truncated:ge().optional(),method:Ze(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:R().optional(),warning:w().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:Pq.optional()}).passthrough(),mat=U({dataset:E$e}).passthrough(),mi=U({value:w(),count:R().int().nonnegative()}),$$e=U({values:oe(mi),distinct_total:R().int().nonnegative(),truncated:ge()}),Th=U({"electrode-system":oe(mi).optional(),source:oe(mi).optional(),zarr:oe(mi).optional(),powerline:oe(mi).optional(),"bids-version":oe(mi).optional(),"hed-version":oe(mi).optional(),license:oe(mi).optional(),modality:oe(mi).optional(),task:$$e.optional(),warning:w().optional()}).passthrough(),hat=U({schema_version:ze(w$e),doc_type:ze("dataset"),dataset_id:w().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:w(),source:Sw,recording_modality:oe(w()).min(1),description:w().nullable().optional(),bids_version:w().nullable().optional(),license:w().nullable().optional()}).passthrough()});var C$e,bat,xat,_at,vat;var Tq=O(()=>{en();C$e=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,bat=w().regex(C$e,"ORCID must be in format 0000-0000-0000-000X"),xat=Ze(["found","no_public_name","lookup_failed"]),_at=Ze(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing"]),vat=Ze(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var k$e,Nq,kd="https://nemar.org/settings",Eat,R$e,A$e,O$e,jq,qq;var Cw=O(()=>{en();k$e=Ze(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Nq=k$e.options,Eat={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, ${kd}).`,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, ${kd}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${kd}), 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, ${kd}).`,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, ${kd}).`,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."},R$e=Ze(["orcid","email","github"]),A$e=U({id:R().int(),username:w().nullable(),email:w(),created_at:w(),has_oauth_identity:ge(),dataset_count:R().int(),identity_conflict:R().int(),canonical:ge()}).passthrough(),O$e=U({kind:R$e,value:w(),canonical_user_id:R().int(),accounts:oe(A$e)}).passthrough(),jq=U({groups:oe(O$e),group_count:R().int(),flagged_count:R().int()}).passthrough(),qq=U({ok:ze(!0),id:R().int(),cleared:ge()}).passthrough()});var kw=120,Mq=64,Rw="unnamed machine",F$e=25,Nh,Lq,tl,Bq,Cat,kat,Uq,P$e,I$e,zq,Aw,Vq,Rat,Aat,jh,qh;var Mh=O(()=>{en();Nh=Ze(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Lq={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."},tl=Ze(["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"]),Bq=tl.options,Cat={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 ${F$e} 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."},kat=U({error:tl,message:w()}).passthrough(),Uq=U({device_code:w(),user_code:w(),verification_uri:w(),verification_uri_complete:w(),expires_in:R().int(),interval:R().int()}).passthrough(),P$e=xw("error",[U({error:ze("authorization_pending"),message:w()}).passthrough(),U({error:ze("slow_down"),message:w()}).passthrough()]),I$e=xw("error",[U({error:ze("expired_token"),reason:tl,message:w()}).passthrough(),U({error:ze("access_denied"),reason:tl,message:w()}).passthrough(),U({error:ze("invalid_grant"),reason:tl,message:w()}).passthrough()]),zq=Sd([P$e,I$e]),Aw=U({id:R().int(),name:w().nullable(),prefix:w(),created_at:w(),last_used_at:w().nullable(),current:ge()}).passthrough(),Vq=U({api_key:w(),key:Aw,user:U({username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),sandbox_completed:ge(),sandbox_dataset_id:w().nullable()}).passthrough()}).passthrough(),Rat=U({user_code:w(),machine_name:w(),requested_at:w(),expires_in:R().int(),account:U({username:w().nullable(),email_masked:w()}).passthrough(),refusal:U({code:tl,message:w()}).passthrough().nullable()}).passthrough(),Aat=U({ok:ze(!0),machine_name:w()}).passthrough(),jh=U({keys:oe(Aw)}).passthrough(),qh=U({api_key:w(),key:Aw}).passthrough()});function Ft(e){return Ct[e]}function hi(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Ct;var rl=O(()=>{Ct={"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 N$e(e){return e==="verified"||e==="upload_access"||e==="publication"}function nl(e){return(e??"").trim().length===0}function j$e(e){return e==="service"||e==="test"}function Wq(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Lh,e)?Lh[e]:void 0;if(!n)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:Ct["gap.set_on.default_web"],setOnCli:null,known:!1};let o=r&&n.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??n.blocks,label:Ct[n.labelKey],setOnWeb:Ct[o?n.orcidWebKey:n.webKey],setOnCli:o||n.cliKey===null?null:Ct[n.cliKey],known:!0}}function Gq(e){let t=Ow.indexOf(e);return t===-1?Ow.length:t}function Kq(e,t={}){return e.map((r)=>Wq(r,{orcidVerified:t.orcidVerified}))}function Bh(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(N$e):[];return Wq(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>Gq(r.field)-Gq(n.field))}function Fw(e){let t=e.blocks[0],r=t?Ct[T$e[t]]:Ct["gap.blocks.unknown"],n=hi(Ct["gap.sentence"],{label:"",blocks:r}).trimStart(),o=e.setOnCli?hi(Ct["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):hi(Ct["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${o}`}function Yq(e){return`${e.label} ${Fw(e)}`}function Uh(){let e=hi(Ct["gap.sentence"],{label:Hq.label,blocks:Ct["cli.gap.blocks.sandbox"]}),t=hi(Ct["cli.gap.set_on.cli_only"],{cli:Hq.command});return`${e} ${t}`}function Jq(){return Ct["cli.gaps.sandbox_unchecked"]}var Lh,Ow,Iat,T$e,Hq;var ol=O(()=>{rl();Lh={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&&nl(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)=>nl(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)=>nl(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&&!j$e(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)=>nl(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)=>nl(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)=>nl(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}},Ow=Object.keys(Lh),Iat=Ow.filter((e)=>Lh[e].isMissing!==null),T$e={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Hq={field:"sandbox",label:Ct["cli.gap.field.sandbox.label"],command:Ct["cli.gap.field.sandbox.set_on.cli"]}});function Hh(e,t){let r=e.sss!==void 0;if(e.derived!==r)t.addIssue({code:j.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 xr,zh,Xq,Vh,Gh,q$e,M$e,L$e,B$e,U$e,jat,z$e,qat,V$e,Mat;var Pw=O(()=>{en();xr=/^[a-z]{2}[0-9]{6}$/,zh=/^[0-9a-f]{40}$/,Xq=U({name:w(),modality:w().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(),Vh=U({converted:R().int().nonnegative().optional(),relabelled:R().int().nonnegative().optional(),kept_importer_unit:R().int().nonnegative().optional(),units_column_present:ge().optional(),sidecar:w().optional(),sidecar_supplied:ge().optional()}).passthrough(),Gh=U({applied:ge().optional(),method:w().optional(),calibration:w().optional(),cross_talk:w().optional(),mne_version:w().optional()}).passthrough();q$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),updated_utc:w().optional(),source_tree:ze("raw"),derived:ge(),modalities:oe(w()).optional(),groups:oe(Xq).optional(),power_line_frequency:R().nullable().optional(),event_description_count:R().int().nonnegative().optional(),n_events:R().int().nonnegative().optional(),trial_types:Qc(w(),R().int().nonnegative()).optional(),units_report:Vh.optional(),channels_tsv_read_error:ge().optional(),split_members:oe(w()).optional(),sss:Gh.optional()}).passthrough().superRefine(Hh),M$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr").optional(),code:w(),reason:w(),detail:w().nullable().optional(),attempts:R().int().nonnegative().optional()}).passthrough(),L$e=Ze(["infra_failure","memory_budget","not_attempted"]),B$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),reason:L$e,attempts:R().int().nonnegative(),last_error:w().nullable().optional(),last_attempt_utc:w().nullable().optional()}).passthrough(),U$e=U({level0:ze("<zarr>/<group>/0"),view:ze("<zarr>/<group>/view/<L>"),view_levels:ze("1..n_view_levels from the group attrs"),scale_offset:ze("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ze("<data_base>events.parquet").optional()}).passthrough(),jat=U({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),contract_base:w().regex(/^https:\/\//,"must be https"),data_base:w().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:w().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:w().min(1),s3_anonymous:ge(),source_commit:w().regex(zh,"must be a full 40-hex SHA"),engine_version:w().min(1),biosigio_version:w().nullable().optional(),updated_utc:w(),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:oe(q$e),failures:oe(M$e),pending:oe(B$e),doi:w().nullable().optional(),license:w().nullable().optional(),citation:w().nullable().optional(),hed_version:w().nullable().optional(),events_parquet:w().regex(/^https:\/\//,"must be https").optional(),events_row_count:R().int().nonnegative().optional(),layout:U$e}).passthrough(),z$e=U({name:w(),configuration:Qc(w(),Ed()).optional()}).passthrough(),qat=U({zarr_format:ze(3),node_type:ze("array"),shape:oe(R().int().nonnegative()),data_type:w(),chunk_grid:U({name:w(),configuration:Qc(w(),Ed()).optional()}).passthrough(),codecs:oe(z$e),fill_value:Ed().optional(),attributes:Qc(w(),Ed()).optional(),dimension_names:oe(w().nullable()).optional()}).passthrough(),V$e=U({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),groups:oe(Xq).optional(),modalities:oe(w()).optional()}).passthrough(),Mat=U({format:ze("nemar-zarr-index"),format_version:R().int(),dataset_id:w().regex(xr,"NEMAR dataset id (nm/on/xx band)"),source_commit:w(),stores:oe(V$e)}).passthrough()});function Zq(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 G$e,H$e,W$e,K$e,ko,Uat;var Wh=O(()=>{$w();G$e=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],H$e=["50","60"],W$e=["ready","pending","failed"],K$e=Sw.options,ko=[{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:H$e},{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:G$e},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:K$e},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:W$e},{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"}],Uat=new Map(ko.map((e)=>[e.key,e]))});var Y$e,Wat,J$e,t9,Rd,Qq,X$e,r9,Z$e=20,Q$e=100,eCe,n9,tCe,Kat,Yat,rCe,Jat,Xat,nCe,oCe,iCe,Zat,sCe=50,aCe=500,Qat,cCe,lCe,ect,uCe=1000,dCe=5000,tct,fCe,rct,pCe=800,mCe=4000,nct,oct,Iw=60,Tw=64,e9,hCe=86400,gCe=4096,ict,yCe,bCe,sct;var o9=O(()=>{en();Wh();Pw();Y$e=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:oe(w()).optional(),tasks:oe(w()).optional(),subject_count:R().int().nonnegative().nullable().optional(),has_hed:Sd([ze(0),ze(1)]).nullable().optional(),hed_version:w().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:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:R().int().nonnegative().nullable().optional(),zarr_verify_status:Ze(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),index_url:w().nullable().optional()}).passthrough(),Wat=U({format:ze("nemar-zarr-catalog"),format_version:R().int(),generated_utc:w(),contract_base:w(),count:R().int().nonnegative(),datasets:oe(Y$e)}).passthrough(),J$e=["verified","failed","unverifiable"],t9=Ze(J$e).nullable(),Rd=U({dataset_id:w().regex(xr),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),source_commit:w().regex(zh),index_etag:w().nullable(),engine_version:w(),source_tree:ze("raw"),derived:ge(),sss:Gh.optional(),lossy:ge(),dtype:w().nullable(),effective_rate_hz:R().nullable(),source_rate_hz:R().nullable(),units_report:Vh.nullable().optional(),zarr_verify_status:t9,note:w().nullable().optional()}).passthrough().superRefine(Hh),Qq=U({start:R().int().nonnegative(),end:R().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),X$e=U({python_zarr:w(),zarrita:w(),python_browser:w()}).passthrough(),r9=U({contract_base:w(),data_base:w(),s3_uri:w(),s3_region:w(),s3_anonymous:ge(),zarr:w(),group:w(),level:Sd([ze("0"),R().int().positive()]),array_path:w(),dtype:w().nullable(),codecs:oe(Ed()).optional(),chunk_samples:R().int().positive().nullable(),shard_samples:R().int().positive().nullable(),n_channels:R().int().nonnegative().nullable(),sample_slice:Qq.optional(),channel_slice:Qq.optional(),scale_offset:w(),how_to:X$e}).passthrough(),eCe=Object.fromEntries(ko.map((e)=>[e.queryParam,w().optional()])),n9={modality:w().optional(),task:w().optional(),has_hed:ge().optional(),has_zarr:ge().optional(),author:w().optional(),has_doi:ge().optional(),has_zarr_verified:ge().optional(),data_complete:ge().optional(),recent:R().int().positive().optional(),license:w().optional()},tCe=Object.keys(n9),Kat=[...tCe,...ko.map((e)=>e.queryParam)],Yat=U({query:w().optional(),...n9,include_unknown:ge().optional(),...eCe,limit:R().int().positive().max(Q$e).default(Z$e)}).passthrough(),rCe=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:oe(w()).optional(),tasks:oe(w()).optional(),subject_count:R().int().nullable().optional(),has_hed:ge().nullable().optional(),has_zarr:ge()}).passthrough(),Jat=U({results:oe(rCe),count:R().int().nonnegative(),limit:R().int(),note:w().nullable().optional(),truncated:ge().optional()}).passthrough(),Xat=U({dataset_id:w().regex(xr)}).passthrough(),nCe=["list_recordings","get_events","render_overview","read_window"],oCe=U({next_cheapest_tool:Ze(nCe),reason:w()}).passthrough(),iCe=["pending","ready","failed"],Zat=U({dataset_id:w().regex(xr),name:w(),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),modalities:oe(w()).optional(),tasks:oe(w()).optional(),subject_count:R().int().nullable().optional(),has_hed:ge().nullable().optional(),hed_version:w().nullable().optional(),recording_count:R().int().nullable().optional(),total_recording_duration_s:R().nullable().optional(),zarr_status:Ze(iCe).nullable().optional(),zarr_verify_status:t9.optional(),zarr_source_commit:w().nullable().optional(),zarr_store_count:R().int().nullable().optional(),cost_hint:oCe}).passthrough(),Qat=U({dataset_id:w().regex(xr),modality:w().optional(),min_duration_s:R().nonnegative().optional(),include_derived:ge().default(!1),limit:R().int().positive().max(aCe).default(sCe),offset:R().int().nonnegative().default(0)}).passthrough(),cCe=U({name:w(),modality:w().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(),lCe=U({path:w(),zarr:w(),source_tree:ze("raw"),derived:ge(),groups:oe(cCe).optional(),n_events:R().int().nonnegative().optional(),sss:Gh.optional(),units_report:Vh.optional()}).passthrough().superRefine(Hh),ect=U({dataset_id:w().regex(xr),source_commit:w().regex(zh).nullable(),recordings:oe(lCe),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:w().nullable().optional(),envelope:Rd.optional()}).passthrough(),tct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),limit:R().int().positive().max(dCe).default(uCe),offset:R().int().nonnegative().default(0)}).passthrough(),fCe=U({store_path:w(),group_name:w(),onset_s:R(),duration_s:R().nullable().optional(),sample_index:R().int().nonnegative(),trial_type:w().nullable().optional(),value:Sd([w(),R()]).nullable().optional(),hed:w().nullable().optional()}).passthrough(),rct=U({dataset_id:w().regex(xr),recording:w(),events:oe(fCe),source:Ze(["events_parquet","events_tsv_fallback"]),estimated:ge(),total_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),truncated:ge(),note:w().nullable().optional(),envelope:Rd.optional()}).passthrough(),nct=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),width_px:R().int().positive().max(mCe).default(pCe)}).passthrough(),oct=U({dataset_id:w().regex(xr),recording:w(),group:w(),level:R().int().positive(),width_px:R().int().positive(),height_px:R().int().positive(),mime_type:ze("image/png"),columns_read:R().int().nonnegative(),chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),envelope:Rd.optional()}).passthrough(),e9=Iw*Tw,ict=U({dataset_id:w().regex(xr),recording:w(),group:w().optional(),start_s:R().nonnegative().default(0),duration_s:R().positive().max(hCe).default(10),channels:oe(R().int().nonnegative()).max(gCe).optional(),taste:ge().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:j.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>Iw)t.addIssue({code:j.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${Iw} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>Tw)t.addIssue({code:j.custom,message:`taste channels (${e.channels.length}) exceeds the ${Tw}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>e9)t.addIssue({code:j.custom,message:`taste exceeds the cap of ${e9} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),yCe=U({mode:ze("recipe"),recipe:r9,envelope:Rd}).passthrough(),bCe=U({mode:ze("taste"),start_s:R(),duration_s:R(),channels:oe(R().int()),sample_rate_hz:R(),values:oe(oe(R())),recipe:r9,chunks_read:R().int().nonnegative(),bytes_read:R().int().nonnegative(),filled_ranges:oe(U({start_sample:R().int().nonnegative(),end_sample:R().int().nonnegative(),start_s:R(),end_s:R()}).passthrough()),note:w().nullable().optional(),envelope:Rd}).passthrough(),sct=xw("mode",[yCe,bCe])});var il=O(()=>{vw();Cd();$w();Tq();Cw();Mh();rl();ol();Pw();o9()});function Kh(e){return e?_Ce:bs}var bs,xCe,_Ce,Nw;var Yh=O(()=>{bs=["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"],xCe=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],_Ce=bs.filter((e)=>!xCe.includes(e));Nw={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 Jh(e){let t=[],r="",n="start",o=!1;for(let i of e)switch(i){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(o)r+=i;n="property",o=!o;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(o){o=!1,r+=i;break}if(jw.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(o){o=!1,r+=i;break}if(n==="property"){if(jw.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"&&!vCe.has(i))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(o)o=!1,r+="\\";r+=i}}if(o)r+="\\";switch(n){case"property":{if(jw.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function qw(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 i9(e,t){if(qw(e,t))throw Error("Cannot use string index")}function s9(e,t,r){if(!pa(e)||typeof t!=="string")return r===void 0?e:r;let n=Jh(t);if(n.length===0)return r;for(let o=0;o<n.length;o++){let i=n[o];if(qw(e,i))e=o===n.length-1?void 0:null;else e=e[i];if(e===void 0||e===null){if(o!==n.length-1)return r;break}}return e===void 0?r:e}function Mw(e,t,r){if(!pa(e)||typeof t!=="string")return e;let n=e,o=Jh(t);for(let i=0;i<o.length;i++){let s=o[i];if(i9(e,s),i===o.length-1)e[s]=r;else if(!pa(e[s]))e[s]=typeof o[i+1]==="number"?[]:{};e=e[s]}return n}function a9(e,t){if(!pa(e)||typeof t!=="string")return!1;let r=Jh(t);for(let n=0;n<r.length;n++){let o=r[n];if(i9(e,o),n===r.length-1)return delete e[o],!0;if(e=e[o],!pa(e))return!1}}function c9(e,t){if(!pa(e)||typeof t!=="string")return!1;let r=Jh(t);if(r.length===0)return!1;for(let n of r){if(!pa(e)||!(n in e)||qw(e,n))return!1;e=e[n]}return!0}var pa=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},jw,vCe;var l9=O(()=>{jw=new Set(["__proto__","prototype","constructor"]),vCe=new Set("0123456789")});import _t from"path";import u9 from"os";import Lw from"process";function Uw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Lw.platform==="darwin")return wCe(e);if(Lw.platform==="win32")return DCe(e);return ECe(e)}var xs,Bw,sl,wCe=(e)=>{let t=_t.join(xs,"Library");return{data:_t.join(t,"Application Support",e),config:_t.join(t,"Preferences",e),cache:_t.join(t,"Caches",e),log:_t.join(t,"Logs",e),temp:_t.join(Bw,e)}},DCe=(e)=>{let t=sl.APPDATA||_t.join(xs,"AppData","Roaming"),r=sl.LOCALAPPDATA||_t.join(xs,"AppData","Local");return{data:_t.join(r,e,"Data"),config:_t.join(t,e,"Config"),cache:_t.join(r,e,"Cache"),log:_t.join(r,e,"Log"),temp:_t.join(Bw,e)}},ECe=(e)=>{let t=_t.basename(xs);return{data:_t.join(sl.XDG_DATA_HOME||_t.join(xs,".local","share"),e),config:_t.join(sl.XDG_CONFIG_HOME||_t.join(xs,".config"),e),cache:_t.join(sl.XDG_CACHE_HOME||_t.join(xs,".cache"),e),log:_t.join(sl.XDG_STATE_HOME||_t.join(xs,".local","state"),e),temp:_t.join(Bw,t,e)}};var d9=O(()=>{xs=u9.homedir(),Bw=u9.tmpdir(),{env:sl}=Lw});var SCe=(e,t)=>{let{onError:r}=t;return function(...o){return e.apply(void 0,o).catch(r)}},Ro;var f9=O(()=>{Ro=SCe});var $Ce=(e,t)=>{let{onError:r}=t;return function(...o){try{return e.apply(void 0,o)}catch(i){return r(i)}}},Bn;var p9=O(()=>{Bn=$Ce});var m9=250;var h9=()=>{};var CCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=o.interval??m9,a=Date.now()+i;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)})}}},Ao;var g9=O(()=>{h9();Ao=CCe});var kCe=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=Date.now()+i;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}}}},Oo;var y9=O(()=>{Oo=kCe});var zw=O(()=>{f9();p9();g9();y9()});var Ad,Vw;var b9=O(()=>{Gw();Ad={isChangeErrorOk:(e)=>{if(!Ad.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!x9&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Ad.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(!Ad.isNodeError(e))throw e;if(Ad.isChangeErrorOk(e))return;throw e}},Vw=Ad});import _9 from"process";var Od,Tr,x9,Zt;var Gw=O(()=>{b9();Od={onError:Vw.onChangeError},Tr={onError:()=>{return}},x9=_9.getuid?!_9.getuid():!1,Zt={isRetriable:Vw.isRetriableError}});import Ke from"fs";import{promisify as sr}from"util";var RCe,Gt;var Hw=O(()=>{zw();zw();Gw();RCe={attempt:{chmod:Ro(sr(Ke.chmod),Od),chown:Ro(sr(Ke.chown),Od),close:Ro(sr(Ke.close),Tr),fsync:Ro(sr(Ke.fsync),Tr),mkdir:Ro(sr(Ke.mkdir),Tr),realpath:Ro(sr(Ke.realpath),Tr),stat:Ro(sr(Ke.stat),Tr),unlink:Ro(sr(Ke.unlink),Tr),chmodSync:Bn(Ke.chmodSync,Od),chownSync:Bn(Ke.chownSync,Od),closeSync:Bn(Ke.closeSync,Tr),existsSync:Bn(Ke.existsSync,Tr),fsyncSync:Bn(Ke.fsync,Tr),mkdirSync:Bn(Ke.mkdirSync,Tr),realpathSync:Bn(Ke.realpathSync,Tr),statSync:Bn(Ke.statSync,Tr),unlinkSync:Bn(Ke.unlinkSync,Tr)},retry:{close:Ao(sr(Ke.close),Zt),fsync:Ao(sr(Ke.fsync),Zt),open:Ao(sr(Ke.open),Zt),readFile:Ao(sr(Ke.readFile),Zt),rename:Ao(sr(Ke.rename),Zt),stat:Ao(sr(Ke.stat),Zt),write:Ao(sr(Ke.write),Zt),writeFile:Ao(sr(Ke.writeFile),Zt),closeSync:Oo(Ke.closeSync,Zt),fsyncSync:Oo(Ke.fsyncSync,Zt),openSync:Oo(Ke.openSync,Zt),readFileSync:Oo(Ke.readFileSync,Zt),renameSync:Oo(Ke.renameSync,Zt),statSync:Oo(Ke.statSync,Zt),writeSync:Oo(Ke.writeSync,Zt),writeFileSync:Oo(Ke.writeFileSync,Zt)}},Gt=RCe});import ma from"process";var v9="utf8",Ww=438,w9=511,D9,E9,S9,$9=1000,C9,Kct,Kw=128;var Yw=O(()=>{D9={},E9=ma.geteuid?ma.geteuid():-1,S9=ma.getegid?ma.getegid():-1,C9=!!ma.getuid,Kct=ma.getuid?!ma.getuid():!1});var k9=(e)=>e instanceof Error&&("code"in e),Jw=(e)=>typeof e==="string",Xh=(e)=>e===void 0;var R9=()=>{};var A9=()=>{};import O9 from"process";var F9,Zh;var Xw=O(()=>{F9=O9.platform==="linux",Zh=O9.platform==="win32"});var Zw,P9;var I9=O(()=>{Xw();Zw=["SIGHUP","SIGINT","SIGTERM"];if(!Zh)Zw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(F9)Zw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");P9=Zw});import al from"process";class T9{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(Zh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))al.kill(al.pid,"SIGTERM");else al.kill(al.pid,e)},this.hook=()=>{al.once("exit",()=>this.exit());for(let e of P9)try{al.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var N9;var j9=O(()=>{Xw();I9();N9=new T9});var ACe,q9;var M9=O(()=>{j9();ACe=N9.register,q9=ACe});import OCe from"path";var tn,Fd;var L9=O(()=>{Hw();M9();Yw();tn={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",o=`.tmp-${r}${t}`;return`${e}${o}`},get:(e,t,r=!0)=>{let n=tn.truncate(t(e));if(n in tn.store)return tn.get(e,t,r);return tn.store[n]=r,[n,()=>delete tn.store[n]]},purge:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlink(e)},purgeSync:(e)=>{if(!tn.store[e])return;delete tn.store[e],Gt.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in tn.store)tn.purgeSync(e)},truncate:(e)=>{let t=OCe.basename(e);if(t.length<=Kw)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Kw;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};q9(tn.purgeSyncAll);Fd=tn});import FCe from"path";function Qw(e,t,r=D9){if(Jw(r))return Qw(e,t,{encoding:r});let o={timeout:r.timeout??$9},i=null,s=null,a=null;try{let c=Gt.attempt.realpathSync(e),u=!!c;e=c||e,[s,i]=Fd.get(e,r.tmpCreate||Fd.create,r.tmpPurge!==!1);let d=C9&&Xh(r.chown),f=Xh(r.mode);if(u&&(d||f)){let m=Gt.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=FCe.dirname(e);Gt.attempt.mkdirSync(m,{mode:w9,recursive:!0})}if(a=Gt.retry.openSync(o)(s,"w",r.mode||Ww),r.tmpCreated)r.tmpCreated(s);if(Jw(t))Gt.retry.writeSync(o)(a,t,0,r.encoding||v9);else if(!Xh(t))Gt.retry.writeSync(o)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Gt.retry.fsyncSync(o)(a);else Gt.attempt.fsync(a);if(Gt.retry.closeSync(o)(a),a=null,r.chown&&(r.chown.uid!==E9||r.chown.gid!==S9))Gt.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Ww)Gt.attempt.chmodSync(s,r.mode);try{Gt.retry.renameSync(o)(s,e)}catch(m){if(!k9(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Gt.retry.renameSync(o)(s,Fd.truncate(e))}i(),s=null}finally{if(a)Gt.attempt.closeSync(a);if(s)Fd.purge(s)}}var B9=O(()=>{Hw();Yw();R9();A9();L9()});var Id=g(function(V9){Object.defineProperty(V9,"__esModule",{value:!0});V9.regexpCode=V9.getEsmExportName=V9.getProperty=V9.safeStringify=V9.stringify=V9.strConcat=V9.addCodeArg=V9.str=V9._=V9.nil=V9._Code=V9.Name=V9.IDENTIFIER=V9._CodeOrName=void 0;class Qh{}V9._CodeOrName=Qh;V9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cl extends Qh{constructor(e){super();if(!V9.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}}}V9.Name=cl;class Un extends Qh{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 cl)t[r.str]=(t[r.str]||0)+1;return t},{})}}V9._Code=Un;V9.nil=new Un("");function U9(e,...t){let r=[e[0]],n=0;while(n<t.length)t1(r,t[n]),r.push(e[++n]);return new Un(r)}V9._=U9;var e1=new Un("+");function z9(e,...t){let r=[Pd(e[0])],n=0;while(n<t.length)r.push(e1),t1(r,t[n]),r.push(e1,Pd(e[++n]));return PCe(r),new Un(r)}V9.str=z9;function t1(e,t){if(t instanceof Un)e.push(...t._items);else if(t instanceof cl)e.push(t);else e.push(NCe(t))}V9.addCodeArg=t1;function PCe(e){let t=1;while(t<e.length-1){if(e[t]===e1){let r=ICe(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function ICe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof cl||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 cl))return`"${e}${t.slice(1)}`;return}function TCe(e,t){return t.emptyStr()?e:e.emptyStr()?t:z9`${e}${t}`}V9.strConcat=TCe;function NCe(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pd(Array.isArray(e)?e.join(","):e)}function jCe(e){return new Un(Pd(e))}V9.stringify=jCe;function Pd(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}V9.safeStringify=Pd;function qCe(e){return typeof e=="string"&&V9.IDENTIFIER.test(e)?new Un(`.${e}`):U9`[${e}]`}V9.getProperty=qCe;function MCe(e){if(typeof e=="string"&&V9.IDENTIFIER.test(e))return new Un(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}V9.getEsmExportName=MCe;function LCe(e){return new Un(e.toString())}V9.regexpCode=LCe});var i1=g(function(K9){Object.defineProperty(K9,"__esModule",{value:!0});K9.ValueScope=K9.ValueScopeName=K9.Scope=K9.varKinds=K9.UsedValueState=void 0;var Nr=Id();class H9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var tg;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(tg||(K9.UsedValueState=tg={}));K9.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};class n1{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Nr.Name?e:this.name(e)}name(e){return new Nr.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}}}K9.Scope=n1;class o1 extends Nr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=Nr._`.${new Nr.Name(t)}[${r}]`}}K9.ValueScopeName=o1;var QCe=Nr._`\n`;class W9 extends n1{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?QCe:Nr.nil}}get(){return this._scope}name(e){return new o1(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:o}=n,i=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[o];if(s){let u=s.get(i);if(u)return u}else s=this._values[o]=new Map;s.set(i,n);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,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 Nr._`${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 o=Nr.nil;for(let i in e){let s=e[i];if(!s)continue;let a=r[i]=r[i]||new Map;s.forEach((c)=>{if(a.has(c))return;a.set(c,tg.Started);let u=t(c);if(u){let d=this.opts.es5?K9.varKinds.var:K9.varKinds.const;o=Nr._`${o}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))o=Nr._`${o}${u}${this.opts._n}`;else throw new H9(c);a.set(c,tg.Completed)})}return o}}K9.ValueScope=W9});var we=g(function(jr){Object.defineProperty(jr,"__esModule",{value:!0});jr.or=jr.and=jr.not=jr.CodeGen=jr.operators=jr.varKinds=jr.ValueScopeName=jr.ValueScope=jr.Scope=jr.Name=jr.regexpCode=jr.stringify=jr.getProperty=jr.nil=jr.strConcat=jr.str=jr._=void 0;var Le=Id(),zn=i1(),_s=Id();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(jr,"strConcat",{enumerable:!0,get:function(){return _s.strConcat}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(jr,"getProperty",{enumerable:!0,get:function(){return _s.getProperty}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(jr,"regexpCode",{enumerable:!0,get:function(){return _s.regexpCode}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return _s.Name}});var ag=i1();Object.defineProperty(jr,"Scope",{enumerable:!0,get:function(){return ag.Scope}});Object.defineProperty(jr,"ValueScope",{enumerable:!0,get:function(){return ag.ValueScope}});Object.defineProperty(jr,"ValueScopeName",{enumerable:!0,get:function(){return ag.ValueScopeName}});Object.defineProperty(jr,"varKinds",{enumerable:!0,get:function(){return ag.varKinds}});jr.operators={GT:new Le._Code(">"),GTE:new Le._Code(">="),LT:new Le._Code("<"),LTE:new Le._Code("<="),EQ:new Le._Code("==="),NEQ:new Le._Code("!=="),NOT:new Le._Code("!"),OR:new Le._Code("||"),AND:new Le._Code("&&"),ADD:new Le._Code("+")};class vs{optimizeNodes(){return this}optimizeNames(e,t){return this}}class J9 extends vs{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?zn.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=ul(this.rhs,e,t);return this}get names(){return this.rhs instanceof Le._CodeOrName?this.rhs.names:{}}}class c1 extends vs{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 Le.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ul(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Le.Name?{}:{...this.lhs.names};return sg(e,this.rhs)}}class X9 extends c1{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Z9 extends vs{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Q9 extends vs{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class eM extends vs{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class tM extends vs{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=ul(this.code,e,t),this}get names(){return this.code instanceof Le._CodeOrName?this.code.names:{}}}class cg extends vs{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 o=r[n];if(o.optimizeNames(e,t))continue;nke(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ha(e,t.names),{})}}class ws extends cg{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class rM extends cg{}class Td extends ws{}Td.kind="else";class gi extends ws{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 Td(r):r}if(t){if(e===!1)return t instanceof gi?t:t.nodes;if(this.nodes.length)return this;return new gi(aM(e),t instanceof gi?[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=ul(this.condition,e,t),this}get names(){let e=super.names;if(sg(e,this.condition),this.else)ha(e,this.else.names);return e}}gi.kind="if";class ll extends ws{}ll.kind="for";class nM extends ll{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=ul(this.iteration,e,t),this}get names(){return ha(super.names,this.iteration.names)}}class oM extends ll{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?zn.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=sg(super.names,this.from);return sg(e,this.to)}}class s1 extends ll{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=ul(this.iterable,e,t),this}get names(){return ha(super.names,this.iterable.names)}}class rg extends ws{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)}}rg.kind="func";class ng extends cg{render(e){return"return "+super.render(e)}}ng.kind="return";class iM extends ws{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)ha(e,this.catch.names);if(this.finally)ha(e,this.finally.names);return e}}class og extends ws{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}og.kind="catch";class ig extends ws{render(e){return"finally"+super.render(e)}}ig.kind="finally";class sM{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
85
85
|
`:""},this._extScope=e,this._scope=new zn.Scope({parent:e}),this._nodes=[new rM]}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 o=this._scope.toName(t);if(r!==void 0&&n)this._constants[o.str]=r;return this._leafNode(new J9(e,o,r)),o}const(e,t,r){return this._def(zn.varKinds.const,e,t,r)}let(e,t,r){return this._def(zn.varKinds.let,e,t,r)}var(e,t,r){return this._def(zn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c1(e,t,r))}add(e,t){return this._leafNode(new X9(e,jr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==Le.nil)this._leafNode(new tM(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(":"),Le.addCodeArg(t,n)}return t.push("}"),new Le._Code(t)}if(e,t,r){if(this._blockNode(new gi(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 gi(e))}else(){return this._elseNode(new Td)}endIf(){return this._endBlockNode(gi,Td)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new nM(e),t)}forRange(e,t,r,n,o=this.opts.es5?zn.varKinds.var:zn.varKinds.let){let i=this._scope.toName(e);return this._for(new oM(o,i,t,r),()=>n(i))}forOf(e,t,r,n=zn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=t instanceof Le.Name?t:this.var("_arr",t);return this.forRange("_i",0,Le._`${i}.length`,(s)=>{this.var(o,Le._`${i}[${s}]`),r(o)})}return this._for(new s1("of",n,o,t),()=>r(o))}forIn(e,t,r,n=this.opts.es5?zn.varKinds.var:zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,Le._`Object.keys(${t})`,r);let o=this._scope.toName(e);return this._for(new s1("in",n,o,t),()=>r(o))}endFor(){return this._endBlockNode(ll)}label(e){return this._leafNode(new Z9(e))}break(e){return this._leafNode(new Q9(e))}return(e){let t=new ng;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ng)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new iM;if(this._blockNode(n),this.code(e),t){let o=this.name("e");this._currNode=n.catch=new og(o),t(o)}if(r)this._currNode=n.finally=new ig,this.code(r);return this._endBlockNode(og,ig)}throw(e){return this._leafNode(new eM(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=Le.nil,r,n){if(this._blockNode(new rg(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(rg)}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 gi))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}}jr.CodeGen=sM;function ha(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function sg(e,t){return t instanceof Le._CodeOrName?ha(e,t.names):e}function ul(e,t,r){if(e instanceof Le.Name)return n(e);if(!o(e))return e;return new Le._Code(e._items.reduce((i,s)=>{if(s instanceof Le.Name)s=n(s);if(s instanceof Le._Code)i.push(...s._items);else i.push(s);return i},[]));function n(i){let s=r[i.str];if(s===void 0||t[i.str]!==1)return i;return delete t[i.str],s}function o(i){return i instanceof Le._Code&&i._items.some((s)=>s instanceof Le.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function nke(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function aM(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Le._`!${a1(e)}`}jr.not=aM;var oke=cM(jr.operators.AND);function ike(...e){return e.reduce(oke)}jr.and=ike;var ske=cM(jr.operators.OR);function ake(...e){return e.reduce(ske)}jr.or=ake;function cM(e){return(t,r)=>t===Le.nil?r:r===Le.nil?t:Le._`${a1(t)} ${e} ${a1(r)}`}function a1(e){return e instanceof Le.Name?e:Le._`(${e})`}});var Ie=g(function(yM){Object.defineProperty(yM,"__esModule",{value:!0});yM.checkStrictMode=yM.getErrorPath=yM.Type=yM.useFunc=yM.setEvaluated=yM.evaluatedPropsToName=yM.mergeEvaluated=yM.eachItem=yM.unescapeJsonPointer=yM.escapeJsonPointer=yM.escapeFragment=yM.unescapeFragment=yM.schemaRefOrVal=yM.schemaHasRulesButRef=yM.schemaHasRules=yM.checkUnknownRules=yM.alwaysValidSchema=yM.toHash=void 0;var st=we(),dke=Id();function fke(e){let t={};for(let r of e)t[r]=!0;return t}yM.toHash=fke;function pke(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return fM(e,t),!pM(t,e.self.RULES.all)}yM.alwaysValidSchema=pke;function fM(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let o=n.RULES.keywords;for(let i in t)if(!o[i])gM(e,`unknown keyword: "${i}"`)}yM.checkUnknownRules=fM;function pM(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}yM.schemaHasRules=pM;function mke(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}yM.schemaHasRulesButRef=mke;function hke({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return st._`${r}`}return st._`${e}${t}${st.getProperty(n)}`}yM.schemaRefOrVal=hke;function gke(e){return mM(decodeURIComponent(e))}yM.unescapeFragment=gke;function yke(e){return encodeURIComponent(u1(e))}yM.escapeFragment=yke;function u1(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}yM.escapeJsonPointer=u1;function mM(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}yM.unescapeJsonPointer=mM;function bke(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}yM.eachItem=bke;function uM({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof st.Name?(i instanceof st.Name?e(o,i,s):t(o,i,s),s):i instanceof st.Name?(t(o,s,i),i):r(i,s);return a===st.Name&&!(c instanceof st.Name)?n(o,c):c}}yM.mergeEvaluated={props:uM({mergeNames:(e,t,r)=>e.if(st._`${r} !== true && ${t} !== undefined`,()=>{e.if(st._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,st._`${r} || {}`).code(st._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(st._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,st._`${r} || {}`),d1(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:hM}),items:uM({mergeNames:(e,t,r)=>e.if(st._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,st._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(st._`${r} !== true`,()=>e.assign(r,t===!0?!0:st._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function hM(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",st._`{}`);if(t!==void 0)d1(e,r,t);return r}yM.evaluatedPropsToName=hM;function d1(e,t,r){Object.keys(r).forEach((n)=>e.assign(st._`${t}${st.getProperty(n)}`,!0))}yM.setEvaluated=d1;var dM={};function xke(e,t){return e.scopeValue("func",{ref:t,code:dM[t.code]||(dM[t.code]=new dke._Code(t.code))})}yM.useFunc=xke;var l1;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(l1||(yM.Type=l1={}));function _ke(e,t,r){if(e instanceof st.Name){let n=t===l1.Num;return r?n?st._`"[" + ${e} + "]"`:st._`"['" + ${e} + "']"`:n?st._`"/" + ${e}`:st._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?st.getProperty(e).toString():"/"+u1(e)}yM.getErrorPath=_ke;function gM(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}yM.checkStrictMode=gM});var bn=g(function(xM){Object.defineProperty(xM,"__esModule",{value:!0});var ar=we(),qke={data:new ar.Name("data"),valCxt:new ar.Name("valCxt"),instancePath:new ar.Name("instancePath"),parentData:new ar.Name("parentData"),parentDataProperty:new ar.Name("parentDataProperty"),rootData:new ar.Name("rootData"),dynamicAnchors:new ar.Name("dynamicAnchors"),vErrors:new ar.Name("vErrors"),errors:new ar.Name("errors"),this:new ar.Name("this"),self:new ar.Name("self"),scope:new ar.Name("scope"),json:new ar.Name("json"),jsonPos:new ar.Name("jsonPos"),jsonLen:new ar.Name("jsonLen"),jsonPart:new ar.Name("jsonPart")};xM.default=qke});var Nd=g(function(DM){Object.defineProperty(DM,"__esModule",{value:!0});DM.extendErrors=DM.resetErrorsCount=DM.reportExtraError=DM.reportError=DM.keyword$DataError=DM.keywordError=void 0;var Ve=we(),ug=Ie(),_r=bn();DM.keywordError={message:({keyword:e})=>Ve.str`must pass "${e}" keyword validation`};DM.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Ve.str`"${e}" keyword must be ${t} ($data)`:Ve.str`"${e}" keyword is invalid ($data)`};function Lke(e,t=DM.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=wM(e,t,r);if(n!==null&&n!==void 0?n:s||a)_M(i,c);else vM(o,Ve._`[${c}]`)}DM.reportError=Lke;function Bke(e,t=DM.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=wM(e,t,r);if(_M(o,a),!(i||s))vM(n,_r.default.vErrors)}DM.reportExtraError=Bke;function Uke(e,t){e.assign(_r.default.errors,t),e.if(Ve._`${_r.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Ve._`${_r.default.vErrors}.length`,t),()=>e.assign(_r.default.vErrors,null)))}DM.resetErrorsCount=Uke;function zke({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,_r.default.errors,(a)=>{if(e.const(s,Ve._`${_r.default.vErrors}[${a}]`),e.if(Ve._`${s}.instancePath === undefined`,()=>e.assign(Ve._`${s}.instancePath`,Ve.strConcat(_r.default.instancePath,i.errorPath))),e.assign(Ve._`${s}.schemaPath`,Ve.str`${i.errSchemaPath}/${t}`),i.opts.verbose)e.assign(Ve._`${s}.schema`,r),e.assign(Ve._`${s}.data`,n)})}DM.extendErrors=zke;function _M(e,t){let r=e.const("err",t);e.if(Ve._`${_r.default.vErrors} === null`,()=>e.assign(_r.default.vErrors,Ve._`[${r}]`),Ve._`${_r.default.vErrors}.push(${r})`),e.code(Ve._`${_r.default.errors}++`)}function vM(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;if(o.$async)r.throw(Ve._`new ${e.ValidationError}(${t})`);else r.assign(Ve._`${n}.errors`,t),r.return(!1)}var ga={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function wM(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Ve._`{}`;return Vke(e,t,r)}function Vke(e,t,r={}){let{gen:n,it:o}=e,i=[Gke(o,r),Hke(e,r)];return Wke(e,t,i),n.object(...i)}function Gke({errorPath:e},{instancePath:t}){let r=t?Ve.str`${e}${ug.getErrorPath(t,ug.Type.Str)}`:e;return[_r.default.instancePath,Ve.strConcat(_r.default.instancePath,r)]}function Hke({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:Ve.str`${t}/${e}`;if(r)o=Ve.str`${o}${ug.getErrorPath(r,ug.Type.Str)}`;return[ga.schemaPath,o]}function Wke(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:f}=a;if(n.push([ga.keyword,o],[ga.params,typeof t=="function"?t(e):t||Ve._`{}`]),c.messages)n.push([ga.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([ga.schema,s],[ga.parentSchema,Ve._`${d}${f}`],[_r.default.data,i]);if(u)n.push([ga.propertyName,u])}});var kM=g(function($M){Object.defineProperty($M,"__esModule",{value:!0});$M.boolOrEmptySchema=$M.topBoolOrEmptySchema=void 0;var Zke=Nd(),Qke=we(),eRe=bn(),tRe={message:"boolean schema is false"};function rRe(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)SM(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(eRe.default.data);else t.assign(Qke._`${n}.errors`,null),t.return(!0)}$M.topBoolOrEmptySchema=rRe;function nRe(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),SM(e);else r.var(t,!0)}$M.boolOrEmptySchema=nRe;function SM(e,t){let{gen:r,data:n}=e;Zke.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},tRe,void 0,t)}});var p1=g(function(RM){Object.defineProperty(RM,"__esModule",{value:!0});RM.getRules=RM.isJSONType=void 0;var iRe=["string","number","integer","boolean","null","object","array"],sRe=new Set(iRe);function aRe(e){return typeof e=="string"&&sRe.has(e)}RM.isJSONType=aRe;function cRe(){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:{}}}RM.getRules=cRe});var m1=g(function(PM){Object.defineProperty(PM,"__esModule",{value:!0});PM.shouldUseRule=PM.shouldUseGroup=PM.schemaHasRulesForType=void 0;function uRe({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&OM(e,n)}PM.schemaHasRulesForType=uRe;function OM(e,t){return t.rules.some((r)=>FM(e,r))}PM.shouldUseGroup=OM;function FM(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))}PM.shouldUseRule=FM});var jd=g(function(qM){Object.defineProperty(qM,"__esModule",{value:!0});qM.reportTypeError=qM.checkDataTypes=qM.checkDataType=qM.coerceAndCheckDataType=qM.getJSONTypes=qM.getSchemaTypes=qM.DataType=void 0;var pRe=p1(),mRe=m1(),hRe=Nd(),Ee=we(),TM=Ie(),dl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(dl||(qM.DataType=dl={}));function gRe(e){let t=NM(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}qM.getSchemaTypes=gRe;function NM(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(pRe.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}qM.getJSONTypes=NM;function yRe(e,t){let{gen:r,data:n,opts:o}=e,i=bRe(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&mRe.schemaHasRulesForType(e,t[0]));if(s){let a=g1(t,n,o.strictNumbers,dl.Wrong);r.if(a,()=>{if(i.length)xRe(e,t,i);else y1(e)})}return s}qM.coerceAndCheckDataType=yRe;var jM=new Set(["string","number","integer","boolean","null"]);function bRe(e,t){return t?e.filter((r)=>jM.has(r)||t==="array"&&r==="array"):[]}function xRe(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",Ee._`typeof ${o}`),a=n.let("coerced",Ee._`undefined`);if(i.coerceTypes==="array")n.if(Ee._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,Ee._`${o}[0]`).assign(s,Ee._`typeof ${o}`).if(g1(t,o,i.strictNumbers),()=>n.assign(a,o)));n.if(Ee._`${a} !== undefined`);for(let u of r)if(jM.has(u)||u==="array"&&i.coerceTypes==="array")c(u);n.else(),y1(e),n.endIf(),n.if(Ee._`${a} !== undefined`,()=>{n.assign(o,a),_Re(e,a)});function c(u){switch(u){case"string":n.elseIf(Ee._`${s} == "number" || ${s} == "boolean"`).assign(a,Ee._`"" + ${o}`).elseIf(Ee._`${o} === null`).assign(a,Ee._`""`);return;case"number":n.elseIf(Ee._`${s} == "boolean" || ${o} === null
|
|
86
86
|
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,Ee._`+${o}`);return;case"integer":n.elseIf(Ee._`${s} === "boolean" || ${o} === null
|
|
87
87
|
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,Ee._`+${o}`);return;case"boolean":n.elseIf(Ee._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(Ee._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf(Ee._`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf(Ee._`${s} === "string" || ${s} === "number"
|
|
@@ -99,7 +99,7 @@ ${t}`,ESe,SSe,$Se=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=DSe.bind(nul
|
|
|
99
99
|
`)}var pE=!1;var{spawn:mLe}=globalThis.Bun;async function C(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let u of t.unsetEnv??[])delete r[u];let n=mLe({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),o=!1,i;if(t.timeout)i=setTimeout(()=>{o=!0,n.kill()},t.timeout);if(mE()){let u=t.cwd?` (cwd=${t.cwd})`:"";Tf(l.dim(`$ ${e.join(" ")}${u}`))}let s=await new Response(n.stdout).text(),a=await new Response(n.stderr).text(),c=await n.exited;if(i)clearTimeout(i);if(mE()){if(s.trim())Tf(l.dim(s.trimEnd()));if(a.trim())Tf(l.yellow(a.trimEnd()));Tf(l.dim(`(exit ${c})`))}if(o)return{stdout:s,stderr:a||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:c??1,timedOut:!0};return{stdout:s,stderr:a,exitCode:c,timedOut:!1}}var vt=O(()=>{Xe()});function gLe(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function oY(e,t=gLe()){return e.installInstructions[t]}function yLe(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function xLe(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:bLe}async function iY(e){try{let{exitCode:t,stdout:r,timedOut:n}=await C(e.cmd,{timeout:xLe()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:yLe(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 Nf(){let e=Object.entries(nY);return Promise.all(e.map(async([t,r])=>{let{available:n,version:o,timedOut:i}=await iY(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:o,timedOut:i,installInstruction:oY(r)}}))}async function sY(){let t=(await Nf()).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 Oa(e){let r=hLe[e].map((s)=>nY[s]).filter(Boolean),n=await Promise.all(r.map(async(s)=>{let a=await iY(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 o=n.filter((s)=>!s.available&&!s.timedOut&&s.check.required).map((s)=>({tool:s.check.name,installInstruction:oY(s.check)}));if(o.length===0)return;let i=[`
|
|
101
101
|
Missing required tools:`];for(let s of o)i.push(` ${s.tool} not installed`),i.push(` Install: ${s.installInstruction}`);throw Error(i.join(`
|
|
102
|
-
`))}var nY,hLe,bLe=4000;var jf=O(()=>{vt();nY={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)"}}},hLe={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 cY;var aY=O(()=>{cY={name:"nemar-cli",version:"0.10.
|
|
102
|
+
`))}var nY,hLe,bLe=4000;var jf=O(()=>{vt();nY={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)"}}},hLe={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 cY;var aY=O(()=>{cY={name:"nemar-cli",version:"0.10.6-PR1478.bcf65a4",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/","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:{"@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",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var Ei;var qf=O(()=>{aY();Ei=cY.version});import{mkdirSync as vLe,readdirSync as wLe,unlinkSync as DLe,writeFileSync as ELe}from"fs";import{join as hE}from"path";function mY(){Ol=!0}function Fa(){return Ol}function hY(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Lf(e){pY=e,$r(`Step: ${e}`)}function Bf(){dY=!0}function gY(){return dY}function yE(){fY=!0}function yY(){return fY}function $r(e){if(Ol)process.stderr.write(`[debug] ${e}
|
|
103
103
|
`)}function kLe(e){let t={};for(let[r,n]of Object.entries(e))t[r]=CLe.has(r.toLowerCase())?"[REDACTED]":n;return t}function xY(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function gE(e,t,r=0){if(r>ALe)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>gE(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[o,i]of Object.entries(t))n[o]=gE(o,i,r+1);return n}if(typeof t==="string"){if(RLe.test(e))return"[REDACTED]";return t.replace(bY,xY)}return t}function bE(e){return e.replace(OLe,"Bearer [REDACTED]").replace(FLe,"[REDACTED_AWS_KEY]").replace(PLe,"$1[REDACTED]").replace(ILe,"$1$2=[REDACTED]").replace(bY,xY)}function TLe(e){return bE(e)}function lY(e,t=$Le){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(gE("",n))}catch{}if(r=bE(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function P0(e){if(!Ol)return;let t=TLe(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?kLe(e.requestHeaders):void 0,requestBody:lY(e.requestBody),responseBody:lY(e.responseBody)};F0.push(r),$r(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=T(r);F0.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),$r(`redaction failed for ${e.method} ${t}: ${n}`)}}async function NLe(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${Ei}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${T(t)})`)}e.push(""),e.push("Active account:");try{let t=ot();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: ${T(t)})`)}e.push(""),e.push("External tools:");try{let t=await Nf();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: ${T(t)})`)}return e}async function xE(){return(await NLe()).join(`
|
|
104
104
|
`)}async function _Y(){if(!Ol||O0!==void 0)return;try{O0=await xE()}catch(e){let t=T(e);O0=`(could not build environment report: ${t})`,$r(`environment snapshot failed: ${t}`)}}function vY(e){if(uY.has(e))return{flag:e};for(let t of uY){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 jLe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=vY(n);if(!o){t.push(n);continue}if(o.kind==="long-eq")t.push(`${o.flag}=[REDACTED]`);else if(o.kind==="short-attached")t.push(`${o.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function qLe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=vY(n);if(!o){t.push(n);continue}if(!o.kind&&r+1<e.length)r++}return t}function MLe(e){let t=[];for(let n of qLe(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 LLe(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${bE(jLe(e).join(" "))}`),r.push(""),r.push(O0??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),F0.length===0)r.push(" (none)");else F0.forEach((n,o)=>{if(r.push(` [${o+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: ${pY??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
|
|
105
105
|
`)}
|
package/package.json
CHANGED