nemar-cli 0.10.34-PR2162.a05e263 → 0.10.34-PR2165.9362fd9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/git-annex-remote-nemar.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ ${t}`,zM,GM,KM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=VM.bind(null,n,
|
|
|
23
23
|
`)}var Fl=!1;var{spawn:WF}=globalThis.Bun;function Vl(e,t=[]){let r=e.replace(YF,'("$1","<redacted>")');for(let n of t)if(n.length>=XF)r=r.split(n).join("<redacted>");return r}function QF(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],r=new Set;for(let n of[process.env,e??{}])for(let s of t){let o=n[s];if(typeof o==="string"&&o.length>0)r.add(o)}return[...r]}async function hb(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:i}=await r.read();if(o)break;if(i.byteLength===0)continue;t(),s+=n.decode(i,{stream:!0})}return s+n.decode()}async function mb(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=WF({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??JF)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let d=ic()?[...QF(r),...t.redact??[]]:[];if(ic()){let y=t.cwd?` (cwd=${t.cwd})`:"";qs(Nt.dim(Vl(`$ ${e.join(" ")}${y}`,d)))}let l=()=>{a=performance.now(),u()},p,f,h,m=n.exited.then((y)=>(c(),y));try{[p,f,h]=await Promise.all([hb(n.stdout,l),hb(n.stderr,l),m])}finally{if(c(),o)clearTimeout(o)}if(ic()){if(t.sensitiveOutput)qs(Nt.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())qs(Nt.dim(Vl(p.trimEnd(),d)));if(f.trim())qs(Nt.yellow(Vl(f.trimEnd(),d)))}qs(Nt.dim(`(exit ${h})`))}if(s)return{stdout:p,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:f,exitCode:h,timedOut:!1}}var YF,XF=8,JF=120000;var gb=F(()=>{Ul();YF=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function eV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function _b(e,t=eV()){return e.installInstructions[t]}function tV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function nV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:rV}async function vb(e){try{let{exitCode:t,stdout:r,timedOut:n}=await mb(e.cmd,{timeout:nV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:tV(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 zl(){let e=Object.entries(yb);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await vb(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:_b(r)}}))}async function Z3(){let t=(await zl()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
|
|
24
24
|
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 eB(e){let r=ZF[e].map((i)=>yb[i]).filter(Boolean),n=await Promise.all(r.map(async(i)=>{let a=await vb(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of n)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:_b(i.check)}));if(s.length===0)return;let o=[`
|
|
25
25
|
Missing required tools:`];for(let i of s)o.push(` ${i.tool} not installed`),o.push(` Install: ${i.installInstruction}`);throw Error(o.join(`
|
|
26
|
-
`))}var yb,ZF,rV=4000;var $b=F(()=>{gb();yb={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)"}}},ZF={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 wb;var Eb=F(()=>{wb={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.34-
|
|
26
|
+
`))}var yb,ZF,rV=4000;var $b=F(()=>{gb();yb={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)"}}},ZF={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 wb;var Eb=F(()=>{wb={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.34-PR2165.9362fd9",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js","git-annex-remote-nemar":"dist/git-annex-remote-nemar.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts src/git-annex-remote-nemar.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},trustedDependencies:["@biomejs/biome"],devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var ac;var Gl=F(()=>{Eb();ac=wb.version});import{mkdirSync as oV,readdirSync as iV,unlinkSync as aV,writeFileSync as cV}from"fs";import{join as Kl}from"path";function dB(){Ds=!0}function lc(){return Ds}function fB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function pB(e){Tb=e,pr(`Step: ${e}`)}function hB(){xb=!0}function mB(){return xb}function gB(){if(Rb)return;Bl=!0}function yB(){Bl=!1,Rb=!0}function _B(){return Bl}function pr(e){if(Ds)process.stderr.write(`[debug] ${e}
|
|
27
27
|
`)}function fV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=dV.has(r.toLowerCase())?"[REDACTED]":n;return t}function Ob(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Hl(e,t,r=0){if(r>hV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Hl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Hl(s,o,r+1);return n}if(typeof t==="string"){if(pV.test(e))return"[REDACTED]";return t.replace(kb,Ob)}return t}function Wl(e){return e.replace(mV,"Bearer [REDACTED]").replace(gV,"[REDACTED_AWS_KEY]").replace(yV,"$1[REDACTED]").replace(_V,"$1$2=[REDACTED]").replace(kb,Ob)}function vV(e){return Wl(e)}function bb(e,t=lV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Hl("",n))}catch{}if(r=Wl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function dc(e){if(!Ds)return;let t=vV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?fV(e.requestHeaders):void 0,requestBody:bb(e.requestBody),responseBody:bb(e.responseBody)};uc.push(r),pr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=dr(r);uc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),pr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function $V(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${ac}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${dr(t)})`)}e.push(""),e.push("Active account:");try{let t=hn();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: ${dr(t)})`)}e.push(""),e.push("External tools:");try{let t=await zl();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: ${dr(t)})`)}return e}async function EV(){return(await $V()).join(`
|
|
28
28
|
`)}async function vB(){if(!Ds||cc!==void 0)return;try{cc=await EV()}catch(e){let t=dr(e);cc=`(could not build environment report: ${t})`,pr(`environment snapshot failed: ${t}`)}}function Ab(e){if(Sb.has(e))return{flag:e};for(let t of Sb){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 wV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Ab(n);if(!s){t.push(n);continue}if(s.kind==="long-eq")t.push(`${s.flag}=[REDACTED]`);else if(s.kind==="short-attached")t.push(`${s.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function bV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Ab(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function SV(e){let t=[];for(let n of bV(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 xV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Wl(wV(e).join(" "))}`),r.push(""),r.push(cc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),uc.length===0)r.push(" (none)");else uc.forEach((n,s)=>{if(r.push(` [${s+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: ${Tb??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
|
|
29
29
|
`)}
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ ${Ds.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)$2(this.rl,th
|
|
|
81
81
|
${t}`,_Xe,xXe,vXe=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=wXe.bind(null,r,t.toString());Object.defineProperty(o,"name",xXe);let{writable:s,enumerable:i,configurable:a}=_Xe;Object.defineProperty(e,"toString",{value:o,writable:s,enumerable:i,configurable:a})};var DP=H(()=>{_Xe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xXe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var HE,Iee=(e,t={})=>{if(typeof e!=="function")throw TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",s=function(...i){if(HE.set(s,++r),r===1)n=e.apply(this,i),e=void 0;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return n};return bb(s,e),HE.set(s,r),s},Nee;var Fee=H(()=>{DP();HE=new WeakMap;Iee.callCount=(e)=>{if(!HE.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return HE.get(e)};Nee=Iee});var Gf;var Mee=H(()=>{Gf=[];Gf.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")Gf.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Gf.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class jee{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(AP[CP])return AP[CP];EXe(AP,CP,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);if(r===-1)return;if(r===0&&n.length===1)n.length=0;else n.splice(r,1)}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let o of this.listeners[e])r=o(t,n)===!0||r;if(e==="exit")r=this.emit("afterExit",t,n)||r;return r}}class TP{}var GE=(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",CP,AP,EXe,SXe=(e)=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),Lee,qee,OP,Uee,VGt,WGt;var Bee=H(()=>{Mee();CP=Symbol.for("signal-exit emitter"),AP=globalThis,EXe=Object.defineProperty.bind(Object);Lee=class Lee extends TP{onExit(){return()=>{}}load(){}unload(){}};qee=class qee extends TP{#n=OP.platform==="win32"?"SIGINT":"SIGHUP";#t=new jee;#e;#o;#f;#r={};#i=!1;constructor(e){super();this.#e=e,this.#r={};for(let t of Gf)this.#r[t]=()=>{let n=this.#e.listeners(t),{count:r}=this.#t,o=e;if(typeof o.__signal_exit_emitter__==="object"&&typeof o.__signal_exit_emitter__.count==="number")r+=o.__signal_exit_emitter__.count;if(n.length===r){this.unload();let s=this.#t.emit("exit",null,t),i=t==="SIGHUP"?this.#n:t;if(!s)e.kill(e.pid,i)}};this.#f=e.reallyExit,this.#o=e.emit}onExit(e,t){if(!GE(this.#e))return()=>{};if(this.#i===!1)this.load();let n=t?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{if(this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0)this.unload()}}load(){if(this.#i)return;this.#i=!0,this.#t.count+=1;for(let e of Gf)try{let t=this.#r[e];if(t)this.#e.on(e,t)}catch(t){}this.#e.emit=(e,...t)=>this.#p(e,...t),this.#e.reallyExit=(e)=>this.#s(e)}unload(){if(!this.#i)return;this.#i=!1,Gf.forEach((e)=>{let t=this.#r[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,t)}catch(n){}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#f,this.#t.count-=1}#s(e){if(!GE(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 n=this.#o;if(e==="exit"&&GE(this.#e)){if(typeof t[0]==="number")this.#e.exitCode=t[0];let r=n.call(this.#e,e,...t);return this.#t.emit("exit",this.#e.exitCode,null),r}else return n.call(this.#e,e,...t)}};OP=globalThis.process,{onExit:Uee,load:VGt,unload:WGt}=SXe(GE(OP)?new qee(OP):new Lee)});import zE from"process";var Hee,kXe,Gee;var zee=H(()=>{Fee();Bee();Hee=zE.stderr.isTTY?zE.stderr:zE.stdout.isTTY?zE.stdout:void 0,kXe=Hee?Nee(()=>{Uee(()=>{Hee.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Gee=kXe});import Vee from"process";var VE=!1,Eh,PP;var Wee=H(()=>{zee();Eh={};Eh.show=(e=Vee.stderr)=>{if(!e.isTTY)return;VE=!1,e.write("\x1B[?25h")};Eh.hide=(e=Vee.stderr)=>{if(!e.isTTY)return;Gee(),VE=!0,e.write("\x1B[?25l")};Eh.toggle=(e,t)=>{if(e!==void 0)VE=e;if(VE)Eh.show(t);else Eh.hide(t)};PP=Eh});import zi from"process";function IP(){if(zi.platform!=="win32")return zi.env.TERM!=="linux";return Boolean(zi.env.CI)||Boolean(zi.env.WT_SESSION)||Boolean(zi.env.TERMINUS_SUBLIME)||zi.env.ConEmuTask==="{cmd::Cmder}"||zi.env.TERM_PROGRAM==="Terminus-Sublime"||zi.env.TERM_PROGRAM==="vscode"||zi.env.TERM==="xterm-256color"||zi.env.TERM==="alacritty"||zi.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Kee=()=>{};var RXe,$Xe,DXe,wb;var Jee=H(()=>{Ve();Kee();RXe={info:u.blue("\u2139"),success:u.green("\u2714"),warning:u.yellow("\u26A0"),error:u.red("\u2716")},$Xe={info:u.blue("i"),success:u.green("\u221A"),warning:u.yellow("\u203C"),error:u.red("\xD7")},DXe=IP()?RXe:$Xe,wb=DXe});function NP({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 _b(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(CXe,"")}var CXe;var FP=H(()=>{CXe=NP()});function Yee(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 Xee(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Qee(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 Zee=()=>{};function AXe(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ete(e,{ambiguousAsWide:t=!1}={}){if(AXe(e),Xee(e)||Qee(e)||t&&Yee(e))return 2;return 1}var tte=H(()=>{Zee()});var nte=()=>/[#*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 MP(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(!r)e=_b(e);if(e.length===0)return 0;let o=0,s={ambiguousAsWide:!n};for(let{segment:i}of OXe.segment(e)){let a=i.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(TXe.test(i))continue;if(nte().test(i)){o+=2;continue}o+=ete(a,s)}return o}var OXe,TXe;var rte=H(()=>{FP();tte();OXe=new Intl.Segmenter,TXe=/^\p{Default_Ignorable_Code_Point}$/u});function jP({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import ote from"process";function LP(){let{env:e}=ote,{TERM:t,TERM_PROGRAM:n}=e;if(ote.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ste=()=>{};import Na from"process";class ite{#n=0;start(){if(this.#n++,this.#n===1)this.#t()}stop(){if(this.#n<=0)throw Error("`stop` called more times than `start`");if(this.#n--,this.#n===0)this.#e()}#t(){if(Na.platform==="win32"||!Na.stdin.isTTY)return;Na.stdin.setRawMode(!0),Na.stdin.on("data",this.#o),Na.stdin.resume()}#e(){if(!Na.stdin.isTTY)return;Na.stdin.off("data",this.#o),Na.stdin.pause(),Na.stdin.setRawMode(!1)}#o(e){if(e[0]===PXe)Na.emit("SIGINT")}}var PXe=3,IXe,qP;var ate=H(()=>{IXe=new ite,qP=IXe});import WE from"process";class cte{#n=0;#t=!1;#e=0;#o=-1;#f=0;#r;#i;#s;#p;#h;#l;#u;#d;#g;#a;#c;color;constructor(e){if(typeof e==="string")e={text:e};if(this.#r={color:"cyan",stream:WE.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#r.color,this.spinner=this.#r.spinner,this.#h=this.#r.interval,this.#s=this.#r.stream,this.#l=typeof this.#r.isEnabled==="boolean"?this.#r.isEnabled:jP({stream:this.#s}),this.#u=typeof this.#r.isSilent==="boolean"?this.#r.isSilent:!1,this.text=this.#r.text,this.prefixText=this.#r.prefixText,this.suffixText=this.#r.suffixText,this.indent=this.#r.indent,WE.env.NODE_ENV==="test")this._stream=this.#s,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#n},set(t){this.#n=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.#i.interval??100}get spinner(){return this.#i}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.#i=e}else if(!LP())this.#i=xb.default.line;else if(e===void 0)this.#i=xb.default.dots;else if(e!=="default"&&xb.default[e])this.#i=xb.default[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#m()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#m()}get suffixText(){return this.#c}set suffixText(e=""){this.#c=e,this.#m()}get isSpinning(){return this.#p!==void 0}#y(e=this.#a,t=" "){if(typeof e==="string"&&e!=="")return e+t;if(typeof e==="function")return e()+t;return""}#b(e=this.#c,t=" "){if(typeof e==="string"&&e!=="")return t+e;if(typeof e==="function")return t+e();return""}#m(){let e=this.#s.columns??80,t=this.#y(this.#a,"-"),n=this.#b(this.#c,"-"),r=" ".repeat(this.#d)+t+"--"+this.#g+"--"+n;this.#e=0;for(let o of _b(r).split(`
|
|
82
82
|
`))this.#e+=Math.max(1,Math.ceil(MP(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.#i.frames.length,this.#f=e;let{frames:t}=this.#i,n=t[this.#o];if(this.color)n=u[this.color](n);let r=typeof this.#a==="string"&&this.#a!==""?this.#a+" ":"",o=typeof this.text==="string"?" "+this.text:"",s=typeof this.#c==="string"&&this.#c!==""?" "+this.#c:"";return r+n+o+s}clear(){if(!this.#l||!this.#s.isTTY)return this;this.#s.cursorTo(0);for(let e=0;e<this.#n;e++){if(e>0)this.#s.moveCursor(0,-1);this.#s.clearLine(1)}if(this.#d||this.lastIndent!==this.#d)this.#s.cursorTo(this.#d);return this.lastIndent=this.#d,this.#n=0,this}render(){if(this.#u)return this;return this.clear(),this.#s.write(this.frame()),this.#n=this.#e,this}start(e){if(e)this.text=e;if(this.#u)return this;if(!this.#l){if(this.text)this.#s.write(`- ${this.text}
|
|
83
83
|
`);return this}if(this.isSpinning)return this;if(this.#r.hideCursor)PP.hide(this.#s);if(this.#r.discardStdin&&WE.stdin.isTTY)this.#t=!0,qP.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.#r.hideCursor)PP.show(this.#s);if(this.#r.discardStdin&&WE.stdin.isTTY&&this.#t)qP.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:wb.success,text:e})}fail(e){return this.stopAndPersist({symbol:wb.error,text:e})}warn(e){return this.stopAndPersist({symbol:wb.warning,text:e})}info(e){return this.stopAndPersist({symbol:wb.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let t=e.prefixText??this.#a,n=this.#y(t," "),r=e.symbol??" ",o=e.text??this.text,i=typeof o==="string"?(r?" ":"")+o:"",a=e.suffixText??this.#c,c=this.#b(a," "),l=n+r+i+c+`
|
|
84
|
-
`;return this.stop(),this.#s.write(l),this}}function D(e){return new cte(e)}var xb,NXe;var vo=H(()=>{Ve();Wee();Jee();FP();rte();ste();ate();xb=st(Bv(),1),NXe=st(Bv(),1)});var Ot,dte,he,pl=(e)=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":if(Array.isArray(e))return he.array;if(e===null)return he.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return he.promise;if(typeof Map<"u"&&e instanceof Map)return he.map;if(typeof Set<"u"&&e instanceof Set)return he.set;if(typeof Date<"u"&&e instanceof Date)return he.date;return he.object;default:return he.unknown}};var vb=H(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function n(o){throw Error()}e.assertNever=n,e.arrayToEnum=(o)=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=(o)=>{let s=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=(o)=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let s=[];for(let i in o)if(Object.prototype.hasOwnProperty.call(o,i))s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map((i)=>typeof i==="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>{if(typeof s==="bigint")return s.toString();return s}})(Ot||(Ot={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(dte||(dte={}));he=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ee,Ps;var KE=H(()=>{vb();ee=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);Ps=class Ps extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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},n={_errors:[]},r=(o)=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return r(this),n}static assert(e){if(!(e instanceof Ps))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Ps.create=(e)=>new Ps(e)});var FXe=(e,t)=>{let n;switch(e.code){case ee.invalid_type:if(e.received===he.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ot.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(e.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(e.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else Ot.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case ee.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case ee.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ot.assertNever(e)}return{message:n}},Vu;var UP=H(()=>{KE();vb();Vu=FXe});function Eb(){return MXe}var MXe;var JE=H(()=>{UP();MXe=Vu});function de(e,t){let n=Eb(),r=YE({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vu?void 0:Vu].filter((o)=>!!o)});e.common.issues.push(r)}class Eo{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 n=[];for(let r of t){if(r.status==="aborted")return Ge;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return Eo.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return Ge;if(s.status==="aborted")return Ge;if(o.status==="dirty")e.dirty();if(s.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet))n[o.value]=s.value}return{status:e.value,value:n}}}var YE=(e)=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},Ge,Sh=(e)=>({status:"dirty",value:e}),Lo=(e)=>({status:"valid",value:e}),BP=(e)=>e.status==="aborted",HP=(e)=>e.status==="dirty",zf=(e)=>e.status==="valid",Sb=(e)=>typeof Promise<"u"&&e instanceof Promise;var GP=H(()=>{JE();UP();Ge=Object.freeze({status:"aborted"})});var fte=()=>{};var Ce;var pte=H(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(Ce||(Ce={}))});class Vi{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 mt(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))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:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??r??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:o}}class Rt{get description(){return this._def.description}_getType(e){return pl(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:pl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Eo,ctx:{common:e.parent.common,data:e.data,parsedType:pl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Sb(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pl(e)},r=this._parseSync({data:e,path:n.path,parent:n});return mte(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pl(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return zf(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>zf(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pl(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(Sb(r)?r:Promise.resolve(r));return mte(n,o)}refine(e,t){let n=(r)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(r);else return t};return this._refinement((r,o)=>{let s=e(r),i=()=>o.addIssue({code:ee.custom,...n(r)});if(typeof Promise<"u"&&s instanceof Promise)return s.then((a)=>{if(!a)return i(),!1;else return!0});if(!s)return i(),!1;else return!0})}refinement(e,t){return this._refinement((n,r)=>{if(!e(n))return r.addIssue(typeof t==="function"?t(n,r):t),!1;else return!0})}_refinement(e){return new ja({schema:this,typeName:We.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 Ma.create(this,this._def)}nullable(){return Wu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fa.create(this)}promise(){return Ch.create(this,this._def)}or(e){return Cb.create([this,e],this._def)}and(e){return Ab.create(this,e,this._def)}transform(e){return new ja({...mt(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Ib({...mt(this._def),innerType:this,defaultValue:t,typeName:We.ZodDefault})}brand(){return new KP({typeName:We.ZodBranded,type:this,...mt(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Nb({...mt(this._def),innerType:this,catchValue:t,typeName:We.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return oS.create(this,e)}readonly(){return Fb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function gte(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function eQe(e){return new RegExp(`^${gte(e)}$`)}function tQe(e){let t=`${hte}T${gte(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function nQe(e,t){if((t==="v4"||!t)&&WXe.test(e))return!0;if((t==="v6"||!t)&&JXe.test(e))return!0;return!1}function rQe(e,t){if(!HXe.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));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 oQe(e,t){if((t==="v4"||!t)&&KXe.test(e))return!0;if((t==="v6"||!t)&&YXe.test(e))return!0;return!1}function sQe(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function kh(e){if(e instanceof Gn){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ma.create(kh(r))}return new Gn({...e._def,shape:()=>t})}else if(e instanceof Fa)return new Fa({...e._def,type:kh(e.element)});else if(e instanceof Ma)return Ma.create(kh(e.unwrap()));else if(e instanceof Wu)return Wu.create(kh(e.unwrap()));else if(e instanceof yl)return yl.create(e.items.map((t)=>kh(t)));else return e}function VP(e,t){let n=pl(e),r=pl(t);if(e===t)return{valid:!0,data:e};else if(n===he.object&&r===he.object){let o=Ot.objectKeys(t),s=Ot.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=VP(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===he.array&&r===he.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=VP(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===he.date&&r===he.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function yte(e,t){return new Wf({values:e,typeName:We.ZodEnum,...mt(t)})}var mte=(e,t)=>{if(zf(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 n=new Ps(e.common.issues);return this._error=n,this._error}}}},jXe,LXe,qXe,UXe,BXe,HXe,GXe,zXe,VXe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zP,WXe,KXe,JXe,YXe,XXe,QXe,hte="((\\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])))",ZXe,hl,Rh,$h,XE,Rb,QE,$b,Db,ZE,Vf,gl,eS,Fa,Gn,Cb,ml=(e)=>{if(e instanceof Ob)return ml(e.schema);else if(e instanceof ja)return ml(e.innerType());else if(e instanceof Tb)return[e.value];else if(e instanceof Wf)return e.options;else if(e instanceof Pb)return Ot.objectValues(e.enum);else if(e instanceof Ib)return ml(e._def.innerType);else if(e instanceof $b)return[void 0];else if(e instanceof Db)return[null];else if(e instanceof Ma)return[void 0,...ml(e.unwrap())];else if(e instanceof Wu)return[null,...ml(e.unwrap())];else if(e instanceof KP)return ml(e.unwrap());else if(e instanceof Fb)return ml(e.unwrap());else if(e instanceof Nb)return ml(e._def.innerType);else return[]},WP,Ab,yl,tS,nS,Dh,kb,Ob,Tb,Wf,Pb,Ch,ja,Ma,Wu,Ib,Nb,rS,Qzt,KP,oS,Fb,Zzt,We,_,C,eVt,tVt,oe,nVt,rVt,oVt,sVt,iVt,li,aVt,cVt,X,F,lVt,Ah,JP,uVt,dVt,pr,fVt,pVt,mVt,hVt,$t,Le,gVt,yVt,bVt,wVt,_Vt,xVt,vVt;var bte=H(()=>{KE();JE();pte();GP();vb();jXe=/^c[^\s-]{8,}$/i,LXe=/^[0-9a-z]+$/,qXe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UXe=/^[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,BXe=/^[a-z0-9_-]{21}$/i,HXe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GXe=/^[-+]?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)?)??$/,zXe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,WXe=/^(?:(?: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])$/,KXe=/^(?:(?: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])$/,JXe=/^(([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]))$/,YXe=/^(([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])$/,XXe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QXe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ZXe=new RegExp(`^${hte}$`);hl=class hl extends Rt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==he.string){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_type,expected:he.string,received:o.parsedType}),Ge}let n=new Eo,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="length"){let s=e.data.length>o.value,i=e.data.length<o.value;if(s||i){if(r=this._getOrReturnCtx(e,r),s)de(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)de(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!zXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"email",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!zP)zP=new RegExp(VXe,"u");if(!zP.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!UXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!BXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!jXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!LXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!qXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"ulid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),de(r,{validation:"url",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"regex",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.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))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!tQe(o).test(e.data))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!ZXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!eQe(o).test(e.data))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!GXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"duration",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!nQe(e.data,o.version))r=this._getOrReturnCtx(e,r),de(r,{validation:"ip",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!rQe(e.data,o.alg))r=this._getOrReturnCtx(e,r),de(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!oQe(e.data,o.version))r=this._getOrReturnCtx(e,r),de(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!XXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"base64",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!QXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),n.dirty()}else Ot.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:ee.invalid_string,...Ce.errToObj(n)})}_addCheck(e){return new hl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ce.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ce.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ce.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ce.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ce.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ce.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,...Ce.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,...Ce.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ce.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ce.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ce.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ce.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ce.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ce.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ce.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ce.errToObj(t)})}nonempty(e){return this.min(1,Ce.errToObj(e))}trim(){return new hl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hl({...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}};hl.create=(e)=>new hl({checks:[],typeName:We.ZodString,coerce:e?.coerce??!1,...mt(e)});Rh=class Rh extends Rt{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)!==he.number){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_type,expected:he.number,received:o.parsedType}),Ge}let n=void 0,r=new Eo;for(let o of this._def.checks)if(o.kind==="int"){if(!Ot.isInteger(e.data))n=this._getOrReturnCtx(e,n),de(n,{code:ee.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(sQe(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),de(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),de(n,{code:ee.not_finite,message:o.message}),r.dirty()}else Ot.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ce.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ce.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ce.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ce.toString(t))}setLimit(e,t,n,r){return new Rh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ce.toString(r)}]})}_addCheck(e){return new Rh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ce.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&Ot.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}};Rh.create=(e)=>new Rh({checks:[],typeName:We.ZodNumber,coerce:e?.coerce||!1,...mt(e)});$h=class $h extends Rt{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)!==he.bigint)return this._getInvalidInput(e);let n=void 0,r=new Eo;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))n=this._getOrReturnCtx(e,n),de(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else Ot.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return de(t,{code:ee.invalid_type,expected:he.bigint,received:t.parsedType}),Ge}gte(e,t){return this.setLimit("min",e,!0,Ce.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ce.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ce.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ce.toString(t))}setLimit(e,t,n,r){return new $h({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ce.toString(r)}]})}_addCheck(e){return new $h({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ce.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}};$h.create=(e)=>new $h({checks:[],typeName:We.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});XE=class XE extends Rt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==he.boolean){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.boolean,received:n.parsedType}),Ge}return Lo(e.data)}};XE.create=(e)=>new XE({typeName:We.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});Rb=class Rb extends Rt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==he.date){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_type,expected:he.date,received:o.parsedType}),Ge}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_date}),Ge}let n=new Eo,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else Ot.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Rb({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ce.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ce.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}};Rb.create=(e)=>new Rb({checks:[],coerce:e?.coerce||!1,typeName:We.ZodDate,...mt(e)});QE=class QE extends Rt{_parse(e){if(this._getType(e)!==he.symbol){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.symbol,received:n.parsedType}),Ge}return Lo(e.data)}};QE.create=(e)=>new QE({typeName:We.ZodSymbol,...mt(e)});$b=class $b extends Rt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.undefined,received:n.parsedType}),Ge}return Lo(e.data)}};$b.create=(e)=>new $b({typeName:We.ZodUndefined,...mt(e)});Db=class Db extends Rt{_parse(e){if(this._getType(e)!==he.null){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.null,received:n.parsedType}),Ge}return Lo(e.data)}};Db.create=(e)=>new Db({typeName:We.ZodNull,...mt(e)});ZE=class ZE extends Rt{constructor(){super(...arguments);this._any=!0}_parse(e){return Lo(e.data)}};ZE.create=(e)=>new ZE({typeName:We.ZodAny,...mt(e)});Vf=class Vf extends Rt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Lo(e.data)}};Vf.create=(e)=>new Vf({typeName:We.ZodUnknown,...mt(e)});gl=class gl extends Rt{_parse(e){let t=this._getOrReturnCtx(e);return de(t,{code:ee.invalid_type,expected:he.never,received:t.parsedType}),Ge}};gl.create=(e)=>new gl({typeName:We.ZodNever,...mt(e)});eS=class eS extends Rt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.void,received:n.parsedType}),Ge}return Lo(e.data)}};eS.create=(e)=>new eS({typeName:We.ZodVoid,...mt(e)});Fa=class Fa extends Rt{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==he.array)return de(t,{code:ee.invalid_type,expected:he.array,received:t.parsedType}),Ge;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)de(t,{code:s?ee.too_big:ee.too_small,minimum:i?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty()}if(r.minLength!==null){if(t.data.length<r.minLength.value)de(t,{code:ee.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()}if(r.maxLength!==null){if(t.data.length>r.maxLength.value)de(t,{code:ee.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((s,i)=>r.type._parseAsync(new Vi(t,s,t.path,i)))).then((s)=>Eo.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Vi(t,s,t.path,i)));return Eo.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Fa({...this._def,minLength:{value:e,message:Ce.toString(t)}})}max(e,t){return new Fa({...this._def,maxLength:{value:e,message:Ce.toString(t)}})}length(e,t){return new Fa({...this._def,exactLength:{value:e,message:Ce.toString(t)}})}nonempty(e){return this.min(1,e)}};Fa.create=(e,t)=>new Fa({type:e,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...mt(t)});Gn=class Gn extends Rt{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Ot.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==he.object){let c=this._getOrReturnCtx(e);return de(c,{code:ee.invalid_type,expected:he.object,received:c.parsedType}),Ge}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof gl&&this._def.unknownKeys==="strip")){for(let c in r.data)if(!s.includes(c))i.push(c)}let a=[];for(let c of s){let l=o[c],d=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Vi(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof gl){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of i)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict"){if(i.length>0)de(r,{code:ee.unrecognized_keys,keys:i}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of i){let d=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Vi(r,d,r.path,l)),alwaysSet:l in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then((c)=>Eo.mergeObjectSync(n,c));else return Eo.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Ce.errToObj,new Gn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:Ce.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Gn({...this._def,unknownKeys:"strip"})}passthrough(){return new Gn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Gn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Gn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:We.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Gn({...this._def,catchall:e})}pick(e){let t={};for(let n of Ot.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Gn({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Ot.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Gn({...this._def,shape:()=>t})}deepPartial(){return kh(this)}partial(e){let t={};for(let n of Ot.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Gn({...this._def,shape:()=>t})}required(e){let t={};for(let n of Ot.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Ma)o=o._def.innerType;t[n]=o}return new Gn({...this._def,shape:()=>t})}keyof(){return yte(Ot.objectKeys(this.shape))}};Gn.create=(e,t)=>new Gn({shape:()=>e,unknownKeys:"strip",catchall:gl.create(),typeName:We.ZodObject,...mt(t)});Gn.strictCreate=(e,t)=>new Gn({shape:()=>e,unknownKeys:"strict",catchall:gl.create(),typeName:We.ZodObject,...mt(t)});Gn.lazycreate=(e,t)=>new Gn({shape:e,unknownKeys:"strip",catchall:gl.create(),typeName:We.ZodObject,...mt(t)});Cb=class Cb extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((i)=>new Ps(i.ctx.common.issues));return de(t,{code:ee.invalid_union,unionErrors:s}),Ge}if(t.common.async)return Promise.all(n.map(async(o)=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);else{let o=void 0,s=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!o)o={result:l,ctx:c};if(c.common.issues.length)s.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map((a)=>new Ps(a));return de(t,{code:ee.invalid_union,unionErrors:i}),Ge}}get options(){return this._def.options}};Cb.create=(e,t)=>new Cb({options:e,typeName:We.ZodUnion,...mt(t)});WP=class WP extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.object)return de(t,{code:ee.invalid_type,expected:he.object,received:t.parsedType}),Ge;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return de(t,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ge;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,n){let r=new Map;for(let o of t){let s=ml(o.shape[e]);if(!s.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return new WP({typeName:We.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...mt(n)})}};Ab=class Ab extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(BP(o)||BP(s))return Ge;let i=VP(o.value,s.value);if(!i.valid)return de(n,{code:ee.invalid_intersection_types}),Ge;if(HP(o)||HP(s))t.dirty();return{status:t.value,value:i.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s));else return r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ab.create=(e,t,n)=>new Ab({left:e,right:t,typeName:We.ZodIntersection,...mt(n)});yl=class yl extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.array)return de(n,{code:ee.invalid_type,expected:he.array,received:n.parsedType}),Ge;if(n.data.length<this._def.items.length)return de(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ge;if(!this._def.rest&&n.data.length>this._def.items.length)de(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...n.data].map((s,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new Vi(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>Eo.mergeArray(t,s));else return Eo.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new yl({...this._def,rest:e})}};yl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new yl({items:e,typeName:We.ZodTuple,rest:null,...mt(t)})};tS=class tS extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.object)return de(n,{code:ee.invalid_type,expected:he.object,received:n.parsedType}),Ge;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Vi(n,i,n.path,i)),value:s._parse(new Vi(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return Eo.mergeObjectAsync(t,r);else return Eo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Rt)return new tS({keyType:e,valueType:t,typeName:We.ZodRecord,...mt(n)});return new tS({keyType:hl.create(),valueType:e,typeName:We.ZodRecord,...mt(t)})}};nS=class nS extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.map)return de(n,{code:ee.invalid_type,expected:he.map,received:n.parsedType}),Ge;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Vi(n,i,n.path,[c,"key"])),value:o._parse(new Vi(n,a,n.path,[c,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of s){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return Ge;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of s){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return Ge;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};nS.create=(e,t,n)=>new nS({valueType:t,keyType:e,typeName:We.ZodMap,...mt(n)});Dh=class Dh extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.set)return de(n,{code:ee.invalid_type,expected:he.set,received:n.parsedType}),Ge;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)de(n,{code:ee.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()}if(r.maxSize!==null){if(n.data.size>r.maxSize.value)de(n,{code:ee.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty()}let o=this._def.valueType;function s(a){let c=new Set;for(let l of a){if(l.status==="aborted")return Ge;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let i=[...n.data.values()].map((a,c)=>o._parse(new Vi(n,a,n.path,c)));if(n.common.async)return Promise.all(i).then((a)=>s(a));else return s(i)}min(e,t){return new Dh({...this._def,minSize:{value:e,message:Ce.toString(t)}})}max(e,t){return new Dh({...this._def,maxSize:{value:e,message:Ce.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Dh.create=(e,t)=>new Dh({valueType:e,minSize:null,maxSize:null,typeName:We.ZodSet,...mt(t)});kb=class kb extends Rt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.function)return de(t,{code:ee.invalid_type,expected:he.function,received:t.parsedType}),Ge;function n(i,a){return YE({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Eb(),Vu].filter((c)=>!!c),issueData:{code:ee.invalid_arguments,argumentsError:a}})}function r(i,a){return YE({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Eb(),Vu].filter((c)=>!!c),issueData:{code:ee.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ch){let i=this;return Lo(async function(...a){let c=new Ps([]),l=await i._def.args.parseAsync(a,o).catch((p)=>{throw c.addIssue(n(a,p)),c}),d=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(d,o).catch((p)=>{throw c.addIssue(r(d,p)),c})})}else{let i=this;return Lo(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new Ps([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new Ps([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kb({...this._def,args:yl.create(e).rest(Vf.create())})}returns(e){return new kb({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new kb({args:e?e:yl.create([]).rest(Vf.create()),returns:t||Vf.create(),typeName:We.ZodFunction,...mt(n)})}};Ob=class Ob extends Rt{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})}};Ob.create=(e,t)=>new Ob({getter:e,typeName:We.ZodLazy,...mt(t)});Tb=class Tb extends Rt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return de(t,{received:t.data,code:ee.invalid_literal,expected:this._def.value}),Ge}return{status:"valid",value:e.data}}get value(){return this._def.value}};Tb.create=(e,t)=>new Tb({value:e,typeName:We.ZodLiteral,...mt(t)});Wf=class Wf extends Rt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return de(t,{expected:Ot.joinValues(n),received:t.parsedType,code:ee.invalid_type}),Ge}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return de(t,{received:t.data,code:ee.invalid_enum_value,options:n}),Ge}return Lo(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 Wf.create(e,{...this._def,...t})}exclude(e,t=this._def){return Wf.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};Wf.create=yte;Pb=class Pb extends Rt{_parse(e){let t=Ot.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==he.string&&n.parsedType!==he.number){let r=Ot.objectValues(t);return de(n,{expected:Ot.joinValues(r),received:n.parsedType,code:ee.invalid_type}),Ge}if(!this._cache)this._cache=new Set(Ot.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=Ot.objectValues(t);return de(n,{received:n.data,code:ee.invalid_enum_value,options:r}),Ge}return Lo(e.data)}get enum(){return this._def.values}};Pb.create=(e,t)=>new Pb({values:e,typeName:We.ZodNativeEnum,...mt(t)});Ch=class Ch extends Rt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.promise&&t.common.async===!1)return de(t,{code:ee.invalid_type,expected:he.promise,received:t.parsedType}),Ge;let n=t.parsedType===he.promise?t.data:Promise.resolve(t.data);return Lo(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ch.create=(e,t)=>new Ch({type:e,typeName:We.ZodPromise,...mt(t)});ja=class ja extends Rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:(s)=>{if(de(n,s),s.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async(i)=>{if(t.value==="aborted")return Ge;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return Ge;if(a.status==="dirty")return Sh(a.value);if(t.value==="dirty")return Sh(a.value);return a});else{if(t.value==="aborted")return Ge;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return Ge;if(i.status==="dirty")return Sh(i.value);if(t.value==="dirty")return Sh(i.value);return i}}if(r.type==="refinement"){let s=(i)=>{let a=r.refinement(i,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(i.status==="aborted")return Ge;if(i.status==="dirty")t.dirty();return s(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(i.status==="aborted")return Ge;if(i.status==="dirty")t.dirty();return s(i.value).then(()=>({status:t.value,value:i.value}))})}if(r.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!zf(s))return Ge;let i=r.transform(s.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(!zf(s))return Ge;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});Ot.assertNever(r)}};ja.create=(e,t,n)=>new ja({schema:e,typeName:We.ZodEffects,effect:t,...mt(n)});ja.createWithPreprocess=(e,t,n)=>new ja({schema:t,effect:{type:"preprocess",transform:e},typeName:We.ZodEffects,...mt(n)});Ma=class Ma extends Rt{_parse(e){if(this._getType(e)===he.undefined)return Lo(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ma.create=(e,t)=>new Ma({innerType:e,typeName:We.ZodOptional,...mt(t)});Wu=class Wu extends Rt{_parse(e){if(this._getType(e)===he.null)return Lo(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Wu.create=(e,t)=>new Wu({innerType:e,typeName:We.ZodNullable,...mt(t)});Ib=class Ib extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===he.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ib.create=(e,t)=>new Ib({innerType:e,typeName:We.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...mt(t)});Nb=class Nb extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(Sb(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ps(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ps(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Nb.create=(e,t)=>new Nb({innerType:e,typeName:We.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...mt(t)});rS=class rS extends Rt{_parse(e){if(this._getType(e)!==he.nan){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.nan,received:n.parsedType}),Ge}return{status:"valid",value:e.data}}};rS.create=(e)=>new rS({typeName:We.ZodNaN,...mt(e)});Qzt=Symbol("zod_brand");KP=class KP extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};oS=class oS extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return Ge;if(o.status==="dirty")return t.dirty(),Sh(o.value);else return this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();else{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return Ge;if(r.status==="dirty")return t.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new oS({in:e,out:t,typeName:We.ZodPipeline})}};Fb=class Fb extends Rt{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(zf(r))r.value=Object.freeze(r.value);return r};return Sb(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};Fb.create=(e,t)=>new Fb({innerType:e,typeName:We.ZodReadonly,...mt(t)});Zzt={object:Gn.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"})(We||(We={}));_=hl.create,C=Rh.create,eVt=rS.create,tVt=$h.create,oe=XE.create,nVt=Rb.create,rVt=QE.create,oVt=$b.create,sVt=Db.create,iVt=ZE.create,li=Vf.create,aVt=gl.create,cVt=eS.create,X=Fa.create,F=Gn.create,lVt=Gn.strictCreate,Ah=Cb.create,JP=WP.create,uVt=Ab.create,dVt=yl.create,pr=tS.create,fVt=nS.create,pVt=Dh.create,mVt=kb.create,hVt=Ob.create,$t=Tb.create,Le=Wf.create,gVt=Pb.create,yVt=Ch.create,bVt=ja.create,wVt=Ma.create,_Vt=Wu.create,xVt=ja.createWithPreprocess,vVt=oS.create});var YP=H(()=>{JE();GP();fte();vb();bte();KE()});var hr=H(()=>{YP();YP()});function XP(e){return sS.includes(e)}var iQe,Kf,sS,wte,aQe,_te,cQe,xte,lQe,uQe,vte,dQe,Ete,PVt,IVt,Ste,fQe,kte,pQe,Rte,QP=20,ZP=500,mQe,NVt;var Oh=H(()=>{hr();iQe=Le(["pending","verified","approved","revoked"]),Kf=Le(["person","service","test"]),sS=Kf.options;wte={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"},aQe=Le(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),_te=aQe.options,cQe=Le(["active","pending","revoked"]),xte=F({field:_(),blocks:X(_()).optional(),set_on:X(_()).optional()}).passthrough(),lQe=F({id:C().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:C().int().optional(),sandbox_completed:oe().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:oe().optional(),status:iQe.optional(),email_verified:oe().optional(),orcid_verified:oe().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:X(xte).optional(),username_auto_assigned:oe().optional(),account_kind:Kf.optional()}).passthrough(),uQe=F({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),vte=F({user:lQe,token:uQe.optional()}).passthrough(),dQe=F({id:C().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:C().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),orcid:_().nullable().optional(),upload_access_requested_at:_().nullable().optional(),account_kind:Kf.optional(),matched_in:X(_()).optional(),match_kind:_().optional()}).passthrough(),Ete=F({users:X(dQe),count:C().int()}).passthrough(),PVt=Le(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),IVt=Le(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Ste=F({suggestion:_().nullable(),based_on:Le(["name","unavailable","exhausted"])}).passthrough(),fQe=Le(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),kte=fQe.options,pQe=Le(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","username_reserved","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"]),Rte=pQe.options,mQe=F({id:C().int(),email:_(),username:_().nullable(),role:_(),status:cQe,email_verified:oe(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:oe(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:oe(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:X(xte),username_auto_assigned:oe()}).passthrough(),NVt=F({user:mQe.nullable()}).passthrough()});var eI,tI,LVt,hQe,qVt,gQe,$te,Dte,nI=8,rI=100,Cte,Ate,yQe,Ote;var Mb=H(()=>{hr();Oh();eI=["given_name","family_name","affiliation","city","country"],tI=["username","github_username","email","orcid"],LVt=[...eI,...tI],hQe={given_name:_().max(200).optional(),family_name:_().max(200).optional(),affiliation:_().max(500).optional(),city:_().max(200).optional(),country:_().max(200).optional(),username:_().max(100).optional(),github_username:_().max(100).optional(),email:_().max(320).optional(),orcid:_().max(40).optional()},qVt=F(hQe),gQe=Le(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),$te=gQe.options,Dte=["exact","name","prefix","substring","fuzzy"],Cte=F({id:C().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Kf.optional(),email_verified:C().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:C().int().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),description:_().nullable().optional(),signup_source:_().nullable().optional(),created_at:_(),updated_at:_().nullable().optional(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),deleted_at:_().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:C().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),identity_conflict:C().int().nullable().optional(),username_auto_assigned:C().int().nullable().optional(),sandbox_completed:C().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:C().int().optional(),active_tokens:C().int().optional(),linked_identities:X(_()).optional()}).passthrough(),Ate=F({user:Cte}).passthrough(),yQe=F({from:_().nullable(),to:_().nullable()}),Ote=F({message:_(),changed:pr(_(),yQe),notes:X(_()).optional(),old_address_notified:oe().optional(),user:Cte}).passthrough()});function _Qe(e){return e.startsWith("v")?e:`v${e}`}var bQe,wQe,Tte,HVt;var oI=H(()=>{hr();bQe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,wQe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;Tte=_().regex(bQe,"must be a semver version, optionally v-prefixed").transform(_Qe),HVt=_().regex(wQe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Ite(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:ee.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function Nte(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:ee.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var xQe="0.4.1",sI,Th,Pte,vQe,EQe,SQe,Fte,WVt,Mte,KVt,bl,kQe,iS,JVt,RQe,$Qe,YVt;var iI=H(()=>{hr();oI();sI=Le(["openneuro","nemar","gin","other"]),Th=Ah([$t(0),$t(1)]).nullable(),Pte=F({dataset_id:_(),id:_().optional(),name:_(),description:_().nullable().optional(),status:_(),visibility:_(),anonymous:C().int().nullable().optional(),concept_doi:_().nullable().optional(),doi:_().nullable().optional(),created_at:_(),updated_at:_().optional(),first_published_at:_().nullable().optional(),owner_username:_().nullable().optional(),source:_().nullable().optional(),modalities:_().optional(),participants:C().int().nonnegative(),tasks:_().optional(),authors:_().optional(),license:_().optional(),file_size:C().nonnegative(),file_size_formatted:_().optional(),total_files:C().nonnegative().nullable().optional(),num_citations:C().int().nonnegative().optional(),n_channels:C().int().nullable().optional(),electrode_system:_().nullable().optional(),has_hed:Th.optional(),hed_version:_().nullable().optional(),data_complete:Th.optional(),bytes_present:C().nonnegative().nullable().optional(),latest_version:Tte.nullable().optional(),latest_version_at:_().nullable().optional(),subject_count:C().int().nullable().optional(),file_size_bytes:C().nullable().optional(),sessions_count:C().int().nullable().optional(),age_min:C().nullable().optional(),age_max:C().nullable().optional(),bids_version:_().nullable().optional(),zarr_status:Le(["pending","ready","failed"]).nullable().optional(),zarr_store_count:C().int().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:C().int().nullable().optional(),zarr_failure_count:C().int().nullable().optional(),zarr_deterministic:Th.optional(),zarr_failed_at:_().nullable().optional(),zarr_index_url:_().nullable().optional(),zarr_verify_status:Le(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),zarr_requeue_at:_().nullable().optional(),anonymity_status:Le(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:_().nullable().optional(),anonymity_findings:_().nullable().optional(),anonymity_unchecked:_().nullable().optional(),total_recording_duration:C().nullable().optional(),recording_duration_min:C().nullable().optional(),recording_duration_max:C().nullable().optional(),recording_count:C().int().nullable().optional(),recordings_unavailable:C().int().nullable().optional(),channel_count_min:C().int().nullable().optional(),channel_count_max:C().int().nullable().optional(),sampling_frequency:C().nullable().optional(),power_line_frequency:C().nullable().optional(),eeg_reference:_().nullable().optional(),placement_scheme:_().nullable().optional()}).passthrough();vQe=Pte.superRefine((e,t)=>{Ite(e,t),Nte(e,t)}),EQe=Pte.extend({file_size:C().nonnegative().nullable(),file_size_formatted:_().nullable().optional(),modalities:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),license:_().nullable().optional(),owner_github:_().nullable().optional(),attestation_deposit_type:Le(["owner","redistribution"]).nullable().optional(),attestation_key_status:Le(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Th.optional(),attestation_no_duplicate:Th.optional(),attestation_upstream_source:_().nullable().optional(),attestation_accepted_at:_().nullable().optional(),zarr_data_failures:F({count:C().int().nonnegative(),detail_ref:_(),compacted_by:_().optional(),pending:C().int().nonnegative().optional(),discovered:C().int().nonnegative().optional(),events_upload_failed:$t(!0).optional(),manifest_upload_failed:$t(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Ite(e,t),Nte(e,t)}),SQe=F({id:_(),name:_(),modalities:_().nullable().optional(),participants:C().int().nullable().optional(),doi:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),has_hed:Th.optional(),score:C().optional(),snippet:_().optional()}).passthrough(),Fte=pr(_(),C().int().nonnegative()),WVt=F({datasets:X(vQe),count:C().int().nonnegative(),total_count:C().int().nonnegative().optional(),limit:C().int().optional(),offset:C().int().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fte.optional()}).passthrough(),Mte=F({results:X(SQe),count:C().int().nonnegative(),returned:C().int().nonnegative().optional(),offset:C().int().nonnegative().optional(),limit:C().int().optional(),candidate_ceiling:C().int().optional(),truncated:oe().optional(),method:Le(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:C().optional(),reranked:$t(!0).optional(),corrected_query:_().optional(),modality_boost:X(_()).optional(),warning:_().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fte.optional()}).passthrough(),KVt=F({dataset:EQe}).passthrough(),bl=F({value:_(),count:C().int().nonnegative()}),kQe=F({values:X(bl),distinct_total:C().int().nonnegative(),truncated:oe()}),iS=F({"electrode-system":X(bl).optional(),source:X(bl).optional(),zarr:X(bl).optional(),powerline:X(bl).optional(),"bids-version":X(bl).optional(),"hed-version":X(bl).optional(),license:X(bl).optional(),modality:X(bl).optional(),task:kQe.optional(),warning:_().optional()}).passthrough(),JVt=F({schema_version:$t(xQe),doc_type:$t("dataset"),dataset_id:_().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:_(),source:sI,recording_modality:X(_()).min(1),description:_().nullable().optional(),bids_version:_().nullable().optional(),license:_().nullable().optional()}).passthrough(),RQe=F({tasks:pr(F({runs:X(_())}).passthrough())}).passthrough(),$Qe=F({sessions:X(_()),modalities:pr(RQe),session_modalities:pr(X(_())).optional()}).passthrough(),YVt=F({version:_(),subjects:pr($Qe)}).passthrough()});function aS(e){return typeof e==="string"&&jte.includes(e)}var DQe,ZVt,eWt,tWt,jte,CQe="ci_check_unavailable",Lte,qte,Ute,Bte="X-Approval-Dispatch-Token",nWt;var jb=H(()=>{hr();DQe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,ZVt=_().regex(DQe,"ORCID must be in format 0000-0000-0000-000X"),eWt=Le(["found","no_public_name","lookup_failed"]),tWt=Le(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),jte=["bids_validation_pending","bids_validation_in_progress"];Lte=[CQe],qte=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Ute=["publication_review_not_clear","request_blocked","request_changed","request_mismatch","dispatch_superseded","dispatch_expired","decision_with_dispatch_token","approval_in_flight","deny_after_publishing","invalid_dataset_id","approval_closed_during_run"],nWt=Le(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var AQe,Hte,Lb="https://nemar.org/settings",sWt,OQe,TQe,PQe,Gte,zte;var aI=H(()=>{hr();AQe=Le(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Hte=AQe.options,sWt={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, ${Lb}).`,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, ${Lb}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Lb}), 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, ${Lb}).`,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, ${Lb}).`,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."},OQe=Le(["orcid","email","github"]),TQe=F({id:C().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:oe(),dataset_count:C().int(),identity_conflict:C().int(),canonical:oe()}).passthrough(),PQe=F({kind:OQe,value:_(),canonical_user_id:C().int(),accounts:X(TQe)}).passthrough(),Gte=F({groups:X(PQe),group_count:C().int(),flagged_count:C().int()}).passthrough(),zte=F({ok:$t(!0),id:C().int(),cleared:oe()}).passthrough()});var cI=120,Vte=64,lI="unnamed machine",IQe=25,cS,Wte,Ph,Kte,cWt,lWt,Jte,NQe,FQe,Yte,uI,Xte,uWt,dWt,lS,uS;var dS=H(()=>{hr();cS=Le(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Wte={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."},Ph=Le(["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"]),Kte=Ph.options,cWt={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 ${IQe} 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."},lWt=F({error:Ph,message:_()}).passthrough(),Jte=F({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:C().int(),interval:C().int()}).passthrough(),NQe=JP("error",[F({error:$t("authorization_pending"),message:_()}).passthrough(),F({error:$t("slow_down"),message:_()}).passthrough()]),FQe=JP("error",[F({error:$t("expired_token"),reason:Ph,message:_()}).passthrough(),F({error:$t("access_denied"),reason:Ph,message:_()}).passthrough(),F({error:$t("invalid_grant"),reason:Ph,message:_()}).passthrough()]),Yte=Ah([NQe,FQe]),uI=F({id:C().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:oe()}).passthrough(),Xte=F({api_key:_(),key:uI,user:F({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:oe(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),uWt=F({user_code:_(),machine_name:_(),requested_at:_(),expires_in:C().int(),account:F({username:_().nullable(),email_masked:_()}).passthrough(),refusal:F({code:Ph,message:_()}).passthrough().nullable()}).passthrough(),dWt=F({ok:$t(!0),machine_name:_()}).passthrough(),lS=F({keys:X(uI)}).passthrough(),uS=F({api_key:_(),key:uI}).passthrough()});function gr(e){return zn[e]}function wl(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var zn;var Ih=H(()=>{zn={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function jQe(e){return e==="verified"||e==="upload_access"||e==="publication"}function Nh(e){return(e??"").trim().length===0}function LQe(e){return e==="service"||e==="test"}function ene(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(fS,e)?fS[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:zn["gap.set_on.default_web"],setOnCli:null,known:!1};let o=n&&r.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??r.blocks,label:zn[r.labelKey],setOnWeb:zn[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:zn[r.cliKey],known:!0}}function Qte(e){let t=dI.indexOf(e);return t===-1?dI.length:t}function tne(e,t={}){return e.map((n)=>ene(n,{orcidVerified:t.orcidVerified}))}function pS(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(jQe):[];return ene(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>Qte(n.field)-Qte(r.field))}function fI(e){let t=e.blocks[0],n=t?zn[MQe[t]]:zn["gap.blocks.unknown"],r=wl(zn["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?wl(zn["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):wl(zn["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function nne(e){return`${e.label} ${fI(e)}`}function mS(){let e=wl(zn["gap.sentence"],{label:Zte.label,blocks:zn["cli.gap.blocks.sandbox"]}),t=wl(zn["cli.gap.set_on.cli_only"],{cli:Zte.command});return`${e} ${t}`}function rne(){return zn["cli.gaps.sandbox_unchecked"]}var fS,dI,hWt,MQe,Zte;var Fh=H(()=>{Ih();fS={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&&Nh(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)=>Nh(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)=>Nh(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&&!LQe(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)=>Nh(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)=>Nh(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)=>Nh(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}},dI=Object.keys(fS),hWt=dI.filter((e)=>fS[e].isMissing!==null),MQe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Zte={field:"sandbox",label:zn["cli.gap.field.sandbox.label"],command:zn["cli.gap.field.sandbox.set_on.cli"]}});function bS(e,t){let n=e.sss!==void 0;if(e.derived!==n)t.addIssue({code:ee.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 qo,hS,one,gS,qQe,yS,UQe,BQe,HQe,GQe,zQe,bWt,VQe,wWt,WQe,_Wt;var pI=H(()=>{hr();qo=/^[a-z]{2}[0-9]{6}$/,hS=/^[0-9a-f]{40}$/,one=F({name:_(),modality:_().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),duration_s:C().nonnegative().nullable().optional(),source_rate_hz:C().nullable().optional(),n_view_levels:C().int().nonnegative().optional(),view_chunk_columns:C().int().positive().optional(),chunk_samples:C().int().positive().optional(),shard_samples:C().int().positive().optional()}).passthrough(),gS=F({converted:C().int().nonnegative().optional(),relabelled:C().int().nonnegative().optional(),kept_importer_unit:C().int().nonnegative().optional(),units_column_present:oe().optional(),sidecar:_().optional(),sidecar_supplied:oe().optional(),unmatched_channels:C().int().nonnegative().optional(),unmatched_case_only:C().int().positive().optional(),matched_case_only:C().int().positive().optional(),matched_case_only_examples:X(_()).max(5).optional(),unmatched_raw_label:C().int().positive().optional(),unmatched_examples:X(_()).max(5).optional()}).passthrough(),qQe=F({channels_tsv:C().int().positive(),in_file:C().int().nonnegative(),in_store:C().int().nonnegative()}).passthrough(),yS=F({applied:oe().optional(),method:_().optional(),calibration:_().optional(),cross_talk:_().optional(),mne_version:_().optional()}).passthrough();UQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),updated_utc:_().optional(),source_tree:$t("raw"),derived:oe(),modalities:X(_()).optional(),groups:X(one).optional(),power_line_frequency:C().nullable().optional(),event_description_count:C().int().nonnegative().optional(),n_events:C().int().nonnegative().optional(),trial_types:pr(_(),C().int().nonnegative()).optional(),units_report:gS.optional(),channels_tsv_read_error:oe().optional(),channels_tsv_count_mismatch:qQe.optional(),split_members:X(_()).optional(),sss:yS.optional()}).passthrough().superRefine(bS),BQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr").optional(),code:_(),reason:_(),detail:_().nullable().optional(),attempts:C().int().nonnegative().optional()}).passthrough(),HQe=Le(["infra_failure","memory_budget","not_attempted"]),GQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),reason:HQe,attempts:C().int().nonnegative(),last_error:_().nullable().optional(),last_attempt_utc:_().nullable().optional()}).passthrough(),zQe=F({level0:$t("<zarr>/<group>/0"),view:$t("<zarr>/<group>/view/<L>"),view_levels:$t("1..n_view_levels from the group attrs"),scale_offset:$t("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:$t("<data_base>events.parquet").optional()}).passthrough(),bWt=F({format:$t("nemar-zarr-index"),format_version:$t(3),dataset_id:_().regex(qo,"NEMAR dataset id (nm/on/xx band)"),contract_base:_().regex(/^https:\/\//,"must be https"),data_base:_().regex(/^https:\/\//,"must be https"),data_base_kind:$t("s3-public"),s3_uri:_().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:_().min(1),s3_anonymous:oe(),source_commit:_().regex(hS,"must be a full 40-hex SHA"),engine_version:_().min(1),biosigio_version:_().nullable().optional(),updated_utc:_(),discovered_count:C().int().nonnegative(),store_count:C().int().nonnegative(),n_recordings:C().int().nonnegative(),errors:C().int().nonnegative(),failure_count:C().int().nonnegative(),pending_count:C().int().nonnegative(),stores:X(UQe),failures:X(BQe),pending:X(GQe),doi:_().nullable().optional(),license:_().nullable().optional(),citation:_().nullable().optional(),hed_version:_().nullable().optional(),events_parquet:_().regex(/^https:\/\//,"must be https").optional(),events_row_count:C().int().nonnegative().optional(),layout:zQe}).passthrough(),VQe=F({name:_(),configuration:pr(_(),li()).optional()}).passthrough(),wWt=F({zarr_format:$t(3),node_type:$t("array"),shape:X(C().int().nonnegative()),data_type:_(),chunk_grid:F({name:_(),configuration:pr(_(),li()).optional()}).passthrough(),codecs:X(VQe),fill_value:li().optional(),attributes:pr(_(),li()).optional(),dimension_names:X(_().nullable()).optional()}).passthrough(),WQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),groups:X(one).optional(),modalities:X(_()).optional()}).passthrough(),_Wt=F({format:$t("nemar-zarr-index"),format_version:C().int(),dataset_id:_().regex(qo,"NEMAR dataset id (nm/on/xx band)"),source_commit:_(),stores:X(WQe)}).passthrough()});function sne(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var KQe,JQe,YQe,XQe,La,EWt;var wS=H(()=>{iI();KQe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],JQe=["50","60"],YQe=["ready","pending","failed"],XQe=sI.options,La=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:JQe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:KQe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:XQe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:YQe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],EWt=new Map(La.map((e)=>[e.key,e]))});var QQe,DWt,ZQe,une,qb,ine,eZe,dne,tZe=20,nZe=100,rZe,fne,oZe,CWt,AWt,sZe,OWt,TWt,iZe,aZe,cZe,PWt,lZe=50,uZe=500,IWt,dZe,fZe,NWt,pZe=1000,mZe=5000,ane=8,hZe=100,gZe=32,cne,FWt,yZe,bZe,wZe,MWt,_Ze=800,xZe=4000,jWt,LWt,mI=60,hI=64,lne,vZe=86400,EZe=4096,qWt,SZe,kZe,UWt;var pne=H(()=>{hr();wS();pI();QQe=F({dataset_id:_().regex(qo),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:X(_()).optional(),tasks:X(_()).optional(),subject_count:C().int().nonnegative().nullable().optional(),has_hed:Ah([$t(0),$t(1)]).nullable().optional(),hed_version:_().nullable().optional(),store_count:C().int().nonnegative().nullable().optional(),recording_count:C().int().nonnegative().nullable().optional(),recordings_unavailable:C().int().nonnegative().nullable().optional(),total_recording_duration:C().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:C().int().nonnegative().nullable().optional(),zarr_verify_status:Le(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),index_url:_().nullable().optional()}).passthrough(),DWt=F({format:$t("nemar-zarr-catalog"),format_version:C().int(),generated_utc:_(),contract_base:_(),count:C().int().nonnegative(),datasets:X(QQe)}).passthrough(),ZQe=["verified","failed","unverifiable"],une=Le(ZQe).nullable(),qb=F({dataset_id:_().regex(qo),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),source_commit:_().regex(hS),index_etag:_().nullable(),engine_version:_(),source_tree:$t("raw"),derived:oe(),sss:yS.optional(),lossy:oe(),dtype:_().nullable(),effective_rate_hz:C().nullable(),source_rate_hz:C().nullable(),units_report:gS.nullable().optional(),zarr_verify_status:une,note:_().nullable().optional()}).passthrough().superRefine(bS),ine=F({start:C().int().nonnegative(),end:C().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),eZe=F({python_zarr:_(),zarrita:_(),python_browser:_()}).passthrough(),dne=F({contract_base:_(),data_base:_(),s3_uri:_(),s3_region:_(),s3_anonymous:oe(),zarr:_(),group:_(),level:Ah([$t("0"),C().int().positive()]),array_path:_(),dtype:_().nullable(),codecs:X(li()).optional(),chunk_samples:C().int().positive().nullable(),shard_samples:C().int().positive().nullable(),n_channels:C().int().nonnegative().nullable(),sample_slice:ine.optional(),channel_slice:ine.optional(),scale_offset:_(),how_to:eZe}).passthrough(),rZe=Object.fromEntries(La.map((e)=>[e.queryParam,_().optional()])),fne={modality:_().optional(),task:_().optional(),has_hed:oe().optional(),has_zarr:oe().optional(),author:_().optional(),has_doi:oe().optional(),has_zarr_verified:oe().optional(),data_complete:oe().optional(),recent:C().int().positive().optional(),license:_().optional()},oZe=Object.keys(fne),CWt=[...oZe,...La.map((e)=>e.queryParam)],AWt=F({query:_().optional(),...fne,include_unknown:oe().optional(),...rZe,limit:C().int().positive().max(nZe).default(tZe)}).passthrough(),sZe=F({dataset_id:_().regex(qo),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:X(_()).optional(),tasks:X(_()).optional(),subject_count:C().int().nullable().optional(),has_hed:oe().nullable().optional(),has_zarr:oe()}).passthrough(),OWt=F({results:X(sZe),count:C().int().nonnegative(),limit:C().int(),note:_().nullable().optional(),truncated:oe().optional()}).passthrough(),TWt=F({dataset_id:_().regex(qo)}).passthrough(),iZe=["list_recordings","get_events","render_overview","read_window"],aZe=F({next_cheapest_tool:Le(iZe),reason:_()}).passthrough(),cZe=["pending","ready","failed"],PWt=F({dataset_id:_().regex(qo),name:_(),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),modalities:X(_()).optional(),tasks:X(_()).optional(),subject_count:C().int().nullable().optional(),has_hed:oe().nullable().optional(),hed_version:_().nullable().optional(),recording_count:C().int().nullable().optional(),total_recording_duration_s:C().nullable().optional(),zarr_status:Le(cZe).nullable().optional(),zarr_verify_status:une.optional(),zarr_source_commit:_().nullable().optional(),zarr_store_count:C().int().nullable().optional(),cost_hint:aZe}).passthrough(),IWt=F({dataset_id:_().regex(qo),modality:_().optional(),min_duration_s:C().nonnegative().optional(),include_derived:oe().default(!1),limit:C().int().positive().max(uZe).default(lZe),offset:C().int().nonnegative().default(0)}).passthrough(),dZe=F({name:_(),modality:_().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nullable().optional(),duration_s:C().nullable().optional(),n_view_levels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),view_chunk_columns:C().int().positive().nullable().optional()}).passthrough(),fZe=F({path:_(),zarr:_(),source_tree:$t("raw"),derived:oe(),groups:X(dZe).optional(),n_events:C().int().nonnegative().optional(),sss:yS.optional(),units_report:gS.optional()}).passthrough().superRefine(bS),NWt=F({dataset_id:_().regex(qo),source_commit:_().regex(hS).nullable(),recordings:X(fZe),total_count:C().int().nonnegative(),excluded_derived_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),index_format_version:C().int(),discovered_count:C().int().nonnegative().nullable(),failure_count:C().int().nonnegative().nullable(),pending_count:C().int().nonnegative().nullable(),excluded_legacy_non_raw_count:C().int().nonnegative(),note:_().nullable().optional(),envelope:qb.optional()}).passthrough(),cne=_().min(1).max(64),FWt=F({dataset_id:_().regex(qo),recording:_(),group:_().optional(),limit:C().int().positive().max(mZe).default(pZe),offset:C().int().nonnegative().default(0),where:pr(cne,X(Ah([_(),C()])).min(1).max(hZe)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=ane},{message:`where names 1 to ${ane} columns`}).optional(),columns:X(cne).min(1).max(gZe).optional()}).passthrough(),yZe=F({store_path:_(),group_name:_(),onset_s:C(),duration_s:C().nullable().optional(),sample_index:C().int().nonnegative(),trial_type:_().nullable().optional(),value:Ah([_(),C()]).nullable().optional(),hed:_().nullable().optional()}).passthrough(),bZe=yZe.partial().required({onset_s:!0,sample_index:!0}),wZe=F({name:_(),distinct_count:C().int().nonnegative(),null_count:C().int().nonnegative(),values:X(F({value:_(),count:C().int().positive()}).passthrough()).nullable()}).passthrough(),MWt=F({dataset_id:_().regex(qo),recording:_(),events:X(bZe),source:Le(["events_parquet","events_tsv_fallback"]),estimated:oe(),total_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),truncated:oe(),note:_().nullable().optional(),columns_summary:X(wZe).optional(),envelope:qb.optional()}).passthrough(),jWt=F({dataset_id:_().regex(qo),recording:_(),group:_().optional(),width_px:C().int().positive().max(xZe).default(_Ze)}).passthrough(),LWt=F({dataset_id:_().regex(qo),recording:_(),group:_(),level:C().int().positive(),width_px:C().int().positive(),height_px:C().int().positive(),mime_type:$t("image/png"),columns_read:C().int().nonnegative(),chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),envelope:qb.optional()}).passthrough(),lne=mI*hI,qWt=F({dataset_id:_().regex(qo),recording:_(),group:_().optional(),start_s:C().nonnegative().default(0),duration_s:C().positive().max(vZe).default(10),channels:X(C().int().nonnegative()).max(EZe).optional(),taste:oe().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:ee.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>mI)t.addIssue({code:ee.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${mI} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>hI)t.addIssue({code:ee.custom,message:`taste channels (${e.channels.length}) exceeds the ${hI}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>lne)t.addIssue({code:ee.custom,message:`taste exceeds the cap of ${lne} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),SZe=F({mode:$t("recipe"),recipe:dne,envelope:qb}).passthrough(),kZe=F({mode:$t("taste"),start_s:C(),duration_s:C(),channels:X(C().int()),sample_rate_hz:C(),values:X(X(C())),recipe:dne,chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),filled_ranges:X(F({start_sample:C().int().nonnegative(),end_sample:C().int().nonnegative(),start_s:C(),end_s:C()}).passthrough()),note:_().nullable().optional(),envelope:qb}).passthrough(),UWt=JP("mode",[SZe,kZe])});function hne(e){let t=Jf.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return $Ze+t}var _l,_S,RZe,GWt,Jf,mne=0,$Ze=10,DZe,gne,Ub,yne,CZe,zWt,VWt,bne,xS,vS,wne;var Yf=H(()=>{_l=/^[a-z0-9_]{1,64}$/,_S=["created","uploading","submitted","queued","running","archiving","finished","failed","cancelled","unreported"],RZe=["created","uploading","submitted","queued","running","archiving","unreported"],GWt=RZe.filter((e)=>e!=="created"&&e!=="uploading"&&e!=="unreported"),Jf=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];DZe=["code_fetch_failed","dataset_fetch_failed","tapis_submit_failed","submit_timeout","staging_failed","launch_failed","archive_failed","tapis_error","result_verification_failed","records_unavailable","result_upload_failed","tapis_record_lost","runner_lost"],gne=["su","none"],Ub=["local","slurm"],yne={runner_credential_not_accepted:401,runner_unknown:401,runner_token_expired:401,runners_disabled:503,lease_lost:409,job_not_claimed:404,runner_outdated:426,protocol_unsupported:426,runner_accounting_unbuilt:409,invalid_body:400},CZe=["results_too_large","results_quota_exceeded","too_many_outputs"],zWt={code_fetch_failed:["unsafe_archive","archive_too_large","bad_response","fetch_failed","checksum_mismatch","digest_mismatch","size_mismatch","content_missing","disk_error"],dataset_fetch_failed:["bad_include","too_many_files","too_many_bytes","dataset_not_found","bad_manifest","manifest_too_large","unsafe_path","bad_response","fetch_failed","checksum_mismatch","size_mismatch","content_missing","file_not_found","disk_error"],entry_not_found:[],runtime_error:["entry_failed","terminated","outputs_unreadable","invalid_spec","unsupported_runtime","scratch_in_output","scratch_unavailable","no_container_runtime","image_missing","image_unverified","runtime_unusable","internal_error","output_dir_not_empty","bind_source_unsafe","pid_namespace_unavailable"],out_of_memory:[],time_limit:[],result_upload_failed:[...CZe,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},VWt=[...Jf,...DZe.filter((e)=>!Jf.includes(e))],bne={no_compute_access:403,suspended:403,insufficient_balance:409,over_job_limit:422,over_concurrency:409,platform_budget_exhausted:409,client_cap_reached:409,invalid_spec:400,partition_not_offered:422,runtime_unavailable:422,registry_not_allowed:422,compute_disabled:503,dataset_not_eligible:422,recipe_unknown:422,pipelines_account_missing:503,live_attempt_exists:409,bundle_too_large:413,bundle_too_many_files:413,results_too_large:413,results_quota_exceeded:409,too_many_outputs:413,results_expired:410,job_not_found:404,bad_state:409,guard_refused:409,results_incomplete:409,policy_unavailable:503,platform_busy:409},xS=["unreserved","unattributed","mismatch","overrun"],vS=["pending","attempting","sent","failed"],wne=["job","account"]});function _I(e){return _().max(e).regex(AZe).refine((t)=>!bI.test(t),{message:"a path may not hold . or .. segments"})}function Gb(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))Gb(t)}return e}function $ne(e){if(typeof e!=="string")return null;let t=IZe.exec(e);if(!t)return null;let n=BigInt(t[1])*1000n+BigInt((t[2]??"").padEnd(3,"0"));if(n>BigInt(Sne))return null;return Number(n)}function so(e){if(!Number.isSafeInteger(e))throw RangeError("an amount is a whole number of milli-SU");let t=Math.abs(e),n=Math.floor(t/1000),r=t%1000,o=r===0?"":`.${String(r).padStart(3,"0").replace(/0+$/,"")}`;return`${e<0?"-":""}${n}${o}`}function MZe(e){let t=0;while(t<e.length){if(e[t]!=="["){t++;continue}let n=e[t+1]==="!"?t+2:t+1,r=e.indexOf("]",n);if(r===-1)return null;if(r===n)return"empty_class";let o=Array.from(e.slice(n,r),(s)=>s.codePointAt(0));for(let s=0;s<o.length;)if(s+2<o.length&&o[s+1]===45){if(o[s]>o[s+2])return"inverted_range";s+=3}else s++;t=r+1}return null}function UZe(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return!1;t++}else if(n>=56320&&n<=57343)return!1}return!0}function BZe(e,t){let n=MZe(e);if(n!==null)t.addIssue({code:ee.custom,message:`an include pattern the dialect refuses: ${n}`})}function Mh(e){let t=2;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===34||r===92)t+=2;else if(r===8||r===9||r===10||r===12||r===13)t+=2;else if(r<32||r>=127)t+=6;else t+=1}return t}function VZe(e){let t=0;if(e.entry!==void 0)t+=Mh(e.entry)+1;for(let n of e.command??[])t+=Mh(n)+1;for(let n of e.args??[])t+=Mh(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=Mh(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=Mh(n)+Mh(r)+2;return t}var yI="\\u0000-\\u001f\\u007f",RS,_ne,AZe,bI,OZe,TZe,Bb=1e5,xl,$S,jh,Xf,DS,vne,Ene=64,Sne,Hb=(e,t=Sne)=>C().int().min(e).max(t),xt,wI,SS,kne,xI,Lh,vI,PZe,ES=2880,Rne,IZe,qh,EI,NZe,SI,FZe,kI="A path inside the bundle. With runtime python the launcher runs python /code/<entry> followed by args; with runtime image and an entry it runs /code/<entry> directly, followed by args, which needs the executable bit that the bundle packer must preserve. The runtime image must provide python on its PATH for the python runtime. A bundle archive's member names may carry a leading ./; absolute names, .. segments, links, devices and FIFOs are refused by the launcher.",RI="An argument vector, run as given, with args appended.",$I="Arguments, each as one argument: after python /code/<entry> (runtime python with an entry), after /code/<entry> (runtime image with an entry) or after the command.",DI="Patterns that select the dataset's files, matched against manifest paths relative to the dataset root; every file when there are none. The dialect: **/ matches zero or more directories (so a/**/b matches a/b); ** elsewhere matches any run of characters including /; * and ? stay inside one path segment; [abc], [a-c] and [!abc] are character classes; a character class never matches /, so like * and ? it stays inside one path segment, and a negated class [!a] matches any single character except a and /; an unterminated [ is a literal [; an empty class [] and an inverted range such as [z-a] are refused, and bad_include is exactly the set of patterns this dialect refuses; matching is case-sensitive; there are no escapes. A matcher MUST run in time linear in the pattern's length times the path's length (no backtracking).",jZe,LZe,qZe,Uh,kS=(e)=>e.refine(UZe,{message:"a lone surrogate is not text a process argument can carry"}),HZe,GZe,zZe,WZe=49152,YWt,KZe,JZe,YZe,XZe,QZe,ZZe,Dne,gI=1073741824,xne=1048576,eet,XWt,QWt,tet,ZWt,Cne,eKt,net,tKt;var vl=H(()=>{hr();Yf();RS=`[^/\\\\${yI}]+`,_ne=RS,AZe=new RegExp(`^(?:${_ne}/)*${_ne}$`),bI=/(?:^|\/)\.\.?(?:\/|$)/,OZe=new RegExp(`^[^\\\\${yI}]+$`),TZe=/^\/|(?:^|\/)\.\.(?:\/|$)/,xl=/^job_[0-9a-f]{24}$/,$S=/^[0-9a-f]{64}$/,jh=/^sha256:[0-9a-f]{64}$/,Xf=/^[a-z]{2}[0-9]{6}$/,DS=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,vne=/^(?:latest|v[0-9]+\.[0-9]+\.[0-9]+)$/,Sne=Number.MAX_SAFE_INTEGER,xt=Hb,wI=_().regex(xl),SS=_().regex($S);kne=_I,xI=_().max(256).regex(OZe).refine((e)=>!TZe.test(e),{message:"a pattern may not leave the dataset"});Lh=["cpu","gpu"],vI=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],PZe=F({maxNodes:xt(1,64),maxCoresPerNode:xt(0,256),maxGpusPerNode:xt(0,8),maxMinutes:xt(1,10080)}).strict(),Rne=Gb({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:ES}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:ES}},debug:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:30}},"large-shared":{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:null},preempt:{pool:"cpu",rate:"core_or_memory",preempt:!0,ceiling:null},"gpu-shared":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:3,maxMinutes:ES}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:ES}},"gpu-debug":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:30}},"gpu-preempt":{pool:"gpu",rate:"gpu_or_memory",preempt:!0,ceiling:null}}),IZe=/^([0-9]+)(?:\.([0-9]{1,3}))?$/;qh=["result.json","provenance.json","manifest.json","launcher.log"],EI=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],NZe=/^[ -~]*$/,SI=_().max(256).regex(NZe),FZe=pr(Le(EI),SI);jZe=["python","matlab","image"],LZe=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,qZe=/^[a-z][a-z0-9-]{0,63}$/,Uh=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;HZe=F({size:xt(1),sha256:SS}).strict(),GZe=F({id:_().regex(Xf),version:_().regex(DS),include:X(kS(xI).superRefine(BZe)).max(64).optional().describe(DI)}).strict(),zZe=kS(_().max(1024));YWt=F({name:_().regex(LZe),runtime:Le(jZe),entry:kS(kne(240)).optional().describe(kI),command:X(kS(_().min(1).max(1024))).min(1).max(64).optional().describe(RI),args:X(zZe).max(64).default([]).describe($I),bundle:HZe.optional(),datasets:X(GZe).max(20).default([]),partition:Le(vI),nodes:xt(1,64).default(1),cores:xt(1,256).default(1),memory_mb:xt(1,16777216).optional(),gpus:xt(0,8).default(0),minutes:xt(1,10080),output_dir:$t("outputs").default("outputs"),env:FZe.default({}),recipe:_().regex(qZe).optional(),image:_().max(512).regex(Uh).optional()}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ee.custom,path:[o],message:s});if(e.entry!==void 0&&e.command!==void 0)n("command","an entry and a command are one or the other");if(e.runtime==="image"&&e.image===void 0)n("image","an image job names a digest-pinned image");if(e.runtime!=="image"&&e.image!==void 0)n("image","only an image job names an image");if(e.recipe===void 0&&e.entry===void 0&&e.command===void 0)n("entry","a job with no recipe names an entry or a command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");if(VZe(e)>WZe)t.addIssue({code:ee.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=Rne[e.partition].pool;if(r==="gpu"&&e.gpus<1)n("gpus","a GPU partition needs at least one GPU");if(r==="cpu"&&e.gpus!==0)n("gpus","a CPU partition takes no GPU")}),KZe=/^[A-Za-z0-9_.-]{1,64}$/,JZe=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,YZe=Object.fromEntries(vI.map((e)=>[e,PZe.optional()])),XZe=F({maxOpenReservations:xt(0,1e5),maxReservedMilliPerDay:xt(0)}).strict(),QZe=F({maxLiveJobs:xt(0,1000),reserved:F({people:xt(0,1000),pipelines:xt(0,1000),partner:xt(0,1000)}).strict()}).strict().refine((e)=>e.reserved.people+e.reserved.pipelines+e.reserved.partner<=e.maxLiveJobs,{message:"the floors reserved for the classes add up to more than the ceiling",path:["reserved"]}),ZZe=F({maxLiveJobs:F({cpu:xt(0,1000),gpu:xt(0,1000)}).strict()}).strict(),Dne=F({defaultGrantMilli:F({cpu:xt(0),gpu:xt(0)}).strict(),renewal:F({enabled:oe(),everyDays:xt(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:F(YZe).strict(),maxLiveJobsPerPerson:xt(0,1000),pipelines:F({dailyJobCap:xt(0,1e5),maxLiveJobs:F({cpu:xt(0,1000),gpu:xt(0,1000)}).strict()}).strict(),clients:pr(_().regex(KZe),XZe),tenant:QZe.optional(),runners:ZZe.optional(),reservationWaitMinutes:xt(1,1440),retention:F({recordsYears:xt(1,30),logsDays:xt(1,3650),resultsDays:xt(14,365)}).strict(),resultLimits:F({maxJobBytes:xt(1),maxFiles:xt(1,Bb),maxStoredBytesPerPerson:xt(1),maxStoredBytesTotal:xt(1)}).strict(),settle:F({toleranceMilli:xt(0),tolerancePercent:xt(0,100)}).strict(),registries:X(_().max(255).regex(JZe)).max(64),bundleLimits:F({maxTotalBytes:xt(1),maxFiles:xt(1,1e5),maxFileBytes:xt(1)}).strict()}).strict(),eet=Gb({maxLiveJobs:20,reserved:{people:8,pipelines:2,partner:0}}),XWt=Gb({maxLiveJobs:{cpu:64,gpu:8}}),QWt=Gb({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(vI.flatMap((e)=>{let t=Rne[e].ceiling;return t?[[e,{...t}]]:[]})),maxLiveJobsPerPerson:4,pipelines:{dailyJobCap:50,maxLiveJobs:{cpu:8,gpu:4}},clients:{},tenant:eet,reservationWaitMinutes:30,retention:{recordsYears:7,logsDays:365,resultsDays:30},resultLimits:{maxJobBytes:20*gI,maxFiles:5000,maxStoredBytesPerPerson:50*gI,maxStoredBytesTotal:1024*gI},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*xne,maxFiles:2000,maxFileBytes:25*xne}}),tet=F({path:kne(512),size:xt(0),sha256:SS}).strict(),ZWt=F({job_id:wI,files:X(tet).max(Bb)}).strict(),Cne=C().int().min(-255).max(255).nullable(),eKt=F({job_id:wI,failure_code:Le(Jf).nullable(),detail:_().regex(_l).nullable(),exit_number:C().int(),entry_exit_code:Cne}).strict().superRefine((e,t)=>{let n=e.failure_code===null?mne:hne(e.failure_code);if(e.exit_number!==n)t.addIssue({code:ee.custom,path:["exit_number"],message:"the exit number is the one the failure code gives"})}),net=F({id:_().regex(Xf),version:_().regex(DS),mode:Le(["bind","download"]),files:xt(0),bytes:xt(0)}).strict(),tKt=F({job_id:wI,launch_spec_digest:SS,bundle_digest:SS.nullable(),image:F({uri:_().regex(/^[^\s]{1,512}$/),digest:_().regex(jh)}).strict(),runtime_version:_().regex(new RegExp(`^[^${yI}]{1,128}$`)),staging:X(net).max(20),timings:pr(_().regex(_l),C().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:_().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:Cne}).strict()});var Ane,rKt;var One=H(()=>{Ane=["dispatched","succeeded","failed","refused"],rKt=Object.freeze([Object.freeze({name:"nemar-floor",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"shared",nodes:1,cores:4,memoryMb:16384,gpus:0,minutes:360,input:"bids",executors:Object.freeze(["tapis"]),autoDispatch:!0,eligibility:"eeg"}),Object.freeze({name:"nemar-floor-zarr",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"shared",nodes:1,cores:4,memoryMb:16384,gpus:0,minutes:120,input:"zarr",executors:Object.freeze(["runner"]),autoDispatch:!1,eligibility:"eeg"}),Object.freeze({name:"nemar-ica",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"gpu-shared",nodes:1,cores:10,gpus:1,minutes:720,input:"bids",executors:Object.freeze(["tapis"]),autoDispatch:!1,placeholder:!0,eligibility:"eeg"})])});function Pne(e){return CI.includes(e)}var ret="pipelines",oet="people",CI,CS,zb=200,Wi,AI,set,Ine,Nne,Fne,OI,Mne,Is,TI,PI,II=100,NI=10,jne=10,AS,FI=200,iet,cKt,aet,cet,uet,Lne,det,qne,OS=8,TS=200,Une,Bne,Tne,Hne,Gne,zne,Vne,Wne,Kne,MI,Jne,Yne,Xne;var Bh=H(()=>{hr();One();Yf();CI=[ret,oet];CS=["granted","charged"],Wi=C().int(),AI=F({id:C().int(),holder_kind:_(),holder_ref:_(),pool:_(),granted_milli:Wi,held_milli:Wi,charged_milli:Wi,available_milli:Wi,frozen:oe(),created_at:_(),updated_at:_()}).passthrough(),set=F({id:C().int(),kind:_(),pool_id:C().int(),budget_pool_id:C().int().nullable(),granted_delta_milli:Wi,held_delta_milli:Wi,charged_delta_milli:Wi,job_id:_().nullable(),hold_ref:C().int().nullable(),reason:_().nullable(),actor_user_id:C().int().nullable(),created_at:_()}).passthrough(),Ine=F({pools:X(AI),next_after:C().int().nullable()}).passthrough(),Nne=F({account_id:C().int(),pools:X(AI)}).passthrough(),Fne=F({pool:AI,entry:set,replayed:oe()}).passthrough(),OI=F({version:C().int().nullable(),is_default:oe(),policy:F({}).passthrough(),set_by:C().int().nullable(),note:_().nullable(),created_at:_().nullable()}).passthrough(),Mne=F({switches:F({environment:_(),compute_enabled:oe(),pipelines_dispatch_enabled:oe()}).passthrough(),tapis:F({configured:oe(),strategy:_().nullable(),problems:X(_()),token:_(),health:_()}).passthrough(),storage:F({records_binding:oe(),results_binding:oe(),signing_configured:oe()}).passthrough(),access:F({key_configured:oe(),resource_name_configured:oe().optional()}).passthrough(),runtime_image:F({set:oe(),valid:oe(),digest:_().nullable()}).passthrough().optional(),prerequisites:F({callback_secret:oe(),api_base_url:oe(),pipelines_account:oe(),policy_set:oe(),people_pool_granted:oe(),pipelines_pool_granted:oe()}).passthrough().optional(),reconciliation:F({paused:oe()}).passthrough().optional(),attention:pr(li()).optional(),tenant:F({ceiling:C(),occupied:C(),by_class:F({people:C(),pipelines:C(),partner:C(),other:C()}).passthrough(),reserved:F({people:C(),pipelines:C(),partner:C()}).passthrough()}).passthrough().optional()}).passthrough(),Is=_().nullable(),TI=F({id:_(),account_id:C().int().nullable(),source:_(),kind:_(),state:_(),tapis_status:Is,failure_code:Is,failure_detail:Is,platform_failure:oe(),cancel_requested:oe(),cancel_reason:Is,partition:_(),pool:_(),held_milli:Wi,charged_milli:Wi,settled:oe(),flags:X(_()),created_at:_(),submitted_at:Is,started_at:Is,ended_at:Is,tapis_synced_at:Is,outputs_completed:oe(),results_verified:oe(),results_bytes:C().int().nullable(),records_copied:oe(),executor:_().optional(),accounting:_().optional(),runner_backend:Is.optional(),runner_id:Is.optional(),runner_claimed_at:Is.optional(),runner_wall_seconds:C().int().nullable().optional(),runner_cpu_seconds:C().int().nullable().optional(),runner_max_rss_mb:C().int().nullable().optional()}).passthrough(),PI=F({ok:oe(),outcome:_(),submit:_().optional(),job:TI.nullable()}).passthrough(),AS=Ane,iet={recipe_not_automatic:422,recipe_placeholder:422,registry_drift:409,version_not_found:404,version_untagged:422,too_many_files:422,zarr_version_not_newest:422,zarr_copy_not_ready:409,zarr_source_mismatch:409,zarr_source_unverifiable:503,runners_disabled:yne.runners_disabled,daily_cap_reached:409,create_failed:502,run_failed:500},cKt={...bne,...iet},aet=F({dataset_id:_(),ok:oe(),version:_().optional(),job_id:_().optional(),stamp_id:C().int().optional(),attempt:C().int().optional(),submit:_().optional(),records_written:oe().optional(),code:_().optional(),blocked_by:X(_()).optional(),reason:_().optional()}).passthrough(),cet=F({daily_left:C().int(),live_left:C().int(),tenant_left:C().int().optional(),limited_by:_()}).passthrough(),uet=F({live_left:C().int(),live_cap:C().int()}).passthrough(),Lne=F({ok:oe(),dry_run:oe(),recipe:_(),results:X(aet).optional(),dispatched:C().int().optional(),stopped_by:_().nullable().optional(),room:cet.optional(),executor:_().optional(),runner_room:uet.optional(),audit_pending:oe().optional(),estimate_milli_per_job:Wi.optional(),estimate_milli_total:Wi.optional(),config:F({compute_enabled:oe(),runtime_image:oe(),pipelines_account:oe(),runners_enabled:oe().optional()}).passthrough().optional(),would_dispatch:X(F({dataset_id:_(),version:_()}).passthrough()).optional(),blocked:F({code:_(),blocked_by:X(_()),version:_().optional(),reason:_().optional()}).passthrough().optional(),blocked_by_term:pr(li()).optional()}).passthrough(),det=F({id:C().int(),dataset_id:_(),version:_(),recipe:_(),recipe_version:_(),engine:_(),attempt:C().int(),state:_(),job_id:Is,refusal_code:Is,created_at:_(),updated_at:_()}).passthrough(),qne=F({stamps:X(det),next_before:C().int().nullable()}).passthrough(),Une=F({jobs:X(TI),next_after:C().int().nullable()}).passthrough(),Bne=F({rows:X(F({slurm_job_id:_(),partition:_(),state:_(),elapsed_seconds:C().int(),alloc_nodes:C().int(),alloc_cpus:C().int(),alloc_gpus:C().int(),charged_milli:C().int().nullable(),ingested_at:_()}).passthrough()),total:C().int()}).passthrough(),Tne=["ok","missing","unreadable"],Hne=F({job:TI,identifiers:F({}).passthrough(),ledger:X(F({}).passthrough()),provenance:F({}).passthrough().nullable(),provenance_status:Le(Tne).optional(),manifest:F({files:C().int(),bytes:C().int()}).passthrough().nullable(),manifest_status:Le(Tne).optional(),legal_hold:oe(),retention_until:_().nullable().optional(),launcher_files:X(_()).optional()}).passthrough(),Gne=F({job_id:_(),name:_(),kind:_(),content:li().optional(),url:_().optional(),expires_at:_().optional()}).passthrough(),zne=F({account_id:C().int(),from:_(),to:_(),totals:F({jobs:C().int(),charged_milli:C().int(),unsettled:C().int().optional(),open_hold_milli:C().int().optional()}).passthrough(),by_pool:pr(F({}).passthrough()),jobs:X(F({}).passthrough()),truncated:oe()}).passthrough(),Vne=F({quarter:_(),rows:X(F({partition:_(),source:_(),distinct_users:C().int(),jobs:C().int()}).passthrough()),totals:F({distinct_users:C().int(),jobs:C().int()}).passthrough()}).passthrough(),Wne=F({id:C().int(),scope:_(),ref:_(),reason:_(),placed_by:C().int(),placed_at:_(),released_at:_().nullable()}).passthrough(),Kne=F({holds:X(Wne),truncated:oe().optional()}).passthrough(),MI=F({hold:Wne}).passthrough(),Jne=F({rows:X(F({job_id:_(),state:_(),attempts:C().int(),last_error_code:_().nullable(),next_attempt_at:_(),sent_at:_().nullable(),created_at:_()}).passthrough()),failed_by_word:pr(li()),next_after:_().nullable()}).passthrough(),Yne=F({ok:oe(),job_id:_(),previous:_().nullable()}).passthrough(),Xne=F({run_id:_(),token:_(),expires_in_minutes:C().int()}).passthrough()});function Ret(e){if(typeof e!=="string"||!jh.test(e))return null;return`${e.slice(7)}.sif`}var fet=65536,ere,pet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",mKt,met,Hh,tre,het,get,yet,Qne,Zne=" Exactly one of entry and command is present.",bet="the image file is not <64 lowercase hex>.sif",wet="the image file is not the one named for the image digest",_et="the image reference is not a digest-pinned reference",xet="the image reference is not pinned to the image digest",vet,Eet,ket,hKt,nre,rre,gKt,yKt,bKt;var ore=H(()=>{hr();vl();ere=Math.ceil(fet*4/3),mKt=new Set(pet),met=["python","image"],Hh=Hb,tre=_I,het=/^https?:\/\/[^\s/?#][^\s?#]*$/,get=/^https?:\/\/[^\s]+$/,yet=/^[A-Za-z0-9_-]{16,256}$/,Qne=/^[0-9a-f]{64}\.sif$/,vet=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,Eet=new RegExp(`^(?:outputs/(?:${RS}/)*${RS}|launcher/(?:${qh.map((e)=>e.replace(".","\\.")).join("|")}))$`),ket=F(Object.fromEntries(EI.map((e)=>[e,SI.optional()]))).strict(),hKt=F({job_id:_().regex(xl),runtime:Le(met),entry:tre(240).optional().describe(kI+Zne),command:X(_().min(1).max(1024)).min(1).max(64).optional().describe(RI+Zne),args:X(_().max(1024)).max(64).describe($I),bundle:F({sha256:_().regex($S),size:Hh(1)}).strict().optional(),datasets:X(F({id:_().regex(Xf),version:_().max(Ene).regex(vne),include:X(xI).max(64).optional().describe(DI)}).strict()).max(20),api_base:_().max(512).regex(het),image:F({uri:_().max(512).regex(Uh,_et),digest:_().regex(jh),sif:_().regex(Qne,bet)}).strict(),env:ket,resources:F({gpus:Hh(0,8)}).strict(),limits:F({max_files:Hh(1,1e6),max_total_bytes:Hh(1)}).strict(),job_token:_().regex(yet)}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ee.custom,path:[o],message:s});if(e.entry===void 0===(e.command===void 0))n("entry","exactly one of entry and command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");let r=Ret(e.image.digest);if(r!==null&&Qne.test(e.image.sif)&&e.image.sif!==r)t.addIssue({code:ee.custom,path:["image","sif"],message:wet});if(r!==null&&Uh.test(e.image.uri)&&!e.image.uri.endsWith(e.image.digest))t.addIssue({code:ee.custom,path:["image","uri"],message:xet})});nre=_().max(4096).regex(get),rre=_().regex(vet),gKt=F({url:nre,expires_at:rre}).passthrough(),yKt=F({outputs:X(F({path:tre(512),size:Hh(0),sha256:_().regex($S)}).strict()).max(Bb),launcher:X(F({name:Le(qh),size:Hh(0)}).strict()).length(qh.length)}).strict().superRefine((e,t)=>{if(new Set(e.launcher.map((n)=>n.name)).size!==qh.length)t.addIssue({code:ee.custom,path:["launcher"],message:"each launcher file is named once"})}),bKt=F({uploads:X(F({path:_().max(600).regex(Eet).refine((e)=>!bI.test(e),{message:"no . or .. segments"}),url:nre}).passthrough()).max(Bb+qh.length),expires_at:rre}).passthrough()});var sre="nemar.runner.v1",$et,Wb,Vb,jI,Det="nmr_",Cet="nmra_",ire="[0-9a-f]{64}",Aet,Oet,LI,Tet,Pet,are=32,Ns,Iet,Net,Fet,Met,jet=32,Let,qI,UI,BI,HI,GI,cre,lre,SKt,kKt,RKt,qet,$Kt,ure,DKt,Uet,CKt,AKt,OKt;var PS=H(()=>{hr();Yf();ore();vl();$et=["started","uploading"],Wb=["amd64","arm64"],Vb=["apptainer","docker","podman"],jI=["lab","hpc"],Aet=new RegExp(`^${Det}${ire}$`),Oet=new RegExp(`^${Cet}${ire}$`),LI=/^rnr_[0-9a-f]{24}$/,Tet=/^[0-9a-f]{32}$/,Pet=/^[a-z0-9_]{1,32}$/,Ns=Hb,Iet=Number.MAX_SAFE_INTEGER,Net=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,Fet=/^[0-9a-f]{64}\.sif$/,Met=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Let=/^[A-Za-z0-9_-]+$/,qI=_().regex(_l),UI=_().regex(xl),BI=_().regex(Tet),HI=_().max(jet).regex(Met),GI=_().regex(Net),cre=X(Le(Vb)).min(1).max(Vb.length).refine((e)=>new Set(e).size===e.length,{message:"each runtime is named once"}),lre=F({name:qI,pool:Le(Lh),cores:Ns(1,256),memory_mb:Ns(1,16777216),gpus:Ns(0,8),scratch_gb:Ns(1,1e5),backend:Le(Ub),runtimes:cre,arch:Le(Wb),accounting:Le(gne),site:_().regex(Pet),trust:Le(jI)}).strict(),SKt=F({protocol:$t(sre),runner_version:HI}).strict(),kKt=F({protocol:$t(sre),free_slots:Ns(1,are),runtimes:cre,arch:Le(Wb),runner_version:HI}).strict(),RKt=F({job_id:UI,lease_id:BI,phase:Le($et)}).strict(),qet=F({wall_seconds:Ns(0),cpu_seconds:Ns(0),max_rss_mb:Ns(0)}).strict(),$Kt=F({job_id:UI,lease_id:BI,exit_number:Ns(0,255),launcher_failure_code:Le(Jf).nullable(),launcher_detail:qI.nullable(),usage:qet,usage_partial:oe(),scratch_discarded:oe()}).strict(),ure=F({runner_id:_().regex(LI),secret:_().regex(Aet)}).passthrough(),DKt=F({access_token:_().regex(Oet),expires_at:GI}).passthrough(),Uet=F({id:UI,lease_id:BI,lease_expires_at:GI,launch_spec_env:_().max(ere).regex(Let),image:F({uri:_().max(512).regex(Uh),digest:_().regex(jh),sif:_().regex(Fet)}).passthrough(),cores:Ns(1,256),memory_mb:Ns(1,16777216).nullable(),gpus:Ns(0,8),minutes:Ns(1,Iet)}).passthrough(),CKt=F({jobs:X(Uet).max(are),min_runner_version:HI}).passthrough(),AKt=F({lease_expires_at:GI,cancel:oe()}).passthrough(),OKt=F({state:qI}).passthrough()});var Gh=H(()=>{oI();Oh();iI();jb();aI();dS();Ih();Fh();pI();pne();vl();Bh();PS()});function jr(e){return typeof e==="string"&&Get.test(e)&&!e.includes("..")}function El(e){return/^v\d/.test(e)?e.slice(1):e}function Lr(e,t){return El(e)===El(t)}var Get;var Ki=H(()=>{Get=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function W(e){if(e instanceof Error)return e.message;return String(e)}function Vh(e){if(!(e instanceof U)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var U,Ju;var ze=H(()=>{U=class U extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;constructor(e,t,n,r,o,s){super(t);this.statusCode=e;this.details=n;this.step=r;this.blockReason=o;this.missing=s;this.name="ApiError"}};Ju=class Ju extends U{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var zet,Vet,Wet,ZKt,pre="override_publication_review",mre="publication_review_not_clear",WI=2000;var NS=H(()=>{zet=["dispatched","redispatched","dispatch_claimed"],Vet=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],Wet=["dispatch_failed","dispatch_unconfigured"],ZKt=[...zet,...Vet,...Wet]});var FS=1e4;function MS(e){return e?Jet:qa}var qa,nJt,Ket,Jet,KI;var jS=H(()=>{qa=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],nJt=qa.slice(0,qa.indexOf("s3_public_read")),Ket=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],Jet=qa.filter((e)=>!Ket.includes(e));KI={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function Yet(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function Xet(e){return new TextEncoder().encode(Yet(e)).length}function hre(e){if(Xet(e)<=50)return null;return["search is too long: its match pattern may be at most 50 bytes,","which is about 48 plain characters (each of _ % \\ counts twice and a non-ASCII","character counts by its UTF-8 length)"].join(" ")}function LS(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function gre(e,t){if(e==="")return!0;let n=LS(e);return t.some((r)=>typeof r==="string"&&LS(r).includes(n))}function yre(e,t){return LS(e)===LS(t)}function qS(e){let t=[],n="",r="start",o=!1;for(let s of e)switch(s){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(o)n+=s;r="property",o=!o;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(o){o=!1,n+=s;break}if(JI.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(o){o=!1,n+=s;break}if(r==="property"){if(JI.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!Qet.has(s))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(o)o=!1,n+="\\";n+=s}}if(o)n+="\\";switch(r){case"property":{if(JI.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function YI(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function bre(e,t){if(YI(e,t))throw Error("Cannot use string index")}function wre(e,t,n){if(!Qf(e)||typeof t!=="string")return n===void 0?e:n;let r=qS(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(YI(e,s))e=o===r.length-1?void 0:null;else e=e[s];if(e===void 0||e===null){if(o!==r.length-1)return n;break}}return e===void 0?n:e}function XI(e,t,n){if(!Qf(e)||typeof t!=="string")return e;let r=e,o=qS(t);for(let s=0;s<o.length;s++){let i=o[s];if(bre(e,i),s===o.length-1)e[i]=n;else if(!Qf(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function _re(e,t){if(!Qf(e)||typeof t!=="string")return!1;let n=qS(t);for(let r=0;r<n.length;r++){let o=n[r];if(bre(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!Qf(e))return!1}}function xre(e,t){if(!Qf(e)||typeof t!=="string")return!1;let n=qS(t);if(n.length===0)return!1;for(let r of n){if(!Qf(e)||!(r in e)||YI(e,r))return!1;e=e[r]}return!0}var Qf=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},JI,Qet;var vre=H(()=>{JI=new Set(["__proto__","prototype","constructor"]),Qet=new Set("0123456789")});import Mn from"path";import Ere from"os";import QI from"process";function eN(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(QI.platform==="darwin")return Zet(e);if(QI.platform==="win32")return ett(e);return ttt(e)}var Yu,ZI,Wh,Zet=(e)=>{let t=Mn.join(Yu,"Library");return{data:Mn.join(t,"Application Support",e),config:Mn.join(t,"Preferences",e),cache:Mn.join(t,"Caches",e),log:Mn.join(t,"Logs",e),temp:Mn.join(ZI,e)}},ett=(e)=>{let t=Wh.APPDATA||Mn.join(Yu,"AppData","Roaming"),n=Wh.LOCALAPPDATA||Mn.join(Yu,"AppData","Local");return{data:Mn.join(n,e,"Data"),config:Mn.join(t,e,"Config"),cache:Mn.join(n,e,"Cache"),log:Mn.join(n,e,"Log"),temp:Mn.join(ZI,e)}},ttt=(e)=>{let t=Mn.basename(Yu);return{data:Mn.join(Wh.XDG_DATA_HOME||Mn.join(Yu,".local","share"),e),config:Mn.join(Wh.XDG_CONFIG_HOME||Mn.join(Yu,".config"),e),cache:Mn.join(Wh.XDG_CACHE_HOME||Mn.join(Yu,".cache"),e),log:Mn.join(Wh.XDG_STATE_HOME||Mn.join(Yu,".local","state"),e),temp:Mn.join(ZI,t,e)}};var Sre=H(()=>{Yu=Ere.homedir(),ZI=Ere.tmpdir(),{env:Wh}=QI});var ntt=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},Ua;var kre=H(()=>{Ua=ntt});var rtt=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},Ji;var Rre=H(()=>{Ji=rtt});var $re=250;var Dre=()=>{};var ott=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??$re,a=Date.now()+s;return function c(...l){return e.apply(void 0,l).catch((d)=>{if(!n(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(i*Math.random());if(f>0)return new Promise((m)=>setTimeout(m,f)).then(()=>c.apply(void 0,l));else return c.apply(void 0,l)})}}},Ba;var Cre=H(()=>{Dre();Ba=ott});var stt=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=Date.now()+s;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(l){if(!n(l))throw l;if(Date.now()>=i)throw l;continue}}}},Ha;var Are=H(()=>{Ha=stt});var tN=H(()=>{kre();Rre();Cre();Are()});var Kb,nN;var Ore=H(()=>{rN();Kb={isChangeErrorOk:(e)=>{if(!Kb.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Tre&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Kb.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(!Kb.isNodeError(e))throw e;if(Kb.isChangeErrorOk(e))return;throw e}},nN=Kb});import Pre from"process";var Jb,us,Tre,io;var rN=H(()=>{Ore();Jb={onError:nN.onChangeError},us={onError:()=>{return}},Tre=Pre.getuid?!Pre.getuid():!1,io={isRetriable:nN.isRetriableError}});import jt from"fs";import{promisify as So}from"util";var itt,qr;var oN=H(()=>{tN();tN();rN();itt={attempt:{chmod:Ua(So(jt.chmod),Jb),chown:Ua(So(jt.chown),Jb),close:Ua(So(jt.close),us),fsync:Ua(So(jt.fsync),us),mkdir:Ua(So(jt.mkdir),us),realpath:Ua(So(jt.realpath),us),stat:Ua(So(jt.stat),us),unlink:Ua(So(jt.unlink),us),chmodSync:Ji(jt.chmodSync,Jb),chownSync:Ji(jt.chownSync,Jb),closeSync:Ji(jt.closeSync,us),existsSync:Ji(jt.existsSync,us),fsyncSync:Ji(jt.fsync,us),mkdirSync:Ji(jt.mkdirSync,us),realpathSync:Ji(jt.realpathSync,us),statSync:Ji(jt.statSync,us),unlinkSync:Ji(jt.unlinkSync,us)},retry:{close:Ba(So(jt.close),io),fsync:Ba(So(jt.fsync),io),open:Ba(So(jt.open),io),readFile:Ba(So(jt.readFile),io),rename:Ba(So(jt.rename),io),stat:Ba(So(jt.stat),io),write:Ba(So(jt.write),io),writeFile:Ba(So(jt.writeFile),io),closeSync:Ha(jt.closeSync,io),fsyncSync:Ha(jt.fsyncSync,io),openSync:Ha(jt.openSync,io),readFileSync:Ha(jt.readFileSync,io),renameSync:Ha(jt.renameSync,io),statSync:Ha(jt.statSync,io),writeSync:Ha(jt.writeSync,io),writeFileSync:Ha(jt.writeFileSync,io)}},qr=itt});import Zf from"process";var Ire="utf8",sN=438,Nre=511,Fre,Mre,jre,Lre=1000,qre,PJt,iN=128;var aN=H(()=>{Fre={},Mre=Zf.geteuid?Zf.geteuid():-1,jre=Zf.getegid?Zf.getegid():-1,qre=!!Zf.getuid,PJt=Zf.getuid?!Zf.getuid():!1});var Ure=(e)=>e instanceof Error&&("code"in e),cN=(e)=>typeof e==="string",US=(e)=>e===void 0;var Bre=()=>{};var Hre=()=>{};import Gre from"process";var zre,BS;var lN=H(()=>{zre=Gre.platform==="linux",BS=Gre.platform==="win32"});var uN,Vre;var Wre=H(()=>{lN();uN=["SIGHUP","SIGINT","SIGTERM"];if(!BS)uN.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(zre)uN.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Vre=uN});import Kh from"process";class Kre{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(BS&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Kh.kill(Kh.pid,"SIGTERM");else Kh.kill(Kh.pid,e)},this.hook=()=>{Kh.once("exit",()=>this.exit());for(let e of Vre)try{Kh.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Jre;var Yre=H(()=>{lN();Wre();Jre=new Kre});var att,Xre;var Qre=H(()=>{Yre();att=Jre.register,Xre=att});import ctt from"path";var Fs,Yb;var Zre=H(()=>{oN();Qre();aN();Fs={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",o=`.tmp-${n}${t}`;return`${e}${o}`},get:(e,t,n=!0)=>{let r=Fs.truncate(t(e));if(r in Fs.store)return Fs.get(e,t,n);return Fs.store[r]=n,[r,()=>delete Fs.store[r]]},purge:(e)=>{if(!Fs.store[e])return;delete Fs.store[e],qr.attempt.unlink(e)},purgeSync:(e)=>{if(!Fs.store[e])return;delete Fs.store[e],qr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Fs.store)Fs.purgeSync(e)},truncate:(e)=>{let t=ctt.basename(e);if(t.length<=iN)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-iN;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};Xre(Fs.purgeSyncAll);Yb=Fs});import ltt from"path";function dN(e,t,n=Fre){if(cN(n))return dN(e,t,{encoding:n});let o={timeout:n.timeout??Lre},s=null,i=null,a=null;try{let c=qr.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=Yb.get(e,n.tmpCreate||Yb.create,n.tmpPurge!==!1);let d=qre&&US(n.chown),f=US(n.mode);if(l&&(d||f)){let p=qr.attempt.statSync(e);if(p){if(n={...n},d)n.chown={uid:p.uid,gid:p.gid};if(f)n.mode=p.mode}}if(!l){let p=ltt.dirname(e);qr.attempt.mkdirSync(p,{mode:Nre,recursive:!0})}if(a=qr.retry.openSync(o)(i,"w",n.mode||sN),n.tmpCreated)n.tmpCreated(i);if(cN(t))qr.retry.writeSync(o)(a,t,0,n.encoding||Ire);else if(!US(t))qr.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)qr.retry.fsyncSync(o)(a);else qr.attempt.fsync(a);if(qr.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Mre||n.chown.gid!==jre))qr.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==sN)qr.attempt.chmodSync(i,n.mode);try{qr.retry.renameSync(o)(i,e)}catch(p){if(!Ure(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;qr.retry.renameSync(o)(i,Yb.truncate(e))}s(),i=null}finally{if(a)qr.attempt.closeSync(a);if(i)Yb.purge(i)}}var eoe=H(()=>{oN();aN();Bre();Hre();Zre()});var Qb=w(function(roe){Object.defineProperty(roe,"__esModule",{value:!0});roe.regexpCode=roe.getEsmExportName=roe.getProperty=roe.safeStringify=roe.stringify=roe.strConcat=roe.addCodeArg=roe.str=roe._=roe.nil=roe._Code=roe.Name=roe.IDENTIFIER=roe._CodeOrName=void 0;class HS{}roe._CodeOrName=HS;roe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Jh extends HS{constructor(e){super();if(!roe.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}}}roe.Name=Jh;class Yi extends HS{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,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof Jh)t[n.str]=(t[n.str]||0)+1;return t},{})}}roe._Code=Yi;roe.nil=new Yi("");function toe(e,...t){let n=[e[0]],r=0;while(r<t.length)pN(n,t[r]),n.push(e[++r]);return new Yi(n)}roe._=toe;var fN=new Yi("+");function noe(e,...t){let n=[Xb(e[0])],r=0;while(r<t.length)n.push(fN),pN(n,t[r]),n.push(fN,Xb(e[++r]));return utt(n),new Yi(n)}roe.str=noe;function pN(e,t){if(t instanceof Yi)e.push(...t._items);else if(t instanceof Jh)e.push(t);else e.push(ptt(t))}roe.addCodeArg=pN;function utt(e){let t=1;while(t<e.length-1){if(e[t]===fN){let n=dtt(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function dtt(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Jh||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 Jh))return`"${e}${t.slice(1)}`;return}function ftt(e,t){return t.emptyStr()?e:e.emptyStr()?t:noe`${e}${t}`}roe.strConcat=ftt;function ptt(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Xb(Array.isArray(e)?e.join(","):e)}function mtt(e){return new Yi(Xb(e))}roe.stringify=mtt;function Xb(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}roe.safeStringify=Xb;function htt(e){return typeof e=="string"&&roe.IDENTIFIER.test(e)?new Yi(`.${e}`):toe`[${e}]`}roe.getProperty=htt;function gtt(e){if(typeof e=="string"&&roe.IDENTIFIER.test(e))return new Yi(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}roe.getEsmExportName=gtt;function ytt(e){return new Yi(e.toString())}roe.regexpCode=ytt});var yN=w(function(aoe){Object.defineProperty(aoe,"__esModule",{value:!0});aoe.ValueScope=aoe.ValueScopeName=aoe.Scope=aoe.varKinds=aoe.UsedValueState=void 0;var un=Qb();class soe extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var zS;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(zS||(aoe.UsedValueState=zS={}));aoe.varKinds={const:new un.Name("const"),let:new un.Name("let"),var:new un.Name("var")};class hN{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof un.Name?e:this.name(e)}name(e){return new un.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.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}}}aoe.Scope=hN;class gN extends un.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=un._`.${new un.Name(t)}[${n}]`}}aoe.ValueScopeName=gN;var Att=un._`\n`;class ioe extends hN{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Att:un.nil}}get(){return this._scope}name(e){return new gN(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(n=t.key)!==null&&n!==void 0?n:t.ref,i=this._values[o];if(i){let l=i.get(s);if(l)return l}else i=this._values[o]=new Map;i.set(s,r);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return un._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=un.nil;for(let s in e){let i=e[s];if(!i)continue;let a=n[s]=n[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,zS.Started);let l=t(c);if(l){let d=this.opts.es5?aoe.varKinds.var:aoe.varKinds.const;o=un._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=un._`${o}${l}${this.opts._n}`;else throw new soe(c);a.set(c,zS.Completed)})}return o}}aoe.ValueScope=ioe});var ht=w(function(ds){Object.defineProperty(ds,"__esModule",{value:!0});ds.or=ds.and=ds.not=ds.CodeGen=ds.operators=ds.varKinds=ds.ValueScopeName=ds.ValueScope=ds.Scope=ds.Name=ds.regexpCode=ds.stringify=ds.getProperty=ds.nil=ds.strConcat=ds.str=ds._=void 0;var ge=Qb(),Vn=yN(),Xu=Qb();Object.defineProperty(ds,"_",{enumerable:!0,get:function(){return Xu._}});Object.defineProperty(ds,"str",{enumerable:!0,get:function(){return Xu.str}});Object.defineProperty(ds,"strConcat",{enumerable:!0,get:function(){return Xu.strConcat}});Object.defineProperty(ds,"nil",{enumerable:!0,get:function(){return Xu.nil}});Object.defineProperty(ds,"getProperty",{enumerable:!0,get:function(){return Xu.getProperty}});Object.defineProperty(ds,"stringify",{enumerable:!0,get:function(){return Xu.stringify}});Object.defineProperty(ds,"regexpCode",{enumerable:!0,get:function(){return Xu.regexpCode}});Object.defineProperty(ds,"Name",{enumerable:!0,get:function(){return Xu.Name}});var XS=yN();Object.defineProperty(ds,"Scope",{enumerable:!0,get:function(){return XS.Scope}});Object.defineProperty(ds,"ValueScope",{enumerable:!0,get:function(){return XS.ValueScope}});Object.defineProperty(ds,"ValueScopeName",{enumerable:!0,get:function(){return XS.ValueScopeName}});Object.defineProperty(ds,"varKinds",{enumerable:!0,get:function(){return XS.varKinds}});ds.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};class Qu{optimizeNodes(){return this}optimizeNames(e,t){return this}}class loe extends Qu{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Vn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Xh(this.rhs,e,t);return this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}}class _N extends Qu{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof ge.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Xh(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return YS(e,this.rhs)}}class uoe extends _N{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class doe extends Qu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class foe extends Qu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class poe extends Qu{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class moe extends Qu{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=Xh(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}}class QS extends Qu{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;Itt(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ep(e,t.names),{})}}class Zu extends QS{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class hoe extends QS{}class Zb extends Zu{}Zb.kind="else";class Sl extends Zu{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 n=t.optimizeNodes();t=this.else=Array.isArray(n)?new Zb(n):n}if(t){if(e===!1)return t instanceof Sl?t:t.nodes;if(this.nodes.length)return this;return new Sl(_oe(e),t instanceof Sl?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Xh(this.condition,e,t),this}get names(){let e=super.names;if(YS(e,this.condition),this.else)ep(e,this.else.names);return e}}Sl.kind="if";class Yh extends Zu{}Yh.kind="for";class goe extends Yh{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=Xh(this.iteration,e,t),this}get names(){return ep(super.names,this.iteration.names)}}class yoe extends Yh{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?Vn.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=YS(super.names,this.from);return YS(e,this.to)}}class bN extends Yh{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}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=Xh(this.iterable,e,t),this}get names(){return ep(super.names,this.iterable.names)}}class VS extends Zu{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}VS.kind="func";class WS extends QS{render(e){return"return "+super.render(e)}}WS.kind="return";class boe extends Zu{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 n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ep(e,this.catch.names);if(this.finally)ep(e,this.finally.names);return e}}class KS extends Zu{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}KS.kind="catch";class JS extends Zu{render(e){return"finally"+super.render(e)}}JS.kind="finally";class woe{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
84
|
+
`;return this.stop(),this.#s.write(l),this}}function D(e){return new cte(e)}var xb,NXe;var vo=H(()=>{Ve();Wee();Jee();FP();rte();ste();ate();xb=st(Bv(),1),NXe=st(Bv(),1)});var Ot,dte,he,pl=(e)=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":if(Array.isArray(e))return he.array;if(e===null)return he.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return he.promise;if(typeof Map<"u"&&e instanceof Map)return he.map;if(typeof Set<"u"&&e instanceof Set)return he.set;if(typeof Date<"u"&&e instanceof Date)return he.date;return he.object;default:return he.unknown}};var vb=H(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function n(o){throw Error()}e.assertNever=n,e.arrayToEnum=(o)=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=(o)=>{let s=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=(o)=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let s=[];for(let i in o)if(Object.prototype.hasOwnProperty.call(o,i))s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map((i)=>typeof i==="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>{if(typeof s==="bigint")return s.toString();return s}})(Ot||(Ot={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(dte||(dte={}));he=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ee,Ps;var KE=H(()=>{vb();ee=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);Ps=class Ps extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};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},n={_errors:[]},r=(o)=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return r(this),n}static assert(e){if(!(e instanceof Ps))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Ps.create=(e)=>new Ps(e)});var FXe=(e,t)=>{let n;switch(e.code){case ee.invalid_type:if(e.received===he.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ot.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(e.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(e.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else Ot.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case ee.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case ee.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ot.assertNever(e)}return{message:n}},Vu;var UP=H(()=>{KE();vb();Vu=FXe});function Eb(){return MXe}var MXe;var JE=H(()=>{UP();MXe=Vu});function de(e,t){let n=Eb(),r=YE({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vu?void 0:Vu].filter((o)=>!!o)});e.common.issues.push(r)}class Eo{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 n=[];for(let r of t){if(r.status==="aborted")return Ge;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return Eo.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return Ge;if(s.status==="aborted")return Ge;if(o.status==="dirty")e.dirty();if(s.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet))n[o.value]=s.value}return{status:e.value,value:n}}}var YE=(e)=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},Ge,Sh=(e)=>({status:"dirty",value:e}),Lo=(e)=>({status:"valid",value:e}),BP=(e)=>e.status==="aborted",HP=(e)=>e.status==="dirty",zf=(e)=>e.status==="valid",Sb=(e)=>typeof Promise<"u"&&e instanceof Promise;var GP=H(()=>{JE();UP();Ge=Object.freeze({status:"aborted"})});var fte=()=>{};var Ce;var pte=H(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(Ce||(Ce={}))});class Vi{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 mt(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))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:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??r??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:o}}class Rt{get description(){return this._def.description}_getType(e){return pl(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:pl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Eo,ctx:{common:e.parent.common,data:e.data,parsedType:pl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Sb(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pl(e)},r=this._parseSync({data:e,path:n.path,parent:n});return mte(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pl(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return zf(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>zf(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pl(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(Sb(r)?r:Promise.resolve(r));return mte(n,o)}refine(e,t){let n=(r)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(r);else return t};return this._refinement((r,o)=>{let s=e(r),i=()=>o.addIssue({code:ee.custom,...n(r)});if(typeof Promise<"u"&&s instanceof Promise)return s.then((a)=>{if(!a)return i(),!1;else return!0});if(!s)return i(),!1;else return!0})}refinement(e,t){return this._refinement((n,r)=>{if(!e(n))return r.addIssue(typeof t==="function"?t(n,r):t),!1;else return!0})}_refinement(e){return new ja({schema:this,typeName:We.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 Ma.create(this,this._def)}nullable(){return Wu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Fa.create(this)}promise(){return Ch.create(this,this._def)}or(e){return Cb.create([this,e],this._def)}and(e){return Ab.create(this,e,this._def)}transform(e){return new ja({...mt(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Ib({...mt(this._def),innerType:this,defaultValue:t,typeName:We.ZodDefault})}brand(){return new KP({typeName:We.ZodBranded,type:this,...mt(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Nb({...mt(this._def),innerType:this,catchValue:t,typeName:We.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return oS.create(this,e)}readonly(){return Fb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function gte(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function eQe(e){return new RegExp(`^${gte(e)}$`)}function tQe(e){let t=`${hte}T${gte(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function nQe(e,t){if((t==="v4"||!t)&&WXe.test(e))return!0;if((t==="v6"||!t)&&JXe.test(e))return!0;return!1}function rQe(e,t){if(!HXe.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));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 oQe(e,t){if((t==="v4"||!t)&&KXe.test(e))return!0;if((t==="v6"||!t)&&YXe.test(e))return!0;return!1}function sQe(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function kh(e){if(e instanceof Gn){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ma.create(kh(r))}return new Gn({...e._def,shape:()=>t})}else if(e instanceof Fa)return new Fa({...e._def,type:kh(e.element)});else if(e instanceof Ma)return Ma.create(kh(e.unwrap()));else if(e instanceof Wu)return Wu.create(kh(e.unwrap()));else if(e instanceof yl)return yl.create(e.items.map((t)=>kh(t)));else return e}function VP(e,t){let n=pl(e),r=pl(t);if(e===t)return{valid:!0,data:e};else if(n===he.object&&r===he.object){let o=Ot.objectKeys(t),s=Ot.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=VP(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===he.array&&r===he.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=VP(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===he.date&&r===he.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function yte(e,t){return new Wf({values:e,typeName:We.ZodEnum,...mt(t)})}var mte=(e,t)=>{if(zf(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 n=new Ps(e.common.issues);return this._error=n,this._error}}}},jXe,LXe,qXe,UXe,BXe,HXe,GXe,zXe,VXe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zP,WXe,KXe,JXe,YXe,XXe,QXe,hte="((\\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])))",ZXe,hl,Rh,$h,XE,Rb,QE,$b,Db,ZE,Vf,gl,eS,Fa,Gn,Cb,ml=(e)=>{if(e instanceof Ob)return ml(e.schema);else if(e instanceof ja)return ml(e.innerType());else if(e instanceof Tb)return[e.value];else if(e instanceof Wf)return e.options;else if(e instanceof Pb)return Ot.objectValues(e.enum);else if(e instanceof Ib)return ml(e._def.innerType);else if(e instanceof $b)return[void 0];else if(e instanceof Db)return[null];else if(e instanceof Ma)return[void 0,...ml(e.unwrap())];else if(e instanceof Wu)return[null,...ml(e.unwrap())];else if(e instanceof KP)return ml(e.unwrap());else if(e instanceof Fb)return ml(e.unwrap());else if(e instanceof Nb)return ml(e._def.innerType);else return[]},WP,Ab,yl,tS,nS,Dh,kb,Ob,Tb,Wf,Pb,Ch,ja,Ma,Wu,Ib,Nb,rS,Qzt,KP,oS,Fb,Zzt,We,_,C,eVt,tVt,oe,nVt,rVt,oVt,sVt,iVt,li,aVt,cVt,X,F,lVt,Ah,JP,uVt,dVt,pr,fVt,pVt,mVt,hVt,$t,Le,gVt,yVt,bVt,wVt,_Vt,xVt,vVt;var bte=H(()=>{KE();JE();pte();GP();vb();jXe=/^c[^\s-]{8,}$/i,LXe=/^[0-9a-z]+$/,qXe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UXe=/^[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,BXe=/^[a-z0-9_-]{21}$/i,HXe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GXe=/^[-+]?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)?)??$/,zXe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,WXe=/^(?:(?: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])$/,KXe=/^(?:(?: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])$/,JXe=/^(([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]))$/,YXe=/^(([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])$/,XXe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QXe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ZXe=new RegExp(`^${hte}$`);hl=class hl extends Rt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==he.string){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_type,expected:he.string,received:o.parsedType}),Ge}let n=new Eo,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="length"){let s=e.data.length>o.value,i=e.data.length<o.value;if(s||i){if(r=this._getOrReturnCtx(e,r),s)de(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)de(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!zXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"email",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!zP)zP=new RegExp(VXe,"u");if(!zP.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!UXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!BXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!jXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!LXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!qXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"ulid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),de(r,{validation:"url",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"regex",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.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))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!tQe(o).test(e.data))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!ZXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!eQe(o).test(e.data))r=this._getOrReturnCtx(e,r),de(r,{code:ee.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!GXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"duration",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!nQe(e.data,o.version))r=this._getOrReturnCtx(e,r),de(r,{validation:"ip",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!rQe(e.data,o.alg))r=this._getOrReturnCtx(e,r),de(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!oQe(e.data,o.version))r=this._getOrReturnCtx(e,r),de(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!XXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"base64",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!QXe.test(e.data))r=this._getOrReturnCtx(e,r),de(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),n.dirty()}else Ot.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:ee.invalid_string,...Ce.errToObj(n)})}_addCheck(e){return new hl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ce.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ce.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ce.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ce.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ce.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ce.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,...Ce.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,...Ce.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ce.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ce.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ce.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ce.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ce.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ce.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ce.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ce.errToObj(t)})}nonempty(e){return this.min(1,Ce.errToObj(e))}trim(){return new hl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hl({...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}};hl.create=(e)=>new hl({checks:[],typeName:We.ZodString,coerce:e?.coerce??!1,...mt(e)});Rh=class Rh extends Rt{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)!==he.number){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_type,expected:he.number,received:o.parsedType}),Ge}let n=void 0,r=new Eo;for(let o of this._def.checks)if(o.kind==="int"){if(!Ot.isInteger(e.data))n=this._getOrReturnCtx(e,n),de(n,{code:ee.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(sQe(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),de(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),de(n,{code:ee.not_finite,message:o.message}),r.dirty()}else Ot.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ce.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ce.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ce.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ce.toString(t))}setLimit(e,t,n,r){return new Rh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ce.toString(r)}]})}_addCheck(e){return new Rh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ce.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&Ot.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}};Rh.create=(e)=>new Rh({checks:[],typeName:We.ZodNumber,coerce:e?.coerce||!1,...mt(e)});$h=class $h extends Rt{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)!==he.bigint)return this._getInvalidInput(e);let n=void 0,r=new Eo;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),de(n,{code:ee.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))n=this._getOrReturnCtx(e,n),de(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else Ot.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return de(t,{code:ee.invalid_type,expected:he.bigint,received:t.parsedType}),Ge}gte(e,t){return this.setLimit("min",e,!0,Ce.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ce.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ce.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ce.toString(t))}setLimit(e,t,n,r){return new $h({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ce.toString(r)}]})}_addCheck(e){return new $h({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ce.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}};$h.create=(e)=>new $h({checks:[],typeName:We.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});XE=class XE extends Rt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==he.boolean){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.boolean,received:n.parsedType}),Ge}return Lo(e.data)}};XE.create=(e)=>new XE({typeName:We.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});Rb=class Rb extends Rt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==he.date){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_type,expected:he.date,received:o.parsedType}),Ge}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return de(o,{code:ee.invalid_date}),Ge}let n=new Eo,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)r=this._getOrReturnCtx(e,r),de(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else Ot.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Rb({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ce.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ce.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}};Rb.create=(e)=>new Rb({checks:[],coerce:e?.coerce||!1,typeName:We.ZodDate,...mt(e)});QE=class QE extends Rt{_parse(e){if(this._getType(e)!==he.symbol){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.symbol,received:n.parsedType}),Ge}return Lo(e.data)}};QE.create=(e)=>new QE({typeName:We.ZodSymbol,...mt(e)});$b=class $b extends Rt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.undefined,received:n.parsedType}),Ge}return Lo(e.data)}};$b.create=(e)=>new $b({typeName:We.ZodUndefined,...mt(e)});Db=class Db extends Rt{_parse(e){if(this._getType(e)!==he.null){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.null,received:n.parsedType}),Ge}return Lo(e.data)}};Db.create=(e)=>new Db({typeName:We.ZodNull,...mt(e)});ZE=class ZE extends Rt{constructor(){super(...arguments);this._any=!0}_parse(e){return Lo(e.data)}};ZE.create=(e)=>new ZE({typeName:We.ZodAny,...mt(e)});Vf=class Vf extends Rt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Lo(e.data)}};Vf.create=(e)=>new Vf({typeName:We.ZodUnknown,...mt(e)});gl=class gl extends Rt{_parse(e){let t=this._getOrReturnCtx(e);return de(t,{code:ee.invalid_type,expected:he.never,received:t.parsedType}),Ge}};gl.create=(e)=>new gl({typeName:We.ZodNever,...mt(e)});eS=class eS extends Rt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.void,received:n.parsedType}),Ge}return Lo(e.data)}};eS.create=(e)=>new eS({typeName:We.ZodVoid,...mt(e)});Fa=class Fa extends Rt{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==he.array)return de(t,{code:ee.invalid_type,expected:he.array,received:t.parsedType}),Ge;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)de(t,{code:s?ee.too_big:ee.too_small,minimum:i?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty()}if(r.minLength!==null){if(t.data.length<r.minLength.value)de(t,{code:ee.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()}if(r.maxLength!==null){if(t.data.length>r.maxLength.value)de(t,{code:ee.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((s,i)=>r.type._parseAsync(new Vi(t,s,t.path,i)))).then((s)=>Eo.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Vi(t,s,t.path,i)));return Eo.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Fa({...this._def,minLength:{value:e,message:Ce.toString(t)}})}max(e,t){return new Fa({...this._def,maxLength:{value:e,message:Ce.toString(t)}})}length(e,t){return new Fa({...this._def,exactLength:{value:e,message:Ce.toString(t)}})}nonempty(e){return this.min(1,e)}};Fa.create=(e,t)=>new Fa({type:e,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...mt(t)});Gn=class Gn extends Rt{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Ot.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==he.object){let c=this._getOrReturnCtx(e);return de(c,{code:ee.invalid_type,expected:he.object,received:c.parsedType}),Ge}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof gl&&this._def.unknownKeys==="strip")){for(let c in r.data)if(!s.includes(c))i.push(c)}let a=[];for(let c of s){let l=o[c],d=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Vi(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof gl){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of i)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict"){if(i.length>0)de(r,{code:ee.unrecognized_keys,keys:i}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of i){let d=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Vi(r,d,r.path,l)),alwaysSet:l in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then((c)=>Eo.mergeObjectSync(n,c));else return Eo.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Ce.errToObj,new Gn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:Ce.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Gn({...this._def,unknownKeys:"strip"})}passthrough(){return new Gn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Gn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Gn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:We.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Gn({...this._def,catchall:e})}pick(e){let t={};for(let n of Ot.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Gn({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Ot.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Gn({...this._def,shape:()=>t})}deepPartial(){return kh(this)}partial(e){let t={};for(let n of Ot.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Gn({...this._def,shape:()=>t})}required(e){let t={};for(let n of Ot.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Ma)o=o._def.innerType;t[n]=o}return new Gn({...this._def,shape:()=>t})}keyof(){return yte(Ot.objectKeys(this.shape))}};Gn.create=(e,t)=>new Gn({shape:()=>e,unknownKeys:"strip",catchall:gl.create(),typeName:We.ZodObject,...mt(t)});Gn.strictCreate=(e,t)=>new Gn({shape:()=>e,unknownKeys:"strict",catchall:gl.create(),typeName:We.ZodObject,...mt(t)});Gn.lazycreate=(e,t)=>new Gn({shape:e,unknownKeys:"strip",catchall:gl.create(),typeName:We.ZodObject,...mt(t)});Cb=class Cb extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((i)=>new Ps(i.ctx.common.issues));return de(t,{code:ee.invalid_union,unionErrors:s}),Ge}if(t.common.async)return Promise.all(n.map(async(o)=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);else{let o=void 0,s=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!o)o={result:l,ctx:c};if(c.common.issues.length)s.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map((a)=>new Ps(a));return de(t,{code:ee.invalid_union,unionErrors:i}),Ge}}get options(){return this._def.options}};Cb.create=(e,t)=>new Cb({options:e,typeName:We.ZodUnion,...mt(t)});WP=class WP extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.object)return de(t,{code:ee.invalid_type,expected:he.object,received:t.parsedType}),Ge;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return de(t,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ge;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,n){let r=new Map;for(let o of t){let s=ml(o.shape[e]);if(!s.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return new WP({typeName:We.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...mt(n)})}};Ab=class Ab extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(BP(o)||BP(s))return Ge;let i=VP(o.value,s.value);if(!i.valid)return de(n,{code:ee.invalid_intersection_types}),Ge;if(HP(o)||HP(s))t.dirty();return{status:t.value,value:i.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s));else return r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ab.create=(e,t,n)=>new Ab({left:e,right:t,typeName:We.ZodIntersection,...mt(n)});yl=class yl extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.array)return de(n,{code:ee.invalid_type,expected:he.array,received:n.parsedType}),Ge;if(n.data.length<this._def.items.length)return de(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ge;if(!this._def.rest&&n.data.length>this._def.items.length)de(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...n.data].map((s,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new Vi(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>Eo.mergeArray(t,s));else return Eo.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new yl({...this._def,rest:e})}};yl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new yl({items:e,typeName:We.ZodTuple,rest:null,...mt(t)})};tS=class tS extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.object)return de(n,{code:ee.invalid_type,expected:he.object,received:n.parsedType}),Ge;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Vi(n,i,n.path,i)),value:s._parse(new Vi(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return Eo.mergeObjectAsync(t,r);else return Eo.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Rt)return new tS({keyType:e,valueType:t,typeName:We.ZodRecord,...mt(n)});return new tS({keyType:hl.create(),valueType:e,typeName:We.ZodRecord,...mt(t)})}};nS=class nS extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.map)return de(n,{code:ee.invalid_type,expected:he.map,received:n.parsedType}),Ge;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Vi(n,i,n.path,[c,"key"])),value:o._parse(new Vi(n,a,n.path,[c,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of s){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return Ge;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of s){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return Ge;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};nS.create=(e,t,n)=>new nS({valueType:t,keyType:e,typeName:We.ZodMap,...mt(n)});Dh=class Dh extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.set)return de(n,{code:ee.invalid_type,expected:he.set,received:n.parsedType}),Ge;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)de(n,{code:ee.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()}if(r.maxSize!==null){if(n.data.size>r.maxSize.value)de(n,{code:ee.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty()}let o=this._def.valueType;function s(a){let c=new Set;for(let l of a){if(l.status==="aborted")return Ge;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let i=[...n.data.values()].map((a,c)=>o._parse(new Vi(n,a,n.path,c)));if(n.common.async)return Promise.all(i).then((a)=>s(a));else return s(i)}min(e,t){return new Dh({...this._def,minSize:{value:e,message:Ce.toString(t)}})}max(e,t){return new Dh({...this._def,maxSize:{value:e,message:Ce.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Dh.create=(e,t)=>new Dh({valueType:e,minSize:null,maxSize:null,typeName:We.ZodSet,...mt(t)});kb=class kb extends Rt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.function)return de(t,{code:ee.invalid_type,expected:he.function,received:t.parsedType}),Ge;function n(i,a){return YE({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Eb(),Vu].filter((c)=>!!c),issueData:{code:ee.invalid_arguments,argumentsError:a}})}function r(i,a){return YE({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Eb(),Vu].filter((c)=>!!c),issueData:{code:ee.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ch){let i=this;return Lo(async function(...a){let c=new Ps([]),l=await i._def.args.parseAsync(a,o).catch((p)=>{throw c.addIssue(n(a,p)),c}),d=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(d,o).catch((p)=>{throw c.addIssue(r(d,p)),c})})}else{let i=this;return Lo(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new Ps([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new Ps([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kb({...this._def,args:yl.create(e).rest(Vf.create())})}returns(e){return new kb({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new kb({args:e?e:yl.create([]).rest(Vf.create()),returns:t||Vf.create(),typeName:We.ZodFunction,...mt(n)})}};Ob=class Ob extends Rt{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})}};Ob.create=(e,t)=>new Ob({getter:e,typeName:We.ZodLazy,...mt(t)});Tb=class Tb extends Rt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return de(t,{received:t.data,code:ee.invalid_literal,expected:this._def.value}),Ge}return{status:"valid",value:e.data}}get value(){return this._def.value}};Tb.create=(e,t)=>new Tb({value:e,typeName:We.ZodLiteral,...mt(t)});Wf=class Wf extends Rt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return de(t,{expected:Ot.joinValues(n),received:t.parsedType,code:ee.invalid_type}),Ge}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return de(t,{received:t.data,code:ee.invalid_enum_value,options:n}),Ge}return Lo(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 Wf.create(e,{...this._def,...t})}exclude(e,t=this._def){return Wf.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};Wf.create=yte;Pb=class Pb extends Rt{_parse(e){let t=Ot.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==he.string&&n.parsedType!==he.number){let r=Ot.objectValues(t);return de(n,{expected:Ot.joinValues(r),received:n.parsedType,code:ee.invalid_type}),Ge}if(!this._cache)this._cache=new Set(Ot.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=Ot.objectValues(t);return de(n,{received:n.data,code:ee.invalid_enum_value,options:r}),Ge}return Lo(e.data)}get enum(){return this._def.values}};Pb.create=(e,t)=>new Pb({values:e,typeName:We.ZodNativeEnum,...mt(t)});Ch=class Ch extends Rt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.promise&&t.common.async===!1)return de(t,{code:ee.invalid_type,expected:he.promise,received:t.parsedType}),Ge;let n=t.parsedType===he.promise?t.data:Promise.resolve(t.data);return Lo(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ch.create=(e,t)=>new Ch({type:e,typeName:We.ZodPromise,...mt(t)});ja=class ja extends Rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:(s)=>{if(de(n,s),s.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async(i)=>{if(t.value==="aborted")return Ge;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return Ge;if(a.status==="dirty")return Sh(a.value);if(t.value==="dirty")return Sh(a.value);return a});else{if(t.value==="aborted")return Ge;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return Ge;if(i.status==="dirty")return Sh(i.value);if(t.value==="dirty")return Sh(i.value);return i}}if(r.type==="refinement"){let s=(i)=>{let a=r.refinement(i,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(i.status==="aborted")return Ge;if(i.status==="dirty")t.dirty();return s(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(i.status==="aborted")return Ge;if(i.status==="dirty")t.dirty();return s(i.value).then(()=>({status:t.value,value:i.value}))})}if(r.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!zf(s))return Ge;let i=r.transform(s.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(!zf(s))return Ge;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});Ot.assertNever(r)}};ja.create=(e,t,n)=>new ja({schema:e,typeName:We.ZodEffects,effect:t,...mt(n)});ja.createWithPreprocess=(e,t,n)=>new ja({schema:t,effect:{type:"preprocess",transform:e},typeName:We.ZodEffects,...mt(n)});Ma=class Ma extends Rt{_parse(e){if(this._getType(e)===he.undefined)return Lo(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ma.create=(e,t)=>new Ma({innerType:e,typeName:We.ZodOptional,...mt(t)});Wu=class Wu extends Rt{_parse(e){if(this._getType(e)===he.null)return Lo(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Wu.create=(e,t)=>new Wu({innerType:e,typeName:We.ZodNullable,...mt(t)});Ib=class Ib extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===he.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ib.create=(e,t)=>new Ib({innerType:e,typeName:We.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...mt(t)});Nb=class Nb extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(Sb(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ps(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ps(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Nb.create=(e,t)=>new Nb({innerType:e,typeName:We.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...mt(t)});rS=class rS extends Rt{_parse(e){if(this._getType(e)!==he.nan){let n=this._getOrReturnCtx(e);return de(n,{code:ee.invalid_type,expected:he.nan,received:n.parsedType}),Ge}return{status:"valid",value:e.data}}};rS.create=(e)=>new rS({typeName:We.ZodNaN,...mt(e)});Qzt=Symbol("zod_brand");KP=class KP extends Rt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};oS=class oS extends Rt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return Ge;if(o.status==="dirty")return t.dirty(),Sh(o.value);else return this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();else{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return Ge;if(r.status==="dirty")return t.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new oS({in:e,out:t,typeName:We.ZodPipeline})}};Fb=class Fb extends Rt{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(zf(r))r.value=Object.freeze(r.value);return r};return Sb(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};Fb.create=(e,t)=>new Fb({innerType:e,typeName:We.ZodReadonly,...mt(t)});Zzt={object:Gn.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"})(We||(We={}));_=hl.create,C=Rh.create,eVt=rS.create,tVt=$h.create,oe=XE.create,nVt=Rb.create,rVt=QE.create,oVt=$b.create,sVt=Db.create,iVt=ZE.create,li=Vf.create,aVt=gl.create,cVt=eS.create,X=Fa.create,F=Gn.create,lVt=Gn.strictCreate,Ah=Cb.create,JP=WP.create,uVt=Ab.create,dVt=yl.create,pr=tS.create,fVt=nS.create,pVt=Dh.create,mVt=kb.create,hVt=Ob.create,$t=Tb.create,Le=Wf.create,gVt=Pb.create,yVt=Ch.create,bVt=ja.create,wVt=Ma.create,_Vt=Wu.create,xVt=ja.createWithPreprocess,vVt=oS.create});var YP=H(()=>{JE();GP();fte();vb();bte();KE()});var hr=H(()=>{YP();YP()});function XP(e){return sS.includes(e)}var iQe,Kf,sS,wte,aQe,_te,cQe,xte,lQe,uQe,vte,dQe,Ete,PVt,IVt,Ste,fQe,kte,pQe,Rte,QP=20,ZP=500,mQe,NVt;var Oh=H(()=>{hr();iQe=Le(["pending","verified","approved","revoked"]),Kf=Le(["person","service","test"]),sS=Kf.options;wte={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"},aQe=Le(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),_te=aQe.options,cQe=Le(["active","pending","revoked"]),xte=F({field:_(),blocks:X(_()).optional(),set_on:X(_()).optional()}).passthrough(),lQe=F({id:C().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:C().int().optional(),sandbox_completed:oe().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:oe().optional(),status:iQe.optional(),email_verified:oe().optional(),orcid_verified:oe().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:X(xte).optional(),username_auto_assigned:oe().optional(),account_kind:Kf.optional()}).passthrough(),uQe=F({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),vte=F({user:lQe,token:uQe.optional()}).passthrough(),dQe=F({id:C().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:C().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),orcid:_().nullable().optional(),upload_access_requested_at:_().nullable().optional(),account_kind:Kf.optional(),matched_in:X(_()).optional(),match_kind:_().optional()}).passthrough(),Ete=F({users:X(dQe),count:C().int()}).passthrough(),PVt=Le(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),IVt=Le(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Ste=F({suggestion:_().nullable(),based_on:Le(["name","unavailable","exhausted"])}).passthrough(),fQe=Le(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),kte=fQe.options,pQe=Le(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","username_reserved","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"]),Rte=pQe.options,mQe=F({id:C().int(),email:_(),username:_().nullable(),role:_(),status:cQe,email_verified:oe(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:oe(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:oe(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:X(xte),username_auto_assigned:oe()}).passthrough(),NVt=F({user:mQe.nullable()}).passthrough()});var eI,tI,LVt,hQe,qVt,gQe,$te,Dte,nI=8,rI=100,Cte,Ate,yQe,Ote;var Mb=H(()=>{hr();Oh();eI=["given_name","family_name","affiliation","city","country"],tI=["username","github_username","email","orcid"],LVt=[...eI,...tI],hQe={given_name:_().max(200).optional(),family_name:_().max(200).optional(),affiliation:_().max(500).optional(),city:_().max(200).optional(),country:_().max(200).optional(),username:_().max(100).optional(),github_username:_().max(100).optional(),email:_().max(320).optional(),orcid:_().max(40).optional()},qVt=F(hQe),gQe=Le(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),$te=gQe.options,Dte=["exact","name","prefix","substring","fuzzy"],Cte=F({id:C().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Kf.optional(),email_verified:C().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:C().int().nullable().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),description:_().nullable().optional(),signup_source:_().nullable().optional(),created_at:_(),updated_at:_().nullable().optional(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),deleted_at:_().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:C().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),identity_conflict:C().int().nullable().optional(),username_auto_assigned:C().int().nullable().optional(),sandbox_completed:C().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:C().int().optional(),active_tokens:C().int().optional(),linked_identities:X(_()).optional()}).passthrough(),Ate=F({user:Cte}).passthrough(),yQe=F({from:_().nullable(),to:_().nullable()}),Ote=F({message:_(),changed:pr(_(),yQe),notes:X(_()).optional(),old_address_notified:oe().optional(),user:Cte}).passthrough()});function _Qe(e){return e.startsWith("v")?e:`v${e}`}var bQe,wQe,Tte,HVt;var oI=H(()=>{hr();bQe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,wQe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;Tte=_().regex(bQe,"must be a semver version, optionally v-prefixed").transform(_Qe),HVt=_().regex(wQe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Ite(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:ee.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function Nte(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:ee.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var xQe="0.4.1",sI,Th,Pte,vQe,EQe,SQe,Fte,WVt,Mte,KVt,bl,kQe,iS,JVt,RQe,$Qe,YVt;var iI=H(()=>{hr();oI();sI=Le(["openneuro","nemar","gin","other"]),Th=Ah([$t(0),$t(1)]).nullable(),Pte=F({dataset_id:_(),id:_().optional(),name:_(),description:_().nullable().optional(),status:_(),visibility:_(),anonymous:C().int().nullable().optional(),concept_doi:_().nullable().optional(),doi:_().nullable().optional(),created_at:_(),updated_at:_().optional(),first_published_at:_().nullable().optional(),owner_username:_().nullable().optional(),source:_().nullable().optional(),modalities:_().optional(),participants:C().int().nonnegative(),tasks:_().optional(),authors:_().optional(),license:_().optional(),file_size:C().nonnegative(),file_size_formatted:_().optional(),total_files:C().nonnegative().nullable().optional(),num_citations:C().int().nonnegative().optional(),n_channels:C().int().nullable().optional(),electrode_system:_().nullable().optional(),has_hed:Th.optional(),hed_version:_().nullable().optional(),data_complete:Th.optional(),bytes_present:C().nonnegative().nullable().optional(),latest_version:Tte.nullable().optional(),latest_version_at:_().nullable().optional(),subject_count:C().int().nullable().optional(),file_size_bytes:C().nullable().optional(),sessions_count:C().int().nullable().optional(),age_min:C().nullable().optional(),age_max:C().nullable().optional(),bids_version:_().nullable().optional(),zarr_status:Le(["pending","ready","failed"]).nullable().optional(),zarr_store_count:C().int().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:C().int().nullable().optional(),zarr_failure_count:C().int().nullable().optional(),zarr_deterministic:Th.optional(),zarr_failed_at:_().nullable().optional(),zarr_index_url:_().nullable().optional(),zarr_verify_status:Le(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),zarr_requeue_at:_().nullable().optional(),anonymity_status:Le(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:_().nullable().optional(),anonymity_findings:_().nullable().optional(),anonymity_unchecked:_().nullable().optional(),total_recording_duration:C().nullable().optional(),recording_duration_min:C().nullable().optional(),recording_duration_max:C().nullable().optional(),recording_count:C().int().nullable().optional(),recordings_unavailable:C().int().nullable().optional(),channel_count_min:C().int().nullable().optional(),channel_count_max:C().int().nullable().optional(),sampling_frequency:C().nullable().optional(),power_line_frequency:C().nullable().optional(),eeg_reference:_().nullable().optional(),placement_scheme:_().nullable().optional()}).passthrough();vQe=Pte.superRefine((e,t)=>{Ite(e,t),Nte(e,t)}),EQe=Pte.extend({file_size:C().nonnegative().nullable(),file_size_formatted:_().nullable().optional(),modalities:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),license:_().nullable().optional(),owner_github:_().nullable().optional(),attestation_deposit_type:Le(["owner","redistribution"]).nullable().optional(),attestation_key_status:Le(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Th.optional(),attestation_no_duplicate:Th.optional(),attestation_upstream_source:_().nullable().optional(),attestation_accepted_at:_().nullable().optional(),zarr_data_failures:F({count:C().int().nonnegative(),detail_ref:_(),compacted_by:_().optional(),pending:C().int().nonnegative().optional(),discovered:C().int().nonnegative().optional(),events_upload_failed:$t(!0).optional(),manifest_upload_failed:$t(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Ite(e,t),Nte(e,t)}),SQe=F({id:_(),name:_(),modalities:_().nullable().optional(),participants:C().int().nullable().optional(),doi:_().nullable().optional(),tasks:_().nullable().optional(),authors:_().nullable().optional(),has_hed:Th.optional(),score:C().optional(),snippet:_().optional()}).passthrough(),Fte=pr(_(),C().int().nonnegative()),WVt=F({datasets:X(vQe),count:C().int().nonnegative(),total_count:C().int().nonnegative().optional(),limit:C().int().optional(),offset:C().int().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fte.optional()}).passthrough(),Mte=F({results:X(SQe),count:C().int().nonnegative(),returned:C().int().nonnegative().optional(),offset:C().int().nonnegative().optional(),limit:C().int().optional(),candidate_ceiling:C().int().optional(),truncated:oe().optional(),method:Le(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:C().optional(),reranked:$t(!0).optional(),corrected_query:_().optional(),modality_boost:X(_()).optional(),warning:_().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fte.optional()}).passthrough(),KVt=F({dataset:EQe}).passthrough(),bl=F({value:_(),count:C().int().nonnegative()}),kQe=F({values:X(bl),distinct_total:C().int().nonnegative(),truncated:oe()}),iS=F({"electrode-system":X(bl).optional(),source:X(bl).optional(),zarr:X(bl).optional(),powerline:X(bl).optional(),"bids-version":X(bl).optional(),"hed-version":X(bl).optional(),license:X(bl).optional(),modality:X(bl).optional(),task:kQe.optional(),warning:_().optional()}).passthrough(),JVt=F({schema_version:$t(xQe),doc_type:$t("dataset"),dataset_id:_().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:_(),source:sI,recording_modality:X(_()).min(1),description:_().nullable().optional(),bids_version:_().nullable().optional(),license:_().nullable().optional()}).passthrough(),RQe=F({tasks:pr(F({runs:X(_())}).passthrough())}).passthrough(),$Qe=F({sessions:X(_()),modalities:pr(RQe),session_modalities:pr(X(_())).optional()}).passthrough(),YVt=F({version:_(),subjects:pr($Qe)}).passthrough()});function aS(e){return typeof e==="string"&&jte.includes(e)}var DQe,ZVt,eWt,tWt,jte,CQe="ci_check_unavailable",Lte,qte,Ute,Bte="X-Approval-Dispatch-Token",nWt;var jb=H(()=>{hr();DQe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,ZVt=_().regex(DQe,"ORCID must be in format 0000-0000-0000-000X"),eWt=Le(["found","no_public_name","lookup_failed"]),tWt=Le(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),jte=["bids_validation_pending","bids_validation_in_progress"];Lte=[CQe],qte=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Ute=["publication_review_not_clear","request_blocked","request_changed","request_mismatch","dispatch_superseded","dispatch_expired","decision_with_dispatch_token","approval_in_flight","deny_after_publishing","invalid_dataset_id","approval_closed_during_run"],nWt=Le(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var AQe,Hte,Lb="https://nemar.org/settings",sWt,OQe,TQe,PQe,Gte,zte;var aI=H(()=>{hr();AQe=Le(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Hte=AQe.options,sWt={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, ${Lb}).`,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, ${Lb}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Lb}), 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, ${Lb}).`,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, ${Lb}).`,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."},OQe=Le(["orcid","email","github"]),TQe=F({id:C().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:oe(),dataset_count:C().int(),identity_conflict:C().int(),canonical:oe()}).passthrough(),PQe=F({kind:OQe,value:_(),canonical_user_id:C().int(),accounts:X(TQe)}).passthrough(),Gte=F({groups:X(PQe),group_count:C().int(),flagged_count:C().int()}).passthrough(),zte=F({ok:$t(!0),id:C().int(),cleared:oe()}).passthrough()});var cI=120,Vte=64,lI="unnamed machine",IQe=25,cS,Wte,Ph,Kte,cWt,lWt,Jte,NQe,FQe,Yte,uI,Xte,uWt,dWt,lS,uS;var dS=H(()=>{hr();cS=Le(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Wte={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."},Ph=Le(["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"]),Kte=Ph.options,cWt={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 ${IQe} 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."},lWt=F({error:Ph,message:_()}).passthrough(),Jte=F({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:C().int(),interval:C().int()}).passthrough(),NQe=JP("error",[F({error:$t("authorization_pending"),message:_()}).passthrough(),F({error:$t("slow_down"),message:_()}).passthrough()]),FQe=JP("error",[F({error:$t("expired_token"),reason:Ph,message:_()}).passthrough(),F({error:$t("access_denied"),reason:Ph,message:_()}).passthrough(),F({error:$t("invalid_grant"),reason:Ph,message:_()}).passthrough()]),Yte=Ah([NQe,FQe]),uI=F({id:C().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:oe()}).passthrough(),Xte=F({api_key:_(),key:uI,user:F({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:oe(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),uWt=F({user_code:_(),machine_name:_(),requested_at:_(),expires_in:C().int(),account:F({username:_().nullable(),email_masked:_()}).passthrough(),refusal:F({code:Ph,message:_()}).passthrough().nullable()}).passthrough(),dWt=F({ok:$t(!0),machine_name:_()}).passthrough(),lS=F({keys:X(uI)}).passthrough(),uS=F({api_key:_(),key:uI}).passthrough()});function gr(e){return zn[e]}function wl(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var zn;var Ih=H(()=>{zn={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function jQe(e){return e==="verified"||e==="upload_access"||e==="publication"}function Nh(e){return(e??"").trim().length===0}function LQe(e){return e==="service"||e==="test"}function ene(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(fS,e)?fS[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:zn["gap.set_on.default_web"],setOnCli:null,known:!1};let o=n&&r.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??r.blocks,label:zn[r.labelKey],setOnWeb:zn[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:zn[r.cliKey],known:!0}}function Qte(e){let t=dI.indexOf(e);return t===-1?dI.length:t}function tne(e,t={}){return e.map((n)=>ene(n,{orcidVerified:t.orcidVerified}))}function pS(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(jQe):[];return ene(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>Qte(n.field)-Qte(r.field))}function fI(e){let t=e.blocks[0],n=t?zn[MQe[t]]:zn["gap.blocks.unknown"],r=wl(zn["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?wl(zn["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):wl(zn["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function nne(e){return`${e.label} ${fI(e)}`}function mS(){let e=wl(zn["gap.sentence"],{label:Zte.label,blocks:zn["cli.gap.blocks.sandbox"]}),t=wl(zn["cli.gap.set_on.cli_only"],{cli:Zte.command});return`${e} ${t}`}function rne(){return zn["cli.gaps.sandbox_unchecked"]}var fS,dI,hWt,MQe,Zte;var Fh=H(()=>{Ih();fS={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&&Nh(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)=>Nh(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)=>Nh(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&&!LQe(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)=>Nh(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)=>Nh(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)=>Nh(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}},dI=Object.keys(fS),hWt=dI.filter((e)=>fS[e].isMissing!==null),MQe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};Zte={field:"sandbox",label:zn["cli.gap.field.sandbox.label"],command:zn["cli.gap.field.sandbox.set_on.cli"]}});function bS(e,t){let n=e.sss!==void 0;if(e.derived!==n)t.addIssue({code:ee.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 qo,hS,one,gS,qQe,yS,UQe,BQe,HQe,GQe,zQe,bWt,VQe,wWt,WQe,_Wt;var pI=H(()=>{hr();qo=/^[a-z]{2}[0-9]{6}$/,hS=/^[0-9a-f]{40}$/,one=F({name:_(),modality:_().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),duration_s:C().nonnegative().nullable().optional(),source_rate_hz:C().nullable().optional(),n_view_levels:C().int().nonnegative().optional(),view_chunk_columns:C().int().positive().optional(),chunk_samples:C().int().positive().optional(),shard_samples:C().int().positive().optional()}).passthrough(),gS=F({converted:C().int().nonnegative().optional(),relabelled:C().int().nonnegative().optional(),kept_importer_unit:C().int().nonnegative().optional(),units_column_present:oe().optional(),sidecar:_().optional(),sidecar_supplied:oe().optional(),unmatched_channels:C().int().nonnegative().optional(),unmatched_case_only:C().int().positive().optional(),matched_case_only:C().int().positive().optional(),matched_case_only_examples:X(_()).max(5).optional(),unmatched_raw_label:C().int().positive().optional(),unmatched_examples:X(_()).max(5).optional()}).passthrough(),qQe=F({channels_tsv:C().int().positive(),in_file:C().int().nonnegative(),in_store:C().int().nonnegative()}).passthrough(),yS=F({applied:oe().optional(),method:_().optional(),calibration:_().optional(),cross_talk:_().optional(),mne_version:_().optional()}).passthrough();UQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),updated_utc:_().optional(),source_tree:$t("raw"),derived:oe(),modalities:X(_()).optional(),groups:X(one).optional(),power_line_frequency:C().nullable().optional(),event_description_count:C().int().nonnegative().optional(),n_events:C().int().nonnegative().optional(),trial_types:pr(_(),C().int().nonnegative()).optional(),units_report:gS.optional(),channels_tsv_read_error:oe().optional(),channels_tsv_count_mismatch:qQe.optional(),split_members:X(_()).optional(),sss:yS.optional()}).passthrough().superRefine(bS),BQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr").optional(),code:_(),reason:_(),detail:_().nullable().optional(),attempts:C().int().nonnegative().optional()}).passthrough(),HQe=Le(["infra_failure","memory_budget","not_attempted"]),GQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),reason:HQe,attempts:C().int().nonnegative(),last_error:_().nullable().optional(),last_attempt_utc:_().nullable().optional()}).passthrough(),zQe=F({level0:$t("<zarr>/<group>/0"),view:$t("<zarr>/<group>/view/<L>"),view_levels:$t("1..n_view_levels from the group attrs"),scale_offset:$t("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:$t("<data_base>events.parquet").optional()}).passthrough(),bWt=F({format:$t("nemar-zarr-index"),format_version:$t(3),dataset_id:_().regex(qo,"NEMAR dataset id (nm/on/xx band)"),contract_base:_().regex(/^https:\/\//,"must be https"),data_base:_().regex(/^https:\/\//,"must be https"),data_base_kind:$t("s3-public"),s3_uri:_().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:_().min(1),s3_anonymous:oe(),source_commit:_().regex(hS,"must be a full 40-hex SHA"),engine_version:_().min(1),biosigio_version:_().nullable().optional(),updated_utc:_(),discovered_count:C().int().nonnegative(),store_count:C().int().nonnegative(),n_recordings:C().int().nonnegative(),errors:C().int().nonnegative(),failure_count:C().int().nonnegative(),pending_count:C().int().nonnegative(),stores:X(UQe),failures:X(BQe),pending:X(GQe),doi:_().nullable().optional(),license:_().nullable().optional(),citation:_().nullable().optional(),hed_version:_().nullable().optional(),events_parquet:_().regex(/^https:\/\//,"must be https").optional(),events_row_count:C().int().nonnegative().optional(),layout:zQe}).passthrough(),VQe=F({name:_(),configuration:pr(_(),li()).optional()}).passthrough(),wWt=F({zarr_format:$t(3),node_type:$t("array"),shape:X(C().int().nonnegative()),data_type:_(),chunk_grid:F({name:_(),configuration:pr(_(),li()).optional()}).passthrough(),codecs:X(VQe),fill_value:li().optional(),attributes:pr(_(),li()).optional(),dimension_names:X(_().nullable()).optional()}).passthrough(),WQe=F({path:_(),zarr:_().regex(/\.zarr$/,"must end in .zarr"),groups:X(one).optional(),modalities:X(_()).optional()}).passthrough(),_Wt=F({format:$t("nemar-zarr-index"),format_version:C().int(),dataset_id:_().regex(qo,"NEMAR dataset id (nm/on/xx band)"),source_commit:_(),stores:X(WQe)}).passthrough()});function sne(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var KQe,JQe,YQe,XQe,La,EWt;var wS=H(()=>{iI();KQe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],JQe=["50","60"],YQe=["ready","pending","failed"],XQe=sI.options,La=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:JQe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:KQe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:XQe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:YQe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],EWt=new Map(La.map((e)=>[e.key,e]))});var QQe,DWt,ZQe,une,qb,ine,eZe,dne,tZe=20,nZe=100,rZe,fne,oZe,CWt,AWt,sZe,OWt,TWt,iZe,aZe,cZe,PWt,lZe=50,uZe=500,IWt,dZe,fZe,NWt,pZe=1000,mZe=5000,ane=8,hZe=100,gZe=32,cne,FWt,yZe,bZe,wZe,MWt,_Ze=800,xZe=4000,jWt,LWt,mI=60,hI=64,lne,vZe=86400,EZe=4096,qWt,SZe,kZe,UWt;var pne=H(()=>{hr();wS();pI();QQe=F({dataset_id:_().regex(qo),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:X(_()).optional(),tasks:X(_()).optional(),subject_count:C().int().nonnegative().nullable().optional(),has_hed:Ah([$t(0),$t(1)]).nullable().optional(),hed_version:_().nullable().optional(),store_count:C().int().nonnegative().nullable().optional(),recording_count:C().int().nonnegative().nullable().optional(),recordings_unavailable:C().int().nonnegative().nullable().optional(),total_recording_duration:C().nullable().optional(),zarr_converted_at:_().nullable().optional(),zarr_source_commit:_().nullable().optional(),zarr_errors:C().int().nonnegative().nullable().optional(),zarr_verify_status:Le(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:_().nullable().optional(),index_url:_().nullable().optional()}).passthrough(),DWt=F({format:$t("nemar-zarr-catalog"),format_version:C().int(),generated_utc:_(),contract_base:_(),count:C().int().nonnegative(),datasets:X(QQe)}).passthrough(),ZQe=["verified","failed","unverifiable"],une=Le(ZQe).nullable(),qb=F({dataset_id:_().regex(qo),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),source_commit:_().regex(hS),index_etag:_().nullable(),engine_version:_(),source_tree:$t("raw"),derived:oe(),sss:yS.optional(),lossy:oe(),dtype:_().nullable(),effective_rate_hz:C().nullable(),source_rate_hz:C().nullable(),units_report:gS.nullable().optional(),zarr_verify_status:une,note:_().nullable().optional()}).passthrough().superRefine(bS),ine=F({start:C().int().nonnegative(),end:C().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),eZe=F({python_zarr:_(),zarrita:_(),python_browser:_()}).passthrough(),dne=F({contract_base:_(),data_base:_(),s3_uri:_(),s3_region:_(),s3_anonymous:oe(),zarr:_(),group:_(),level:Ah([$t("0"),C().int().positive()]),array_path:_(),dtype:_().nullable(),codecs:X(li()).optional(),chunk_samples:C().int().positive().nullable(),shard_samples:C().int().positive().nullable(),n_channels:C().int().nonnegative().nullable(),sample_slice:ine.optional(),channel_slice:ine.optional(),scale_offset:_(),how_to:eZe}).passthrough(),rZe=Object.fromEntries(La.map((e)=>[e.queryParam,_().optional()])),fne={modality:_().optional(),task:_().optional(),has_hed:oe().optional(),has_zarr:oe().optional(),author:_().optional(),has_doi:oe().optional(),has_zarr_verified:oe().optional(),data_complete:oe().optional(),recent:C().int().positive().optional(),license:_().optional()},oZe=Object.keys(fne),CWt=[...oZe,...La.map((e)=>e.queryParam)],AWt=F({query:_().optional(),...fne,include_unknown:oe().optional(),...rZe,limit:C().int().positive().max(nZe).default(tZe)}).passthrough(),sZe=F({dataset_id:_().regex(qo),name:_(),doi:_().nullable().optional(),license:_().nullable().optional(),modalities:X(_()).optional(),tasks:X(_()).optional(),subject_count:C().int().nullable().optional(),has_hed:oe().nullable().optional(),has_zarr:oe()}).passthrough(),OWt=F({results:X(sZe),count:C().int().nonnegative(),limit:C().int(),note:_().nullable().optional(),truncated:oe().optional()}).passthrough(),TWt=F({dataset_id:_().regex(qo)}).passthrough(),iZe=["list_recordings","get_events","render_overview","read_window"],aZe=F({next_cheapest_tool:Le(iZe),reason:_()}).passthrough(),cZe=["pending","ready","failed"],PWt=F({dataset_id:_().regex(qo),name:_(),doi:_().nullable(),license:_().nullable(),citation:_().nullable(),modalities:X(_()).optional(),tasks:X(_()).optional(),subject_count:C().int().nullable().optional(),has_hed:oe().nullable().optional(),hed_version:_().nullable().optional(),recording_count:C().int().nullable().optional(),total_recording_duration_s:C().nullable().optional(),zarr_status:Le(cZe).nullable().optional(),zarr_verify_status:une.optional(),zarr_source_commit:_().nullable().optional(),zarr_store_count:C().int().nullable().optional(),cost_hint:aZe}).passthrough(),IWt=F({dataset_id:_().regex(qo),modality:_().optional(),min_duration_s:C().nonnegative().optional(),include_derived:oe().default(!1),limit:C().int().positive().max(uZe).default(lZe),offset:C().int().nonnegative().default(0)}).passthrough(),dZe=F({name:_(),modality:_().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nullable().optional(),duration_s:C().nullable().optional(),n_view_levels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),view_chunk_columns:C().int().positive().nullable().optional()}).passthrough(),fZe=F({path:_(),zarr:_(),source_tree:$t("raw"),derived:oe(),groups:X(dZe).optional(),n_events:C().int().nonnegative().optional(),sss:yS.optional(),units_report:gS.optional()}).passthrough().superRefine(bS),NWt=F({dataset_id:_().regex(qo),source_commit:_().regex(hS).nullable(),recordings:X(fZe),total_count:C().int().nonnegative(),excluded_derived_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),index_format_version:C().int(),discovered_count:C().int().nonnegative().nullable(),failure_count:C().int().nonnegative().nullable(),pending_count:C().int().nonnegative().nullable(),excluded_legacy_non_raw_count:C().int().nonnegative(),note:_().nullable().optional(),envelope:qb.optional()}).passthrough(),cne=_().min(1).max(64),FWt=F({dataset_id:_().regex(qo),recording:_(),group:_().optional(),limit:C().int().positive().max(mZe).default(pZe),offset:C().int().nonnegative().default(0),where:pr(cne,X(Ah([_(),C()])).min(1).max(hZe)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=ane},{message:`where names 1 to ${ane} columns`}).optional(),columns:X(cne).min(1).max(gZe).optional()}).passthrough(),yZe=F({store_path:_(),group_name:_(),onset_s:C(),duration_s:C().nullable().optional(),sample_index:C().int().nonnegative(),trial_type:_().nullable().optional(),value:Ah([_(),C()]).nullable().optional(),hed:_().nullable().optional()}).passthrough(),bZe=yZe.partial().required({onset_s:!0,sample_index:!0}),wZe=F({name:_(),distinct_count:C().int().nonnegative(),null_count:C().int().nonnegative(),values:X(F({value:_(),count:C().int().positive()}).passthrough()).nullable()}).passthrough(),MWt=F({dataset_id:_().regex(qo),recording:_(),events:X(bZe),source:Le(["events_parquet","events_tsv_fallback"]),estimated:oe(),total_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),truncated:oe(),note:_().nullable().optional(),columns_summary:X(wZe).optional(),envelope:qb.optional()}).passthrough(),jWt=F({dataset_id:_().regex(qo),recording:_(),group:_().optional(),width_px:C().int().positive().max(xZe).default(_Ze)}).passthrough(),LWt=F({dataset_id:_().regex(qo),recording:_(),group:_(),level:C().int().positive(),width_px:C().int().positive(),height_px:C().int().positive(),mime_type:$t("image/png"),columns_read:C().int().nonnegative(),chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),envelope:qb.optional()}).passthrough(),lne=mI*hI,qWt=F({dataset_id:_().regex(qo),recording:_(),group:_().optional(),start_s:C().nonnegative().default(0),duration_s:C().positive().max(vZe).default(10),channels:X(C().int().nonnegative()).max(EZe).optional(),taste:oe().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:ee.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>mI)t.addIssue({code:ee.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${mI} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>hI)t.addIssue({code:ee.custom,message:`taste channels (${e.channels.length}) exceeds the ${hI}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>lne)t.addIssue({code:ee.custom,message:`taste exceeds the cap of ${lne} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),SZe=F({mode:$t("recipe"),recipe:dne,envelope:qb}).passthrough(),kZe=F({mode:$t("taste"),start_s:C(),duration_s:C(),channels:X(C().int()),sample_rate_hz:C(),values:X(X(C())),recipe:dne,chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),filled_ranges:X(F({start_sample:C().int().nonnegative(),end_sample:C().int().nonnegative(),start_s:C(),end_s:C()}).passthrough()),note:_().nullable().optional(),envelope:qb}).passthrough(),UWt=JP("mode",[SZe,kZe])});function hne(e){let t=Jf.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return $Ze+t}var _l,_S,RZe,GWt,Jf,mne=0,$Ze=10,DZe,gne,Ub,yne,CZe,zWt,VWt,bne,xS,vS,wne;var Yf=H(()=>{_l=/^[a-z0-9_]{1,64}$/,_S=["created","uploading","submitted","queued","running","archiving","finished","failed","cancelled","unreported"],RZe=["created","uploading","submitted","queued","running","archiving","unreported"],GWt=RZe.filter((e)=>e!=="created"&&e!=="uploading"&&e!=="unreported"),Jf=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];DZe=["code_fetch_failed","dataset_fetch_failed","tapis_submit_failed","submit_timeout","staging_failed","launch_failed","archive_failed","tapis_error","result_verification_failed","records_unavailable","result_upload_failed","tapis_record_lost","runner_lost"],gne=["su","none"],Ub=["local","slurm"],yne={runner_credential_not_accepted:401,runner_unknown:401,runner_token_expired:401,runners_disabled:503,lease_lost:409,job_not_claimed:404,runner_outdated:426,protocol_unsupported:426,runner_accounting_unbuilt:409,invalid_body:400},CZe=["results_too_large","results_quota_exceeded","too_many_outputs"],zWt={code_fetch_failed:["unsafe_archive","archive_too_large","bad_response","fetch_failed","checksum_mismatch","digest_mismatch","size_mismatch","content_missing","disk_error"],dataset_fetch_failed:["bad_include","too_many_files","too_many_bytes","dataset_not_found","bad_manifest","manifest_too_large","unsafe_path","bad_response","fetch_failed","checksum_mismatch","size_mismatch","content_missing","file_not_found","disk_error"],entry_not_found:[],runtime_error:["entry_failed","terminated","outputs_unreadable","invalid_spec","unsupported_runtime","scratch_in_output","scratch_unavailable","no_container_runtime","image_missing","runtime_unusable","internal_error","output_dir_not_empty","bind_source_unsafe","pid_namespace_unavailable"],out_of_memory:[],time_limit:[],result_upload_failed:[...CZe,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},VWt=[...Jf,...DZe.filter((e)=>!Jf.includes(e))],bne={no_compute_access:403,suspended:403,insufficient_balance:409,over_job_limit:422,over_concurrency:409,platform_budget_exhausted:409,client_cap_reached:409,invalid_spec:400,partition_not_offered:422,runtime_unavailable:422,registry_not_allowed:422,compute_disabled:503,dataset_not_eligible:422,recipe_unknown:422,pipelines_account_missing:503,live_attempt_exists:409,bundle_too_large:413,bundle_too_many_files:413,results_too_large:413,results_quota_exceeded:409,too_many_outputs:413,results_expired:410,job_not_found:404,bad_state:409,guard_refused:409,results_incomplete:409,policy_unavailable:503,platform_busy:409},xS=["unreserved","unattributed","mismatch","overrun"],vS=["pending","attempting","sent","failed"],wne=["job","account"]});function _I(e){return _().max(e).regex(AZe).refine((t)=>!bI.test(t),{message:"a path may not hold . or .. segments"})}function Gb(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))Gb(t)}return e}function $ne(e){if(typeof e!=="string")return null;let t=IZe.exec(e);if(!t)return null;let n=BigInt(t[1])*1000n+BigInt((t[2]??"").padEnd(3,"0"));if(n>BigInt(Sne))return null;return Number(n)}function so(e){if(!Number.isSafeInteger(e))throw RangeError("an amount is a whole number of milli-SU");let t=Math.abs(e),n=Math.floor(t/1000),r=t%1000,o=r===0?"":`.${String(r).padStart(3,"0").replace(/0+$/,"")}`;return`${e<0?"-":""}${n}${o}`}function MZe(e){let t=0;while(t<e.length){if(e[t]!=="["){t++;continue}let n=e[t+1]==="!"?t+2:t+1,r=e.indexOf("]",n);if(r===-1)return null;if(r===n)return"empty_class";let o=Array.from(e.slice(n,r),(s)=>s.codePointAt(0));for(let s=0;s<o.length;)if(s+2<o.length&&o[s+1]===45){if(o[s]>o[s+2])return"inverted_range";s+=3}else s++;t=r+1}return null}function UZe(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return!1;t++}else if(n>=56320&&n<=57343)return!1}return!0}function BZe(e,t){let n=MZe(e);if(n!==null)t.addIssue({code:ee.custom,message:`an include pattern the dialect refuses: ${n}`})}function Mh(e){let t=2;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===34||r===92)t+=2;else if(r===8||r===9||r===10||r===12||r===13)t+=2;else if(r<32||r>=127)t+=6;else t+=1}return t}function VZe(e){let t=0;if(e.entry!==void 0)t+=Mh(e.entry)+1;for(let n of e.command??[])t+=Mh(n)+1;for(let n of e.args??[])t+=Mh(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=Mh(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=Mh(n)+Mh(r)+2;return t}var yI="\\u0000-\\u001f\\u007f",RS,_ne,AZe,bI,OZe,TZe,Bb=1e5,xl,$S,jh,Xf,DS,vne,Ene=64,Sne,Hb=(e,t=Sne)=>C().int().min(e).max(t),xt,wI,SS,kne,xI,Lh,vI,PZe,ES=2880,Rne,IZe,qh,EI,NZe,SI,FZe,kI="A path inside the bundle. With runtime python the launcher runs python /code/<entry> followed by args; with runtime image and an entry it runs /code/<entry> directly, followed by args, which needs the executable bit that the bundle packer must preserve. The runtime image must provide python on its PATH for the python runtime. A bundle archive's member names may carry a leading ./; absolute names, .. segments, links, devices and FIFOs are refused by the launcher.",RI="An argument vector, run as given, with args appended.",$I="Arguments, each as one argument: after python /code/<entry> (runtime python with an entry), after /code/<entry> (runtime image with an entry) or after the command.",DI="Patterns that select the dataset's files, matched against manifest paths relative to the dataset root; every file when there are none. The dialect: **/ matches zero or more directories (so a/**/b matches a/b); ** elsewhere matches any run of characters including /; * and ? stay inside one path segment; [abc], [a-c] and [!abc] are character classes; a character class never matches /, so like * and ? it stays inside one path segment, and a negated class [!a] matches any single character except a and /; an unterminated [ is a literal [; an empty class [] and an inverted range such as [z-a] are refused, and bad_include is exactly the set of patterns this dialect refuses; matching is case-sensitive; there are no escapes. A matcher MUST run in time linear in the pattern's length times the path's length (no backtracking).",jZe,LZe,qZe,Uh,kS=(e)=>e.refine(UZe,{message:"a lone surrogate is not text a process argument can carry"}),HZe,GZe,zZe,WZe=49152,YWt,KZe,JZe,YZe,XZe,QZe,ZZe,Dne,gI=1073741824,xne=1048576,eet,XWt,QWt,tet,ZWt,Cne,eKt,net,tKt;var vl=H(()=>{hr();Yf();RS=`[^/\\\\${yI}]+`,_ne=RS,AZe=new RegExp(`^(?:${_ne}/)*${_ne}$`),bI=/(?:^|\/)\.\.?(?:\/|$)/,OZe=new RegExp(`^[^\\\\${yI}]+$`),TZe=/^\/|(?:^|\/)\.\.(?:\/|$)/,xl=/^job_[0-9a-f]{24}$/,$S=/^[0-9a-f]{64}$/,jh=/^sha256:[0-9a-f]{64}$/,Xf=/^[a-z]{2}[0-9]{6}$/,DS=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,vne=/^(?:latest|v[0-9]+\.[0-9]+\.[0-9]+)$/,Sne=Number.MAX_SAFE_INTEGER,xt=Hb,wI=_().regex(xl),SS=_().regex($S);kne=_I,xI=_().max(256).regex(OZe).refine((e)=>!TZe.test(e),{message:"a pattern may not leave the dataset"});Lh=["cpu","gpu"],vI=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],PZe=F({maxNodes:xt(1,64),maxCoresPerNode:xt(0,256),maxGpusPerNode:xt(0,8),maxMinutes:xt(1,10080)}).strict(),Rne=Gb({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:ES}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:ES}},debug:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:30}},"large-shared":{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:null},preempt:{pool:"cpu",rate:"core_or_memory",preempt:!0,ceiling:null},"gpu-shared":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:3,maxMinutes:ES}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:ES}},"gpu-debug":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:30}},"gpu-preempt":{pool:"gpu",rate:"gpu_or_memory",preempt:!0,ceiling:null}}),IZe=/^([0-9]+)(?:\.([0-9]{1,3}))?$/;qh=["result.json","provenance.json","manifest.json","launcher.log"],EI=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],NZe=/^[ -~]*$/,SI=_().max(256).regex(NZe),FZe=pr(Le(EI),SI);jZe=["python","matlab","image"],LZe=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,qZe=/^[a-z][a-z0-9-]{0,63}$/,Uh=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;HZe=F({size:xt(1),sha256:SS}).strict(),GZe=F({id:_().regex(Xf),version:_().regex(DS),include:X(kS(xI).superRefine(BZe)).max(64).optional().describe(DI)}).strict(),zZe=kS(_().max(1024));YWt=F({name:_().regex(LZe),runtime:Le(jZe),entry:kS(kne(240)).optional().describe(kI),command:X(kS(_().min(1).max(1024))).min(1).max(64).optional().describe(RI),args:X(zZe).max(64).default([]).describe($I),bundle:HZe.optional(),datasets:X(GZe).max(20).default([]),partition:Le(vI),nodes:xt(1,64).default(1),cores:xt(1,256).default(1),memory_mb:xt(1,16777216).optional(),gpus:xt(0,8).default(0),minutes:xt(1,10080),output_dir:$t("outputs").default("outputs"),env:FZe.default({}),recipe:_().regex(qZe).optional(),image:_().max(512).regex(Uh).optional()}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ee.custom,path:[o],message:s});if(e.entry!==void 0&&e.command!==void 0)n("command","an entry and a command are one or the other");if(e.runtime==="image"&&e.image===void 0)n("image","an image job names a digest-pinned image");if(e.runtime!=="image"&&e.image!==void 0)n("image","only an image job names an image");if(e.recipe===void 0&&e.entry===void 0&&e.command===void 0)n("entry","a job with no recipe names an entry or a command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");if(VZe(e)>WZe)t.addIssue({code:ee.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=Rne[e.partition].pool;if(r==="gpu"&&e.gpus<1)n("gpus","a GPU partition needs at least one GPU");if(r==="cpu"&&e.gpus!==0)n("gpus","a CPU partition takes no GPU")}),KZe=/^[A-Za-z0-9_.-]{1,64}$/,JZe=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,YZe=Object.fromEntries(vI.map((e)=>[e,PZe.optional()])),XZe=F({maxOpenReservations:xt(0,1e5),maxReservedMilliPerDay:xt(0)}).strict(),QZe=F({maxLiveJobs:xt(0,1000),reserved:F({people:xt(0,1000),pipelines:xt(0,1000),partner:xt(0,1000)}).strict()}).strict().refine((e)=>e.reserved.people+e.reserved.pipelines+e.reserved.partner<=e.maxLiveJobs,{message:"the floors reserved for the classes add up to more than the ceiling",path:["reserved"]}),ZZe=F({maxLiveJobs:F({cpu:xt(0,1000),gpu:xt(0,1000)}).strict()}).strict(),Dne=F({defaultGrantMilli:F({cpu:xt(0),gpu:xt(0)}).strict(),renewal:F({enabled:oe(),everyDays:xt(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:F(YZe).strict(),maxLiveJobsPerPerson:xt(0,1000),pipelines:F({dailyJobCap:xt(0,1e5),maxLiveJobs:F({cpu:xt(0,1000),gpu:xt(0,1000)}).strict()}).strict(),clients:pr(_().regex(KZe),XZe),tenant:QZe.optional(),runners:ZZe.optional(),reservationWaitMinutes:xt(1,1440),retention:F({recordsYears:xt(1,30),logsDays:xt(1,3650),resultsDays:xt(14,365)}).strict(),resultLimits:F({maxJobBytes:xt(1),maxFiles:xt(1,Bb),maxStoredBytesPerPerson:xt(1),maxStoredBytesTotal:xt(1)}).strict(),settle:F({toleranceMilli:xt(0),tolerancePercent:xt(0,100)}).strict(),registries:X(_().max(255).regex(JZe)).max(64),bundleLimits:F({maxTotalBytes:xt(1),maxFiles:xt(1,1e5),maxFileBytes:xt(1)}).strict()}).strict(),eet=Gb({maxLiveJobs:20,reserved:{people:8,pipelines:2,partner:0}}),XWt=Gb({maxLiveJobs:{cpu:64,gpu:8}}),QWt=Gb({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(vI.flatMap((e)=>{let t=Rne[e].ceiling;return t?[[e,{...t}]]:[]})),maxLiveJobsPerPerson:4,pipelines:{dailyJobCap:50,maxLiveJobs:{cpu:8,gpu:4}},clients:{},tenant:eet,reservationWaitMinutes:30,retention:{recordsYears:7,logsDays:365,resultsDays:30},resultLimits:{maxJobBytes:20*gI,maxFiles:5000,maxStoredBytesPerPerson:50*gI,maxStoredBytesTotal:1024*gI},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*xne,maxFiles:2000,maxFileBytes:25*xne}}),tet=F({path:kne(512),size:xt(0),sha256:SS}).strict(),ZWt=F({job_id:wI,files:X(tet).max(Bb)}).strict(),Cne=C().int().min(-255).max(255).nullable(),eKt=F({job_id:wI,failure_code:Le(Jf).nullable(),detail:_().regex(_l).nullable(),exit_number:C().int(),entry_exit_code:Cne}).strict().superRefine((e,t)=>{let n=e.failure_code===null?mne:hne(e.failure_code);if(e.exit_number!==n)t.addIssue({code:ee.custom,path:["exit_number"],message:"the exit number is the one the failure code gives"})}),net=F({id:_().regex(Xf),version:_().regex(DS),mode:Le(["bind","download"]),files:xt(0),bytes:xt(0)}).strict(),tKt=F({job_id:wI,launch_spec_digest:SS,bundle_digest:SS.nullable(),image:F({uri:_().regex(/^[^\s]{1,512}$/),digest:_().regex(jh)}).strict(),runtime_version:_().regex(new RegExp(`^[^${yI}]{1,128}$`)),staging:X(net).max(20),timings:pr(_().regex(_l),C().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:_().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:Cne}).strict()});var Ane,rKt;var One=H(()=>{Ane=["dispatched","succeeded","failed","refused"],rKt=Object.freeze([Object.freeze({name:"nemar-floor",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"shared",nodes:1,cores:4,memoryMb:16384,gpus:0,minutes:360,input:"bids",executors:Object.freeze(["tapis"]),autoDispatch:!0,eligibility:"eeg"}),Object.freeze({name:"nemar-floor-zarr",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"shared",nodes:1,cores:4,memoryMb:16384,gpus:0,minutes:120,input:"zarr",executors:Object.freeze(["runner"]),autoDispatch:!1,eligibility:"eeg"}),Object.freeze({name:"nemar-ica",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"gpu-shared",nodes:1,cores:10,gpus:1,minutes:720,input:"bids",executors:Object.freeze(["tapis"]),autoDispatch:!1,placeholder:!0,eligibility:"eeg"})])});function Pne(e){return CI.includes(e)}var ret="pipelines",oet="people",CI,CS,zb=200,Wi,AI,set,Ine,Nne,Fne,OI,Mne,Is,TI,PI,II=100,NI=10,jne=10,AS,FI=200,iet,cKt,aet,cet,uet,Lne,det,qne,OS=8,TS=200,Une,Bne,Tne,Hne,Gne,zne,Vne,Wne,Kne,MI,Jne,Yne,Xne;var Bh=H(()=>{hr();One();Yf();CI=[ret,oet];CS=["granted","charged"],Wi=C().int(),AI=F({id:C().int(),holder_kind:_(),holder_ref:_(),pool:_(),granted_milli:Wi,held_milli:Wi,charged_milli:Wi,available_milli:Wi,frozen:oe(),created_at:_(),updated_at:_()}).passthrough(),set=F({id:C().int(),kind:_(),pool_id:C().int(),budget_pool_id:C().int().nullable(),granted_delta_milli:Wi,held_delta_milli:Wi,charged_delta_milli:Wi,job_id:_().nullable(),hold_ref:C().int().nullable(),reason:_().nullable(),actor_user_id:C().int().nullable(),created_at:_()}).passthrough(),Ine=F({pools:X(AI),next_after:C().int().nullable()}).passthrough(),Nne=F({account_id:C().int(),pools:X(AI)}).passthrough(),Fne=F({pool:AI,entry:set,replayed:oe()}).passthrough(),OI=F({version:C().int().nullable(),is_default:oe(),policy:F({}).passthrough(),set_by:C().int().nullable(),note:_().nullable(),created_at:_().nullable()}).passthrough(),Mne=F({switches:F({environment:_(),compute_enabled:oe(),pipelines_dispatch_enabled:oe()}).passthrough(),tapis:F({configured:oe(),strategy:_().nullable(),problems:X(_()),token:_(),health:_()}).passthrough(),storage:F({records_binding:oe(),results_binding:oe(),signing_configured:oe()}).passthrough(),access:F({key_configured:oe(),resource_name_configured:oe().optional()}).passthrough(),runtime_image:F({set:oe(),valid:oe(),digest:_().nullable()}).passthrough().optional(),prerequisites:F({callback_secret:oe(),api_base_url:oe(),pipelines_account:oe(),policy_set:oe(),people_pool_granted:oe(),pipelines_pool_granted:oe()}).passthrough().optional(),reconciliation:F({paused:oe()}).passthrough().optional(),attention:pr(li()).optional(),tenant:F({ceiling:C(),occupied:C(),by_class:F({people:C(),pipelines:C(),partner:C(),other:C()}).passthrough(),reserved:F({people:C(),pipelines:C(),partner:C()}).passthrough()}).passthrough().optional()}).passthrough(),Is=_().nullable(),TI=F({id:_(),account_id:C().int().nullable(),source:_(),kind:_(),state:_(),tapis_status:Is,failure_code:Is,failure_detail:Is,platform_failure:oe(),cancel_requested:oe(),cancel_reason:Is,partition:_(),pool:_(),held_milli:Wi,charged_milli:Wi,settled:oe(),flags:X(_()),created_at:_(),submitted_at:Is,started_at:Is,ended_at:Is,tapis_synced_at:Is,outputs_completed:oe(),results_verified:oe(),results_bytes:C().int().nullable(),records_copied:oe(),executor:_().optional(),accounting:_().optional(),runner_backend:Is.optional(),runner_id:Is.optional(),runner_claimed_at:Is.optional(),runner_wall_seconds:C().int().nullable().optional(),runner_cpu_seconds:C().int().nullable().optional(),runner_max_rss_mb:C().int().nullable().optional()}).passthrough(),PI=F({ok:oe(),outcome:_(),submit:_().optional(),job:TI.nullable()}).passthrough(),AS=Ane,iet={recipe_not_automatic:422,recipe_placeholder:422,registry_drift:409,version_not_found:404,version_untagged:422,too_many_files:422,zarr_version_not_newest:422,zarr_copy_not_ready:409,zarr_source_mismatch:409,zarr_source_unverifiable:503,runners_disabled:yne.runners_disabled,daily_cap_reached:409,create_failed:502,run_failed:500},cKt={...bne,...iet},aet=F({dataset_id:_(),ok:oe(),version:_().optional(),job_id:_().optional(),stamp_id:C().int().optional(),attempt:C().int().optional(),submit:_().optional(),records_written:oe().optional(),code:_().optional(),blocked_by:X(_()).optional(),reason:_().optional()}).passthrough(),cet=F({daily_left:C().int(),live_left:C().int(),tenant_left:C().int().optional(),limited_by:_()}).passthrough(),uet=F({live_left:C().int(),live_cap:C().int()}).passthrough(),Lne=F({ok:oe(),dry_run:oe(),recipe:_(),results:X(aet).optional(),dispatched:C().int().optional(),stopped_by:_().nullable().optional(),room:cet.optional(),executor:_().optional(),runner_room:uet.optional(),audit_pending:oe().optional(),estimate_milli_per_job:Wi.optional(),estimate_milli_total:Wi.optional(),config:F({compute_enabled:oe(),runtime_image:oe(),pipelines_account:oe(),runners_enabled:oe().optional()}).passthrough().optional(),would_dispatch:X(F({dataset_id:_(),version:_()}).passthrough()).optional(),blocked:F({code:_(),blocked_by:X(_()),version:_().optional(),reason:_().optional()}).passthrough().optional(),blocked_by_term:pr(li()).optional()}).passthrough(),det=F({id:C().int(),dataset_id:_(),version:_(),recipe:_(),recipe_version:_(),engine:_(),attempt:C().int(),state:_(),job_id:Is,refusal_code:Is,created_at:_(),updated_at:_()}).passthrough(),qne=F({stamps:X(det),next_before:C().int().nullable()}).passthrough(),Une=F({jobs:X(TI),next_after:C().int().nullable()}).passthrough(),Bne=F({rows:X(F({slurm_job_id:_(),partition:_(),state:_(),elapsed_seconds:C().int(),alloc_nodes:C().int(),alloc_cpus:C().int(),alloc_gpus:C().int(),charged_milli:C().int().nullable(),ingested_at:_()}).passthrough()),total:C().int()}).passthrough(),Tne=["ok","missing","unreadable"],Hne=F({job:TI,identifiers:F({}).passthrough(),ledger:X(F({}).passthrough()),provenance:F({}).passthrough().nullable(),provenance_status:Le(Tne).optional(),manifest:F({files:C().int(),bytes:C().int()}).passthrough().nullable(),manifest_status:Le(Tne).optional(),legal_hold:oe(),retention_until:_().nullable().optional(),launcher_files:X(_()).optional()}).passthrough(),Gne=F({job_id:_(),name:_(),kind:_(),content:li().optional(),url:_().optional(),expires_at:_().optional()}).passthrough(),zne=F({account_id:C().int(),from:_(),to:_(),totals:F({jobs:C().int(),charged_milli:C().int(),unsettled:C().int().optional(),open_hold_milli:C().int().optional()}).passthrough(),by_pool:pr(F({}).passthrough()),jobs:X(F({}).passthrough()),truncated:oe()}).passthrough(),Vne=F({quarter:_(),rows:X(F({partition:_(),source:_(),distinct_users:C().int(),jobs:C().int()}).passthrough()),totals:F({distinct_users:C().int(),jobs:C().int()}).passthrough()}).passthrough(),Wne=F({id:C().int(),scope:_(),ref:_(),reason:_(),placed_by:C().int(),placed_at:_(),released_at:_().nullable()}).passthrough(),Kne=F({holds:X(Wne),truncated:oe().optional()}).passthrough(),MI=F({hold:Wne}).passthrough(),Jne=F({rows:X(F({job_id:_(),state:_(),attempts:C().int(),last_error_code:_().nullable(),next_attempt_at:_(),sent_at:_().nullable(),created_at:_()}).passthrough()),failed_by_word:pr(li()),next_after:_().nullable()}).passthrough(),Yne=F({ok:oe(),job_id:_(),previous:_().nullable()}).passthrough(),Xne=F({run_id:_(),token:_(),expires_in_minutes:C().int()}).passthrough()});function Ret(e){if(typeof e!=="string"||!jh.test(e))return null;return`${e.slice(7)}.sif`}var fet=65536,ere,pet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",mKt,met,Hh,tre,het,get,yet,Qne,Zne=" Exactly one of entry and command is present.",bet="the image file is not <64 lowercase hex>.sif",wet="the image file is not the one named for the image digest",_et="the image reference is not a digest-pinned reference",xet="the image reference is not pinned to the image digest",vet,Eet,ket,hKt,nre,rre,gKt,yKt,bKt;var ore=H(()=>{hr();vl();ere=Math.ceil(fet*4/3),mKt=new Set(pet),met=["python","image"],Hh=Hb,tre=_I,het=/^https?:\/\/[^\s/?#][^\s?#]*$/,get=/^https?:\/\/[^\s]+$/,yet=/^[A-Za-z0-9_-]{16,256}$/,Qne=/^[0-9a-f]{64}\.sif$/,vet=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,Eet=new RegExp(`^(?:outputs/(?:${RS}/)*${RS}|launcher/(?:${qh.map((e)=>e.replace(".","\\.")).join("|")}))$`),ket=F(Object.fromEntries(EI.map((e)=>[e,SI.optional()]))).strict(),hKt=F({job_id:_().regex(xl),runtime:Le(met),entry:tre(240).optional().describe(kI+Zne),command:X(_().min(1).max(1024)).min(1).max(64).optional().describe(RI+Zne),args:X(_().max(1024)).max(64).describe($I),bundle:F({sha256:_().regex($S),size:Hh(1)}).strict().optional(),datasets:X(F({id:_().regex(Xf),version:_().max(Ene).regex(vne),include:X(xI).max(64).optional().describe(DI)}).strict()).max(20),api_base:_().max(512).regex(het),image:F({uri:_().max(512).regex(Uh,_et),digest:_().regex(jh),sif:_().regex(Qne,bet)}).strict(),env:ket,resources:F({gpus:Hh(0,8)}).strict(),limits:F({max_files:Hh(1,1e6),max_total_bytes:Hh(1)}).strict(),job_token:_().regex(yet)}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ee.custom,path:[o],message:s});if(e.entry===void 0===(e.command===void 0))n("entry","exactly one of entry and command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");let r=Ret(e.image.digest);if(r!==null&&Qne.test(e.image.sif)&&e.image.sif!==r)t.addIssue({code:ee.custom,path:["image","sif"],message:wet});if(r!==null&&Uh.test(e.image.uri)&&!e.image.uri.endsWith(e.image.digest))t.addIssue({code:ee.custom,path:["image","uri"],message:xet})});nre=_().max(4096).regex(get),rre=_().regex(vet),gKt=F({url:nre,expires_at:rre}).passthrough(),yKt=F({outputs:X(F({path:tre(512),size:Hh(0),sha256:_().regex($S)}).strict()).max(Bb),launcher:X(F({name:Le(qh),size:Hh(0)}).strict()).length(qh.length)}).strict().superRefine((e,t)=>{if(new Set(e.launcher.map((n)=>n.name)).size!==qh.length)t.addIssue({code:ee.custom,path:["launcher"],message:"each launcher file is named once"})}),bKt=F({uploads:X(F({path:_().max(600).regex(Eet).refine((e)=>!bI.test(e),{message:"no . or .. segments"}),url:nre}).passthrough()).max(Bb+qh.length),expires_at:rre}).passthrough()});var sre="nemar.runner.v1",$et,Wb,Vb,jI,Det="nmr_",Cet="nmra_",ire="[0-9a-f]{64}",Aet,Oet,LI,Tet,Pet,are=32,Ns,Iet,Net,Fet,Met,jet=32,Let,qI,UI,BI,HI,GI,cre,lre,SKt,kKt,RKt,qet,$Kt,ure,DKt,Uet,CKt,AKt,OKt;var PS=H(()=>{hr();Yf();ore();vl();$et=["started","uploading"],Wb=["amd64","arm64"],Vb=["apptainer","docker","podman"],jI=["lab","hpc"],Aet=new RegExp(`^${Det}${ire}$`),Oet=new RegExp(`^${Cet}${ire}$`),LI=/^rnr_[0-9a-f]{24}$/,Tet=/^[0-9a-f]{32}$/,Pet=/^[a-z0-9_]{1,32}$/,Ns=Hb,Iet=Number.MAX_SAFE_INTEGER,Net=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,Fet=/^[0-9a-f]{64}\.sif$/,Met=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Let=/^[A-Za-z0-9_-]+$/,qI=_().regex(_l),UI=_().regex(xl),BI=_().regex(Tet),HI=_().max(jet).regex(Met),GI=_().regex(Net),cre=X(Le(Vb)).min(1).max(Vb.length).refine((e)=>new Set(e).size===e.length,{message:"each runtime is named once"}),lre=F({name:qI,pool:Le(Lh),cores:Ns(1,256),memory_mb:Ns(1,16777216),gpus:Ns(0,8),scratch_gb:Ns(1,1e5),backend:Le(Ub),runtimes:cre,arch:Le(Wb),accounting:Le(gne),site:_().regex(Pet),trust:Le(jI)}).strict(),SKt=F({protocol:$t(sre),runner_version:HI}).strict(),kKt=F({protocol:$t(sre),free_slots:Ns(1,are),runtimes:cre,arch:Le(Wb),runner_version:HI}).strict(),RKt=F({job_id:UI,lease_id:BI,phase:Le($et)}).strict(),qet=F({wall_seconds:Ns(0),cpu_seconds:Ns(0),max_rss_mb:Ns(0)}).strict(),$Kt=F({job_id:UI,lease_id:BI,exit_number:Ns(0,255),launcher_failure_code:Le(Jf).nullable(),launcher_detail:qI.nullable(),usage:qet,usage_partial:oe(),scratch_discarded:oe()}).strict(),ure=F({runner_id:_().regex(LI),secret:_().regex(Aet)}).passthrough(),DKt=F({access_token:_().regex(Oet),expires_at:GI}).passthrough(),Uet=F({id:UI,lease_id:BI,lease_expires_at:GI,launch_spec_env:_().max(ere).regex(Let),image:F({uri:_().max(512).regex(Uh),digest:_().regex(jh),sif:_().regex(Fet)}).passthrough(),cores:Ns(1,256),memory_mb:Ns(1,16777216).nullable(),gpus:Ns(0,8),minutes:Ns(1,Iet)}).passthrough(),CKt=F({jobs:X(Uet).max(are),min_runner_version:HI}).passthrough(),AKt=F({lease_expires_at:GI,cancel:oe()}).passthrough(),OKt=F({state:qI}).passthrough()});var Gh=H(()=>{oI();Oh();iI();jb();aI();dS();Ih();Fh();pI();pne();vl();Bh();PS()});function jr(e){return typeof e==="string"&&Get.test(e)&&!e.includes("..")}function El(e){return/^v\d/.test(e)?e.slice(1):e}function Lr(e,t){return El(e)===El(t)}var Get;var Ki=H(()=>{Get=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function W(e){if(e instanceof Error)return e.message;return String(e)}function Vh(e){if(!(e instanceof U)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var U,Ju;var ze=H(()=>{U=class U extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;constructor(e,t,n,r,o,s){super(t);this.statusCode=e;this.details=n;this.step=r;this.blockReason=o;this.missing=s;this.name="ApiError"}};Ju=class Ju extends U{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var zet,Vet,Wet,ZKt,pre="override_publication_review",mre="publication_review_not_clear",WI=2000;var NS=H(()=>{zet=["dispatched","redispatched","dispatch_claimed"],Vet=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],Wet=["dispatch_failed","dispatch_unconfigured"],ZKt=[...zet,...Vet,...Wet]});var FS=1e4;function MS(e){return e?Jet:qa}var qa,nJt,Ket,Jet,KI;var jS=H(()=>{qa=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],nJt=qa.slice(0,qa.indexOf("s3_public_read")),Ket=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],Jet=qa.filter((e)=>!Ket.includes(e));KI={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function Yet(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function Xet(e){return new TextEncoder().encode(Yet(e)).length}function hre(e){if(Xet(e)<=50)return null;return["search is too long: its match pattern may be at most 50 bytes,","which is about 48 plain characters (each of _ % \\ counts twice and a non-ASCII","character counts by its UTF-8 length)"].join(" ")}function LS(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function gre(e,t){if(e==="")return!0;let n=LS(e);return t.some((r)=>typeof r==="string"&&LS(r).includes(n))}function yre(e,t){return LS(e)===LS(t)}function qS(e){let t=[],n="",r="start",o=!1;for(let s of e)switch(s){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(o)n+=s;r="property",o=!o;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(o){o=!1,n+=s;break}if(JI.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(o){o=!1,n+=s;break}if(r==="property"){if(JI.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!Qet.has(s))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(o)o=!1,n+="\\";n+=s}}if(o)n+="\\";switch(r){case"property":{if(JI.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function YI(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function bre(e,t){if(YI(e,t))throw Error("Cannot use string index")}function wre(e,t,n){if(!Qf(e)||typeof t!=="string")return n===void 0?e:n;let r=qS(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(YI(e,s))e=o===r.length-1?void 0:null;else e=e[s];if(e===void 0||e===null){if(o!==r.length-1)return n;break}}return e===void 0?n:e}function XI(e,t,n){if(!Qf(e)||typeof t!=="string")return e;let r=e,o=qS(t);for(let s=0;s<o.length;s++){let i=o[s];if(bre(e,i),s===o.length-1)e[i]=n;else if(!Qf(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function _re(e,t){if(!Qf(e)||typeof t!=="string")return!1;let n=qS(t);for(let r=0;r<n.length;r++){let o=n[r];if(bre(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!Qf(e))return!1}}function xre(e,t){if(!Qf(e)||typeof t!=="string")return!1;let n=qS(t);if(n.length===0)return!1;for(let r of n){if(!Qf(e)||!(r in e)||YI(e,r))return!1;e=e[r]}return!0}var Qf=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},JI,Qet;var vre=H(()=>{JI=new Set(["__proto__","prototype","constructor"]),Qet=new Set("0123456789")});import Mn from"path";import Ere from"os";import QI from"process";function eN(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(QI.platform==="darwin")return Zet(e);if(QI.platform==="win32")return ett(e);return ttt(e)}var Yu,ZI,Wh,Zet=(e)=>{let t=Mn.join(Yu,"Library");return{data:Mn.join(t,"Application Support",e),config:Mn.join(t,"Preferences",e),cache:Mn.join(t,"Caches",e),log:Mn.join(t,"Logs",e),temp:Mn.join(ZI,e)}},ett=(e)=>{let t=Wh.APPDATA||Mn.join(Yu,"AppData","Roaming"),n=Wh.LOCALAPPDATA||Mn.join(Yu,"AppData","Local");return{data:Mn.join(n,e,"Data"),config:Mn.join(t,e,"Config"),cache:Mn.join(n,e,"Cache"),log:Mn.join(n,e,"Log"),temp:Mn.join(ZI,e)}},ttt=(e)=>{let t=Mn.basename(Yu);return{data:Mn.join(Wh.XDG_DATA_HOME||Mn.join(Yu,".local","share"),e),config:Mn.join(Wh.XDG_CONFIG_HOME||Mn.join(Yu,".config"),e),cache:Mn.join(Wh.XDG_CACHE_HOME||Mn.join(Yu,".cache"),e),log:Mn.join(Wh.XDG_STATE_HOME||Mn.join(Yu,".local","state"),e),temp:Mn.join(ZI,t,e)}};var Sre=H(()=>{Yu=Ere.homedir(),ZI=Ere.tmpdir(),{env:Wh}=QI});var ntt=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},Ua;var kre=H(()=>{Ua=ntt});var rtt=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},Ji;var Rre=H(()=>{Ji=rtt});var $re=250;var Dre=()=>{};var ott=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??$re,a=Date.now()+s;return function c(...l){return e.apply(void 0,l).catch((d)=>{if(!n(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(i*Math.random());if(f>0)return new Promise((m)=>setTimeout(m,f)).then(()=>c.apply(void 0,l));else return c.apply(void 0,l)})}}},Ba;var Cre=H(()=>{Dre();Ba=ott});var stt=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=Date.now()+s;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(l){if(!n(l))throw l;if(Date.now()>=i)throw l;continue}}}},Ha;var Are=H(()=>{Ha=stt});var tN=H(()=>{kre();Rre();Cre();Are()});var Kb,nN;var Ore=H(()=>{rN();Kb={isChangeErrorOk:(e)=>{if(!Kb.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Tre&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Kb.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(!Kb.isNodeError(e))throw e;if(Kb.isChangeErrorOk(e))return;throw e}},nN=Kb});import Pre from"process";var Jb,us,Tre,io;var rN=H(()=>{Ore();Jb={onError:nN.onChangeError},us={onError:()=>{return}},Tre=Pre.getuid?!Pre.getuid():!1,io={isRetriable:nN.isRetriableError}});import jt from"fs";import{promisify as So}from"util";var itt,qr;var oN=H(()=>{tN();tN();rN();itt={attempt:{chmod:Ua(So(jt.chmod),Jb),chown:Ua(So(jt.chown),Jb),close:Ua(So(jt.close),us),fsync:Ua(So(jt.fsync),us),mkdir:Ua(So(jt.mkdir),us),realpath:Ua(So(jt.realpath),us),stat:Ua(So(jt.stat),us),unlink:Ua(So(jt.unlink),us),chmodSync:Ji(jt.chmodSync,Jb),chownSync:Ji(jt.chownSync,Jb),closeSync:Ji(jt.closeSync,us),existsSync:Ji(jt.existsSync,us),fsyncSync:Ji(jt.fsync,us),mkdirSync:Ji(jt.mkdirSync,us),realpathSync:Ji(jt.realpathSync,us),statSync:Ji(jt.statSync,us),unlinkSync:Ji(jt.unlinkSync,us)},retry:{close:Ba(So(jt.close),io),fsync:Ba(So(jt.fsync),io),open:Ba(So(jt.open),io),readFile:Ba(So(jt.readFile),io),rename:Ba(So(jt.rename),io),stat:Ba(So(jt.stat),io),write:Ba(So(jt.write),io),writeFile:Ba(So(jt.writeFile),io),closeSync:Ha(jt.closeSync,io),fsyncSync:Ha(jt.fsyncSync,io),openSync:Ha(jt.openSync,io),readFileSync:Ha(jt.readFileSync,io),renameSync:Ha(jt.renameSync,io),statSync:Ha(jt.statSync,io),writeSync:Ha(jt.writeSync,io),writeFileSync:Ha(jt.writeFileSync,io)}},qr=itt});import Zf from"process";var Ire="utf8",sN=438,Nre=511,Fre,Mre,jre,Lre=1000,qre,PJt,iN=128;var aN=H(()=>{Fre={},Mre=Zf.geteuid?Zf.geteuid():-1,jre=Zf.getegid?Zf.getegid():-1,qre=!!Zf.getuid,PJt=Zf.getuid?!Zf.getuid():!1});var Ure=(e)=>e instanceof Error&&("code"in e),cN=(e)=>typeof e==="string",US=(e)=>e===void 0;var Bre=()=>{};var Hre=()=>{};import Gre from"process";var zre,BS;var lN=H(()=>{zre=Gre.platform==="linux",BS=Gre.platform==="win32"});var uN,Vre;var Wre=H(()=>{lN();uN=["SIGHUP","SIGINT","SIGTERM"];if(!BS)uN.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(zre)uN.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Vre=uN});import Kh from"process";class Kre{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(BS&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Kh.kill(Kh.pid,"SIGTERM");else Kh.kill(Kh.pid,e)},this.hook=()=>{Kh.once("exit",()=>this.exit());for(let e of Vre)try{Kh.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Jre;var Yre=H(()=>{lN();Wre();Jre=new Kre});var att,Xre;var Qre=H(()=>{Yre();att=Jre.register,Xre=att});import ctt from"path";var Fs,Yb;var Zre=H(()=>{oN();Qre();aN();Fs={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",o=`.tmp-${n}${t}`;return`${e}${o}`},get:(e,t,n=!0)=>{let r=Fs.truncate(t(e));if(r in Fs.store)return Fs.get(e,t,n);return Fs.store[r]=n,[r,()=>delete Fs.store[r]]},purge:(e)=>{if(!Fs.store[e])return;delete Fs.store[e],qr.attempt.unlink(e)},purgeSync:(e)=>{if(!Fs.store[e])return;delete Fs.store[e],qr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Fs.store)Fs.purgeSync(e)},truncate:(e)=>{let t=ctt.basename(e);if(t.length<=iN)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-iN;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};Xre(Fs.purgeSyncAll);Yb=Fs});import ltt from"path";function dN(e,t,n=Fre){if(cN(n))return dN(e,t,{encoding:n});let o={timeout:n.timeout??Lre},s=null,i=null,a=null;try{let c=qr.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=Yb.get(e,n.tmpCreate||Yb.create,n.tmpPurge!==!1);let d=qre&&US(n.chown),f=US(n.mode);if(l&&(d||f)){let p=qr.attempt.statSync(e);if(p){if(n={...n},d)n.chown={uid:p.uid,gid:p.gid};if(f)n.mode=p.mode}}if(!l){let p=ltt.dirname(e);qr.attempt.mkdirSync(p,{mode:Nre,recursive:!0})}if(a=qr.retry.openSync(o)(i,"w",n.mode||sN),n.tmpCreated)n.tmpCreated(i);if(cN(t))qr.retry.writeSync(o)(a,t,0,n.encoding||Ire);else if(!US(t))qr.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)qr.retry.fsyncSync(o)(a);else qr.attempt.fsync(a);if(qr.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Mre||n.chown.gid!==jre))qr.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==sN)qr.attempt.chmodSync(i,n.mode);try{qr.retry.renameSync(o)(i,e)}catch(p){if(!Ure(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;qr.retry.renameSync(o)(i,Yb.truncate(e))}s(),i=null}finally{if(a)qr.attempt.closeSync(a);if(i)Yb.purge(i)}}var eoe=H(()=>{oN();aN();Bre();Hre();Zre()});var Qb=w(function(roe){Object.defineProperty(roe,"__esModule",{value:!0});roe.regexpCode=roe.getEsmExportName=roe.getProperty=roe.safeStringify=roe.stringify=roe.strConcat=roe.addCodeArg=roe.str=roe._=roe.nil=roe._Code=roe.Name=roe.IDENTIFIER=roe._CodeOrName=void 0;class HS{}roe._CodeOrName=HS;roe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Jh extends HS{constructor(e){super();if(!roe.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}}}roe.Name=Jh;class Yi extends HS{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,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof Jh)t[n.str]=(t[n.str]||0)+1;return t},{})}}roe._Code=Yi;roe.nil=new Yi("");function toe(e,...t){let n=[e[0]],r=0;while(r<t.length)pN(n,t[r]),n.push(e[++r]);return new Yi(n)}roe._=toe;var fN=new Yi("+");function noe(e,...t){let n=[Xb(e[0])],r=0;while(r<t.length)n.push(fN),pN(n,t[r]),n.push(fN,Xb(e[++r]));return utt(n),new Yi(n)}roe.str=noe;function pN(e,t){if(t instanceof Yi)e.push(...t._items);else if(t instanceof Jh)e.push(t);else e.push(ptt(t))}roe.addCodeArg=pN;function utt(e){let t=1;while(t<e.length-1){if(e[t]===fN){let n=dtt(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function dtt(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Jh||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 Jh))return`"${e}${t.slice(1)}`;return}function ftt(e,t){return t.emptyStr()?e:e.emptyStr()?t:noe`${e}${t}`}roe.strConcat=ftt;function ptt(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Xb(Array.isArray(e)?e.join(","):e)}function mtt(e){return new Yi(Xb(e))}roe.stringify=mtt;function Xb(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}roe.safeStringify=Xb;function htt(e){return typeof e=="string"&&roe.IDENTIFIER.test(e)?new Yi(`.${e}`):toe`[${e}]`}roe.getProperty=htt;function gtt(e){if(typeof e=="string"&&roe.IDENTIFIER.test(e))return new Yi(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}roe.getEsmExportName=gtt;function ytt(e){return new Yi(e.toString())}roe.regexpCode=ytt});var yN=w(function(aoe){Object.defineProperty(aoe,"__esModule",{value:!0});aoe.ValueScope=aoe.ValueScopeName=aoe.Scope=aoe.varKinds=aoe.UsedValueState=void 0;var un=Qb();class soe extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var zS;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(zS||(aoe.UsedValueState=zS={}));aoe.varKinds={const:new un.Name("const"),let:new un.Name("let"),var:new un.Name("var")};class hN{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof un.Name?e:this.name(e)}name(e){return new un.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.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}}}aoe.Scope=hN;class gN extends un.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=un._`.${new un.Name(t)}[${n}]`}}aoe.ValueScopeName=gN;var Att=un._`\n`;class ioe extends hN{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Att:un.nil}}get(){return this._scope}name(e){return new gN(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(n=t.key)!==null&&n!==void 0?n:t.ref,i=this._values[o];if(i){let l=i.get(s);if(l)return l}else i=this._values[o]=new Map;i.set(s,r);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return un._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=un.nil;for(let s in e){let i=e[s];if(!i)continue;let a=n[s]=n[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,zS.Started);let l=t(c);if(l){let d=this.opts.es5?aoe.varKinds.var:aoe.varKinds.const;o=un._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=un._`${o}${l}${this.opts._n}`;else throw new soe(c);a.set(c,zS.Completed)})}return o}}aoe.ValueScope=ioe});var ht=w(function(ds){Object.defineProperty(ds,"__esModule",{value:!0});ds.or=ds.and=ds.not=ds.CodeGen=ds.operators=ds.varKinds=ds.ValueScopeName=ds.ValueScope=ds.Scope=ds.Name=ds.regexpCode=ds.stringify=ds.getProperty=ds.nil=ds.strConcat=ds.str=ds._=void 0;var ge=Qb(),Vn=yN(),Xu=Qb();Object.defineProperty(ds,"_",{enumerable:!0,get:function(){return Xu._}});Object.defineProperty(ds,"str",{enumerable:!0,get:function(){return Xu.str}});Object.defineProperty(ds,"strConcat",{enumerable:!0,get:function(){return Xu.strConcat}});Object.defineProperty(ds,"nil",{enumerable:!0,get:function(){return Xu.nil}});Object.defineProperty(ds,"getProperty",{enumerable:!0,get:function(){return Xu.getProperty}});Object.defineProperty(ds,"stringify",{enumerable:!0,get:function(){return Xu.stringify}});Object.defineProperty(ds,"regexpCode",{enumerable:!0,get:function(){return Xu.regexpCode}});Object.defineProperty(ds,"Name",{enumerable:!0,get:function(){return Xu.Name}});var XS=yN();Object.defineProperty(ds,"Scope",{enumerable:!0,get:function(){return XS.Scope}});Object.defineProperty(ds,"ValueScope",{enumerable:!0,get:function(){return XS.ValueScope}});Object.defineProperty(ds,"ValueScopeName",{enumerable:!0,get:function(){return XS.ValueScopeName}});Object.defineProperty(ds,"varKinds",{enumerable:!0,get:function(){return XS.varKinds}});ds.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};class Qu{optimizeNodes(){return this}optimizeNames(e,t){return this}}class loe extends Qu{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Vn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Xh(this.rhs,e,t);return this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}}class _N extends Qu{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof ge.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Xh(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return YS(e,this.rhs)}}class uoe extends _N{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class doe extends Qu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class foe extends Qu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class poe extends Qu{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class moe extends Qu{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=Xh(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}}class QS extends Qu{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;Itt(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ep(e,t.names),{})}}class Zu extends QS{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class hoe extends QS{}class Zb extends Zu{}Zb.kind="else";class Sl extends Zu{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 n=t.optimizeNodes();t=this.else=Array.isArray(n)?new Zb(n):n}if(t){if(e===!1)return t instanceof Sl?t:t.nodes;if(this.nodes.length)return this;return new Sl(_oe(e),t instanceof Sl?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Xh(this.condition,e,t),this}get names(){let e=super.names;if(YS(e,this.condition),this.else)ep(e,this.else.names);return e}}Sl.kind="if";class Yh extends Zu{}Yh.kind="for";class goe extends Yh{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=Xh(this.iteration,e,t),this}get names(){return ep(super.names,this.iteration.names)}}class yoe extends Yh{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?Vn.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=YS(super.names,this.from);return YS(e,this.to)}}class bN extends Yh{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}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=Xh(this.iterable,e,t),this}get names(){return ep(super.names,this.iterable.names)}}class VS extends Zu{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}VS.kind="func";class WS extends QS{render(e){return"return "+super.render(e)}}WS.kind="return";class boe extends Zu{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 n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ep(e,this.catch.names);if(this.finally)ep(e,this.finally.names);return e}}class KS extends Zu{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}KS.kind="catch";class JS extends Zu{render(e){return"finally"+super.render(e)}}JS.kind="finally";class woe{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
85
85
|
`:""},this._extScope=e,this._scope=new Vn.Scope({parent:e}),this._nodes=[new hoe]}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 n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}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,n,r){let o=this._scope.toName(t);if(n!==void 0&&r)this._constants[o.str]=n;return this._leafNode(new loe(e,o,n)),o}const(e,t,n){return this._def(Vn.varKinds.const,e,t,n)}let(e,t,n){return this._def(Vn.varKinds.let,e,t,n)}var(e,t,n){return this._def(Vn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new _N(e,t,n))}add(e,t){return this._leafNode(new uoe(e,ds.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==ge.nil)this._leafNode(new moe(e));return this}object(...e){let t=["{"];for(let[n,r]of e){if(t.length>1)t.push(",");if(t.push(n),n!==r||this.opts.es5)t.push(":"),ge.addCodeArg(t,r)}return t.push("}"),new ge._Code(t)}if(e,t,n){if(this._blockNode(new Sl(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Sl(e))}else(){return this._elseNode(new Zb)}endIf(){return this._endBlockNode(Sl,Zb)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new goe(e),t)}forRange(e,t,n,r,o=this.opts.es5?Vn.varKinds.var:Vn.varKinds.let){let s=this._scope.toName(e);return this._for(new yoe(o,s,t,n),()=>r(s))}forOf(e,t,n,r=Vn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=t instanceof ge.Name?t:this.var("_arr",t);return this.forRange("_i",0,ge._`${s}.length`,(i)=>{this.var(o,ge._`${s}[${i}]`),n(o)})}return this._for(new bN("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?Vn.varKinds.var:Vn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,ge._`Object.keys(${t})`,n);let o=this._scope.toName(e);return this._for(new bN("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(Yh)}label(e){return this._leafNode(new doe(e))}break(e){return this._leafNode(new foe(e))}return(e){let t=new WS;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(WS)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new boe;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new KS(o),t(o)}if(n)this._currNode=r.finally=new JS,this.code(n);return this._endBlockNode(KS,JS)}throw(e){return this._leafNode(new poe(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 n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=ge.nil,n,r){if(this._blockNode(new VS(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(VS)}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 n=this._currNode;if(n instanceof e||t&&n 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 Sl))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}}ds.CodeGen=woe;function ep(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function YS(e,t){return t instanceof ge._CodeOrName?ep(e,t.names):e}function Xh(e,t,n){if(e instanceof ge.Name)return r(e);if(!o(e))return e;return new ge._Code(e._items.reduce((s,i)=>{if(i instanceof ge.Name)i=r(i);if(i instanceof ge._Code)s.push(...i._items);else s.push(i);return s},[]));function r(s){let i=n[s.str];if(i===void 0||t[s.str]!==1)return s;return delete t[s.str],i}function o(s){return s instanceof ge._Code&&s._items.some((i)=>i instanceof ge.Name&&t[i.str]===1&&n[i.str]!==void 0)}}function Itt(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function _oe(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:ge._`!${wN(e)}`}ds.not=_oe;var Ntt=xoe(ds.operators.AND);function Ftt(...e){return e.reduce(Ntt)}ds.and=Ftt;var Mtt=xoe(ds.operators.OR);function jtt(...e){return e.reduce(Mtt)}ds.or=jtt;function xoe(e){return(t,n)=>t===ge.nil?n:n===ge.nil?t:ge._`${wN(t)} ${e} ${wN(n)}`}function wN(e){return e instanceof ge.Name?e:ge._`(${e})`}});var Ct=w(function(Ooe){Object.defineProperty(Ooe,"__esModule",{value:!0});Ooe.checkStrictMode=Ooe.getErrorPath=Ooe.Type=Ooe.useFunc=Ooe.setEvaluated=Ooe.evaluatedPropsToName=Ooe.mergeEvaluated=Ooe.eachItem=Ooe.unescapeJsonPointer=Ooe.escapeJsonPointer=Ooe.escapeFragment=Ooe.unescapeFragment=Ooe.schemaRefOrVal=Ooe.schemaHasRulesButRef=Ooe.schemaHasRules=Ooe.checkUnknownRules=Ooe.alwaysValidSchema=Ooe.toHash=void 0;var Ne=ht(),koe=Qb();function Btt(e){let t={};for(let n of e)t[n]=!0;return t}Ooe.toHash=Btt;function Htt(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Roe(e,t),!$oe(t,e.self.RULES.all)}Ooe.alwaysValidSchema=Htt;function Roe(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema)return;if(typeof t==="boolean")return;let o=r.RULES.keywords;for(let s in t)if(!o[s])Aoe(e,`unknown keyword: "${s}"`)}Ooe.checkUnknownRules=Roe;function $oe(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}Ooe.schemaHasRules=$oe;function Gtt(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}Ooe.schemaHasRulesButRef=Gtt;function ztt({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return Ne._`${n}`}return Ne._`${e}${t}${Ne.getProperty(r)}`}Ooe.schemaRefOrVal=ztt;function Vtt(e){return Doe(decodeURIComponent(e))}Ooe.unescapeFragment=Vtt;function Wtt(e){return encodeURIComponent(vN(e))}Ooe.escapeFragment=Wtt;function vN(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Ooe.escapeJsonPointer=vN;function Doe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Ooe.unescapeJsonPointer=Doe;function Ktt(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}Ooe.eachItem=Ktt;function Eoe({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof Ne.Name?(s instanceof Ne.Name?e(o,s,i):t(o,s,i),i):s instanceof Ne.Name?(t(o,i,s),s):n(s,i);return a===Ne.Name&&!(c instanceof Ne.Name)?r(o,c):c}}Ooe.mergeEvaluated={props:Eoe({mergeNames:(e,t,n)=>e.if(Ne._`${n} !== true && ${t} !== undefined`,()=>{e.if(Ne._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,Ne._`${n} || {}`).code(Ne._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(Ne._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,Ne._`${n} || {}`),EN(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Coe}),items:Eoe({mergeNames:(e,t,n)=>e.if(Ne._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,Ne._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(Ne._`${n} !== true`,()=>e.assign(n,t===!0?!0:Ne._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Coe(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",Ne._`{}`);if(t!==void 0)EN(e,n,t);return n}Ooe.evaluatedPropsToName=Coe;function EN(e,t,n){Object.keys(n).forEach((r)=>e.assign(Ne._`${t}${Ne.getProperty(r)}`,!0))}Ooe.setEvaluated=EN;var Soe={};function Jtt(e,t){return e.scopeValue("func",{ref:t,code:Soe[t.code]||(Soe[t.code]=new koe._Code(t.code))})}Ooe.useFunc=Jtt;var xN;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(xN||(Ooe.Type=xN={}));function Ytt(e,t,n){if(e instanceof Ne.Name){let r=t===xN.Num;return n?r?Ne._`"[" + ${e} + "]"`:Ne._`"['" + ${e} + "']"`:r?Ne._`"/" + ${e}`:Ne._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?Ne.getProperty(e).toString():"/"+vN(e)}Ooe.getErrorPath=Ytt;function Aoe(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}Ooe.checkStrictMode=Aoe});var ui=w(function(Poe){Object.defineProperty(Poe,"__esModule",{value:!0});var Bt=ht(),mnt={data:new Bt.Name("data"),valCxt:new Bt.Name("valCxt"),instancePath:new Bt.Name("instancePath"),parentData:new Bt.Name("parentData"),parentDataProperty:new Bt.Name("parentDataProperty"),rootData:new Bt.Name("rootData"),dynamicAnchors:new Bt.Name("dynamicAnchors"),vErrors:new Bt.Name("vErrors"),errors:new Bt.Name("errors"),this:new Bt.Name("this"),self:new Bt.Name("self"),scope:new Bt.Name("scope"),json:new Bt.Name("json"),jsonPos:new Bt.Name("jsonPos"),jsonLen:new Bt.Name("jsonLen"),jsonPart:new Bt.Name("jsonPart")};Poe.default=mnt});var ew=w(function(Moe){Object.defineProperty(Moe,"__esModule",{value:!0});Moe.extendErrors=Moe.resetErrorsCount=Moe.reportExtraError=Moe.reportError=Moe.keyword$DataError=Moe.keywordError=void 0;var be=ht(),ed=Ct(),Uo=ui();Moe.keywordError={message:({keyword:e})=>be.str`must pass "${e}" keyword validation`};Moe.keyword$DataError={message:({keyword:e,schemaType:t})=>t?be.str`"${e}" keyword must be ${t} ($data)`:be.str`"${e}" keyword is invalid ($data)`};function gnt(e,t=Moe.keywordError,n,r){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=Foe(e,t,n);if(r!==null&&r!==void 0?r:i||a)Ioe(s,c);else Noe(o,be._`[${c}]`)}Moe.reportError=gnt;function ynt(e,t=Moe.keywordError,n){let{it:r}=e,{gen:o,compositeRule:s,allErrors:i}=r,a=Foe(e,t,n);if(Ioe(o,a),!(s||i))Noe(r,Uo.default.vErrors)}Moe.reportExtraError=ynt;function bnt(e,t){e.assign(Uo.default.errors,t),e.if(be._`${Uo.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(be._`${Uo.default.vErrors}.length`,t),()=>e.assign(Uo.default.vErrors,null)))}Moe.resetErrorsCount=bnt;function wnt({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:s}){if(o===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Uo.default.errors,(a)=>{if(e.const(i,be._`${Uo.default.vErrors}[${a}]`),e.if(be._`${i}.instancePath === undefined`,()=>e.assign(be._`${i}.instancePath`,be.strConcat(Uo.default.instancePath,s.errorPath))),e.assign(be._`${i}.schemaPath`,be.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(be._`${i}.schema`,n),e.assign(be._`${i}.data`,r)})}Moe.extendErrors=wnt;function Ioe(e,t){let n=e.const("err",t);e.if(be._`${Uo.default.vErrors} === null`,()=>e.assign(Uo.default.vErrors,be._`[${n}]`),be._`${Uo.default.vErrors}.push(${n})`),e.code(be._`${Uo.default.errors}++`)}function Noe(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(be._`new ${e.ValidationError}(${t})`);else n.assign(be._`${r}.errors`,t),n.return(!1)}var tp={keyword:new be.Name("keyword"),schemaPath:new be.Name("schemaPath"),params:new be.Name("params"),propertyName:new be.Name("propertyName"),message:new be.Name("message"),schema:new be.Name("schema"),parentSchema:new be.Name("parentSchema")};function Foe(e,t,n){let{createErrors:r}=e.it;if(r===!1)return be._`{}`;return _nt(e,t,n)}function _nt(e,t,n={}){let{gen:r,it:o}=e,s=[xnt(o,n),vnt(e,n)];return Ent(e,t,s),r.object(...s)}function xnt({errorPath:e},{instancePath:t}){let n=t?be.str`${e}${ed.getErrorPath(t,ed.Type.Str)}`:e;return[Uo.default.instancePath,be.strConcat(Uo.default.instancePath,n)]}function vnt({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:be.str`${t}/${e}`;if(n)o=be.str`${o}${ed.getErrorPath(n,ed.Type.Str)}`;return[tp.schemaPath,o]}function Ent(e,{params:t,message:n},r){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;if(r.push([tp.keyword,o],[tp.params,typeof t=="function"?t(e):t||be._`{}`]),c.messages)r.push([tp.message,typeof n=="function"?n(e):n]);if(c.verbose)r.push([tp.schema,i],[tp.parentSchema,be._`${d}${f}`],[Uo.default.data,s]);if(l)r.push([tp.propertyName,l])}});var Goe=w(function(Boe){Object.defineProperty(Boe,"__esModule",{value:!0});Boe.boolOrEmptySchema=Boe.topBoolOrEmptySchema=void 0;var Loe=ew(),qoe=ht(),Dnt=ui(),Cnt={message:"boolean schema is false"};function Ant(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)Uoe(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return(Dnt.default.data);else t.assign(qoe._`${r}.errors`,null),t.return(!0)}Boe.topBoolOrEmptySchema=Ant;function Ont(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),Uoe(e);else n.var(t,!0)}Boe.boolOrEmptySchema=Ont;function Uoe(e,t){let{gen:n,data:r}=e;Loe.reportError({gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},Cnt,void 0,t)}});var kN=w(function(zoe){Object.defineProperty(zoe,"__esModule",{value:!0});zoe.getRules=zoe.isJSONType=void 0;var Pnt=["string","number","integer","boolean","null","object","array"],Int=new Set(Pnt);function Nnt(e){return typeof e=="string"&&Int.has(e)}zoe.isJSONType=Nnt;function Fnt(){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:{}}}zoe.getRules=Fnt});var RN=w(function(Joe){Object.defineProperty(Joe,"__esModule",{value:!0});Joe.shouldUseRule=Joe.shouldUseGroup=Joe.schemaHasRulesForType=void 0;function jnt({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&Woe(e,r)}Joe.schemaHasRulesForType=jnt;function Woe(e,t){return t.rules.some((n)=>Koe(e,n))}Joe.shouldUseGroup=Woe;function Koe(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some((r)=>e[r]!==void 0))}Joe.shouldUseRule=Koe});var tw=w(function(nse){Object.defineProperty(nse,"__esModule",{value:!0});nse.reportTypeError=nse.checkDataTypes=nse.checkDataType=nse.coerceAndCheckDataType=nse.getJSONTypes=nse.getSchemaTypes=nse.DataType=void 0;var Xoe=kN(),Qoe=RN(),Zoe=ew(),le=ht(),ek=Ct(),Qh;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Qh||(nse.DataType=Qh={}));function Unt(e){let t=ese(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}nse.getSchemaTypes=Unt;function ese(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Xoe.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}nse.getJSONTypes=ese;function Bnt(e,t){let{gen:n,data:r,opts:o}=e,s=Hnt(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&Qoe.schemaHasRulesForType(e,t[0]));if(i){let a=DN(t,r,o.strictNumbers,Qh.Wrong);n.if(a,()=>{if(s.length)Gnt(e,t,s);else CN(e)})}return i}nse.coerceAndCheckDataType=Bnt;var tse=new Set(["string","number","integer","boolean","null"]);function Hnt(e,t){return t?e.filter((n)=>tse.has(n)||t==="array"&&n==="array"):[]}function Gnt(e,t,n){let{gen:r,data:o,opts:s}=e,i=r.let("dataType",le._`typeof ${o}`),a=r.let("coerced",le._`undefined`);if(s.coerceTypes==="array")r.if(le._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,le._`${o}[0]`).assign(i,le._`typeof ${o}`).if(DN(t,o,s.strictNumbers),()=>r.assign(a,o)));r.if(le._`${a} !== undefined`);for(let l of n)if(tse.has(l)||l==="array"&&s.coerceTypes==="array")c(l);r.else(),CN(e),r.endIf(),r.if(le._`${a} !== undefined`,()=>{r.assign(o,a),znt(e,a)});function c(l){switch(l){case"string":r.elseIf(le._`${i} == "number" || ${i} == "boolean"`).assign(a,le._`"" + ${o}`).elseIf(le._`${o} === null`).assign(a,le._`""`);return;case"number":r.elseIf(le._`${i} == "boolean" || ${o} === null
|
|
86
86
|
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,le._`+${o}`);return;case"integer":r.elseIf(le._`${i} === "boolean" || ${o} === null
|
|
87
87
|
|| (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,le._`+${o}`);return;case"boolean":r.elseIf(le._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(le._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf(le._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf(le._`${i} === "string" || ${i} === "number"
|
|
@@ -99,7 +99,7 @@ ${t}`,_Xe,xXe,vXe=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=wXe.bind(nul
|
|
|
99
99
|
`)}var ZF=!1;var{spawn:_bt}=globalThis.Bun;function dp(e,t=[]){let n=e.replace(xbt,'("$1","<redacted>")');for(let r of t)if(r.length>=vbt)n=n.split(r).join("<redacted>");return n}function jR(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],n=new Set;for(let r of[process.env,e??{}])for(let o of t){let s=r[o];if(typeof s==="string"&&s.length>0)n.add(s)}return[...n]}async function Zhe(e,t){let n=e.getReader(),r=new TextDecoder,o="";while(!0){let{done:s,value:i}=await n.read();if(s)break;if(i.byteLength===0)continue;t(),o+=r.decode(i,{stream:!0})}return o+r.decode()}async function A(e,t={}){let n={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete n[y];let r=_bt({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:n}),o=!1,s,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},l=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??Ebt)};if(l(),t.timeout)s=setTimeout(()=>{o=!0,c(),r.kill()},t.timeout);let d=jg()?[...jR(n),...t.redact??[]]:[];if(jg()){let y=t.cwd?` (cwd=${t.cwd})`:"";Nd(u.dim(dp(`$ ${e.join(" ")}${y}`,d)))}let f=()=>{a=performance.now(),l()},p,m,h,g=r.exited.then((y)=>(c(),y));try{[p,m,h]=await Promise.all([Zhe(r.stdout,f),Zhe(r.stderr,f),g])}finally{if(c(),s)clearTimeout(s)}if(jg()){if(t.sensitiveOutput)Nd(u.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())Nd(u.dim(dp(p.trimEnd(),d)));if(m.trim())Nd(u.yellow(dp(m.trimEnd(),d)))}Nd(u.dim(`(exit ${h})`))}if(o)return{stdout:p,stderr:m||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:m,exitCode:h,timedOut:!1}}var xbt,vbt=8,Ebt=120000;var zt=H(()=>{Ve();xbt=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function kbt(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function tge(e,t=kbt()){return e.installInstructions[t]}function Rbt(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function Dbt(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:$bt}async function nge(e){try{let{exitCode:t,stdout:n,timedOut:r}=await A(e.cmd,{timeout:Dbt()});if(r)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:Rbt(n)}}catch(t){let n=t instanceof Error?t.message:String(t);if(!n.includes("ENOENT")&&!n.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${n}`);return{available:!1}}}async function Aw(){let e=Object.entries(ege);return Promise.all(e.map(async([t,n])=>{let{available:r,version:o,timedOut:s}=await nge(n);return{key:t,name:n.name,purpose:n.purpose,required:n.required,available:r,version:o,timedOut:s,installInstruction:tge(n)}}))}async function rge(){let t=(await Aw()).filter((n)=>n.required&&!n.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 n of t)console.warn(` - ${n.name} (${n.purpose})`),console.warn(` Install: ${n.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function fp(e){let n=Sbt[e].map((i)=>ege[i]).filter(Boolean),r=await Promise.all(n.map(async(i)=>{let a=await nge(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of r)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let o=r.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:tge(i.check)}));if(o.length===0)return;let s=[`
|
|
101
101
|
Missing required tools:`];for(let i of o)s.push(` ${i.tool} not installed`),s.push(` Install: ${i.installInstruction}`);throw Error(s.join(`
|
|
102
|
-
`))}var ege,Sbt,$bt=4000;var Ow=H(()=>{zt();ege={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)"}}},Sbt={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 sge;var oge=H(()=>{sge={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.34-
|
|
102
|
+
`))}var ege,Sbt,$bt=4000;var Ow=H(()=>{zt();ege={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)"}}},Sbt={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 sge;var oge=H(()=>{sge={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.34-PR2165.9362fd9",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js","git-annex-remote-nemar":"dist/git-annex-remote-nemar.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts src/git-annex-remote-nemar.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},trustedDependencies:["@biomejs/biome"],devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var Ms;var pp=H(()=>{oge();Ms=sge.version});import{mkdirSync as Abt,readdirSync as Obt,unlinkSync as Tbt,writeFileSync as Pbt}from"fs";import{join as eM}from"path";function dge(){Lg=!0}function Al(){return Lg}function fge(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function Pw(e){uge=e,Tn(`Step: ${e}`)}function zo(){cge=!0}function pge(){return cge}function fe(){if(lge)return;nM=!0}function Iw(){nM=!1,lge=!0}function mge(){return nM}function Tn(e){if(Lg)process.stderr.write(`[debug] ${e}
|
|
103
103
|
`)}function Mbt(e){let t={};for(let[n,r]of Object.entries(e))t[n]=Fbt.has(n.toLowerCase())?"[REDACTED]":r;return t}function gge(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function tM(e,t,n=0){if(n>Lbt)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((r)=>tM(e,r,n+1));if(t&&typeof t==="object"){let r={};for(let[o,s]of Object.entries(t))r[o]=tM(o,s,n+1);return r}if(typeof t==="string"){if(jbt.test(e))return"[REDACTED]";return t.replace(hge,gge)}return t}function rM(e){return e.replace(qbt,"Bearer [REDACTED]").replace(Ubt,"[REDACTED_AWS_KEY]").replace(Bbt,"$1[REDACTED]").replace(Hbt,"$1$2=[REDACTED]").replace(hge,gge)}function Gbt(e){return rM(e)}function ige(e,t=Nbt){if(e===void 0)return;let n=e;try{let r=JSON.parse(e);n=JSON.stringify(tM("",r))}catch{}if(n=rM(n),Buffer.byteLength(n,"utf8")>t)n=`${Buffer.from(n,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return n}function UR(e){if(!Lg)return;let t=Gbt(e.url);try{let n={...e,url:t,requestHeaders:e.requestHeaders?Mbt(e.requestHeaders):void 0,requestBody:ige(e.requestBody),responseBody:ige(e.responseBody)};qR.push(n),Tn(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(n){let r=W(n);qR.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${r}`}),Tn(`redaction failed for ${e.method} ${t}: ${r}`)}}async function zbt(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${Ms}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${W(t)})`)}e.push(""),e.push("Active account:");try{let t=Yt();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: ${W(t)})`)}e.push(""),e.push("External tools:");try{let t=await Aw();for(let n of t){let r=n.available?n.version??"installed":n.timedOut?"(timed out)":"not installed";e.push(` ${n.name}: ${r}`)}}catch(t){e.push(` (could not probe external tools: ${W(t)})`)}return e}async function oM(){return(await zbt()).join(`
|
|
104
104
|
`)}async function yge(){if(!Lg||LR!==void 0)return;try{LR=await oM()}catch(e){let t=W(e);LR=`(could not build environment report: ${t})`,Tn(`environment snapshot failed: ${t}`)}}function bge(e){if(age.has(e))return{flag:e};for(let t of age){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 Vbt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=bge(r);if(!o){t.push(r);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(r),n+1<e.length)t.push("[REDACTED]"),n++}return t}function Wbt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=bge(r);if(!o){t.push(r);continue}if(!o.kind&&n+1<e.length)n++}return t}function Kbt(e){let t=[];for(let r of Wbt(e)){if(r.startsWith("-"))continue;if(t.push(r),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function Jbt(e,t){let n=[];if(n.push("NEMAR CLI Debug Log"),n.push(`Generated: ${new Date().toISOString()}`),n.push(`Command: nemar ${rM(Vbt(e).join(" "))}`),n.push(""),n.push(LR??"(environment snapshot unavailable)"),n.push(""),n.push("HTTP requests:"),qR.length===0)n.push(" (none)");else qR.forEach((r,o)=>{if(n.push(` [${o+1}] ${r.method} ${r.url} -> ${r.status??"ERROR"} (${r.durationMs}ms)`),r.error)n.push(` Error: ${r.error}`);if(r.note)n.push(` Note: ${r.note}`);if(r.requestHeaders)n.push(` Request headers: ${JSON.stringify(r.requestHeaders)}`);if(r.requestBody)n.push(` Request body: ${r.requestBody}`);if(r.responseBody)n.push(` Response body: ${r.responseBody}`)});return n.push(""),n.push(`Failing step: ${uge??"(none recorded)"}`),n.push(`Exit code: ${t}`),`${n.join(`
|
|
105
105
|
`)}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nemar-cli",
|
|
3
3
|
"packageManager": "bun@1.4.3",
|
|
4
|
-
"version": "0.10.34-
|
|
4
|
+
"version": "0.10.34-PR2165.9362fd9",
|
|
5
5
|
"description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|