nemar-cli 0.10.4-PR1410.f0a7732 → 0.10.4-PR1411.bc2413e

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -81,7 +81,7 @@ ${Hr.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)j_(this.rl,th
81
81
  ${t}`,T2e,N2e,j2e=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=I2e.bind(null,n,t.toString());Object.defineProperty(o,"name",N2e);let{writable:i,enumerable:s,configurable:a}=T2e;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})};var qv=O(()=>{T2e=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),N2e=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var uh,pj=(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(uh.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 ed(i,e),uh.set(i,n),i},mj;var hj=O(()=>{qv();uh=new WeakMap;pj.callCount=(e)=>{if(!uh.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return uh.get(e)};mj=pj});var na;var gj=O(()=>{na=[];na.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")na.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")na.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class yj{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Lv[Mv])return Lv[Mv];q2e(Lv,Mv,{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 Uv{}var dh=(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",Mv,Lv,q2e,M2e=(e)=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),xj,bj,Bv,_j,Wnt,Knt;var vj=O(()=>{gj();Mv=Symbol.for("signal-exit emitter"),Lv=globalThis,q2e=Object.defineProperty.bind(Object);xj=class xj extends Uv{onExit(){return()=>{}}load(){}unload(){}};bj=class bj extends Uv{#r=Bv.platform==="win32"?"SIGINT":"SIGHUP";#t=new yj;#e;#o;#f;#n={};#s=!1;constructor(e){super();this.#e=e,this.#n={};for(let t of na)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(!dh(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 na)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,na.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(!dh(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"&&dh(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)}};Bv=globalThis.process,{onExit:_j,load:Wnt,unload:Knt}=M2e(dh(Bv)?new bj(Bv):new xj)});import fh from"process";var wj,L2e,Dj;var Ej=O(()=>{hj();vj();wj=fh.stderr.isTTY?fh.stderr:fh.stdout.isTTY?fh.stdout:void 0,L2e=wj?mj(()=>{_j(()=>{wj.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Dj=L2e});import Sj from"process";var ph=!1,Mc,zv;var $j=O(()=>{Ej();Mc={};Mc.show=(e=Sj.stderr)=>{if(!e.isTTY)return;ph=!1,e.write("\x1B[?25h")};Mc.hide=(e=Sj.stderr)=>{if(!e.isTTY)return;Dj(),ph=!0,e.write("\x1B[?25l")};Mc.toggle=(e,t)=>{if(e!==void 0)ph=e;if(ph)Mc.show(t);else Mc.hide(t)};zv=Mc});import Tn from"process";function Vv(){if(Tn.platform!=="win32")return Tn.env.TERM!=="linux";return Boolean(Tn.env.CI)||Boolean(Tn.env.WT_SESSION)||Boolean(Tn.env.TERMINUS_SUBLIME)||Tn.env.ConEmuTask==="{cmd::Cmder}"||Tn.env.TERM_PROGRAM==="Terminus-Sublime"||Tn.env.TERM_PROGRAM==="vscode"||Tn.env.TERM==="xterm-256color"||Tn.env.TERM==="alacritty"||Tn.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Cj=()=>{};var B2e,U2e,z2e,td;var kj=O(()=>{Xe();Cj();B2e={info:l.blue("\u2139"),success:l.green("\u2714"),warning:l.yellow("\u26A0"),error:l.red("\u2716")},U2e={info:l.blue("i"),success:l.green("\u221A"),warning:l.yellow("\u203C"),error:l.red("\xD7")},z2e=Vv()?B2e:U2e,td=z2e});function Gv({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 rd(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(V2e,"")}var V2e;var Hv=O(()=>{V2e=Gv()});function Rj(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 Aj(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Oj(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 Fj=()=>{};function G2e(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Pj(e,{ambiguousAsWide:t=!1}={}){if(G2e(e),Aj(e)||Oj(e)||t&&Rj(e))return 2;return 1}var Ij=O(()=>{Fj()});var Tj=()=>/[#*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 Wv(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(!n)e=rd(e);if(e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of H2e.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(W2e.test(s))continue;if(Tj().test(s)){o+=2;continue}o+=Pj(a,i)}return o}var H2e,W2e;var Nj=O(()=>{Hv();Ij();H2e=new Intl.Segmenter,W2e=/^\p{Default_Ignorable_Code_Point}$/u});function Kv({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import jj from"process";function Yv(){let{env:e}=jj,{TERM:t,TERM_PROGRAM:r}=e;if(jj.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 qj=()=>{};import wo from"process";class Mj{#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(wo.platform==="win32"||!wo.stdin.isTTY)return;wo.stdin.setRawMode(!0),wo.stdin.on("data",this.#o),wo.stdin.resume()}#e(){if(!wo.stdin.isTTY)return;wo.stdin.off("data",this.#o),wo.stdin.pause(),wo.stdin.setRawMode(!1)}#o(e){if(e[0]===K2e)wo.emit("SIGINT")}}var K2e=3,Y2e,Jv;var Lj=O(()=>{Y2e=new Mj,Jv=Y2e});import mh from"process";class Bj{#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:mh.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:Kv({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,mh.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(!Yv())this.#s=nd.default.line;else if(e===void 0)this.#s=nd.default.dots;else if(e!=="default"&&nd.default[e])this.#s=nd.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""}#x(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.#x(this.#c,"-"),n=" ".repeat(this.#d)+t+"--"+this.#g+"--"+r;this.#e=0;for(let o of rd(n).split(`
82
82
  `))this.#e+=Math.max(1,Math.ceil(Wv(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)zv.hide(this.#i);if(this.#n.discardStdin&&mh.stdin.isTTY)this.#t=!0,Jv.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)zv.show(this.#i);if(this.#n.discardStdin&&mh.stdin.isTTY&&this.#t)Jv.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:td.success,text:e})}fail(e){return this.stopAndPersist({symbol:td.error,text:e})}warn(e){return this.stopAndPersist({symbol:td.warning,text:e})}info(e){return this.stopAndPersist({symbol:td.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.#x(a," "),u=r+n+s+c+`
84
- `;return this.stop(),this.#i.write(u),this}}function D(e){return new Bj(e)}var nd,J2e;var Nn=O(()=>{Xe();$j();kj();Hv();Nj();qj();Lj();nd=he(cm(),1),J2e=he(cm(),1)});var Ne,Vj,H,oi=(e)=>{switch(typeof e){case"undefined":return H.undefined;case"string":return H.string;case"number":return Number.isNaN(e)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":if(Array.isArray(e))return H.array;if(e===null)return H.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return H.promise;if(typeof Map<"u"&&e instanceof Map)return H.map;if(typeof Set<"u"&&e instanceof Set)return H.set;if(typeof Date<"u"&&e instanceof Date)return H.date;return H.object;default:return H.unknown}};var od=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}})(Ne||(Ne={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Vj||(Vj={}));H=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var j,Xr;var hh=O(()=>{od();j=Ne.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"]);Xr=class Xr 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 Xr))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.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()}};Xr.create=(e)=>new Xr(e)});var X2e=(e,t)=>{let r;switch(e.code){case j.invalid_type:if(e.received===H.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,Ne.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case j.invalid_union:r="Invalid input";break;case j.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case j.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.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 Ne.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,Ne.assertNever(e)}return{message:r}},ls;var Xv=O(()=>{hh();od();ls=X2e});function id(){return Z2e}var Z2e;var gh=O(()=>{Xv();Z2e=ls});function z(e,t){let r=id(),n=yh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ls?void 0:ls].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 yh=(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,Lc=(e)=>({status:"dirty",value:e}),xr=(e)=>({status:"valid",value:e}),Zv=(e)=>e.status==="aborted",Qv=(e)=>e.status==="dirty",oa=(e)=>e.status==="valid",sd=(e)=>typeof Promise<"u"&&e instanceof Promise;var ew=O(()=>{gh();Xv();ce=Object.freeze({status:"aborted"})});var Gj=()=>{};var ee;var Hj=O(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(ee||(ee={}))});class jn{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 _e(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 oi(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:oi(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:oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(sd(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:oi(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Wj(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oi(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return oa(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)=>oa(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:oi(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(sd(n)?n:Promise.resolve(n));return Wj(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 So({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 Eo.create(this,this._def)}nullable(){return us.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Do.create(this)}promise(){return Gc.create(this,this._def)}or(e){return dd.create([this,e],this._def)}and(e){return fd.create(this,e,this._def)}transform(e){return new So({..._e(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new gd({..._e(this._def),innerType:this,defaultValue:t,typeName:le.ZodDefault})}brand(){return new ow({typeName:le.ZodBranded,type:this,..._e(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new yd({..._e(this._def),innerType:this,catchValue:t,typeName:le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Sh.create(this,e)}readonly(){return xd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Yj(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 hSe(e){return new RegExp(`^${Yj(e)}$`)}function gSe(e){let t=`${Kj}T${Yj(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 ySe(e,t){if((t==="v4"||!t)&&cSe.test(e))return!0;if((t==="v6"||!t)&&uSe.test(e))return!0;return!1}function xSe(e,t){if(!oSe.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 bSe(e,t){if((t==="v4"||!t)&&lSe.test(e))return!0;if((t==="v6"||!t)&&dSe.test(e))return!0;return!1}function _Se(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 Bc(e){if(e instanceof $t){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Eo.create(Bc(n))}return new $t({...e._def,shape:()=>t})}else if(e instanceof Do)return new Do({...e._def,type:Bc(e.element)});else if(e instanceof Eo)return Eo.create(Bc(e.unwrap()));else if(e instanceof us)return us.create(Bc(e.unwrap()));else if(e instanceof ci)return ci.create(e.items.map((t)=>Bc(t)));else return e}function rw(e,t){let r=oi(e),n=oi(t);if(e===t)return{valid:!0,data:e};else if(r===H.object&&n===H.object){let o=Ne.objectKeys(t),i=Ne.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=rw(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===H.array&&n===H.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=rw(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(r===H.date&&n===H.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Jj(e,t){return new sa({values:e,typeName:le.ZodEnum,..._e(t)})}var Wj=(e,t)=>{if(oa(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 Xr(e.common.issues);return this._error=r,this._error}}}},Q2e,eSe,tSe,rSe,nSe,oSe,iSe,sSe,aSe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tw,cSe,lSe,uSe,dSe,fSe,pSe,Kj="((\\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])))",mSe,si,Uc,zc,xh,cd,bh,ld,ud,_h,ia,ai,vh,Do,$t,dd,ii=(e)=>{if(e instanceof pd)return ii(e.schema);else if(e instanceof So)return ii(e.innerType());else if(e instanceof md)return[e.value];else if(e instanceof sa)return e.options;else if(e instanceof hd)return Ne.objectValues(e.enum);else if(e instanceof gd)return ii(e._def.innerType);else if(e instanceof ld)return[void 0];else if(e instanceof ud)return[null];else if(e instanceof Eo)return[void 0,...ii(e.unwrap())];else if(e instanceof us)return[null,...ii(e.unwrap())];else if(e instanceof ow)return ii(e.unwrap());else if(e instanceof xd)return ii(e.unwrap());else if(e instanceof yd)return ii(e._def.innerType);else return[]},nw,fd,ci,wh,Dh,Vc,ad,pd,md,sa,hd,Gc,So,Eo,us,gd,yd,Eh,Qot,ow,Sh,xd,eit,le,v,R,tit,rit,Ce,nit,oit,iit,sit,ait,bd,cit,lit,oe,U,uit,_d,iw,dit,fit,Hc,pit,mit,hit,git,ze,et,yit,xit,bit,_it,vit,wit,Dit;var Xj=O(()=>{hh();gh();Hj();ew();od();Q2e=/^c[^\s-]{8,}$/i,eSe=/^[0-9a-z]+$/,tSe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rSe=/^[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,nSe=/^[a-z0-9_-]{21}$/i,oSe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,iSe=/^[-+]?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)?)??$/,sSe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cSe=/^(?:(?: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])$/,lSe=/^(?:(?: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])$/,uSe=/^(([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]))$/,dSe=/^(([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])$/,fSe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pSe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mSe=new RegExp(`^${Kj}$`);si=class si extends Re{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==H.string){let o=this._getOrReturnCtx(e);return z(o,{code:j.invalid_type,expected:H.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),z(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),z(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)z(n,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(s)z(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(!sSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"email",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="emoji"){if(!tw)tw=new RegExp(aSe,"u");if(!tw.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"emoji",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="uuid"){if(!rSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"uuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="nanoid"){if(!nSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"nanoid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid"){if(!Q2e.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"cuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid2"){if(!eSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"cuid2",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ulid"){if(!tSe.test(e.data))n=this._getOrReturnCtx(e,n),z(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),z(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),z(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),z(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),z(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),z(n,{code:j.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="datetime"){if(!gSe(o).test(e.data))n=this._getOrReturnCtx(e,n),z(n,{code:j.invalid_string,validation:"datetime",message:o.message}),r.dirty()}else if(o.kind==="date"){if(!mSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{code:j.invalid_string,validation:"date",message:o.message}),r.dirty()}else if(o.kind==="time"){if(!hSe(o).test(e.data))n=this._getOrReturnCtx(e,n),z(n,{code:j.invalid_string,validation:"time",message:o.message}),r.dirty()}else if(o.kind==="duration"){if(!iSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"duration",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ip"){if(!ySe(e.data,o.version))n=this._getOrReturnCtx(e,n),z(n,{validation:"ip",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="jwt"){if(!xSe(e.data,o.alg))n=this._getOrReturnCtx(e,n),z(n,{validation:"jwt",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cidr"){if(!bSe(e.data,o.version))n=this._getOrReturnCtx(e,n),z(n,{validation:"cidr",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64"){if(!fSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"base64",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64url"){if(!pSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"base64url",code:j.invalid_string,message:o.message}),r.dirty()}else Ne.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 si({...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 si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new si({...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}};si.create=(e)=>new si({checks:[],typeName:le.ZodString,coerce:e?.coerce??!1,..._e(e)});Uc=class Uc 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)!==H.number){let o=this._getOrReturnCtx(e);return z(o,{code:j.invalid_type,expected:H.number,received:o.parsedType}),ce}let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="int"){if(!Ne.isInteger(e.data))r=this._getOrReturnCtx(e,r),z(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),z(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),z(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(_Se(e.data,o.value)!==0)r=this._getOrReturnCtx(e,r),z(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),z(r,{code:j.not_finite,message:o.message}),n.dirty()}else Ne.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 Uc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new Uc({...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"&&Ne.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)}};Uc.create=(e)=>new Uc({checks:[],typeName:le.ZodNumber,coerce:e?.coerce||!1,..._e(e)});zc=class zc 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)!==H.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),z(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),z(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),z(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else Ne.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return z(t,{code:j.invalid_type,expected:H.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 zc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new zc({...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}};zc.create=(e)=>new zc({checks:[],typeName:le.ZodBigInt,coerce:e?.coerce??!1,..._e(e)});xh=class xh extends Re{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==H.boolean){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.boolean,received:r.parsedType}),ce}return xr(e.data)}};xh.create=(e)=>new xh({typeName:le.ZodBoolean,coerce:e?.coerce||!1,..._e(e)});cd=class cd extends Re{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==H.date){let o=this._getOrReturnCtx(e);return z(o,{code:j.invalid_type,expected:H.date,received:o.parsedType}),ce}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return z(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),z(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),z(n,{code:j.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()}else Ne.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new cd({...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}};cd.create=(e)=>new cd({checks:[],coerce:e?.coerce||!1,typeName:le.ZodDate,..._e(e)});bh=class bh extends Re{_parse(e){if(this._getType(e)!==H.symbol){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.symbol,received:r.parsedType}),ce}return xr(e.data)}};bh.create=(e)=>new bh({typeName:le.ZodSymbol,..._e(e)});ld=class ld extends Re{_parse(e){if(this._getType(e)!==H.undefined){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.undefined,received:r.parsedType}),ce}return xr(e.data)}};ld.create=(e)=>new ld({typeName:le.ZodUndefined,..._e(e)});ud=class ud extends Re{_parse(e){if(this._getType(e)!==H.null){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.null,received:r.parsedType}),ce}return xr(e.data)}};ud.create=(e)=>new ud({typeName:le.ZodNull,..._e(e)});_h=class _h extends Re{constructor(){super(...arguments);this._any=!0}_parse(e){return xr(e.data)}};_h.create=(e)=>new _h({typeName:le.ZodAny,..._e(e)});ia=class ia extends Re{constructor(){super(...arguments);this._unknown=!0}_parse(e){return xr(e.data)}};ia.create=(e)=>new ia({typeName:le.ZodUnknown,..._e(e)});ai=class ai extends Re{_parse(e){let t=this._getOrReturnCtx(e);return z(t,{code:j.invalid_type,expected:H.never,received:t.parsedType}),ce}};ai.create=(e)=>new ai({typeName:le.ZodNever,..._e(e)});vh=class vh extends Re{_parse(e){if(this._getType(e)!==H.undefined){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.void,received:r.parsedType}),ce}return xr(e.data)}};vh.create=(e)=>new vh({typeName:le.ZodVoid,..._e(e)});Do=class Do extends Re{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==H.array)return z(t,{code:j.invalid_type,expected:H.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)z(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)z(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)z(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 jn(t,i,t.path,s)))).then((i)=>ir.mergeArray(r,i));let o=[...t.data].map((i,s)=>n.type._parseSync(new jn(t,i,t.path,s)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new Do({...this._def,minLength:{value:e,message:ee.toString(t)}})}max(e,t){return new Do({...this._def,maxLength:{value:e,message:ee.toString(t)}})}length(e,t){return new Do({...this._def,exactLength:{value:e,message:ee.toString(t)}})}nonempty(e){return this.min(1,e)}};Do.create=(e,t)=>new Do({type:e,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,..._e(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=Ne.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let c=this._getOrReturnCtx(e);return z(c,{code:j.invalid_type,expected:H.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 ai&&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 jn(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ai){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)z(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 jn(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 Ne.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 Ne.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}deepPartial(){return Bc(this)}partial(e){let t={};for(let r of Ne.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 Ne.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];while(o instanceof Eo)o=o._def.innerType;t[r]=o}return new $t({...this._def,shape:()=>t})}keyof(){return Jj(Ne.objectKeys(this.shape))}};$t.create=(e,t)=>new $t({shape:()=>e,unknownKeys:"strip",catchall:ai.create(),typeName:le.ZodObject,..._e(t)});$t.strictCreate=(e,t)=>new $t({shape:()=>e,unknownKeys:"strict",catchall:ai.create(),typeName:le.ZodObject,..._e(t)});$t.lazycreate=(e,t)=>new $t({shape:e,unknownKeys:"strip",catchall:ai.create(),typeName:le.ZodObject,..._e(t)});dd=class dd 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 Xr(s.ctx.common.issues));return z(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 Xr(a));return z(t,{code:j.invalid_union,unionErrors:s}),ce}}get options(){return this._def.options}};dd.create=(e,t)=>new dd({options:e,typeName:le.ZodUnion,..._e(t)});nw=class nw extends Re{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return z(t,{code:j.invalid_type,expected:H.object,received:t.parsedType}),ce;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);if(!o)return z(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=ii(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 nw({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._e(r)})}};fd=class fd extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(Zv(o)||Zv(i))return ce;let s=rw(o.value,i.value);if(!s.valid)return z(r,{code:j.invalid_intersection_types}),ce;if(Qv(o)||Qv(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}))}};fd.create=(e,t,r)=>new fd({left:e,right:t,typeName:le.ZodIntersection,..._e(r)});ci=class ci extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==H.array)return z(r,{code:j.invalid_type,expected:H.array,received:r.parsedType}),ce;if(r.data.length<this._def.items.length)return z(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)z(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 jn(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 ci({...this._def,rest:e})}};ci.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:e,typeName:le.ZodTuple,rest:null,..._e(t)})};wh=class wh 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!==H.object)return z(r,{code:j.invalid_type,expected:H.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 jn(r,s,r.path,s)),value:i._parse(new jn(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 wh({keyType:e,valueType:t,typeName:le.ZodRecord,..._e(r)});return new wh({keyType:si.create(),valueType:e,typeName:le.ZodRecord,..._e(t)})}};Dh=class Dh 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!==H.map)return z(r,{code:j.invalid_type,expected:H.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 jn(r,s,r.path,[c,"key"])),value:o._parse(new jn(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}}}};Dh.create=(e,t,r)=>new Dh({valueType:t,keyType:e,typeName:le.ZodMap,..._e(r)});Vc=class Vc extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==H.set)return z(r,{code:j.invalid_type,expected:H.set,received:r.parsedType}),ce;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)z(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)z(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 jn(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 Vc({...this._def,minSize:{value:e,message:ee.toString(t)}})}max(e,t){return new Vc({...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)}};Vc.create=(e,t)=>new Vc({valueType:e,minSize:null,maxSize:null,typeName:le.ZodSet,..._e(t)});ad=class ad extends Re{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return z(t,{code:j.invalid_type,expected:H.function,received:t.parsedType}),ce;function r(s,a){return yh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,id(),ls].filter((c)=>!!c),issueData:{code:j.invalid_arguments,argumentsError:a}})}function n(s,a){return yh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,id(),ls].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 Gc){let s=this;return xr(async function(...a){let c=new Xr([]),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 xr(function(...a){let c=s._def.args.safeParse(a,o);if(!c.success)throw new Xr([r(a,c.error)]);let u=Reflect.apply(i,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Xr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ad({...this._def,args:ci.create(e).rest(ia.create())})}returns(e){return new ad({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ad({args:e?e:ci.create([]).rest(ia.create()),returns:t||ia.create(),typeName:le.ZodFunction,..._e(r)})}};pd=class pd 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})}};pd.create=(e,t)=>new pd({getter:e,typeName:le.ZodLazy,..._e(t)});md=class md extends Re{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return z(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}};md.create=(e,t)=>new md({value:e,typeName:le.ZodLiteral,..._e(t)});sa=class sa extends Re{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return z(t,{expected:Ne.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 z(t,{received:t.data,code:j.invalid_enum_value,options:r}),ce}return xr(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 sa.create(e,{...this._def,...t})}exclude(e,t=this._def){return sa.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};sa.create=Jj;hd=class hd extends Re{_parse(e){let t=Ne.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==H.string&&r.parsedType!==H.number){let n=Ne.objectValues(t);return z(r,{expected:Ne.joinValues(n),received:r.parsedType,code:j.invalid_type}),ce}if(!this._cache)this._cache=new Set(Ne.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=Ne.objectValues(t);return z(r,{received:r.data,code:j.invalid_enum_value,options:n}),ce}return xr(e.data)}get enum(){return this._def.values}};hd.create=(e,t)=>new hd({values:e,typeName:le.ZodNativeEnum,..._e(t)});Gc=class Gc extends Re{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.promise&&t.common.async===!1)return z(t,{code:j.invalid_type,expected:H.promise,received:t.parsedType}),ce;let r=t.parsedType===H.promise?t.data:Promise.resolve(t.data);return xr(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Gc.create=(e,t)=>new Gc({type:e,typeName:le.ZodPromise,..._e(t)});So=class So 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(z(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 Lc(a.value);if(t.value==="dirty")return Lc(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 Lc(s.value);if(t.value==="dirty")return Lc(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(!oa(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(!oa(i))return ce;return Promise.resolve(n.transform(i.value,o)).then((s)=>({status:t.value,value:s}))});Ne.assertNever(n)}};So.create=(e,t,r)=>new So({schema:e,typeName:le.ZodEffects,effect:t,..._e(r)});So.createWithPreprocess=(e,t,r)=>new So({schema:t,effect:{type:"preprocess",transform:e},typeName:le.ZodEffects,..._e(r)});Eo=class Eo extends Re{_parse(e){if(this._getType(e)===H.undefined)return xr(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Eo.create=(e,t)=>new Eo({innerType:e,typeName:le.ZodOptional,..._e(t)});us=class us extends Re{_parse(e){if(this._getType(e)===H.null)return xr(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};us.create=(e,t)=>new us({innerType:e,typeName:le.ZodNullable,..._e(t)});gd=class gd extends Re{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===H.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};gd.create=(e,t)=>new gd({innerType:e,typeName:le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,..._e(t)});yd=class yd 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(sd(n))return n.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xr(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Xr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};yd.create=(e,t)=>new yd({innerType:e,typeName:le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,..._e(t)});Eh=class Eh extends Re{_parse(e){if(this._getType(e)!==H.nan){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.nan,received:r.parsedType}),ce}return{status:"valid",value:e.data}}};Eh.create=(e)=>new Eh({typeName:le.ZodNaN,..._e(e)});Qot=Symbol("zod_brand");ow=class ow 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}};Sh=class Sh 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(),Lc(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 Sh({in:e,out:t,typeName:le.ZodPipeline})}};xd=class xd extends Re{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(oa(n))n.value=Object.freeze(n.value);return n};return sd(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};xd.create=(e,t)=>new xd({innerType:e,typeName:le.ZodReadonly,..._e(t)});eit={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={}));v=si.create,R=Uc.create,tit=Eh.create,rit=zc.create,Ce=xh.create,nit=cd.create,oit=bh.create,iit=ld.create,sit=ud.create,ait=_h.create,bd=ia.create,cit=ai.create,lit=vh.create,oe=Do.create,U=$t.create,uit=$t.strictCreate,_d=dd.create,iw=nw.create,dit=fd.create,fit=ci.create,Hc=wh.create,pit=Dh.create,mit=Vc.create,hit=ad.create,git=pd.create,ze=md.create,et=sa.create,yit=hd.create,xit=Gc.create,bit=So.create,_it=Eo.create,vit=us.create,wit=So.createWithPreprocess,Dit=Sh.create});var sw=O(()=>{gh();ew();Gj();od();Xj();hh()});var Qr=O(()=>{sw();sw()});function DSe(e){return e.startsWith("v")?e:`v${e}`}var vSe,wSe,Zj,Iit;var aw=O(()=>{Qr();vSe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,wSe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;Zj=v().regex(vSe,"must be a semver version, optionally v-prefixed").transform(DSe),Iit=v().regex(wSe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function cw(e){return $h.includes(e)}var ESe,vd,$h,Qj,SSe,eq,$Se,tq,CSe,kSe,rq,RSe,nq,jit,qit,oq,ASe,iq,OSe,sq,lw=20,uw=500,FSe,Mit;var wd=O(()=>{Qr();ESe=et(["pending","verified","approved","revoked"]),vd=et(["person","service","test"]),$h=vd.options;Qj={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"},SSe=et(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),eq=SSe.options,$Se=et(["active","pending","revoked"]),tq=U({field:v(),blocks:oe(v()).optional(),set_on:oe(v()).optional()}).passthrough(),CSe=U({id:R().int(),username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),orcid:v().nullable().optional(),created_at:v().optional(),approved_at:v().nullable().optional(),dataset_count:R().int().optional(),sandbox_completed:Ce().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),service_access:Ce().optional(),status:ESe.optional(),email_verified:Ce().optional(),orcid_verified:Ce().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:oe(tq).optional(),username_auto_assigned:Ce().optional(),account_kind:vd.optional()}).passthrough(),kSe=U({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),rq=U({user:CSe,token:kSe.optional()}).passthrough(),RSe=U({id:R().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),email_verified:R().int().nullable().optional(),role:v().nullable(),created_at:v(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),signup_source:v().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),orcid:v().nullable().optional(),upload_access_requested_at:v().nullable().optional(),account_kind:vd.optional()}).passthrough(),nq=U({users:oe(RSe),count:R().int()}).passthrough(),jit=et(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),qit=et(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),oq=U({suggestion:v().nullable(),based_on:et(["name","unavailable","exhausted"])}).passthrough(),ASe=et(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),iq=ASe.options,OSe=et(["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"]),sq=OSe.options,FSe=U({id:R().int(),email:v(),username:v().nullable(),role:v(),status:$Se,email_verified:Ce(),given_name:v().nullable(),family_name:v().nullable(),orcid:v().nullable(),orcid_verified:Ce(),github_username:v().nullable(),city:v().nullable(),country:v().nullable(),affiliation:v().nullable(),service_access:Ce(),service_access_granted_at:v().nullable(),upload_access_requested_at:v().nullable(),profile_gaps:oe(tq),username_auto_assigned:Ce()}).passthrough(),Mit=U({user:FSe.nullable()}).passthrough()});function cq(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 lq(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 PSe="0.4.0",dw,Wc,aq,ISe,TSe,NSe,uq,zit,dq,Vit,li,jSe,Ch,Git;var fw=O(()=>{Qr();aw();dw=et(["openneuro","nemar","gin","other"]),Wc=_d([ze(0),ze(1)]).nullable(),aq=U({dataset_id:v(),id:v().optional(),name:v(),description:v().nullable().optional(),status:v(),visibility:v(),concept_doi:v().nullable().optional(),doi:v().nullable().optional(),created_at:v(),updated_at:v().optional(),owner_username:v().nullable().optional(),source:v().nullable().optional(),modalities:v().optional(),participants:R().int().nonnegative(),tasks:v().optional(),authors:v().optional(),license:v().optional(),file_size:R().nonnegative(),file_size_formatted:v().optional(),total_files:R().nonnegative().nullable().optional(),num_citations:R().int().nonnegative().optional(),n_channels:R().int().nullable().optional(),electrode_system:v().nullable().optional(),has_hed:Wc.optional(),hed_version:v().nullable().optional(),data_complete:Wc.optional(),bytes_present:R().nonnegative().nullable().optional(),latest_version:Zj.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:v().nullable().optional(),zarr_status:et(["pending","ready","failed"]).nullable().optional(),zarr_store_count:R().int().nullable().optional(),zarr_converted_at:v().nullable().optional(),zarr_source_commit:v().nullable().optional(),zarr_errors:R().int().nullable().optional(),zarr_failure_count:R().int().nullable().optional(),zarr_deterministic:Wc.optional(),zarr_failed_at:v().nullable().optional(),zarr_index_url:v().nullable().optional(),zarr_verify_status:et(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:v().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:v().nullable().optional(),placement_scheme:v().nullable().optional()}).passthrough();ISe=aq.superRefine((e,t)=>{cq(e,t),lq(e,t)}),TSe=aq.extend({file_size:R().nonnegative().nullable(),file_size_formatted:v().nullable().optional(),modalities:v().nullable().optional(),tasks:v().nullable().optional(),authors:v().nullable().optional(),license:v().nullable().optional(),owner_github:v().nullable().optional(),attestation_deposit_type:et(["owner","redistribution"]).nullable().optional(),attestation_key_status:et(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Wc.optional(),attestation_no_duplicate:Wc.optional(),attestation_upstream_source:v().nullable().optional(),attestation_accepted_at:v().nullable().optional(),zarr_data_failures:U({count:R().int().nonnegative(),detail_ref:v(),compacted_by:v().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)=>{cq(e,t),lq(e,t)}),NSe=U({id:v(),name:v(),modalities:v().nullable().optional(),participants:R().int().nullable().optional(),doi:v().nullable().optional(),tasks:v().nullable().optional(),authors:v().nullable().optional(),has_hed:Wc.optional(),score:R().optional(),snippet:v().optional()}).passthrough(),uq=Hc(v(),R().int().nonnegative()),zit=U({datasets:oe(ISe),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:uq.optional()}).passthrough(),dq=U({results:oe(NSe),count:R().int().nonnegative(),returned:R().int().nonnegative().optional(),offset:R().int().nonnegative().optional(),limit:R().int().optional(),candidate_ceiling:R().int().optional(),truncated:Ce().optional(),method:et(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:R().optional(),warning:v().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:uq.optional()}).passthrough(),Vit=U({dataset:TSe}).passthrough(),li=U({value:v(),count:R().int().nonnegative()}),jSe=U({values:oe(li),distinct_total:R().int().nonnegative(),truncated:Ce()}),Ch=U({"electrode-system":oe(li).optional(),source:oe(li).optional(),zarr:oe(li).optional(),powerline:oe(li).optional(),"bids-version":oe(li).optional(),"hed-version":oe(li).optional(),license:oe(li).optional(),modality:oe(li).optional(),task:jSe.optional(),warning:v().optional()}).passthrough(),Git=U({schema_version:ze(PSe),doc_type:ze("dataset"),dataset_id:v().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:v(),source:dw,recording_modality:oe(v()).min(1),description:v().nullable().optional(),bids_version:v().nullable().optional(),license:v().nullable().optional()}).passthrough()});var qSe,Kit,Yit,Jit,Xit;var fq=O(()=>{Qr();qSe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Kit=v().regex(qSe,"ORCID must be in format 0000-0000-0000-000X"),Yit=et(["found","no_public_name","lookup_failed"]),Jit=et(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing"]),Xit=et(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var MSe,pq,Dd="https://nemar.org/settings",est,LSe,BSe,USe,mq,hq;var pw=O(()=>{Qr();MSe=et(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),pq=MSe.options,est={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, ${Dd}).`,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, ${Dd}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Dd}), 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, ${Dd}).`,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, ${Dd}).`,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."},LSe=et(["orcid","email","github"]),BSe=U({id:R().int(),username:v().nullable(),email:v(),created_at:v(),has_oauth_identity:Ce(),dataset_count:R().int(),identity_conflict:R().int(),canonical:Ce()}).passthrough(),USe=U({kind:LSe,value:v(),canonical_user_id:R().int(),accounts:oe(BSe)}).passthrough(),mq=U({groups:oe(USe),group_count:R().int(),flagged_count:R().int()}).passthrough(),hq=U({ok:ze(!0),id:R().int(),cleared:Ce()}).passthrough()});var mw=120,gq=64,hw="unnamed machine",zSe=25,kh,yq,Kc,xq,nst,ost,bq,VSe,GSe,_q,gw,vq,ist,sst,Rh,Ah;var Oh=O(()=>{Qr();kh=et(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),yq={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."},Kc=et(["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"]),xq=Kc.options,nst={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 ${zSe} 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."},ost=U({error:Kc,message:v()}).passthrough(),bq=U({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:R().int(),interval:R().int()}).passthrough(),VSe=iw("error",[U({error:ze("authorization_pending"),message:v()}).passthrough(),U({error:ze("slow_down"),message:v()}).passthrough()]),GSe=iw("error",[U({error:ze("expired_token"),reason:Kc,message:v()}).passthrough(),U({error:ze("access_denied"),reason:Kc,message:v()}).passthrough(),U({error:ze("invalid_grant"),reason:Kc,message:v()}).passthrough()]),_q=_d([VSe,GSe]),gw=U({id:R().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ce()}).passthrough(),vq=U({api_key:v(),key:gw,user:U({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ce(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),ist=U({user_code:v(),machine_name:v(),requested_at:v(),expires_in:R().int(),account:U({username:v().nullable(),email_masked:v()}).passthrough(),refusal:U({code:Kc,message:v()}).passthrough().nullable()}).passthrough(),sst=U({ok:ze(!0),machine_name:v()}).passthrough(),Rh=U({keys:oe(gw)}).passthrough(),Ah=U({api_key:v(),key:gw}).passthrough()});function Ft(e){return Ct[e]}function ui(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Ct;var Yc=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 WSe(e){return e==="verified"||e==="upload_access"||e==="publication"}function Jc(e){return(e??"").trim().length===0}function KSe(e){return e==="service"||e==="test"}function Eq(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Fh,e)?Fh[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 wq(e){let t=yw.indexOf(e);return t===-1?yw.length:t}function Sq(e,t={}){return e.map((r)=>Eq(r,{orcidVerified:t.orcidVerified}))}function Ph(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(WSe):[];return Eq(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>wq(r.field)-wq(n.field))}function xw(e){let t=e.blocks[0],r=t?Ct[HSe[t]]:Ct["gap.blocks.unknown"],n=ui(Ct["gap.sentence"],{label:"",blocks:r}).trimStart(),o=e.setOnCli?ui(Ct["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):ui(Ct["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${o}`}function $q(e){return`${e.label} ${xw(e)}`}function Ih(){let e=ui(Ct["gap.sentence"],{label:Dq.label,blocks:Ct["cli.gap.blocks.sandbox"]}),t=ui(Ct["cli.gap.set_on.cli_only"],{cli:Dq.command});return`${e} ${t}`}function Cq(){return Ct["cli.gaps.sandbox_unchecked"]}var Fh,yw,ust,HSe,Dq;var Xc=O(()=>{Yc();Fh={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&&Jc(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)=>Jc(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)=>Jc(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&&!KSe(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)=>Jc(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)=>Jc(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)=>Jc(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}},yw=Object.keys(Fh),ust=yw.filter((e)=>Fh[e].isMissing!==null),HSe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Dq={field:"sandbox",label:Ct["cli.gap.field.sandbox.label"],command:Ct["cli.gap.field.sandbox.set_on.cli"]}});function qh(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 br,Th,kq,Nh,jh,YSe,JSe,XSe,ZSe,QSe,pst,e$e,mst,t$e,hst;var bw=O(()=>{Qr();br=/^[a-z]{2}[0-9]{6}$/,Th=/^[0-9a-f]{40}$/,kq=U({name:v(),modality:v().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(),Nh=U({converted:R().int().nonnegative().optional(),relabelled:R().int().nonnegative().optional(),kept_importer_unit:R().int().nonnegative().optional(),units_column_present:Ce().optional(),sidecar:v().optional(),sidecar_supplied:Ce().optional()}).passthrough(),jh=U({applied:Ce().optional(),method:v().optional(),calibration:v().optional(),cross_talk:v().optional(),mne_version:v().optional()}).passthrough();YSe=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr"),updated_utc:v().optional(),source_tree:ze("raw"),derived:Ce(),modalities:oe(v()).optional(),groups:oe(kq).optional(),power_line_frequency:R().nullable().optional(),event_description_count:R().int().nonnegative().optional(),n_events:R().int().nonnegative().optional(),trial_types:Hc(v(),R().int().nonnegative()).optional(),units_report:Nh.optional(),channels_tsv_read_error:Ce().optional(),split_members:oe(v()).optional(),sss:jh.optional()}).passthrough().superRefine(qh),JSe=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr").optional(),code:v(),reason:v(),detail:v().nullable().optional(),attempts:R().int().nonnegative().optional()}).passthrough(),XSe=et(["infra_failure","memory_budget","not_attempted"]),ZSe=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr"),reason:XSe,attempts:R().int().nonnegative(),last_error:v().nullable().optional(),last_attempt_utc:v().nullable().optional()}).passthrough(),QSe=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(),pst=U({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:v().regex(br,"NEMAR dataset id (nm/on/xx band)"),contract_base:v().regex(/^https:\/\//,"must be https"),data_base:v().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:v().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:v().min(1),s3_anonymous:Ce(),source_commit:v().regex(Th,"must be a full 40-hex SHA"),engine_version:v().min(1),biosigio_version:v().nullable().optional(),updated_utc:v(),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(YSe),failures:oe(JSe),pending:oe(ZSe),doi:v().nullable().optional(),license:v().nullable().optional(),citation:v().nullable().optional(),hed_version:v().nullable().optional(),events_parquet:v().regex(/^https:\/\//,"must be https").optional(),events_row_count:R().int().nonnegative().optional(),layout:QSe}).passthrough(),e$e=U({name:v(),configuration:Hc(v(),bd()).optional()}).passthrough(),mst=U({zarr_format:ze(3),node_type:ze("array"),shape:oe(R().int().nonnegative()),data_type:v(),chunk_grid:U({name:v(),configuration:Hc(v(),bd()).optional()}).passthrough(),codecs:oe(e$e),fill_value:bd().optional(),attributes:Hc(v(),bd()).optional(),dimension_names:oe(v().nullable()).optional()}).passthrough(),t$e=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr"),groups:oe(kq).optional(),modalities:oe(v()).optional()}).passthrough(),hst=U({format:ze("nemar-zarr-index"),format_version:R().int(),dataset_id:v().regex(br,"NEMAR dataset id (nm/on/xx band)"),source_commit:v(),stores:oe(t$e)}).passthrough()});var r$e,bst,n$e,Oq,Ed,Rq,o$e,Fq,i$e=20,s$e=100,_st,a$e,vst,wst,c$e,l$e,u$e,Dst,d$e=50,f$e=500,Est,p$e,m$e,Sst,h$e=1000,g$e=5000,$st,y$e,Cst,x$e=800,b$e=4000,kst,Rst,_w=60,vw=64,Aq,_$e=86400,v$e=4096,Ast,w$e,D$e,Ost;var Pq=O(()=>{Qr();bw();r$e=U({dataset_id:v().regex(br),name:v(),doi:v().nullable().optional(),license:v().nullable().optional(),modalities:oe(v()).optional(),tasks:oe(v()).optional(),subject_count:R().int().nonnegative().nullable().optional(),has_hed:_d([ze(0),ze(1)]).nullable().optional(),hed_version:v().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:v().nullable().optional(),zarr_source_commit:v().nullable().optional(),zarr_errors:R().int().nonnegative().nullable().optional(),zarr_verify_status:et(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:v().nullable().optional(),index_url:v().nullable().optional()}).passthrough(),bst=U({format:ze("nemar-zarr-catalog"),format_version:R().int(),generated_utc:v(),contract_base:v(),count:R().int().nonnegative(),datasets:oe(r$e)}).passthrough(),n$e=["verified","failed","unverifiable"],Oq=et(n$e).nullable(),Ed=U({dataset_id:v().regex(br),doi:v().nullable(),license:v().nullable(),citation:v().nullable(),source_commit:v().regex(Th),index_etag:v().nullable(),engine_version:v(),source_tree:ze("raw"),derived:Ce(),sss:jh.optional(),lossy:Ce(),dtype:v().nullable(),effective_rate_hz:R().nullable(),source_rate_hz:R().nullable(),units_report:Nh.nullable().optional(),zarr_verify_status:Oq,note:v().nullable().optional()}).passthrough().superRefine(qh),Rq=U({start:R().int().nonnegative(),end:R().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),o$e=U({python_zarr:v(),zarrita:v()}).passthrough(),Fq=U({contract_base:v(),data_base:v(),s3_uri:v(),s3_region:v(),s3_anonymous:Ce(),zarr:v(),group:v(),level:_d([ze("0"),R().int().positive()]),array_path:v(),dtype:v().nullable(),codecs:oe(bd()).optional(),chunk_samples:R().int().positive().nullable(),shard_samples:R().int().positive().nullable(),n_channels:R().int().nonnegative().nullable(),sample_slice:Rq.optional(),channel_slice:Rq.optional(),scale_offset:v(),how_to:o$e}).passthrough(),_st=U({query:v().optional(),modality:v().optional(),task:v().optional(),has_hed:Ce().optional(),has_zarr:Ce().optional(),limit:R().int().positive().max(s$e).default(i$e)}).passthrough(),a$e=U({dataset_id:v().regex(br),name:v(),doi:v().nullable().optional(),license:v().nullable().optional(),modalities:oe(v()).optional(),tasks:oe(v()).optional(),subject_count:R().int().nullable().optional(),has_hed:Ce().nullable().optional(),has_zarr:Ce()}).passthrough(),vst=U({results:oe(a$e),count:R().int().nonnegative(),limit:R().int(),note:v().nullable().optional(),truncated:Ce().optional()}).passthrough(),wst=U({dataset_id:v().regex(br)}).passthrough(),c$e=["list_recordings","get_events","render_overview","read_window"],l$e=U({next_cheapest_tool:et(c$e),reason:v()}).passthrough(),u$e=["pending","ready","failed"],Dst=U({dataset_id:v().regex(br),name:v(),doi:v().nullable(),license:v().nullable(),citation:v().nullable(),modalities:oe(v()).optional(),tasks:oe(v()).optional(),subject_count:R().int().nullable().optional(),has_hed:Ce().nullable().optional(),hed_version:v().nullable().optional(),recording_count:R().int().nullable().optional(),total_recording_duration_s:R().nullable().optional(),zarr_status:et(u$e).nullable().optional(),zarr_verify_status:Oq.optional(),zarr_source_commit:v().nullable().optional(),zarr_store_count:R().int().nullable().optional(),cost_hint:l$e}).passthrough(),Est=U({dataset_id:v().regex(br),modality:v().optional(),min_duration_s:R().nonnegative().optional(),include_derived:Ce().default(!1),limit:R().int().positive().max(f$e).default(d$e),offset:R().int().nonnegative().default(0)}).passthrough(),p$e=U({name:v(),modality:v().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(),m$e=U({path:v(),zarr:v(),source_tree:ze("raw"),derived:Ce(),groups:oe(p$e).optional(),n_events:R().int().nonnegative().optional(),sss:jh.optional(),units_report:Nh.optional()}).passthrough().superRefine(qh),Sst=U({dataset_id:v().regex(br),source_commit:v().regex(Th).nullable(),recordings:oe(m$e),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:v().nullable().optional(),envelope:Ed.optional()}).passthrough(),$st=U({dataset_id:v().regex(br),recording:v(),group:v().optional(),limit:R().int().positive().max(g$e).default(h$e),offset:R().int().nonnegative().default(0)}).passthrough(),y$e=U({store_path:v(),group_name:v(),onset_s:R(),duration_s:R().nullable().optional(),sample_index:R().int().nonnegative(),trial_type:v().nullable().optional(),value:_d([v(),R()]).nullable().optional(),hed:v().nullable().optional()}).passthrough(),Cst=U({dataset_id:v().regex(br),recording:v(),events:oe(y$e),source:et(["events_parquet","events_tsv_fallback"]),estimated:Ce(),total_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),truncated:Ce(),note:v().nullable().optional(),envelope:Ed.optional()}).passthrough(),kst=U({dataset_id:v().regex(br),recording:v(),group:v().optional(),width_px:R().int().positive().max(b$e).default(x$e)}).passthrough(),Rst=U({dataset_id:v().regex(br),recording:v(),group:v(),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:Ed.optional()}).passthrough(),Aq=_w*vw,Ast=U({dataset_id:v().regex(br),recording:v(),group:v().optional(),start_s:R().nonnegative().default(0),duration_s:R().positive().max(_$e).default(10),channels:oe(R().int().nonnegative()).max(v$e).optional(),taste:Ce().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>_w)t.addIssue({code:j.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${_w} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>vw)t.addIssue({code:j.custom,message:`taste channels (${e.channels.length}) exceeds the ${vw}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>Aq)t.addIssue({code:j.custom,message:`taste exceeds the cap of ${Aq} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),w$e=U({mode:ze("recipe"),recipe:Fq,envelope:Ed}).passthrough(),D$e=U({mode:ze("taste"),start_s:R(),duration_s:R(),channels:oe(R().int()),sample_rate_hz:R(),values:oe(oe(R())),recipe:Fq,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:v().nullable().optional(),envelope:Ed}).passthrough(),Ost=iw("mode",[w$e,D$e])});var Zc=O(()=>{aw();wd();fw();fq();pw();Oh();Yc();Xc();bw();Pq()});function Mh(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(ww.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(ww.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"&&!E$e.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(ww.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function Dw(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 Iq(e,t){if(Dw(e,t))throw Error("Cannot use string index")}function Tq(e,t,r){if(!aa(e)||typeof t!=="string")return r===void 0?e:r;let n=Mh(t);if(n.length===0)return r;for(let o=0;o<n.length;o++){let i=n[o];if(Dw(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 Ew(e,t,r){if(!aa(e)||typeof t!=="string")return e;let n=e,o=Mh(t);for(let i=0;i<o.length;i++){let s=o[i];if(Iq(e,s),i===o.length-1)e[s]=r;else if(!aa(e[s]))e[s]=typeof o[i+1]==="number"?[]:{};e=e[s]}return n}function Nq(e,t){if(!aa(e)||typeof t!=="string")return!1;let r=Mh(t);for(let n=0;n<r.length;n++){let o=r[n];if(Iq(e,o),n===r.length-1)return delete e[o],!0;if(e=e[o],!aa(e))return!1}}function jq(e,t){if(!aa(e)||typeof t!=="string")return!1;let r=Mh(t);if(r.length===0)return!1;for(let n of r){if(!aa(e)||!(n in e)||Dw(e,n))return!1;e=e[n]}return!0}var aa=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},ww,E$e;var qq=O(()=>{ww=new Set(["__proto__","prototype","constructor"]),E$e=new Set("0123456789")});import vt from"path";import Mq from"os";import Sw from"process";function Cw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Sw.platform==="darwin")return S$e(e);if(Sw.platform==="win32")return $$e(e);return C$e(e)}var ds,$w,Qc,S$e=(e)=>{let t=vt.join(ds,"Library");return{data:vt.join(t,"Application Support",e),config:vt.join(t,"Preferences",e),cache:vt.join(t,"Caches",e),log:vt.join(t,"Logs",e),temp:vt.join($w,e)}},$$e=(e)=>{let t=Qc.APPDATA||vt.join(ds,"AppData","Roaming"),r=Qc.LOCALAPPDATA||vt.join(ds,"AppData","Local");return{data:vt.join(r,e,"Data"),config:vt.join(t,e,"Config"),cache:vt.join(r,e,"Cache"),log:vt.join(r,e,"Log"),temp:vt.join($w,e)}},C$e=(e)=>{let t=vt.basename(ds);return{data:vt.join(Qc.XDG_DATA_HOME||vt.join(ds,".local","share"),e),config:vt.join(Qc.XDG_CONFIG_HOME||vt.join(ds,".config"),e),cache:vt.join(Qc.XDG_CACHE_HOME||vt.join(ds,".cache"),e),log:vt.join(Qc.XDG_STATE_HOME||vt.join(ds,".local","state"),e),temp:vt.join($w,t,e)}};var Lq=O(()=>{ds=Mq.homedir(),$w=Mq.tmpdir(),{env:Qc}=Sw});var k$e=(e,t)=>{let{onError:r}=t;return function(...o){return e.apply(void 0,o).catch(r)}},$o;var Bq=O(()=>{$o=k$e});var R$e=(e,t)=>{let{onError:r}=t;return function(...o){try{return e.apply(void 0,o)}catch(i){return r(i)}}},qn;var Uq=O(()=>{qn=R$e});var zq=250;var Vq=()=>{};var A$e=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=o.interval??zq,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)})}}},Co;var Gq=O(()=>{Vq();Co=A$e});var O$e=(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}}}},ko;var Hq=O(()=>{ko=O$e});var kw=O(()=>{Bq();Uq();Gq();Hq()});var Sd,Rw;var Wq=O(()=>{Aw();Sd={isChangeErrorOk:(e)=>{if(!Sd.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Kq&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Sd.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(!Sd.isNodeError(e))throw e;if(Sd.isChangeErrorOk(e))return;throw e}},Rw=Sd});import Yq from"process";var $d,Tr,Kq,Xt;var Aw=O(()=>{Wq();$d={onError:Rw.onChangeError},Tr={onError:()=>{return}},Kq=Yq.getuid?!Yq.getuid():!1,Xt={isRetriable:Rw.isRetriableError}});import Ke from"fs";import{promisify as sr}from"util";var F$e,Vt;var Ow=O(()=>{kw();kw();Aw();F$e={attempt:{chmod:$o(sr(Ke.chmod),$d),chown:$o(sr(Ke.chown),$d),close:$o(sr(Ke.close),Tr),fsync:$o(sr(Ke.fsync),Tr),mkdir:$o(sr(Ke.mkdir),Tr),realpath:$o(sr(Ke.realpath),Tr),stat:$o(sr(Ke.stat),Tr),unlink:$o(sr(Ke.unlink),Tr),chmodSync:qn(Ke.chmodSync,$d),chownSync:qn(Ke.chownSync,$d),closeSync:qn(Ke.closeSync,Tr),existsSync:qn(Ke.existsSync,Tr),fsyncSync:qn(Ke.fsync,Tr),mkdirSync:qn(Ke.mkdirSync,Tr),realpathSync:qn(Ke.realpathSync,Tr),statSync:qn(Ke.statSync,Tr),unlinkSync:qn(Ke.unlinkSync,Tr)},retry:{close:Co(sr(Ke.close),Xt),fsync:Co(sr(Ke.fsync),Xt),open:Co(sr(Ke.open),Xt),readFile:Co(sr(Ke.readFile),Xt),rename:Co(sr(Ke.rename),Xt),stat:Co(sr(Ke.stat),Xt),write:Co(sr(Ke.write),Xt),writeFile:Co(sr(Ke.writeFile),Xt),closeSync:ko(Ke.closeSync,Xt),fsyncSync:ko(Ke.fsyncSync,Xt),openSync:ko(Ke.openSync,Xt),readFileSync:ko(Ke.readFileSync,Xt),renameSync:ko(Ke.renameSync,Xt),statSync:ko(Ke.statSync,Xt),writeSync:ko(Ke.writeSync,Xt),writeFileSync:ko(Ke.writeFileSync,Xt)}},Vt=F$e});import ca from"process";var Jq="utf8",Fw=438,Xq=511,Zq,Qq,e9,t9=1000,r9,xat,Pw=128;var Iw=O(()=>{Zq={},Qq=ca.geteuid?ca.geteuid():-1,e9=ca.getegid?ca.getegid():-1,r9=!!ca.getuid,xat=ca.getuid?!ca.getuid():!1});var n9=(e)=>e instanceof Error&&("code"in e),Tw=(e)=>typeof e==="string",Lh=(e)=>e===void 0;var o9=()=>{};var i9=()=>{};import s9 from"process";var a9,Bh;var Nw=O(()=>{a9=s9.platform==="linux",Bh=s9.platform==="win32"});var jw,c9;var l9=O(()=>{Nw();jw=["SIGHUP","SIGINT","SIGTERM"];if(!Bh)jw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(a9)jw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");c9=jw});import el from"process";class u9{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(Bh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))el.kill(el.pid,"SIGTERM");else el.kill(el.pid,e)},this.hook=()=>{el.once("exit",()=>this.exit());for(let e of c9)try{el.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var d9;var f9=O(()=>{Nw();l9();d9=new u9});var P$e,p9;var m9=O(()=>{f9();P$e=d9.register,p9=P$e});import I$e from"path";var en,Cd;var h9=O(()=>{Ow();m9();Iw();en={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=en.truncate(t(e));if(n in en.store)return en.get(e,t,r);return en.store[n]=r,[n,()=>delete en.store[n]]},purge:(e)=>{if(!en.store[e])return;delete en.store[e],Vt.attempt.unlink(e)},purgeSync:(e)=>{if(!en.store[e])return;delete en.store[e],Vt.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in en.store)en.purgeSync(e)},truncate:(e)=>{let t=I$e.basename(e);if(t.length<=Pw)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Pw;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};p9(en.purgeSyncAll);Cd=en});import T$e from"path";function qw(e,t,r=Zq){if(Tw(r))return qw(e,t,{encoding:r});let o={timeout:r.timeout??t9},i=null,s=null,a=null;try{let c=Vt.attempt.realpathSync(e),u=!!c;e=c||e,[s,i]=Cd.get(e,r.tmpCreate||Cd.create,r.tmpPurge!==!1);let d=r9&&Lh(r.chown),f=Lh(r.mode);if(u&&(d||f)){let m=Vt.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=T$e.dirname(e);Vt.attempt.mkdirSync(m,{mode:Xq,recursive:!0})}if(a=Vt.retry.openSync(o)(s,"w",r.mode||Fw),r.tmpCreated)r.tmpCreated(s);if(Tw(t))Vt.retry.writeSync(o)(a,t,0,r.encoding||Jq);else if(!Lh(t))Vt.retry.writeSync(o)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Vt.retry.fsyncSync(o)(a);else Vt.attempt.fsync(a);if(Vt.retry.closeSync(o)(a),a=null,r.chown&&(r.chown.uid!==Qq||r.chown.gid!==e9))Vt.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Fw)Vt.attempt.chmodSync(s,r.mode);try{Vt.retry.renameSync(o)(s,e)}catch(m){if(!n9(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Vt.retry.renameSync(o)(s,Cd.truncate(e))}i(),s=null}finally{if(a)Vt.attempt.closeSync(a);if(s)Cd.purge(s)}}var g9=O(()=>{Ow();Iw();o9();i9();h9()});var Rd=h(function(b9){Object.defineProperty(b9,"__esModule",{value:!0});b9.regexpCode=b9.getEsmExportName=b9.getProperty=b9.safeStringify=b9.stringify=b9.strConcat=b9.addCodeArg=b9.str=b9._=b9.nil=b9._Code=b9.Name=b9.IDENTIFIER=b9._CodeOrName=void 0;class Uh{}b9._CodeOrName=Uh;b9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class tl extends Uh{constructor(e){super();if(!b9.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}}}b9.Name=tl;class Mn extends Uh{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 tl)t[r.str]=(t[r.str]||0)+1;return t},{})}}b9._Code=Mn;b9.nil=new Mn("");function y9(e,...t){let r=[e[0]],n=0;while(n<t.length)Lw(r,t[n]),r.push(e[++n]);return new Mn(r)}b9._=y9;var Mw=new Mn("+");function x9(e,...t){let r=[kd(e[0])],n=0;while(n<t.length)r.push(Mw),Lw(r,t[n]),r.push(Mw,kd(e[++n]));return N$e(r),new Mn(r)}b9.str=x9;function Lw(e,t){if(t instanceof Mn)e.push(...t._items);else if(t instanceof tl)e.push(t);else e.push(M$e(t))}b9.addCodeArg=Lw;function N$e(e){let t=1;while(t<e.length-1){if(e[t]===Mw){let r=j$e(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function j$e(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof tl||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 tl))return`"${e}${t.slice(1)}`;return}function q$e(e,t){return t.emptyStr()?e:e.emptyStr()?t:x9`${e}${t}`}b9.strConcat=q$e;function M$e(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:kd(Array.isArray(e)?e.join(","):e)}function L$e(e){return new Mn(kd(e))}b9.stringify=L$e;function kd(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}b9.safeStringify=kd;function B$e(e){return typeof e=="string"&&b9.IDENTIFIER.test(e)?new Mn(`.${e}`):y9`[${e}]`}b9.getProperty=B$e;function U$e(e){if(typeof e=="string"&&b9.IDENTIFIER.test(e))return new Mn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}b9.getEsmExportName=U$e;function z$e(e){return new Mn(e.toString())}b9.regexpCode=z$e});var Vw=h(function(D9){Object.defineProperty(D9,"__esModule",{value:!0});D9.ValueScope=D9.ValueScopeName=D9.Scope=D9.varKinds=D9.UsedValueState=void 0;var Nr=Rd();class v9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Vh;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Vh||(D9.UsedValueState=Vh={}));D9.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};class Uw{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}}}D9.Scope=Uw;class zw 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}]`}}D9.ValueScopeName=zw;var rCe=Nr._`\n`;class w9 extends Uw{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?rCe:Nr.nil}}get(){return this._scope}name(e){return new zw(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,Vh.Started);let u=t(c);if(u){let d=this.opts.es5?D9.varKinds.var:D9.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 v9(c);a.set(c,Vh.Completed)})}return o}}D9.ValueScope=w9});var ve=h(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=Rd(),Ln=Vw(),fs=Rd();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return fs._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return fs.str}});Object.defineProperty(jr,"strConcat",{enumerable:!0,get:function(){return fs.strConcat}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return fs.nil}});Object.defineProperty(jr,"getProperty",{enumerable:!0,get:function(){return fs.getProperty}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return fs.stringify}});Object.defineProperty(jr,"regexpCode",{enumerable:!0,get:function(){return fs.regexpCode}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return fs.Name}});var Jh=Vw();Object.defineProperty(jr,"Scope",{enumerable:!0,get:function(){return Jh.Scope}});Object.defineProperty(jr,"ValueScope",{enumerable:!0,get:function(){return Jh.ValueScope}});Object.defineProperty(jr,"ValueScopeName",{enumerable:!0,get:function(){return Jh.ValueScopeName}});Object.defineProperty(jr,"varKinds",{enumerable:!0,get:function(){return Jh.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 ps{optimizeNodes(){return this}optimizeNames(e,t){return this}}class S9 extends ps{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Ln.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=nl(this.rhs,e,t);return this}get names(){return this.rhs instanceof Le._CodeOrName?this.rhs.names:{}}}class Ww extends ps{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=nl(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Le.Name?{}:{...this.lhs.names};return Yh(e,this.rhs)}}class $9 extends Ww{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class C9 extends ps{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class k9 extends ps{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class R9 extends ps{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class A9 extends ps{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=nl(this.code,e,t),this}get names(){return this.code instanceof Le._CodeOrName?this.code.names:{}}}class Xh extends ps{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;sCe(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>la(e,t.names),{})}}class ms extends Xh{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class O9 extends Xh{}class Ad extends ms{}Ad.kind="else";class di extends ms{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 Ad(r):r}if(t){if(e===!1)return t instanceof di?t:t.nodes;if(this.nodes.length)return this;return new di(N9(e),t instanceof di?[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=nl(this.condition,e,t),this}get names(){let e=super.names;if(Yh(e,this.condition),this.else)la(e,this.else.names);return e}}di.kind="if";class rl extends ms{}rl.kind="for";class F9 extends rl{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=nl(this.iteration,e,t),this}get names(){return la(super.names,this.iteration.names)}}class P9 extends rl{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Ln.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=Yh(super.names,this.from);return Yh(e,this.to)}}class Gw extends rl{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=nl(this.iterable,e,t),this}get names(){return la(super.names,this.iterable.names)}}class Gh extends ms{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)}}Gh.kind="func";class Hh extends Xh{render(e){return"return "+super.render(e)}}Hh.kind="return";class I9 extends ms{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)la(e,this.catch.names);if(this.finally)la(e,this.finally.names);return e}}class Wh extends ms{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Wh.kind="catch";class Kh extends ms{render(e){return"finally"+super.render(e)}}Kh.kind="finally";class T9{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 Bj(e)}var nd,J2e;var Nn=O(()=>{Xe();$j();kj();Hv();Nj();qj();Lj();nd=he(cm(),1),J2e=he(cm(),1)});var Ne,Vj,H,oi=(e)=>{switch(typeof e){case"undefined":return H.undefined;case"string":return H.string;case"number":return Number.isNaN(e)?H.nan:H.number;case"boolean":return H.boolean;case"function":return H.function;case"bigint":return H.bigint;case"symbol":return H.symbol;case"object":if(Array.isArray(e))return H.array;if(e===null)return H.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return H.promise;if(typeof Map<"u"&&e instanceof Map)return H.map;if(typeof Set<"u"&&e instanceof Set)return H.set;if(typeof Date<"u"&&e instanceof Date)return H.date;return H.object;default:return H.unknown}};var od=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}})(Ne||(Ne={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Vj||(Vj={}));H=Ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var j,Xr;var hh=O(()=>{od();j=Ne.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"]);Xr=class Xr 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 Xr))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ne.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()}};Xr.create=(e)=>new Xr(e)});var X2e=(e,t)=>{let r;switch(e.code){case j.invalid_type:if(e.received===H.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,Ne.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.joinValues(e.keys,", ")}`;break;case j.invalid_union:r="Invalid input";break;case j.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.joinValues(e.options)}`;break;case j.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.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 Ne.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,Ne.assertNever(e)}return{message:r}},ls;var Xv=O(()=>{hh();od();ls=X2e});function id(){return Z2e}var Z2e;var gh=O(()=>{Xv();Z2e=ls});function z(e,t){let r=id(),n=yh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ls?void 0:ls].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 yh=(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,Lc=(e)=>({status:"dirty",value:e}),xr=(e)=>({status:"valid",value:e}),Zv=(e)=>e.status==="aborted",Qv=(e)=>e.status==="dirty",oa=(e)=>e.status==="valid",sd=(e)=>typeof Promise<"u"&&e instanceof Promise;var ew=O(()=>{gh();Xv();ce=Object.freeze({status:"aborted"})});var Gj=()=>{};var ee;var Hj=O(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(ee||(ee={}))});class jn{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 _e(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 oi(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:oi(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:oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(sd(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:oi(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Wj(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oi(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return oa(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)=>oa(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:oi(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(sd(n)?n:Promise.resolve(n));return Wj(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 So({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 Eo.create(this,this._def)}nullable(){return us.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Do.create(this)}promise(){return Gc.create(this,this._def)}or(e){return dd.create([this,e],this._def)}and(e){return fd.create(this,e,this._def)}transform(e){return new So({..._e(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new gd({..._e(this._def),innerType:this,defaultValue:t,typeName:le.ZodDefault})}brand(){return new ow({typeName:le.ZodBranded,type:this,..._e(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new yd({..._e(this._def),innerType:this,catchValue:t,typeName:le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Sh.create(this,e)}readonly(){return xd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Yj(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 hSe(e){return new RegExp(`^${Yj(e)}$`)}function gSe(e){let t=`${Kj}T${Yj(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 ySe(e,t){if((t==="v4"||!t)&&cSe.test(e))return!0;if((t==="v6"||!t)&&uSe.test(e))return!0;return!1}function xSe(e,t){if(!oSe.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 bSe(e,t){if((t==="v4"||!t)&&lSe.test(e))return!0;if((t==="v6"||!t)&&dSe.test(e))return!0;return!1}function _Se(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 Bc(e){if(e instanceof $t){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Eo.create(Bc(n))}return new $t({...e._def,shape:()=>t})}else if(e instanceof Do)return new Do({...e._def,type:Bc(e.element)});else if(e instanceof Eo)return Eo.create(Bc(e.unwrap()));else if(e instanceof us)return us.create(Bc(e.unwrap()));else if(e instanceof ci)return ci.create(e.items.map((t)=>Bc(t)));else return e}function rw(e,t){let r=oi(e),n=oi(t);if(e===t)return{valid:!0,data:e};else if(r===H.object&&n===H.object){let o=Ne.objectKeys(t),i=Ne.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=rw(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===H.array&&n===H.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=rw(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(r===H.date&&n===H.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Jj(e,t){return new sa({values:e,typeName:le.ZodEnum,..._e(t)})}var Wj=(e,t)=>{if(oa(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 Xr(e.common.issues);return this._error=r,this._error}}}},Q2e,eSe,tSe,rSe,nSe,oSe,iSe,sSe,aSe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tw,cSe,lSe,uSe,dSe,fSe,pSe,Kj="((\\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])))",mSe,si,Uc,zc,xh,cd,bh,ld,ud,_h,ia,ai,vh,Do,$t,dd,ii=(e)=>{if(e instanceof pd)return ii(e.schema);else if(e instanceof So)return ii(e.innerType());else if(e instanceof md)return[e.value];else if(e instanceof sa)return e.options;else if(e instanceof hd)return Ne.objectValues(e.enum);else if(e instanceof gd)return ii(e._def.innerType);else if(e instanceof ld)return[void 0];else if(e instanceof ud)return[null];else if(e instanceof Eo)return[void 0,...ii(e.unwrap())];else if(e instanceof us)return[null,...ii(e.unwrap())];else if(e instanceof ow)return ii(e.unwrap());else if(e instanceof xd)return ii(e.unwrap());else if(e instanceof yd)return ii(e._def.innerType);else return[]},nw,fd,ci,wh,Dh,Vc,ad,pd,md,sa,hd,Gc,So,Eo,us,gd,yd,Eh,Qot,ow,Sh,xd,eit,le,v,R,tit,rit,Ce,nit,oit,iit,sit,ait,bd,cit,lit,oe,U,uit,_d,iw,dit,fit,Hc,pit,mit,hit,git,ze,et,yit,xit,bit,_it,vit,wit,Dit;var Xj=O(()=>{hh();gh();Hj();ew();od();Q2e=/^c[^\s-]{8,}$/i,eSe=/^[0-9a-z]+$/,tSe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rSe=/^[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,nSe=/^[a-z0-9_-]{21}$/i,oSe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,iSe=/^[-+]?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)?)??$/,sSe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cSe=/^(?:(?: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])$/,lSe=/^(?:(?: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])$/,uSe=/^(([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]))$/,dSe=/^(([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])$/,fSe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pSe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mSe=new RegExp(`^${Kj}$`);si=class si extends Re{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==H.string){let o=this._getOrReturnCtx(e);return z(o,{code:j.invalid_type,expected:H.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),z(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),z(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)z(n,{code:j.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(s)z(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(!sSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"email",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="emoji"){if(!tw)tw=new RegExp(aSe,"u");if(!tw.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"emoji",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="uuid"){if(!rSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"uuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="nanoid"){if(!nSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"nanoid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid"){if(!Q2e.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"cuid",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cuid2"){if(!eSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"cuid2",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ulid"){if(!tSe.test(e.data))n=this._getOrReturnCtx(e,n),z(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),z(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),z(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),z(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),z(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),z(n,{code:j.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()}else if(o.kind==="datetime"){if(!gSe(o).test(e.data))n=this._getOrReturnCtx(e,n),z(n,{code:j.invalid_string,validation:"datetime",message:o.message}),r.dirty()}else if(o.kind==="date"){if(!mSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{code:j.invalid_string,validation:"date",message:o.message}),r.dirty()}else if(o.kind==="time"){if(!hSe(o).test(e.data))n=this._getOrReturnCtx(e,n),z(n,{code:j.invalid_string,validation:"time",message:o.message}),r.dirty()}else if(o.kind==="duration"){if(!iSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"duration",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="ip"){if(!ySe(e.data,o.version))n=this._getOrReturnCtx(e,n),z(n,{validation:"ip",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="jwt"){if(!xSe(e.data,o.alg))n=this._getOrReturnCtx(e,n),z(n,{validation:"jwt",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="cidr"){if(!bSe(e.data,o.version))n=this._getOrReturnCtx(e,n),z(n,{validation:"cidr",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64"){if(!fSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"base64",code:j.invalid_string,message:o.message}),r.dirty()}else if(o.kind==="base64url"){if(!pSe.test(e.data))n=this._getOrReturnCtx(e,n),z(n,{validation:"base64url",code:j.invalid_string,message:o.message}),r.dirty()}else Ne.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 si({...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 si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new si({...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}};si.create=(e)=>new si({checks:[],typeName:le.ZodString,coerce:e?.coerce??!1,..._e(e)});Uc=class Uc 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)!==H.number){let o=this._getOrReturnCtx(e);return z(o,{code:j.invalid_type,expected:H.number,received:o.parsedType}),ce}let r=void 0,n=new ir;for(let o of this._def.checks)if(o.kind==="int"){if(!Ne.isInteger(e.data))r=this._getOrReturnCtx(e,r),z(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),z(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),z(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(_Se(e.data,o.value)!==0)r=this._getOrReturnCtx(e,r),z(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),z(r,{code:j.not_finite,message:o.message}),n.dirty()}else Ne.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 Uc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new Uc({...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"&&Ne.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)}};Uc.create=(e)=>new Uc({checks:[],typeName:le.ZodNumber,coerce:e?.coerce||!1,..._e(e)});zc=class zc 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)!==H.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),z(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),z(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),z(r,{code:j.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()}else Ne.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return z(t,{code:j.invalid_type,expected:H.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 zc({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:ee.toString(n)}]})}_addCheck(e){return new zc({...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}};zc.create=(e)=>new zc({checks:[],typeName:le.ZodBigInt,coerce:e?.coerce??!1,..._e(e)});xh=class xh extends Re{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==H.boolean){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.boolean,received:r.parsedType}),ce}return xr(e.data)}};xh.create=(e)=>new xh({typeName:le.ZodBoolean,coerce:e?.coerce||!1,..._e(e)});cd=class cd extends Re{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==H.date){let o=this._getOrReturnCtx(e);return z(o,{code:j.invalid_type,expected:H.date,received:o.parsedType}),ce}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return z(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),z(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),z(n,{code:j.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()}else Ne.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new cd({...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}};cd.create=(e)=>new cd({checks:[],coerce:e?.coerce||!1,typeName:le.ZodDate,..._e(e)});bh=class bh extends Re{_parse(e){if(this._getType(e)!==H.symbol){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.symbol,received:r.parsedType}),ce}return xr(e.data)}};bh.create=(e)=>new bh({typeName:le.ZodSymbol,..._e(e)});ld=class ld extends Re{_parse(e){if(this._getType(e)!==H.undefined){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.undefined,received:r.parsedType}),ce}return xr(e.data)}};ld.create=(e)=>new ld({typeName:le.ZodUndefined,..._e(e)});ud=class ud extends Re{_parse(e){if(this._getType(e)!==H.null){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.null,received:r.parsedType}),ce}return xr(e.data)}};ud.create=(e)=>new ud({typeName:le.ZodNull,..._e(e)});_h=class _h extends Re{constructor(){super(...arguments);this._any=!0}_parse(e){return xr(e.data)}};_h.create=(e)=>new _h({typeName:le.ZodAny,..._e(e)});ia=class ia extends Re{constructor(){super(...arguments);this._unknown=!0}_parse(e){return xr(e.data)}};ia.create=(e)=>new ia({typeName:le.ZodUnknown,..._e(e)});ai=class ai extends Re{_parse(e){let t=this._getOrReturnCtx(e);return z(t,{code:j.invalid_type,expected:H.never,received:t.parsedType}),ce}};ai.create=(e)=>new ai({typeName:le.ZodNever,..._e(e)});vh=class vh extends Re{_parse(e){if(this._getType(e)!==H.undefined){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.void,received:r.parsedType}),ce}return xr(e.data)}};vh.create=(e)=>new vh({typeName:le.ZodVoid,..._e(e)});Do=class Do extends Re{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==H.array)return z(t,{code:j.invalid_type,expected:H.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)z(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)z(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)z(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 jn(t,i,t.path,s)))).then((i)=>ir.mergeArray(r,i));let o=[...t.data].map((i,s)=>n.type._parseSync(new jn(t,i,t.path,s)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new Do({...this._def,minLength:{value:e,message:ee.toString(t)}})}max(e,t){return new Do({...this._def,maxLength:{value:e,message:ee.toString(t)}})}length(e,t){return new Do({...this._def,exactLength:{value:e,message:ee.toString(t)}})}nonempty(e){return this.min(1,e)}};Do.create=(e,t)=>new Do({type:e,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,..._e(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=Ne.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==H.object){let c=this._getOrReturnCtx(e);return z(c,{code:j.invalid_type,expected:H.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 ai&&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 jn(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ai){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)z(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 jn(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 Ne.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 Ne.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new $t({...this._def,shape:()=>t})}deepPartial(){return Bc(this)}partial(e){let t={};for(let r of Ne.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 Ne.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let o=this.shape[r];while(o instanceof Eo)o=o._def.innerType;t[r]=o}return new $t({...this._def,shape:()=>t})}keyof(){return Jj(Ne.objectKeys(this.shape))}};$t.create=(e,t)=>new $t({shape:()=>e,unknownKeys:"strip",catchall:ai.create(),typeName:le.ZodObject,..._e(t)});$t.strictCreate=(e,t)=>new $t({shape:()=>e,unknownKeys:"strict",catchall:ai.create(),typeName:le.ZodObject,..._e(t)});$t.lazycreate=(e,t)=>new $t({shape:e,unknownKeys:"strip",catchall:ai.create(),typeName:le.ZodObject,..._e(t)});dd=class dd 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 Xr(s.ctx.common.issues));return z(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 Xr(a));return z(t,{code:j.invalid_union,unionErrors:s}),ce}}get options(){return this._def.options}};dd.create=(e,t)=>new dd({options:e,typeName:le.ZodUnion,..._e(t)});nw=class nw extends Re{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return z(t,{code:j.invalid_type,expected:H.object,received:t.parsedType}),ce;let r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);if(!o)return z(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=ii(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 nw({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._e(r)})}};fd=class fd extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(o,i)=>{if(Zv(o)||Zv(i))return ce;let s=rw(o.value,i.value);if(!s.valid)return z(r,{code:j.invalid_intersection_types}),ce;if(Qv(o)||Qv(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}))}};fd.create=(e,t,r)=>new fd({left:e,right:t,typeName:le.ZodIntersection,..._e(r)});ci=class ci extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==H.array)return z(r,{code:j.invalid_type,expected:H.array,received:r.parsedType}),ce;if(r.data.length<this._def.items.length)return z(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)z(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 jn(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 ci({...this._def,rest:e})}};ci.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:e,typeName:le.ZodTuple,rest:null,..._e(t)})};wh=class wh 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!==H.object)return z(r,{code:j.invalid_type,expected:H.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 jn(r,s,r.path,s)),value:i._parse(new jn(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 wh({keyType:e,valueType:t,typeName:le.ZodRecord,..._e(r)});return new wh({keyType:si.create(),valueType:e,typeName:le.ZodRecord,..._e(t)})}};Dh=class Dh 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!==H.map)return z(r,{code:j.invalid_type,expected:H.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 jn(r,s,r.path,[c,"key"])),value:o._parse(new jn(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}}}};Dh.create=(e,t,r)=>new Dh({valueType:t,keyType:e,typeName:le.ZodMap,..._e(r)});Vc=class Vc extends Re{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==H.set)return z(r,{code:j.invalid_type,expected:H.set,received:r.parsedType}),ce;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)z(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)z(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 jn(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 Vc({...this._def,minSize:{value:e,message:ee.toString(t)}})}max(e,t){return new Vc({...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)}};Vc.create=(e,t)=>new Vc({valueType:e,minSize:null,maxSize:null,typeName:le.ZodSet,..._e(t)});ad=class ad extends Re{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return z(t,{code:j.invalid_type,expected:H.function,received:t.parsedType}),ce;function r(s,a){return yh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,id(),ls].filter((c)=>!!c),issueData:{code:j.invalid_arguments,argumentsError:a}})}function n(s,a){return yh({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,id(),ls].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 Gc){let s=this;return xr(async function(...a){let c=new Xr([]),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 xr(function(...a){let c=s._def.args.safeParse(a,o);if(!c.success)throw new Xr([r(a,c.error)]);let u=Reflect.apply(i,this,c.data),d=s._def.returns.safeParse(u,o);if(!d.success)throw new Xr([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ad({...this._def,args:ci.create(e).rest(ia.create())})}returns(e){return new ad({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ad({args:e?e:ci.create([]).rest(ia.create()),returns:t||ia.create(),typeName:le.ZodFunction,..._e(r)})}};pd=class pd 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})}};pd.create=(e,t)=>new pd({getter:e,typeName:le.ZodLazy,..._e(t)});md=class md extends Re{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return z(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}};md.create=(e,t)=>new md({value:e,typeName:le.ZodLiteral,..._e(t)});sa=class sa extends Re{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return z(t,{expected:Ne.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 z(t,{received:t.data,code:j.invalid_enum_value,options:r}),ce}return xr(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 sa.create(e,{...this._def,...t})}exclude(e,t=this._def){return sa.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};sa.create=Jj;hd=class hd extends Re{_parse(e){let t=Ne.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==H.string&&r.parsedType!==H.number){let n=Ne.objectValues(t);return z(r,{expected:Ne.joinValues(n),received:r.parsedType,code:j.invalid_type}),ce}if(!this._cache)this._cache=new Set(Ne.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=Ne.objectValues(t);return z(r,{received:r.data,code:j.invalid_enum_value,options:n}),ce}return xr(e.data)}get enum(){return this._def.values}};hd.create=(e,t)=>new hd({values:e,typeName:le.ZodNativeEnum,..._e(t)});Gc=class Gc extends Re{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.promise&&t.common.async===!1)return z(t,{code:j.invalid_type,expected:H.promise,received:t.parsedType}),ce;let r=t.parsedType===H.promise?t.data:Promise.resolve(t.data);return xr(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Gc.create=(e,t)=>new Gc({type:e,typeName:le.ZodPromise,..._e(t)});So=class So 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(z(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 Lc(a.value);if(t.value==="dirty")return Lc(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 Lc(s.value);if(t.value==="dirty")return Lc(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(!oa(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(!oa(i))return ce;return Promise.resolve(n.transform(i.value,o)).then((s)=>({status:t.value,value:s}))});Ne.assertNever(n)}};So.create=(e,t,r)=>new So({schema:e,typeName:le.ZodEffects,effect:t,..._e(r)});So.createWithPreprocess=(e,t,r)=>new So({schema:t,effect:{type:"preprocess",transform:e},typeName:le.ZodEffects,..._e(r)});Eo=class Eo extends Re{_parse(e){if(this._getType(e)===H.undefined)return xr(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Eo.create=(e,t)=>new Eo({innerType:e,typeName:le.ZodOptional,..._e(t)});us=class us extends Re{_parse(e){if(this._getType(e)===H.null)return xr(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};us.create=(e,t)=>new us({innerType:e,typeName:le.ZodNullable,..._e(t)});gd=class gd extends Re{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===H.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};gd.create=(e,t)=>new gd({innerType:e,typeName:le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,..._e(t)});yd=class yd 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(sd(n))return n.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xr(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Xr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};yd.create=(e,t)=>new yd({innerType:e,typeName:le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,..._e(t)});Eh=class Eh extends Re{_parse(e){if(this._getType(e)!==H.nan){let r=this._getOrReturnCtx(e);return z(r,{code:j.invalid_type,expected:H.nan,received:r.parsedType}),ce}return{status:"valid",value:e.data}}};Eh.create=(e)=>new Eh({typeName:le.ZodNaN,..._e(e)});Qot=Symbol("zod_brand");ow=class ow 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}};Sh=class Sh 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(),Lc(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 Sh({in:e,out:t,typeName:le.ZodPipeline})}};xd=class xd extends Re{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(oa(n))n.value=Object.freeze(n.value);return n};return sd(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};xd.create=(e,t)=>new xd({innerType:e,typeName:le.ZodReadonly,..._e(t)});eit={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={}));v=si.create,R=Uc.create,tit=Eh.create,rit=zc.create,Ce=xh.create,nit=cd.create,oit=bh.create,iit=ld.create,sit=ud.create,ait=_h.create,bd=ia.create,cit=ai.create,lit=vh.create,oe=Do.create,U=$t.create,uit=$t.strictCreate,_d=dd.create,iw=nw.create,dit=fd.create,fit=ci.create,Hc=wh.create,pit=Dh.create,mit=Vc.create,hit=ad.create,git=pd.create,ze=md.create,et=sa.create,yit=hd.create,xit=Gc.create,bit=So.create,_it=Eo.create,vit=us.create,wit=So.createWithPreprocess,Dit=Sh.create});var sw=O(()=>{gh();ew();Gj();od();Xj();hh()});var Qr=O(()=>{sw();sw()});function DSe(e){return e.startsWith("v")?e:`v${e}`}var vSe,wSe,Zj,Iit;var aw=O(()=>{Qr();vSe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,wSe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;Zj=v().regex(vSe,"must be a semver version, optionally v-prefixed").transform(DSe),Iit=v().regex(wSe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function cw(e){return $h.includes(e)}var ESe,vd,$h,Qj,SSe,eq,$Se,tq,CSe,kSe,rq,RSe,nq,jit,qit,oq,ASe,iq,OSe,sq,lw=20,uw=500,FSe,Mit;var wd=O(()=>{Qr();ESe=et(["pending","verified","approved","revoked"]),vd=et(["person","service","test"]),$h=vd.options;Qj={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"},SSe=et(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),eq=SSe.options,$Se=et(["active","pending","revoked"]),tq=U({field:v(),blocks:oe(v()).optional(),set_on:oe(v()).optional()}).passthrough(),CSe=U({id:R().int(),username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),orcid:v().nullable().optional(),created_at:v().optional(),approved_at:v().nullable().optional(),dataset_count:R().int().optional(),sandbox_completed:Ce().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),service_access:Ce().optional(),status:ESe.optional(),email_verified:Ce().optional(),orcid_verified:Ce().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:oe(tq).optional(),username_auto_assigned:Ce().optional(),account_kind:vd.optional()}).passthrough(),kSe=U({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),rq=U({user:CSe,token:kSe.optional()}).passthrough(),RSe=U({id:R().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),email_verified:R().int().nullable().optional(),role:v().nullable(),created_at:v(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),signup_source:v().nullable().optional(),service_access:R().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),orcid:v().nullable().optional(),upload_access_requested_at:v().nullable().optional(),account_kind:vd.optional()}).passthrough(),nq=U({users:oe(RSe),count:R().int()}).passthrough(),jit=et(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),qit=et(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),oq=U({suggestion:v().nullable(),based_on:et(["name","unavailable","exhausted"])}).passthrough(),ASe=et(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),iq=ASe.options,OSe=et(["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"]),sq=OSe.options,FSe=U({id:R().int(),email:v(),username:v().nullable(),role:v(),status:$Se,email_verified:Ce(),given_name:v().nullable(),family_name:v().nullable(),orcid:v().nullable(),orcid_verified:Ce(),github_username:v().nullable(),city:v().nullable(),country:v().nullable(),affiliation:v().nullable(),service_access:Ce(),service_access_granted_at:v().nullable(),upload_access_requested_at:v().nullable(),profile_gaps:oe(tq),username_auto_assigned:Ce()}).passthrough(),Mit=U({user:FSe.nullable()}).passthrough()});function cq(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 lq(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 PSe="0.4.0",dw,Wc,aq,ISe,TSe,NSe,uq,zit,dq,Vit,li,jSe,Ch,Git;var fw=O(()=>{Qr();aw();dw=et(["openneuro","nemar","gin","other"]),Wc=_d([ze(0),ze(1)]).nullable(),aq=U({dataset_id:v(),id:v().optional(),name:v(),description:v().nullable().optional(),status:v(),visibility:v(),concept_doi:v().nullable().optional(),doi:v().nullable().optional(),created_at:v(),updated_at:v().optional(),owner_username:v().nullable().optional(),source:v().nullable().optional(),modalities:v().optional(),participants:R().int().nonnegative(),tasks:v().optional(),authors:v().optional(),license:v().optional(),file_size:R().nonnegative(),file_size_formatted:v().optional(),total_files:R().nonnegative().nullable().optional(),num_citations:R().int().nonnegative().optional(),n_channels:R().int().nullable().optional(),electrode_system:v().nullable().optional(),has_hed:Wc.optional(),hed_version:v().nullable().optional(),data_complete:Wc.optional(),bytes_present:R().nonnegative().nullable().optional(),latest_version:Zj.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:v().nullable().optional(),zarr_status:et(["pending","ready","failed"]).nullable().optional(),zarr_store_count:R().int().nullable().optional(),zarr_converted_at:v().nullable().optional(),zarr_source_commit:v().nullable().optional(),zarr_errors:R().int().nullable().optional(),zarr_failure_count:R().int().nullable().optional(),zarr_deterministic:Wc.optional(),zarr_failed_at:v().nullable().optional(),zarr_index_url:v().nullable().optional(),zarr_verify_status:et(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:v().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:v().nullable().optional(),placement_scheme:v().nullable().optional()}).passthrough();ISe=aq.superRefine((e,t)=>{cq(e,t),lq(e,t)}),TSe=aq.extend({file_size:R().nonnegative().nullable(),file_size_formatted:v().nullable().optional(),modalities:v().nullable().optional(),tasks:v().nullable().optional(),authors:v().nullable().optional(),license:v().nullable().optional(),owner_github:v().nullable().optional(),attestation_deposit_type:et(["owner","redistribution"]).nullable().optional(),attestation_key_status:et(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Wc.optional(),attestation_no_duplicate:Wc.optional(),attestation_upstream_source:v().nullable().optional(),attestation_accepted_at:v().nullable().optional(),zarr_data_failures:U({count:R().int().nonnegative(),detail_ref:v(),compacted_by:v().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)=>{cq(e,t),lq(e,t)}),NSe=U({id:v(),name:v(),modalities:v().nullable().optional(),participants:R().int().nullable().optional(),doi:v().nullable().optional(),tasks:v().nullable().optional(),authors:v().nullable().optional(),has_hed:Wc.optional(),score:R().optional(),snippet:v().optional()}).passthrough(),uq=Hc(v(),R().int().nonnegative()),zit=U({datasets:oe(ISe),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:uq.optional()}).passthrough(),dq=U({results:oe(NSe),count:R().int().nonnegative(),returned:R().int().nonnegative().optional(),offset:R().int().nonnegative().optional(),limit:R().int().optional(),candidate_ceiling:R().int().optional(),truncated:Ce().optional(),method:et(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:R().optional(),warning:v().optional(),excluded_unknown:R().int().nonnegative().optional(),excluded_unknown_by_facet:uq.optional()}).passthrough(),Vit=U({dataset:TSe}).passthrough(),li=U({value:v(),count:R().int().nonnegative()}),jSe=U({values:oe(li),distinct_total:R().int().nonnegative(),truncated:Ce()}),Ch=U({"electrode-system":oe(li).optional(),source:oe(li).optional(),zarr:oe(li).optional(),powerline:oe(li).optional(),"bids-version":oe(li).optional(),"hed-version":oe(li).optional(),license:oe(li).optional(),modality:oe(li).optional(),task:jSe.optional(),warning:v().optional()}).passthrough(),Git=U({schema_version:ze(PSe),doc_type:ze("dataset"),dataset_id:v().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:v(),source:dw,recording_modality:oe(v()).min(1),description:v().nullable().optional(),bids_version:v().nullable().optional(),license:v().nullable().optional()}).passthrough()});var qSe,Kit,Yit,Jit,Xit;var fq=O(()=>{Qr();qSe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Kit=v().regex(qSe,"ORCID must be in format 0000-0000-0000-000X"),Yit=et(["found","no_public_name","lookup_failed"]),Jit=et(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","anonymous_deposit"]),Xit=et(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var MSe,pq,Dd="https://nemar.org/settings",est,LSe,BSe,USe,mq,hq;var pw=O(()=>{Qr();MSe=et(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),pq=MSe.options,est={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, ${Dd}).`,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, ${Dd}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Dd}), 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, ${Dd}).`,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, ${Dd}).`,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."},LSe=et(["orcid","email","github"]),BSe=U({id:R().int(),username:v().nullable(),email:v(),created_at:v(),has_oauth_identity:Ce(),dataset_count:R().int(),identity_conflict:R().int(),canonical:Ce()}).passthrough(),USe=U({kind:LSe,value:v(),canonical_user_id:R().int(),accounts:oe(BSe)}).passthrough(),mq=U({groups:oe(USe),group_count:R().int(),flagged_count:R().int()}).passthrough(),hq=U({ok:ze(!0),id:R().int(),cleared:Ce()}).passthrough()});var mw=120,gq=64,hw="unnamed machine",zSe=25,kh,yq,Kc,xq,nst,ost,bq,VSe,GSe,_q,gw,vq,ist,sst,Rh,Ah;var Oh=O(()=>{Qr();kh=et(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),yq={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."},Kc=et(["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"]),xq=Kc.options,nst={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 ${zSe} 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."},ost=U({error:Kc,message:v()}).passthrough(),bq=U({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:R().int(),interval:R().int()}).passthrough(),VSe=iw("error",[U({error:ze("authorization_pending"),message:v()}).passthrough(),U({error:ze("slow_down"),message:v()}).passthrough()]),GSe=iw("error",[U({error:ze("expired_token"),reason:Kc,message:v()}).passthrough(),U({error:ze("access_denied"),reason:Kc,message:v()}).passthrough(),U({error:ze("invalid_grant"),reason:Kc,message:v()}).passthrough()]),_q=_d([VSe,GSe]),gw=U({id:R().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ce()}).passthrough(),vq=U({api_key:v(),key:gw,user:U({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ce(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),ist=U({user_code:v(),machine_name:v(),requested_at:v(),expires_in:R().int(),account:U({username:v().nullable(),email_masked:v()}).passthrough(),refusal:U({code:Kc,message:v()}).passthrough().nullable()}).passthrough(),sst=U({ok:ze(!0),machine_name:v()}).passthrough(),Rh=U({keys:oe(gw)}).passthrough(),Ah=U({api_key:v(),key:gw}).passthrough()});function Ft(e){return Ct[e]}function ui(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Ct;var Yc=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 WSe(e){return e==="verified"||e==="upload_access"||e==="publication"}function Jc(e){return(e??"").trim().length===0}function KSe(e){return e==="service"||e==="test"}function Eq(e,t={}){let r=t.orcidVerified===!0,n=Object.hasOwn(Fh,e)?Fh[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 wq(e){let t=yw.indexOf(e);return t===-1?yw.length:t}function Sq(e,t={}){return e.map((r)=>Eq(r,{orcidVerified:t.orcidVerified}))}function Ph(e,t={}){return e.filter((r)=>!!r&&typeof r.field==="string").map((r)=>{let n=Array.isArray(r.blocks)?r.blocks.filter(WSe):[];return Eq(r.field,{orcidVerified:t.orcidVerified,blocks:n.length>0?n:void 0})}).sort((r,n)=>wq(r.field)-wq(n.field))}function xw(e){let t=e.blocks[0],r=t?Ct[HSe[t]]:Ct["gap.blocks.unknown"],n=ui(Ct["gap.sentence"],{label:"",blocks:r}).trimStart(),o=e.setOnCli?ui(Ct["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):ui(Ct["gap.set_on.web"],{web:e.setOnWeb});return`${n} ${o}`}function $q(e){return`${e.label} ${xw(e)}`}function Ih(){let e=ui(Ct["gap.sentence"],{label:Dq.label,blocks:Ct["cli.gap.blocks.sandbox"]}),t=ui(Ct["cli.gap.set_on.cli_only"],{cli:Dq.command});return`${e} ${t}`}function Cq(){return Ct["cli.gaps.sandbox_unchecked"]}var Fh,yw,ust,HSe,Dq;var Xc=O(()=>{Yc();Fh={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&&Jc(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)=>Jc(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)=>Jc(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&&!KSe(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)=>Jc(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)=>Jc(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)=>Jc(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}},yw=Object.keys(Fh),ust=yw.filter((e)=>Fh[e].isMissing!==null),HSe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Dq={field:"sandbox",label:Ct["cli.gap.field.sandbox.label"],command:Ct["cli.gap.field.sandbox.set_on.cli"]}});function qh(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 br,Th,kq,Nh,jh,YSe,JSe,XSe,ZSe,QSe,pst,e$e,mst,t$e,hst;var bw=O(()=>{Qr();br=/^[a-z]{2}[0-9]{6}$/,Th=/^[0-9a-f]{40}$/,kq=U({name:v(),modality:v().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(),Nh=U({converted:R().int().nonnegative().optional(),relabelled:R().int().nonnegative().optional(),kept_importer_unit:R().int().nonnegative().optional(),units_column_present:Ce().optional(),sidecar:v().optional(),sidecar_supplied:Ce().optional()}).passthrough(),jh=U({applied:Ce().optional(),method:v().optional(),calibration:v().optional(),cross_talk:v().optional(),mne_version:v().optional()}).passthrough();YSe=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr"),updated_utc:v().optional(),source_tree:ze("raw"),derived:Ce(),modalities:oe(v()).optional(),groups:oe(kq).optional(),power_line_frequency:R().nullable().optional(),event_description_count:R().int().nonnegative().optional(),n_events:R().int().nonnegative().optional(),trial_types:Hc(v(),R().int().nonnegative()).optional(),units_report:Nh.optional(),channels_tsv_read_error:Ce().optional(),split_members:oe(v()).optional(),sss:jh.optional()}).passthrough().superRefine(qh),JSe=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr").optional(),code:v(),reason:v(),detail:v().nullable().optional(),attempts:R().int().nonnegative().optional()}).passthrough(),XSe=et(["infra_failure","memory_budget","not_attempted"]),ZSe=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr"),reason:XSe,attempts:R().int().nonnegative(),last_error:v().nullable().optional(),last_attempt_utc:v().nullable().optional()}).passthrough(),QSe=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(),pst=U({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:v().regex(br,"NEMAR dataset id (nm/on/xx band)"),contract_base:v().regex(/^https:\/\//,"must be https"),data_base:v().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:v().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:v().min(1),s3_anonymous:Ce(),source_commit:v().regex(Th,"must be a full 40-hex SHA"),engine_version:v().min(1),biosigio_version:v().nullable().optional(),updated_utc:v(),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(YSe),failures:oe(JSe),pending:oe(ZSe),doi:v().nullable().optional(),license:v().nullable().optional(),citation:v().nullable().optional(),hed_version:v().nullable().optional(),events_parquet:v().regex(/^https:\/\//,"must be https").optional(),events_row_count:R().int().nonnegative().optional(),layout:QSe}).passthrough(),e$e=U({name:v(),configuration:Hc(v(),bd()).optional()}).passthrough(),mst=U({zarr_format:ze(3),node_type:ze("array"),shape:oe(R().int().nonnegative()),data_type:v(),chunk_grid:U({name:v(),configuration:Hc(v(),bd()).optional()}).passthrough(),codecs:oe(e$e),fill_value:bd().optional(),attributes:Hc(v(),bd()).optional(),dimension_names:oe(v().nullable()).optional()}).passthrough(),t$e=U({path:v(),zarr:v().regex(/\.zarr$/,"must end in .zarr"),groups:oe(kq).optional(),modalities:oe(v()).optional()}).passthrough(),hst=U({format:ze("nemar-zarr-index"),format_version:R().int(),dataset_id:v().regex(br,"NEMAR dataset id (nm/on/xx band)"),source_commit:v(),stores:oe(t$e)}).passthrough()});var r$e,bst,n$e,Oq,Ed,Rq,o$e,Fq,i$e=20,s$e=100,_st,a$e,vst,wst,c$e,l$e,u$e,Dst,d$e=50,f$e=500,Est,p$e,m$e,Sst,h$e=1000,g$e=5000,$st,y$e,Cst,x$e=800,b$e=4000,kst,Rst,_w=60,vw=64,Aq,_$e=86400,v$e=4096,Ast,w$e,D$e,Ost;var Pq=O(()=>{Qr();bw();r$e=U({dataset_id:v().regex(br),name:v(),doi:v().nullable().optional(),license:v().nullable().optional(),modalities:oe(v()).optional(),tasks:oe(v()).optional(),subject_count:R().int().nonnegative().nullable().optional(),has_hed:_d([ze(0),ze(1)]).nullable().optional(),hed_version:v().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:v().nullable().optional(),zarr_source_commit:v().nullable().optional(),zarr_errors:R().int().nonnegative().nullable().optional(),zarr_verify_status:et(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:v().nullable().optional(),index_url:v().nullable().optional()}).passthrough(),bst=U({format:ze("nemar-zarr-catalog"),format_version:R().int(),generated_utc:v(),contract_base:v(),count:R().int().nonnegative(),datasets:oe(r$e)}).passthrough(),n$e=["verified","failed","unverifiable"],Oq=et(n$e).nullable(),Ed=U({dataset_id:v().regex(br),doi:v().nullable(),license:v().nullable(),citation:v().nullable(),source_commit:v().regex(Th),index_etag:v().nullable(),engine_version:v(),source_tree:ze("raw"),derived:Ce(),sss:jh.optional(),lossy:Ce(),dtype:v().nullable(),effective_rate_hz:R().nullable(),source_rate_hz:R().nullable(),units_report:Nh.nullable().optional(),zarr_verify_status:Oq,note:v().nullable().optional()}).passthrough().superRefine(qh),Rq=U({start:R().int().nonnegative(),end:R().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),o$e=U({python_zarr:v(),zarrita:v()}).passthrough(),Fq=U({contract_base:v(),data_base:v(),s3_uri:v(),s3_region:v(),s3_anonymous:Ce(),zarr:v(),group:v(),level:_d([ze("0"),R().int().positive()]),array_path:v(),dtype:v().nullable(),codecs:oe(bd()).optional(),chunk_samples:R().int().positive().nullable(),shard_samples:R().int().positive().nullable(),n_channels:R().int().nonnegative().nullable(),sample_slice:Rq.optional(),channel_slice:Rq.optional(),scale_offset:v(),how_to:o$e}).passthrough(),_st=U({query:v().optional(),modality:v().optional(),task:v().optional(),has_hed:Ce().optional(),has_zarr:Ce().optional(),limit:R().int().positive().max(s$e).default(i$e)}).passthrough(),a$e=U({dataset_id:v().regex(br),name:v(),doi:v().nullable().optional(),license:v().nullable().optional(),modalities:oe(v()).optional(),tasks:oe(v()).optional(),subject_count:R().int().nullable().optional(),has_hed:Ce().nullable().optional(),has_zarr:Ce()}).passthrough(),vst=U({results:oe(a$e),count:R().int().nonnegative(),limit:R().int(),note:v().nullable().optional(),truncated:Ce().optional()}).passthrough(),wst=U({dataset_id:v().regex(br)}).passthrough(),c$e=["list_recordings","get_events","render_overview","read_window"],l$e=U({next_cheapest_tool:et(c$e),reason:v()}).passthrough(),u$e=["pending","ready","failed"],Dst=U({dataset_id:v().regex(br),name:v(),doi:v().nullable(),license:v().nullable(),citation:v().nullable(),modalities:oe(v()).optional(),tasks:oe(v()).optional(),subject_count:R().int().nullable().optional(),has_hed:Ce().nullable().optional(),hed_version:v().nullable().optional(),recording_count:R().int().nullable().optional(),total_recording_duration_s:R().nullable().optional(),zarr_status:et(u$e).nullable().optional(),zarr_verify_status:Oq.optional(),zarr_source_commit:v().nullable().optional(),zarr_store_count:R().int().nullable().optional(),cost_hint:l$e}).passthrough(),Est=U({dataset_id:v().regex(br),modality:v().optional(),min_duration_s:R().nonnegative().optional(),include_derived:Ce().default(!1),limit:R().int().positive().max(f$e).default(d$e),offset:R().int().nonnegative().default(0)}).passthrough(),p$e=U({name:v(),modality:v().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(),m$e=U({path:v(),zarr:v(),source_tree:ze("raw"),derived:Ce(),groups:oe(p$e).optional(),n_events:R().int().nonnegative().optional(),sss:jh.optional(),units_report:Nh.optional()}).passthrough().superRefine(qh),Sst=U({dataset_id:v().regex(br),source_commit:v().regex(Th).nullable(),recordings:oe(m$e),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:v().nullable().optional(),envelope:Ed.optional()}).passthrough(),$st=U({dataset_id:v().regex(br),recording:v(),group:v().optional(),limit:R().int().positive().max(g$e).default(h$e),offset:R().int().nonnegative().default(0)}).passthrough(),y$e=U({store_path:v(),group_name:v(),onset_s:R(),duration_s:R().nullable().optional(),sample_index:R().int().nonnegative(),trial_type:v().nullable().optional(),value:_d([v(),R()]).nullable().optional(),hed:v().nullable().optional()}).passthrough(),Cst=U({dataset_id:v().regex(br),recording:v(),events:oe(y$e),source:et(["events_parquet","events_tsv_fallback"]),estimated:Ce(),total_count:R().int().nonnegative(),limit:R().int(),offset:R().int(),truncated:Ce(),note:v().nullable().optional(),envelope:Ed.optional()}).passthrough(),kst=U({dataset_id:v().regex(br),recording:v(),group:v().optional(),width_px:R().int().positive().max(b$e).default(x$e)}).passthrough(),Rst=U({dataset_id:v().regex(br),recording:v(),group:v(),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:Ed.optional()}).passthrough(),Aq=_w*vw,Ast=U({dataset_id:v().regex(br),recording:v(),group:v().optional(),start_s:R().nonnegative().default(0),duration_s:R().positive().max(_$e).default(10),channels:oe(R().int().nonnegative()).max(v$e).optional(),taste:Ce().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>_w)t.addIssue({code:j.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${_w} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>vw)t.addIssue({code:j.custom,message:`taste channels (${e.channels.length}) exceeds the ${vw}-channel cap; omit taste for a recipe instead`,path:["channels"]});let r=e.duration_s*e.channels.length;if(r>Aq)t.addIssue({code:j.custom,message:`taste exceeds the cap of ${Aq} channel-seconds (duration_s x channels = ${r}); omit taste for a recipe instead`,path:["duration_s"]})}),w$e=U({mode:ze("recipe"),recipe:Fq,envelope:Ed}).passthrough(),D$e=U({mode:ze("taste"),start_s:R(),duration_s:R(),channels:oe(R().int()),sample_rate_hz:R(),values:oe(oe(R())),recipe:Fq,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:v().nullable().optional(),envelope:Ed}).passthrough(),Ost=iw("mode",[w$e,D$e])});var Zc=O(()=>{aw();wd();fw();fq();pw();Oh();Yc();Xc();bw();Pq()});function Mh(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(ww.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(ww.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"&&!E$e.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(ww.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function Dw(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 Iq(e,t){if(Dw(e,t))throw Error("Cannot use string index")}function Tq(e,t,r){if(!aa(e)||typeof t!=="string")return r===void 0?e:r;let n=Mh(t);if(n.length===0)return r;for(let o=0;o<n.length;o++){let i=n[o];if(Dw(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 Ew(e,t,r){if(!aa(e)||typeof t!=="string")return e;let n=e,o=Mh(t);for(let i=0;i<o.length;i++){let s=o[i];if(Iq(e,s),i===o.length-1)e[s]=r;else if(!aa(e[s]))e[s]=typeof o[i+1]==="number"?[]:{};e=e[s]}return n}function Nq(e,t){if(!aa(e)||typeof t!=="string")return!1;let r=Mh(t);for(let n=0;n<r.length;n++){let o=r[n];if(Iq(e,o),n===r.length-1)return delete e[o],!0;if(e=e[o],!aa(e))return!1}}function jq(e,t){if(!aa(e)||typeof t!=="string")return!1;let r=Mh(t);if(r.length===0)return!1;for(let n of r){if(!aa(e)||!(n in e)||Dw(e,n))return!1;e=e[n]}return!0}var aa=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},ww,E$e;var qq=O(()=>{ww=new Set(["__proto__","prototype","constructor"]),E$e=new Set("0123456789")});import vt from"path";import Mq from"os";import Sw from"process";function Cw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Sw.platform==="darwin")return S$e(e);if(Sw.platform==="win32")return $$e(e);return C$e(e)}var ds,$w,Qc,S$e=(e)=>{let t=vt.join(ds,"Library");return{data:vt.join(t,"Application Support",e),config:vt.join(t,"Preferences",e),cache:vt.join(t,"Caches",e),log:vt.join(t,"Logs",e),temp:vt.join($w,e)}},$$e=(e)=>{let t=Qc.APPDATA||vt.join(ds,"AppData","Roaming"),r=Qc.LOCALAPPDATA||vt.join(ds,"AppData","Local");return{data:vt.join(r,e,"Data"),config:vt.join(t,e,"Config"),cache:vt.join(r,e,"Cache"),log:vt.join(r,e,"Log"),temp:vt.join($w,e)}},C$e=(e)=>{let t=vt.basename(ds);return{data:vt.join(Qc.XDG_DATA_HOME||vt.join(ds,".local","share"),e),config:vt.join(Qc.XDG_CONFIG_HOME||vt.join(ds,".config"),e),cache:vt.join(Qc.XDG_CACHE_HOME||vt.join(ds,".cache"),e),log:vt.join(Qc.XDG_STATE_HOME||vt.join(ds,".local","state"),e),temp:vt.join($w,t,e)}};var Lq=O(()=>{ds=Mq.homedir(),$w=Mq.tmpdir(),{env:Qc}=Sw});var k$e=(e,t)=>{let{onError:r}=t;return function(...o){return e.apply(void 0,o).catch(r)}},$o;var Bq=O(()=>{$o=k$e});var R$e=(e,t)=>{let{onError:r}=t;return function(...o){try{return e.apply(void 0,o)}catch(i){return r(i)}}},qn;var Uq=O(()=>{qn=R$e});var zq=250;var Vq=()=>{};var A$e=(e,t)=>{let{isRetriable:r}=t;return function(o){let{timeout:i}=o,s=o.interval??zq,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)})}}},Co;var Gq=O(()=>{Vq();Co=A$e});var O$e=(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}}}},ko;var Hq=O(()=>{ko=O$e});var kw=O(()=>{Bq();Uq();Gq();Hq()});var Sd,Rw;var Wq=O(()=>{Aw();Sd={isChangeErrorOk:(e)=>{if(!Sd.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Kq&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Sd.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(!Sd.isNodeError(e))throw e;if(Sd.isChangeErrorOk(e))return;throw e}},Rw=Sd});import Yq from"process";var $d,Tr,Kq,Xt;var Aw=O(()=>{Wq();$d={onError:Rw.onChangeError},Tr={onError:()=>{return}},Kq=Yq.getuid?!Yq.getuid():!1,Xt={isRetriable:Rw.isRetriableError}});import Ke from"fs";import{promisify as sr}from"util";var F$e,Vt;var Ow=O(()=>{kw();kw();Aw();F$e={attempt:{chmod:$o(sr(Ke.chmod),$d),chown:$o(sr(Ke.chown),$d),close:$o(sr(Ke.close),Tr),fsync:$o(sr(Ke.fsync),Tr),mkdir:$o(sr(Ke.mkdir),Tr),realpath:$o(sr(Ke.realpath),Tr),stat:$o(sr(Ke.stat),Tr),unlink:$o(sr(Ke.unlink),Tr),chmodSync:qn(Ke.chmodSync,$d),chownSync:qn(Ke.chownSync,$d),closeSync:qn(Ke.closeSync,Tr),existsSync:qn(Ke.existsSync,Tr),fsyncSync:qn(Ke.fsync,Tr),mkdirSync:qn(Ke.mkdirSync,Tr),realpathSync:qn(Ke.realpathSync,Tr),statSync:qn(Ke.statSync,Tr),unlinkSync:qn(Ke.unlinkSync,Tr)},retry:{close:Co(sr(Ke.close),Xt),fsync:Co(sr(Ke.fsync),Xt),open:Co(sr(Ke.open),Xt),readFile:Co(sr(Ke.readFile),Xt),rename:Co(sr(Ke.rename),Xt),stat:Co(sr(Ke.stat),Xt),write:Co(sr(Ke.write),Xt),writeFile:Co(sr(Ke.writeFile),Xt),closeSync:ko(Ke.closeSync,Xt),fsyncSync:ko(Ke.fsyncSync,Xt),openSync:ko(Ke.openSync,Xt),readFileSync:ko(Ke.readFileSync,Xt),renameSync:ko(Ke.renameSync,Xt),statSync:ko(Ke.statSync,Xt),writeSync:ko(Ke.writeSync,Xt),writeFileSync:ko(Ke.writeFileSync,Xt)}},Vt=F$e});import ca from"process";var Jq="utf8",Fw=438,Xq=511,Zq,Qq,e9,t9=1000,r9,xat,Pw=128;var Iw=O(()=>{Zq={},Qq=ca.geteuid?ca.geteuid():-1,e9=ca.getegid?ca.getegid():-1,r9=!!ca.getuid,xat=ca.getuid?!ca.getuid():!1});var n9=(e)=>e instanceof Error&&("code"in e),Tw=(e)=>typeof e==="string",Lh=(e)=>e===void 0;var o9=()=>{};var i9=()=>{};import s9 from"process";var a9,Bh;var Nw=O(()=>{a9=s9.platform==="linux",Bh=s9.platform==="win32"});var jw,c9;var l9=O(()=>{Nw();jw=["SIGHUP","SIGINT","SIGTERM"];if(!Bh)jw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(a9)jw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");c9=jw});import el from"process";class u9{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(Bh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))el.kill(el.pid,"SIGTERM");else el.kill(el.pid,e)},this.hook=()=>{el.once("exit",()=>this.exit());for(let e of c9)try{el.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var d9;var f9=O(()=>{Nw();l9();d9=new u9});var P$e,p9;var m9=O(()=>{f9();P$e=d9.register,p9=P$e});import I$e from"path";var en,Cd;var h9=O(()=>{Ow();m9();Iw();en={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=en.truncate(t(e));if(n in en.store)return en.get(e,t,r);return en.store[n]=r,[n,()=>delete en.store[n]]},purge:(e)=>{if(!en.store[e])return;delete en.store[e],Vt.attempt.unlink(e)},purgeSync:(e)=>{if(!en.store[e])return;delete en.store[e],Vt.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in en.store)en.purgeSync(e)},truncate:(e)=>{let t=I$e.basename(e);if(t.length<=Pw)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Pw;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};p9(en.purgeSyncAll);Cd=en});import T$e from"path";function qw(e,t,r=Zq){if(Tw(r))return qw(e,t,{encoding:r});let o={timeout:r.timeout??t9},i=null,s=null,a=null;try{let c=Vt.attempt.realpathSync(e),u=!!c;e=c||e,[s,i]=Cd.get(e,r.tmpCreate||Cd.create,r.tmpPurge!==!1);let d=r9&&Lh(r.chown),f=Lh(r.mode);if(u&&(d||f)){let m=Vt.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=T$e.dirname(e);Vt.attempt.mkdirSync(m,{mode:Xq,recursive:!0})}if(a=Vt.retry.openSync(o)(s,"w",r.mode||Fw),r.tmpCreated)r.tmpCreated(s);if(Tw(t))Vt.retry.writeSync(o)(a,t,0,r.encoding||Jq);else if(!Lh(t))Vt.retry.writeSync(o)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Vt.retry.fsyncSync(o)(a);else Vt.attempt.fsync(a);if(Vt.retry.closeSync(o)(a),a=null,r.chown&&(r.chown.uid!==Qq||r.chown.gid!==e9))Vt.attempt.chownSync(s,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Fw)Vt.attempt.chmodSync(s,r.mode);try{Vt.retry.renameSync(o)(s,e)}catch(m){if(!n9(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Vt.retry.renameSync(o)(s,Cd.truncate(e))}i(),s=null}finally{if(a)Vt.attempt.closeSync(a);if(s)Cd.purge(s)}}var g9=O(()=>{Ow();Iw();o9();i9();h9()});var Rd=h(function(b9){Object.defineProperty(b9,"__esModule",{value:!0});b9.regexpCode=b9.getEsmExportName=b9.getProperty=b9.safeStringify=b9.stringify=b9.strConcat=b9.addCodeArg=b9.str=b9._=b9.nil=b9._Code=b9.Name=b9.IDENTIFIER=b9._CodeOrName=void 0;class Uh{}b9._CodeOrName=Uh;b9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class tl extends Uh{constructor(e){super();if(!b9.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}}}b9.Name=tl;class Mn extends Uh{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 tl)t[r.str]=(t[r.str]||0)+1;return t},{})}}b9._Code=Mn;b9.nil=new Mn("");function y9(e,...t){let r=[e[0]],n=0;while(n<t.length)Lw(r,t[n]),r.push(e[++n]);return new Mn(r)}b9._=y9;var Mw=new Mn("+");function x9(e,...t){let r=[kd(e[0])],n=0;while(n<t.length)r.push(Mw),Lw(r,t[n]),r.push(Mw,kd(e[++n]));return N$e(r),new Mn(r)}b9.str=x9;function Lw(e,t){if(t instanceof Mn)e.push(...t._items);else if(t instanceof tl)e.push(t);else e.push(M$e(t))}b9.addCodeArg=Lw;function N$e(e){let t=1;while(t<e.length-1){if(e[t]===Mw){let r=j$e(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function j$e(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof tl||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 tl))return`"${e}${t.slice(1)}`;return}function q$e(e,t){return t.emptyStr()?e:e.emptyStr()?t:x9`${e}${t}`}b9.strConcat=q$e;function M$e(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:kd(Array.isArray(e)?e.join(","):e)}function L$e(e){return new Mn(kd(e))}b9.stringify=L$e;function kd(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}b9.safeStringify=kd;function B$e(e){return typeof e=="string"&&b9.IDENTIFIER.test(e)?new Mn(`.${e}`):y9`[${e}]`}b9.getProperty=B$e;function U$e(e){if(typeof e=="string"&&b9.IDENTIFIER.test(e))return new Mn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}b9.getEsmExportName=U$e;function z$e(e){return new Mn(e.toString())}b9.regexpCode=z$e});var Vw=h(function(D9){Object.defineProperty(D9,"__esModule",{value:!0});D9.ValueScope=D9.ValueScopeName=D9.Scope=D9.varKinds=D9.UsedValueState=void 0;var Nr=Rd();class v9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Vh;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Vh||(D9.UsedValueState=Vh={}));D9.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};class Uw{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}}}D9.Scope=Uw;class zw 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}]`}}D9.ValueScopeName=zw;var rCe=Nr._`\n`;class w9 extends Uw{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?rCe:Nr.nil}}get(){return this._scope}name(e){return new zw(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,Vh.Started);let u=t(c);if(u){let d=this.opts.es5?D9.varKinds.var:D9.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 v9(c);a.set(c,Vh.Completed)})}return o}}D9.ValueScope=w9});var ve=h(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=Rd(),Ln=Vw(),fs=Rd();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return fs._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return fs.str}});Object.defineProperty(jr,"strConcat",{enumerable:!0,get:function(){return fs.strConcat}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return fs.nil}});Object.defineProperty(jr,"getProperty",{enumerable:!0,get:function(){return fs.getProperty}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return fs.stringify}});Object.defineProperty(jr,"regexpCode",{enumerable:!0,get:function(){return fs.regexpCode}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return fs.Name}});var Jh=Vw();Object.defineProperty(jr,"Scope",{enumerable:!0,get:function(){return Jh.Scope}});Object.defineProperty(jr,"ValueScope",{enumerable:!0,get:function(){return Jh.ValueScope}});Object.defineProperty(jr,"ValueScopeName",{enumerable:!0,get:function(){return Jh.ValueScopeName}});Object.defineProperty(jr,"varKinds",{enumerable:!0,get:function(){return Jh.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 ps{optimizeNodes(){return this}optimizeNames(e,t){return this}}class S9 extends ps{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Ln.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=nl(this.rhs,e,t);return this}get names(){return this.rhs instanceof Le._CodeOrName?this.rhs.names:{}}}class Ww extends ps{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=nl(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Le.Name?{}:{...this.lhs.names};return Yh(e,this.rhs)}}class $9 extends Ww{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class C9 extends ps{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class k9 extends ps{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class R9 extends ps{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class A9 extends ps{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=nl(this.code,e,t),this}get names(){return this.code instanceof Le._CodeOrName?this.code.names:{}}}class Xh extends ps{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;sCe(e,o.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>la(e,t.names),{})}}class ms extends Xh{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class O9 extends Xh{}class Ad extends ms{}Ad.kind="else";class di extends ms{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 Ad(r):r}if(t){if(e===!1)return t instanceof di?t:t.nodes;if(this.nodes.length)return this;return new di(N9(e),t instanceof di?[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=nl(this.condition,e,t),this}get names(){let e=super.names;if(Yh(e,this.condition),this.else)la(e,this.else.names);return e}}di.kind="if";class rl extends ms{}rl.kind="for";class F9 extends rl{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=nl(this.iteration,e,t),this}get names(){return la(super.names,this.iteration.names)}}class P9 extends rl{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Ln.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=Yh(super.names,this.from);return Yh(e,this.to)}}class Gw extends rl{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=nl(this.iterable,e,t),this}get names(){return la(super.names,this.iterable.names)}}class Gh extends ms{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)}}Gh.kind="func";class Hh extends Xh{render(e){return"return "+super.render(e)}}Hh.kind="return";class I9 extends ms{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)la(e,this.catch.names);if(this.finally)la(e,this.finally.names);return e}}class Wh extends ms{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Wh.kind="catch";class Kh extends ms{render(e){return"finally"+super.render(e)}}Kh.kind="finally";class T9{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
85
85
  `:""},this._extScope=e,this._scope=new Ln.Scope({parent:e}),this._nodes=[new O9]}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 S9(e,o,r)),o}const(e,t,r){return this._def(Ln.varKinds.const,e,t,r)}let(e,t,r){return this._def(Ln.varKinds.let,e,t,r)}var(e,t,r){return this._def(Ln.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Ww(e,t,r))}add(e,t){return this._leafNode(new $9(e,jr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==Le.nil)this._leafNode(new A9(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 di(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 di(e))}else(){return this._elseNode(new Ad)}endIf(){return this._endBlockNode(di,Ad)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new F9(e),t)}forRange(e,t,r,n,o=this.opts.es5?Ln.varKinds.var:Ln.varKinds.let){let i=this._scope.toName(e);return this._for(new P9(o,i,t,r),()=>n(i))}forOf(e,t,r,n=Ln.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 Gw("of",n,o,t),()=>r(o))}forIn(e,t,r,n=this.opts.es5?Ln.varKinds.var:Ln.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 Gw("in",n,o,t),()=>r(o))}endFor(){return this._endBlockNode(rl)}label(e){return this._leafNode(new C9(e))}break(e){return this._leafNode(new k9(e))}return(e){let t=new Hh;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Hh)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new I9;if(this._blockNode(n),this.code(e),t){let o=this.name("e");this._currNode=n.catch=new Wh(o),t(o)}if(r)this._currNode=n.finally=new Kh,this.code(r);return this._endBlockNode(Wh,Kh)}throw(e){return this._leafNode(new R9(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 Gh(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Gh)}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 di))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=T9;function la(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Yh(e,t){return t instanceof Le._CodeOrName?la(e,t.names):e}function nl(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 sCe(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function N9(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Le._`!${Hw(e)}`}jr.not=N9;var aCe=j9(jr.operators.AND);function cCe(...e){return e.reduce(aCe)}jr.and=cCe;var lCe=j9(jr.operators.OR);function uCe(...e){return e.reduce(lCe)}jr.or=uCe;function j9(e){return(t,r)=>t===Le.nil?r:r===Le.nil?t:Le._`${Hw(t)} ${e} ${Hw(r)}`}function Hw(e){return e instanceof Le.Name?e:Le._`(${e})`}});var Ie=h(function(H9){Object.defineProperty(H9,"__esModule",{value:!0});H9.checkStrictMode=H9.getErrorPath=H9.Type=H9.useFunc=H9.setEvaluated=H9.evaluatedPropsToName=H9.mergeEvaluated=H9.eachItem=H9.unescapeJsonPointer=H9.escapeJsonPointer=H9.escapeFragment=H9.unescapeFragment=H9.schemaRefOrVal=H9.schemaHasRulesButRef=H9.schemaHasRules=H9.checkUnknownRules=H9.alwaysValidSchema=H9.toHash=void 0;var st=ve(),mCe=Rd();function hCe(e){let t={};for(let r of e)t[r]=!0;return t}H9.toHash=hCe;function gCe(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return B9(e,t),!U9(t,e.self.RULES.all)}H9.alwaysValidSchema=gCe;function B9(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])G9(e,`unknown keyword: "${i}"`)}H9.checkUnknownRules=B9;function U9(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}H9.schemaHasRules=U9;function yCe(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}H9.schemaHasRulesButRef=yCe;function xCe({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)}`}H9.schemaRefOrVal=xCe;function bCe(e){return z9(decodeURIComponent(e))}H9.unescapeFragment=bCe;function _Ce(e){return encodeURIComponent(Yw(e))}H9.escapeFragment=_Ce;function Yw(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}H9.escapeJsonPointer=Yw;function z9(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}H9.unescapeJsonPointer=z9;function vCe(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}H9.eachItem=vCe;function M9({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}}H9.mergeEvaluated={props:M9({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} || {}`),Jw(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:V9}),items:M9({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 V9(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",st._`{}`);if(t!==void 0)Jw(e,r,t);return r}H9.evaluatedPropsToName=V9;function Jw(e,t,r){Object.keys(r).forEach((n)=>e.assign(st._`${t}${st.getProperty(n)}`,!0))}H9.setEvaluated=Jw;var L9={};function wCe(e,t){return e.scopeValue("func",{ref:t,code:L9[t.code]||(L9[t.code]=new mCe._Code(t.code))})}H9.useFunc=wCe;var Kw;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Kw||(H9.Type=Kw={}));function DCe(e,t,r){if(e instanceof st.Name){let n=t===Kw.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():"/"+Yw(e)}H9.getErrorPath=DCe;function G9(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}H9.checkStrictMode=G9});var gn=h(function(K9){Object.defineProperty(K9,"__esModule",{value:!0});var ar=ve(),BCe={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")};K9.default=BCe});var Od=h(function(Z9){Object.defineProperty(Z9,"__esModule",{value:!0});Z9.extendErrors=Z9.resetErrorsCount=Z9.reportExtraError=Z9.reportError=Z9.keyword$DataError=Z9.keywordError=void 0;var Ve=ve(),Qh=Ie(),_r=gn();Z9.keywordError={message:({keyword:e})=>Ve.str`must pass "${e}" keyword validation`};Z9.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Ve.str`"${e}" keyword must be ${t} ($data)`:Ve.str`"${e}" keyword is invalid ($data)`};function zCe(e,t=Z9.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=X9(e,t,r);if(n!==null&&n!==void 0?n:s||a)Y9(i,c);else J9(o,Ve._`[${c}]`)}Z9.reportError=zCe;function VCe(e,t=Z9.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=X9(e,t,r);if(Y9(o,a),!(i||s))J9(n,_r.default.vErrors)}Z9.reportExtraError=VCe;function GCe(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)))}Z9.resetErrorsCount=GCe;function HCe({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)})}Z9.extendErrors=HCe;function Y9(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 J9(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 ua={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 X9(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Ve._`{}`;return WCe(e,t,r)}function WCe(e,t,r={}){let{gen:n,it:o}=e,i=[KCe(o,r),YCe(e,r)];return JCe(e,t,i),n.object(...i)}function KCe({errorPath:e},{instancePath:t}){let r=t?Ve.str`${e}${Qh.getErrorPath(t,Qh.Type.Str)}`:e;return[_r.default.instancePath,Ve.strConcat(_r.default.instancePath,r)]}function YCe({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:Ve.str`${t}/${e}`;if(r)o=Ve.str`${o}${Qh.getErrorPath(r,Qh.Type.Str)}`;return[ua.schemaPath,o]}function JCe(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([ua.keyword,o],[ua.params,typeof t=="function"?t(e):t||Ve._`{}`]),c.messages)n.push([ua.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([ua.schema,s],[ua.parentSchema,Ve._`${d}${f}`],[_r.default.data,i]);if(u)n.push([ua.propertyName,u])}});var n7=h(function(t7){Object.defineProperty(t7,"__esModule",{value:!0});t7.boolOrEmptySchema=t7.topBoolOrEmptySchema=void 0;var tke=Od(),rke=ve(),nke=gn(),oke={message:"boolean schema is false"};function ike(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)e7(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(nke.default.data);else t.assign(rke._`${n}.errors`,null),t.return(!0)}t7.topBoolOrEmptySchema=ike;function ske(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),e7(e);else r.var(t,!0)}t7.boolOrEmptySchema=ske;function e7(e,t){let{gen:r,data:n}=e;tke.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},oke,void 0,t)}});var Zw=h(function(o7){Object.defineProperty(o7,"__esModule",{value:!0});o7.getRules=o7.isJSONType=void 0;var cke=["string","number","integer","boolean","null","object","array"],lke=new Set(cke);function uke(e){return typeof e=="string"&&lke.has(e)}o7.isJSONType=uke;function dke(){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:{}}}o7.getRules=dke});var Qw=h(function(c7){Object.defineProperty(c7,"__esModule",{value:!0});c7.shouldUseRule=c7.shouldUseGroup=c7.schemaHasRulesForType=void 0;function pke({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&s7(e,n)}c7.schemaHasRulesForType=pke;function s7(e,t){return t.rules.some((r)=>a7(e,r))}c7.shouldUseGroup=s7;function a7(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))}c7.shouldUseRule=a7});var Fd=h(function(p7){Object.defineProperty(p7,"__esModule",{value:!0});p7.reportTypeError=p7.checkDataTypes=p7.checkDataType=p7.coerceAndCheckDataType=p7.getJSONTypes=p7.getSchemaTypes=p7.DataType=void 0;var gke=Zw(),yke=Qw(),xke=Od(),De=ve(),u7=Ie(),ol;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ol||(p7.DataType=ol={}));function bke(e){let t=d7(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}p7.getSchemaTypes=bke;function d7(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(gke.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}p7.getJSONTypes=d7;function _ke(e,t){let{gen:r,data:n,opts:o}=e,i=vke(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&yke.schemaHasRulesForType(e,t[0]));if(s){let a=t1(t,n,o.strictNumbers,ol.Wrong);r.if(a,()=>{if(i.length)wke(e,t,i);else r1(e)})}return s}p7.coerceAndCheckDataType=_ke;var f7=new Set(["string","number","integer","boolean","null"]);function vke(e,t){return t?e.filter((r)=>f7.has(r)||t==="array"&&r==="array"):[]}function wke(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",De._`typeof ${o}`),a=n.let("coerced",De._`undefined`);if(i.coerceTypes==="array")n.if(De._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,De._`${o}[0]`).assign(s,De._`typeof ${o}`).if(t1(t,o,i.strictNumbers),()=>n.assign(a,o)));n.if(De._`${a} !== undefined`);for(let u of r)if(f7.has(u)||u==="array"&&i.coerceTypes==="array")c(u);n.else(),r1(e),n.endIf(),n.if(De._`${a} !== undefined`,()=>{n.assign(o,a),Dke(e,a)});function c(u){switch(u){case"string":n.elseIf(De._`${s} == "number" || ${s} == "boolean"`).assign(a,De._`"" + ${o}`).elseIf(De._`${o} === null`).assign(a,De._`""`);return;case"number":n.elseIf(De._`${s} == "boolean" || ${o} === null
86
86
  || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,De._`+${o}`);return;case"integer":n.elseIf(De._`${s} === "boolean" || ${o} === null
87
87
  || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,De._`+${o}`);return;case"boolean":n.elseIf(De._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(De._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf(De._`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf(De._`${s} === "string" || ${s} === "number"
@@ -99,7 +99,7 @@ ${t}`,T2e,N2e,j2e=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=I2e.bind(nul
99
99
  `)}var ZD=!1;var{spawn:yMe}=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=yMe({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(QD()){let u=t.cwd?` (cwd=${t.cwd})`:"";Af(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(QD()){if(s.trim())Af(l.dim(s.trimEnd()));if(a.trim())Af(l.yellow(a.trimEnd()));Af(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 At=O(()=>{Xe()});function bMe(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function PK(e,t=bMe()){return e.installInstructions[t]}function _Me(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function wMe(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:vMe}async function IK(e){try{let{exitCode:t,stdout:r,timedOut:n}=await C(e.cmd,{timeout:wMe()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:_Me(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 Of(){let e=Object.entries(FK);return Promise.all(e.map(async([t,r])=>{let{available:n,version:o,timedOut:i}=await IK(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:o,timedOut:i,installInstruction:PK(r)}}))}async function TK(){let t=(await Of()).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 Sa(e){let r=xMe[e].map((s)=>FK[s]).filter(Boolean),n=await Promise.all(r.map(async(s)=>{let a=await IK(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:PK(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 FK,xMe,vMe=4000;var Ff=O(()=>{At();FK={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)"}}},xMe={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 jK;var NK=O(()=>{jK={name:"nemar-cli",version:"0.10.4-PR1410.f0a7732",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 bi;var Pf=O(()=>{NK();bi=jK.version});import{mkdirSync as EMe,readdirSync as SMe,unlinkSync as $Me,writeFileSync as CMe}from"fs";import{join as eE}from"path";function zK(){El=!0}function $a(){return El}function VK(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Tf(e){UK=e,$r(`Step: ${e}`)}function Nf(){LK=!0}function GK(){return LK}function rE(){BK=!0}function HK(){return BK}function $r(e){if(El)process.stderr.write(`[debug] ${e}
102
+ `))}var FK,xMe,vMe=4000;var Ff=O(()=>{At();FK={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)"}}},xMe={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 jK;var NK=O(()=>{jK={name:"nemar-cli",version:"0.10.4-PR1411.bc2413e",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 bi;var Pf=O(()=>{NK();bi=jK.version});import{mkdirSync as EMe,readdirSync as SMe,unlinkSync as $Me,writeFileSync as CMe}from"fs";import{join as eE}from"path";function zK(){El=!0}function $a(){return El}function VK(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Tf(e){UK=e,$r(`Step: ${e}`)}function Nf(){LK=!0}function GK(){return LK}function rE(){BK=!0}function HK(){return BK}function $r(e){if(El)process.stderr.write(`[debug] ${e}
103
103
  `)}function OMe(e){let t={};for(let[r,n]of Object.entries(e))t[r]=AMe.has(r.toLowerCase())?"[REDACTED]":n;return t}function KK(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function tE(e,t,r=0){if(r>PMe)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>tE(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[o,i]of Object.entries(t))n[o]=tE(o,i,r+1);return n}if(typeof t==="string"){if(FMe.test(e))return"[REDACTED]";return t.replace(WK,KK)}return t}function nE(e){return e.replace(IMe,"Bearer [REDACTED]").replace(TMe,"[REDACTED_AWS_KEY]").replace(NMe,"$1[REDACTED]").replace(jMe,"$1$2=[REDACTED]").replace(WK,KK)}function qMe(e){return nE(e)}function qK(e,t=RMe){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(tE("",n))}catch{}if(r=nE(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function w0(e){if(!El)return;let t=qMe(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?OMe(e.requestHeaders):void 0,requestBody:qK(e.requestBody),responseBody:qK(e.responseBody)};v0.push(r),$r(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=T(r);v0.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 MMe(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${bi}`),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 Of();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 oE(){return(await MMe()).join(`
104
104
  `)}async function YK(){if(!El||_0!==void 0)return;try{_0=await oE()}catch(e){let t=T(e);_0=`(could not build environment report: ${t})`,$r(`environment snapshot failed: ${t}`)}}function JK(e){if(MK.has(e))return{flag:e};for(let t of MK){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 LMe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=JK(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 BMe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=JK(n);if(!o){t.push(n);continue}if(!o.kind&&r+1<e.length)r++}return t}function UMe(e){let t=[];for(let n of BMe(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 zMe(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${nE(LMe(e).join(" "))}`),r.push(""),r.push(_0??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),v0.length===0)r.push(" (none)");else v0.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: ${UK??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
105
105
  `)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nemar-cli",
3
- "version": "0.10.4-PR1410.f0a7732",
3
+ "version": "0.10.4-PR1411.bc2413e",
4
4
  "description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",