nemar-cli 0.10.39-dev.4721 → 0.10.39-dev.4754
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 +21 -21
- package/dist/index.js +599 -590
- package/package.json +1 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var $S=Object.create;var{getPrototypeOf:ES,defineProperty:Yo,getOwnPropertyNames:SS}=Object;var ad=Object.prototype.hasOwnProperty;function xS(e){return this[e]}var RS,kS,vc=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?RS??=new WeakMap:kS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?$S(ES(e)):{};let a=t||!e||!e.__esModule||!ad.call(e,"default")?Yo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let i of SS(e))if(!ad.call(a,i))Yo(a,i,{get:xS.bind(e,i),enumerable:!0})}if(n)s.set(e,a);return a};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var TS=(e)=>e;function AS(e,t){this[e]=TS.bind(null,t)}var j9=(e,t)=>{for(var r in t)Yo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:AS.bind(t,r)})};var L=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var q9=(e,t,r)=>{for(var n in t)Yo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},D9=import.meta.require;function Xo(e){let t=[],r="",n="start",s=!1;for(let o of e)switch(o){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(s)r+=o;n="property",s=!s;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=o;break}if(bc.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=o;break}if(n==="property"){if(bc.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!OS.has(o))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(s)s=!1,r+="\\";r+=o}}if(s)r+="\\";switch(n){case"property":{if(bc.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function wc(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function id(e,t){if(wc(e,t))throw Error("Cannot use string index")}function cd(e,t,r){if(!$n(e)||typeof t!=="string")return r===void 0?e:r;let n=Xo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if(wc(e,o))e=s===n.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(s!==n.length-1)return r;break}}return e===void 0?r:e}function $c(e,t,r){if(!$n(e)||typeof t!=="string")return e;let n=e,s=Xo(t);for(let o=0;o<s.length;o++){let a=s[o];if(id(e,a),o===s.length-1)e[a]=r;else if(!$n(e[a]))e[a]=typeof s[o+1]==="number"?[]:{};e=e[a]}return n}function ud(e,t){if(!$n(e)||typeof t!=="string")return!1;let r=Xo(t);for(let n=0;n<r.length;n++){let s=r[n];if(id(e,s),n===r.length-1)return delete e[s],!0;if(e=e[s],!$n(e))return!1}}function ld(e,t){if(!$n(e)||typeof t!=="string")return!1;let r=Xo(t);if(r.length===0)return!1;for(let n of r){if(!$n(e)||!(n in e)||wc(e,n))return!1;e=e[n]}return!0}var $n=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},bc,OS;var dd=L(()=>{bc=new Set(["__proto__","prototype","constructor"]),OS=new Set("0123456789")});import Ee from"path";import fd from"os";import Ec from"process";function xc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Ec.platform==="darwin")return NS(e);if(Ec.platform==="win32")return PS(e);return IS(e)}var Tr,Sc,Un,NS=(e)=>{let t=Ee.join(Tr,"Library");return{data:Ee.join(t,"Application Support",e),config:Ee.join(t,"Preferences",e),cache:Ee.join(t,"Caches",e),log:Ee.join(t,"Logs",e),temp:Ee.join(Sc,e)}},PS=(e)=>{let t=Un.APPDATA||Ee.join(Tr,"AppData","Roaming"),r=Un.LOCALAPPDATA||Ee.join(Tr,"AppData","Local");return{data:Ee.join(r,e,"Data"),config:Ee.join(t,e,"Config"),cache:Ee.join(r,e,"Cache"),log:Ee.join(r,e,"Log"),temp:Ee.join(Sc,e)}},IS=(e)=>{let t=Ee.basename(Tr);return{data:Ee.join(Un.XDG_DATA_HOME||Ee.join(Tr,".local","share"),e),config:Ee.join(Un.XDG_CONFIG_HOME||Ee.join(Tr,".config"),e),cache:Ee.join(Un.XDG_CACHE_HOME||Ee.join(Tr,".cache"),e),log:Ee.join(Un.XDG_STATE_HOME||Ee.join(Tr,".local","state"),e),temp:Ee.join(Sc,t,e)}};var pd=L(()=>{Tr=fd.homedir(),Sc=fd.tmpdir(),{env:Un}=Ec});var CS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},jt;var md=L(()=>{jt=CS});var jS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},Rt;var hd=L(()=>{Rt=jS});var gd=250;var yd=()=>{};var qS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,a=s.interval??gd,i=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((l)=>{if(!r(l))throw l;if(Date.now()>=i)throw l;let d=Math.round(a*Math.random());if(d>0)return new Promise((f)=>setTimeout(f,d)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},qt;var _d=L(()=>{yd();qt=qS});var DS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,a=Date.now()+o;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=a)throw u;continue}}}},Dt;var vd=L(()=>{Dt=DS});var Rc=L(()=>{md();hd();_d();vd()});var Gs,kc;var bd=L(()=>{Tc();Gs={isChangeErrorOk:(e)=>{if(!Gs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!wd&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Gs.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(!Gs.isNodeError(e))throw e;if(Gs.isChangeErrorOk(e))return;throw e}},kc=Gs});import $d from"process";var Ks,tt,wd,ze;var Tc=L(()=>{bd();Ks={onError:kc.onChangeError},tt={onError:()=>{return}},wd=$d.getuid?!$d.getuid():!1,ze={isRetriable:kc.isRetriableError}});import ie from"fs";import{promisify as Ge}from"util";var MS,Me;var Ac=L(()=>{Rc();Rc();Tc();MS={attempt:{chmod:jt(Ge(ie.chmod),Ks),chown:jt(Ge(ie.chown),Ks),close:jt(Ge(ie.close),tt),fsync:jt(Ge(ie.fsync),tt),mkdir:jt(Ge(ie.mkdir),tt),realpath:jt(Ge(ie.realpath),tt),stat:jt(Ge(ie.stat),tt),unlink:jt(Ge(ie.unlink),tt),chmodSync:Rt(ie.chmodSync,Ks),chownSync:Rt(ie.chownSync,Ks),closeSync:Rt(ie.closeSync,tt),existsSync:Rt(ie.existsSync,tt),fsyncSync:Rt(ie.fsync,tt),mkdirSync:Rt(ie.mkdirSync,tt),realpathSync:Rt(ie.realpathSync,tt),statSync:Rt(ie.statSync,tt),unlinkSync:Rt(ie.unlinkSync,tt)},retry:{close:qt(Ge(ie.close),ze),fsync:qt(Ge(ie.fsync),ze),open:qt(Ge(ie.open),ze),readFile:qt(Ge(ie.readFile),ze),rename:qt(Ge(ie.rename),ze),stat:qt(Ge(ie.stat),ze),write:qt(Ge(ie.write),ze),writeFile:qt(Ge(ie.writeFile),ze),closeSync:Dt(ie.closeSync,ze),fsyncSync:Dt(ie.fsyncSync,ze),openSync:Dt(ie.openSync,ze),readFileSync:Dt(ie.readFileSync,ze),renameSync:Dt(ie.renameSync,ze),statSync:Dt(ie.statSync,ze),writeSync:Dt(ie.writeSync,ze),writeFileSync:Dt(ie.writeFileSync,ze)}},Me=MS});import En from"process";var Ed="utf8",Oc=438,Sd=511,xd,Rd,kd,Td=1000,Ad,pz,Nc=128;var Pc=L(()=>{xd={},Rd=En.geteuid?En.geteuid():-1,kd=En.getegid?En.getegid():-1,Ad=!!En.getuid,pz=En.getuid?!En.getuid():!1});var Od=(e)=>e instanceof Error&&("code"in e),Ic=(e)=>typeof e==="string",Jo=(e)=>e===void 0;var Nd=()=>{};var Pd=()=>{};import Id from"process";var Cd,Qo;var Cc=L(()=>{Cd=Id.platform==="linux",Qo=Id.platform==="win32"});var jc,jd;var qd=L(()=>{Cc();jc=["SIGHUP","SIGINT","SIGTERM"];if(!Qo)jc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Cd)jc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");jd=jc});import Fn from"process";class Dd{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(Qo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Fn.kill(Fn.pid,"SIGTERM");else Fn.kill(Fn.pid,e)},this.hook=()=>{Fn.once("exit",()=>this.exit());for(let e of jd)try{Fn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Md;var Ld=L(()=>{Cc();qd();Md=new Dd});var LS,Ud;var Fd=L(()=>{Ld();LS=Md.register,Ud=LS});import US from"path";var dt,Hs;var Vd=L(()=>{Ac();Fd();Pc();dt={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",s=`.tmp-${r}${t}`;return`${e}${s}`},get:(e,t,r=!0)=>{let n=dt.truncate(t(e));if(n in dt.store)return dt.get(e,t,r);return dt.store[n]=r,[n,()=>delete dt.store[n]]},purge:(e)=>{if(!dt.store[e])return;delete dt.store[e],Me.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],Me.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=US.basename(e);if(t.length<=Nc)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Nc;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ud(dt.purgeSyncAll);Hs=dt});import FS from"path";function qc(e,t,r=xd){if(Ic(r))return qc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,a=null,i=null;try{let c=Me.attempt.realpathSync(e),u=!!c;e=c||e,[a,o]=Hs.get(e,r.tmpCreate||Hs.create,r.tmpPurge!==!1);let l=Ad&&Jo(r.chown),d=Jo(r.mode);if(u&&(l||d)){let m=Me.attempt.statSync(e);if(m){if(r={...r},l)r.chown={uid:m.uid,gid:m.gid};if(d)r.mode=m.mode}}if(!u){let m=FS.dirname(e);Me.attempt.mkdirSync(m,{mode:Sd,recursive:!0})}if(i=Me.retry.openSync(s)(a,"w",r.mode||Oc),r.tmpCreated)r.tmpCreated(a);if(Ic(t))Me.retry.writeSync(s)(i,t,0,r.encoding||Ed);else if(!Jo(t))Me.retry.writeSync(s)(i,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Me.retry.fsyncSync(s)(i);else Me.attempt.fsync(i);if(Me.retry.closeSync(s)(i),i=null,r.chown&&(r.chown.uid!==Rd||r.chown.gid!==kd))Me.attempt.chownSync(a,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Oc)Me.attempt.chmodSync(a,r.mode);try{Me.retry.renameSync(s)(a,e)}catch(m){if(!Od(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Me.retry.renameSync(s)(a,Hs.truncate(e))}o(),a=null}finally{if(i)Me.attempt.closeSync(i);if(a)Hs.purge(a)}}var zd=L(()=>{Ac();Pc();Nd();Pd();Vd()});var Ws=g(function(Hd){Object.defineProperty(Hd,"__esModule",{value:!0});Hd.regexpCode=Hd.getEsmExportName=Hd.getProperty=Hd.safeStringify=Hd.stringify=Hd.strConcat=Hd.addCodeArg=Hd.str=Hd._=Hd.nil=Hd._Code=Hd.Name=Hd.IDENTIFIER=Hd._CodeOrName=void 0;class Zo{}Hd._CodeOrName=Zo;Hd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Vn extends Zo{constructor(e){super();if(!Hd.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}}}Hd.Name=Vn;class kt extends Zo{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof Vn)t[r.str]=(t[r.str]||0)+1;return t},{})}}Hd._Code=kt;Hd.nil=new kt("");function Gd(e,...t){let r=[e[0]],n=0;while(n<t.length)Mc(r,t[n]),r.push(e[++n]);return new kt(r)}Hd._=Gd;var Dc=new kt("+");function Kd(e,...t){let r=[Bs(e[0])],n=0;while(n<t.length)r.push(Dc),Mc(r,t[n]),r.push(Dc,Bs(e[++n]));return VS(r),new kt(r)}Hd.str=Kd;function Mc(e,t){if(t instanceof kt)e.push(...t._items);else if(t instanceof Vn)e.push(t);else e.push(KS(t))}Hd.addCodeArg=Mc;function VS(e){let t=1;while(t<e.length-1){if(e[t]===Dc){let r=zS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function zS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Vn||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 Vn))return`"${e}${t.slice(1)}`;return}function GS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Kd`${e}${t}`}Hd.strConcat=GS;function KS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Bs(Array.isArray(e)?e.join(","):e)}function HS(e){return new kt(Bs(e))}Hd.stringify=HS;function Bs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Hd.safeStringify=Bs;function BS(e){return typeof e=="string"&&Hd.IDENTIFIER.test(e)?new kt(`.${e}`):Gd`[${e}]`}Hd.getProperty=BS;function WS(e){if(typeof e=="string"&&Hd.IDENTIFIER.test(e))return new kt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Hd.getEsmExportName=WS;function YS(e){return new kt(e.toString())}Hd.regexpCode=YS});var Vc=g(function(Xd){Object.defineProperty(Xd,"__esModule",{value:!0});Xd.ValueScope=Xd.ValueScopeName=Xd.Scope=Xd.varKinds=Xd.UsedValueState=void 0;var pe=Ws();class Wd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ta;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ta||(Xd.UsedValueState=ta={}));Xd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Uc{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof pe.Name?e:this.name(e)}name(e){return new pe.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Xd.Scope=Uc;class Fc extends pe.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=pe._`.${new pe.Name(t)}[${r}]`}}Xd.ValueScopeName=Fc;var cx=pe._`\n`;class Yd extends Uc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?cx:pe.nil}}get(){return this._scope}name(e){return new Fc(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,n);let i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return pe._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=pe.nil;for(let o in e){let a=e[o];if(!a)continue;let i=r[o]=r[o]||new Map;a.forEach((c)=>{if(i.has(c))return;i.set(c,ta.Started);let u=t(c);if(u){let l=this.opts.es5?Xd.varKinds.var:Xd.varKinds.const;s=pe._`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=pe._`${s}${u}${this.opts._n}`;else throw new Wd(c);i.set(c,ta.Completed)})}return s}}Xd.ValueScope=Yd});var Y=g(function(rt){Object.defineProperty(rt,"__esModule",{value:!0});rt.or=rt.and=rt.not=rt.CodeGen=rt.operators=rt.varKinds=rt.ValueScopeName=rt.ValueScope=rt.Scope=rt.Name=rt.regexpCode=rt.stringify=rt.getProperty=rt.nil=rt.strConcat=rt.str=rt._=void 0;var O=Ws(),Se=Vc(),Ar=Ws();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Ar._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Ar.str}});Object.defineProperty(rt,"strConcat",{enumerable:!0,get:function(){return Ar.strConcat}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Ar.nil}});Object.defineProperty(rt,"getProperty",{enumerable:!0,get:function(){return Ar.getProperty}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Ar.stringify}});Object.defineProperty(rt,"regexpCode",{enumerable:!0,get:function(){return Ar.regexpCode}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Ar.Name}});var ia=Vc();Object.defineProperty(rt,"Scope",{enumerable:!0,get:function(){return ia.Scope}});Object.defineProperty(rt,"ValueScope",{enumerable:!0,get:function(){return ia.ValueScope}});Object.defineProperty(rt,"ValueScopeName",{enumerable:!0,get:function(){return ia.ValueScopeName}});Object.defineProperty(rt,"varKinds",{enumerable:!0,get:function(){return ia.varKinds}});rt.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};class Or{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Qd extends Or{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Se.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Gn(this.rhs,e,t);return this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}}class Kc extends Or{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Gn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return aa(e,this.rhs)}}class Zd extends Kc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ef extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class tf extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class rf extends Or{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class nf extends Or{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=Gn(this.code,e,t),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}}class ca extends Or{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;fx(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Sn(e,t.names),{})}}class Nr extends ca{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class sf extends ca{}class Ys extends Nr{}Ys.kind="else";class gr extends Nr{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ys(r):r}if(t){if(e===!1)return t instanceof gr?t:t.nodes;if(this.nodes.length)return this;return new gr(lf(e),t instanceof gr?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Gn(this.condition,e,t),this}get names(){let e=super.names;if(aa(e,this.condition),this.else)Sn(e,this.else.names);return e}}gr.kind="if";class zn extends Nr{}zn.kind="for";class of extends zn{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=Gn(this.iteration,e,t),this}get names(){return Sn(super.names,this.iteration.names)}}class af extends zn{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Se.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=aa(super.names,this.from);return aa(e,this.to)}}class zc extends zn{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Gn(this.iterable,e,t),this}get names(){return Sn(super.names,this.iterable.names)}}class ra extends Nr{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ra.kind="func";class na extends ca{render(e){return"return "+super.render(e)}}na.kind="return";class cf extends Nr{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Sn(e,this.catch.names);if(this.finally)Sn(e,this.finally.names);return e}}class sa extends Nr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}sa.kind="catch";class oa extends Nr{render(e){return"finally"+super.render(e)}}oa.kind="finally";class uf{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
4
|
-
`:""},this._extScope=e,this._scope=new Se.Scope({parent:e}),this._nodes=[new sf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Qd(e,s,r)),s}const(e,t,r){return this._def(Se.varKinds.const,e,t,r)}let(e,t,r){return this._def(Se.varKinds.let,e,t,r)}var(e,t,r){return this._def(Se.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Kc(e,t,r))}add(e,t){return this._leafNode(new Zd(e,rt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==O.nil)this._leafNode(new nf(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),O.addCodeArg(t,n)}return t.push("}"),new O._Code(t)}if(e,t,r){if(this._blockNode(new gr(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new gr(e))}else(){return this._elseNode(new Ys)}endIf(){return this._endBlockNode(gr,Ys)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new of(e),t)}forRange(e,t,r,n,s=this.opts.es5?Se.varKinds.var:Se.varKinds.let){let o=this._scope.toName(e);return this._for(new af(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Se.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof O.Name?t:this.var("_arr",t);return this.forRange("_i",0,O._`${o}.length`,(a)=>{this.var(s,O._`${o}[${a}]`),r(s)})}return this._for(new zc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Se.varKinds.var:Se.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,O._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new zc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(zn)}label(e){return this._leafNode(new ef(e))}break(e){return this._leafNode(new tf(e))}return(e){let t=new na;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(na)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new cf;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new sa(s),t(s)}if(r)this._currNode=n.finally=new oa,this.code(r);return this._endBlockNode(sa,oa)}throw(e){return this._leafNode(new rf(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=O.nil,r,n){if(this._blockNode(new ra(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ra)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof gr))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}}rt.CodeGen=uf;function Sn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function aa(e,t){return t instanceof O._CodeOrName?Sn(e,t.names):e}function Gn(e,t,r){if(e instanceof O.Name)return n(e);if(!s(e))return e;return new O._Code(e._items.reduce((o,a)=>{if(a instanceof O.Name)a=n(a);if(a instanceof O._Code)o.push(...a._items);else o.push(a);return o},[]));function n(o){let a=r[o.str];if(a===void 0||t[o.str]!==1)return o;return delete t[o.str],a}function s(o){return o instanceof O._Code&&o._items.some((a)=>a instanceof O.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function fx(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function lf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:O._`!${Gc(e)}`}rt.not=lf;var px=df(rt.operators.AND);function mx(...e){return e.reduce(px)}rt.and=mx;var hx=df(rt.operators.OR);function gx(...e){return e.reduce(hx)}rt.or=gx;function df(e){return(t,r)=>t===O.nil?r:r===O.nil?t:O._`${Gc(t)} ${e} ${Gc(r)}`}function Gc(e){return e instanceof O.Name?e:O._`(${e})`}});var re=g(function(wf){Object.defineProperty(wf,"__esModule",{value:!0});wf.checkStrictMode=wf.getErrorPath=wf.Type=wf.useFunc=wf.setEvaluated=wf.evaluatedPropsToName=wf.mergeEvaluated=wf.eachItem=wf.unescapeJsonPointer=wf.escapeJsonPointer=wf.escapeFragment=wf.unescapeFragment=wf.schemaRefOrVal=wf.schemaHasRulesButRef=wf.schemaHasRules=wf.checkUnknownRules=wf.alwaysValidSchema=wf.toHash=void 0;var U=Y(),hf=Ws();function bx(e){let t={};for(let r of e)t[r]=!0;return t}wf.toHash=bx;function wx(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return gf(e,t),!yf(t,e.self.RULES.all)}wf.alwaysValidSchema=wx;function gf(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])bf(e,`unknown keyword: "${o}"`)}wf.checkUnknownRules=gf;function yf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}wf.schemaHasRules=yf;function $x(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}wf.schemaHasRulesButRef=$x;function Ex({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return U._`${r}`}return U._`${e}${t}${U.getProperty(n)}`}wf.schemaRefOrVal=Ex;function Sx(e){return _f(decodeURIComponent(e))}wf.unescapeFragment=Sx;function xx(e){return encodeURIComponent(Bc(e))}wf.escapeFragment=xx;function Bc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}wf.escapeJsonPointer=Bc;function _f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}wf.unescapeJsonPointer=_f;function Rx(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}wf.eachItem=Rx;function pf({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof U.Name?(o instanceof U.Name?e(s,o,a):t(s,o,a),a):o instanceof U.Name?(t(s,a,o),o):r(o,a);return i===U.Name&&!(c instanceof U.Name)?n(s,c):c}}wf.mergeEvaluated={props:pf({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>{e.if(U._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,U._`${r} || {}`).code(U._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,U._`${r} || {}`),Wc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:vf}),items:pf({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,U._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>e.assign(r,t===!0?!0:U._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function vf(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Wc(e,r,t);return r}wf.evaluatedPropsToName=vf;function Wc(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}wf.setEvaluated=Wc;var mf={};function kx(e,t){return e.scopeValue("func",{ref:t,code:mf[t.code]||(mf[t.code]=new hf._Code(t.code))})}wf.useFunc=kx;var Hc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Hc||(wf.Type=Hc={}));function Tx(e,t,r){if(e instanceof U.Name){let n=t===Hc.Num;return r?n?U._`"[" + ${e} + "]"`:U._`"['" + ${e} + "']"`:n?U._`"/" + ${e}`:U._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?U.getProperty(e).toString():"/"+Bc(e)}wf.getErrorPath=Tx;function bf(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}wf.checkStrictMode=bf});var pt=g(function(Ef){Object.defineProperty(Ef,"__esModule",{value:!0});var ue=Y(),Hx={data:new ue.Name("data"),valCxt:new ue.Name("valCxt"),instancePath:new ue.Name("instancePath"),parentData:new ue.Name("parentData"),parentDataProperty:new ue.Name("parentDataProperty"),rootData:new ue.Name("rootData"),dynamicAnchors:new ue.Name("dynamicAnchors"),vErrors:new ue.Name("vErrors"),errors:new ue.Name("errors"),this:new ue.Name("this"),self:new ue.Name("self"),scope:new ue.Name("scope"),json:new ue.Name("json"),jsonPos:new ue.Name("jsonPos"),jsonLen:new ue.Name("jsonLen"),jsonPart:new ue.Name("jsonPart")};Ef.default=Hx});var Xs=g(function(kf){Object.defineProperty(kf,"__esModule",{value:!0});kf.extendErrors=kf.resetErrorsCount=kf.reportExtraError=kf.reportError=kf.keyword$DataError=kf.keywordError=void 0;var I=Y(),Pr=re(),Xe=pt();kf.keywordError={message:({keyword:e})=>I.str`must pass "${e}" keyword validation`};kf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?I.str`"${e}" keyword must be ${t} ($data)`:I.str`"${e}" keyword is invalid ($data)`};function Wx(e,t=kf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:a,allErrors:i}=s,c=Rf(e,t,r);if(n!==null&&n!==void 0?n:a||i)Sf(o,c);else xf(s,I._`[${c}]`)}kf.reportError=Wx;function Yx(e,t=kf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:a}=n,i=Rf(e,t,r);if(Sf(s,i),!(o||a))xf(n,Xe.default.vErrors)}kf.reportExtraError=Yx;function Xx(e,t){e.assign(Xe.default.errors,t),e.if(I._`${Xe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(I._`${Xe.default.vErrors}.length`,t),()=>e.assign(Xe.default.vErrors,null)))}kf.resetErrorsCount=Xx;function Jx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let a=e.name("err");e.forRange("i",s,Xe.default.errors,(i)=>{if(e.const(a,I._`${Xe.default.vErrors}[${i}]`),e.if(I._`${a}.instancePath === undefined`,()=>e.assign(I._`${a}.instancePath`,I.strConcat(Xe.default.instancePath,o.errorPath))),e.assign(I._`${a}.schemaPath`,I.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(I._`${a}.schema`,r),e.assign(I._`${a}.data`,n)})}kf.extendErrors=Jx;function Sf(e,t){let r=e.const("err",t);e.if(I._`${Xe.default.vErrors} === null`,()=>e.assign(Xe.default.vErrors,I._`[${r}]`),I._`${Xe.default.vErrors}.push(${r})`),e.code(I._`${Xe.default.errors}++`)}function xf(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(I._`new ${e.ValidationError}(${t})`);else r.assign(I._`${n}.errors`,t),r.return(!1)}var xn={keyword:new I.Name("keyword"),schemaPath:new I.Name("schemaPath"),params:new I.Name("params"),propertyName:new I.Name("propertyName"),message:new I.Name("message"),schema:new I.Name("schema"),parentSchema:new I.Name("parentSchema")};function Rf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return I._`{}`;return Qx(e,t,r)}function Qx(e,t,r={}){let{gen:n,it:s}=e,o=[Zx(s,r),eR(e,r)];return tR(e,t,o),n.object(...o)}function Zx({errorPath:e},{instancePath:t}){let r=t?I.str`${e}${Pr.getErrorPath(t,Pr.Type.Str)}`:e;return[Xe.default.instancePath,I.strConcat(Xe.default.instancePath,r)]}function eR({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:I.str`${t}/${e}`;if(r)s=I.str`${s}${Pr.getErrorPath(r,Pr.Type.Str)}`;return[xn.schemaPath,s]}function tR(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;if(n.push([xn.keyword,s],[xn.params,typeof t=="function"?t(e):t||I._`{}`]),c.messages)n.push([xn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([xn.schema,a],[xn.parentSchema,I._`${l}${d}`],[Xe.default.data,o]);if(u)n.push([xn.propertyName,u])}});var Cf=g(function(Pf){Object.defineProperty(Pf,"__esModule",{value:!0});Pf.boolOrEmptySchema=Pf.topBoolOrEmptySchema=void 0;var Af=Xs(),Of=Y(),aR=pt(),iR={message:"boolean schema is false"};function cR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Nf(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(aR.default.data);else t.assign(Of._`${n}.errors`,null),t.return(!0)}Pf.topBoolOrEmptySchema=cR;function uR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Nf(e);else r.var(t,!0)}Pf.boolOrEmptySchema=uR;function Nf(e,t){let{gen:r,data:n}=e;Af.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},iR,void 0,t)}});var Xc=g(function(jf){Object.defineProperty(jf,"__esModule",{value:!0});jf.getRules=jf.isJSONType=void 0;var dR=["string","number","integer","boolean","null","object","array"],fR=new Set(dR);function pR(e){return typeof e=="string"&&fR.has(e)}jf.isJSONType=pR;function mR(){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:{}}}jf.getRules=mR});var Jc=g(function(Lf){Object.defineProperty(Lf,"__esModule",{value:!0});Lf.shouldUseRule=Lf.shouldUseGroup=Lf.schemaHasRulesForType=void 0;function gR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Df(e,n)}Lf.schemaHasRulesForType=gR;function Df(e,t){return t.rules.some((r)=>Mf(e,r))}Lf.shouldUseGroup=Df;function Mf(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}Lf.shouldUseRule=Mf});var Js=g(function(Hf){Object.defineProperty(Hf,"__esModule",{value:!0});Hf.reportTypeError=Hf.checkDataTypes=Hf.checkDataType=Hf.coerceAndCheckDataType=Hf.getJSONTypes=Hf.getSchemaTypes=Hf.DataType=void 0;var Ff=Xc(),Vf=Jc(),zf=Xs(),x=Y(),la=re(),Kn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Kn||(Hf.DataType=Kn={}));function vR(e){let t=Gf(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}Hf.getSchemaTypes=vR;function Gf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Ff.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Hf.getJSONTypes=Gf;function bR(e,t){let{gen:r,data:n,opts:s}=e,o=wR(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&Vf.schemaHasRulesForType(e,t[0]));if(a){let i=Zc(t,n,s.strictNumbers,Kn.Wrong);r.if(i,()=>{if(o.length)$R(e,t,o);else eu(e)})}return a}Hf.coerceAndCheckDataType=bR;var Kf=new Set(["string","number","integer","boolean","null"]);function wR(e,t){return t?e.filter((r)=>Kf.has(r)||t==="array"&&r==="array"):[]}function $R(e,t,r){let{gen:n,data:s,opts:o}=e,a=n.let("dataType",x._`typeof ${s}`),i=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(a,x._`typeof ${s}`).if(Zc(t,s,o.strictNumbers),()=>n.assign(i,s)));n.if(x._`${i} !== undefined`);for(let u of r)if(Kf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),eu(e),n.endIf(),n.if(x._`${i} !== undefined`,()=>{n.assign(s,i),ER(e,i)});function c(u){switch(u){case"string":n.elseIf(x._`${a} == "number" || ${a} == "boolean"`).assign(i,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(i,x._`""`);return;case"number":n.elseIf(x._`${a} == "boolean" || ${s} === null
|
|
3
|
+
var ES=Object.create;var{getPrototypeOf:SS,defineProperty:Yo,getOwnPropertyNames:xS}=Object;var ad=Object.prototype.hasOwnProperty;function RS(e){return this[e]}var kS,TS,vc=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?kS??=new WeakMap:TS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?ES(SS(e)):{};let a=t||!e||!e.__esModule||!ad.call(e,"default")?Yo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let i of xS(e))if(!ad.call(a,i))Yo(a,i,{get:RS.bind(e,i),enumerable:!0})}if(n)s.set(e,a);return a};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var AS=(e)=>e;function OS(e,t){this[e]=AS.bind(null,t)}var L9=(e,t)=>{for(var r in t)Yo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:OS.bind(t,r)})};var L=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var U9=(e,t,r)=>{for(var n in t)Yo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},F9=import.meta.require;function Xo(e){let t=[],r="",n="start",s=!1;for(let o of e)switch(o){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(s)r+=o;n="property",s=!s;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=o;break}if(bc.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=o;break}if(n==="property"){if(bc.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!NS.has(o))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(s)s=!1,r+="\\";r+=o}}if(s)r+="\\";switch(n){case"property":{if(bc.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function wc(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function id(e,t){if(wc(e,t))throw Error("Cannot use string index")}function cd(e,t,r){if(!$n(e)||typeof t!=="string")return r===void 0?e:r;let n=Xo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if(wc(e,o))e=s===n.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(s!==n.length-1)return r;break}}return e===void 0?r:e}function $c(e,t,r){if(!$n(e)||typeof t!=="string")return e;let n=e,s=Xo(t);for(let o=0;o<s.length;o++){let a=s[o];if(id(e,a),o===s.length-1)e[a]=r;else if(!$n(e[a]))e[a]=typeof s[o+1]==="number"?[]:{};e=e[a]}return n}function ud(e,t){if(!$n(e)||typeof t!=="string")return!1;let r=Xo(t);for(let n=0;n<r.length;n++){let s=r[n];if(id(e,s),n===r.length-1)return delete e[s],!0;if(e=e[s],!$n(e))return!1}}function ld(e,t){if(!$n(e)||typeof t!=="string")return!1;let r=Xo(t);if(r.length===0)return!1;for(let n of r){if(!$n(e)||!(n in e)||wc(e,n))return!1;e=e[n]}return!0}var $n=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},bc,NS;var dd=L(()=>{bc=new Set(["__proto__","prototype","constructor"]),NS=new Set("0123456789")});import Ee from"path";import fd from"os";import Ec from"process";function xc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(Ec.platform==="darwin")return PS(e);if(Ec.platform==="win32")return CS(e);return IS(e)}var Tr,Sc,Un,PS=(e)=>{let t=Ee.join(Tr,"Library");return{data:Ee.join(t,"Application Support",e),config:Ee.join(t,"Preferences",e),cache:Ee.join(t,"Caches",e),log:Ee.join(t,"Logs",e),temp:Ee.join(Sc,e)}},CS=(e)=>{let t=Un.APPDATA||Ee.join(Tr,"AppData","Roaming"),r=Un.LOCALAPPDATA||Ee.join(Tr,"AppData","Local");return{data:Ee.join(r,e,"Data"),config:Ee.join(t,e,"Config"),cache:Ee.join(r,e,"Cache"),log:Ee.join(r,e,"Log"),temp:Ee.join(Sc,e)}},IS=(e)=>{let t=Ee.basename(Tr);return{data:Ee.join(Un.XDG_DATA_HOME||Ee.join(Tr,".local","share"),e),config:Ee.join(Un.XDG_CONFIG_HOME||Ee.join(Tr,".config"),e),cache:Ee.join(Un.XDG_CACHE_HOME||Ee.join(Tr,".cache"),e),log:Ee.join(Un.XDG_STATE_HOME||Ee.join(Tr,".local","state"),e),temp:Ee.join(Sc,t,e)}};var pd=L(()=>{Tr=fd.homedir(),Sc=fd.tmpdir(),{env:Un}=Ec});var jS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},jt;var md=L(()=>{jt=jS});var qS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},Rt;var hd=L(()=>{Rt=qS});var gd=250;var yd=()=>{};var DS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,a=s.interval??gd,i=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((l)=>{if(!r(l))throw l;if(Date.now()>=i)throw l;let d=Math.round(a*Math.random());if(d>0)return new Promise((f)=>setTimeout(f,d)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},qt;var _d=L(()=>{yd();qt=DS});var MS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,a=Date.now()+o;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=a)throw u;continue}}}},Dt;var vd=L(()=>{Dt=MS});var Rc=L(()=>{md();hd();_d();vd()});var Gs,kc;var bd=L(()=>{Tc();Gs={isChangeErrorOk:(e)=>{if(!Gs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!wd&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Gs.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(!Gs.isNodeError(e))throw e;if(Gs.isChangeErrorOk(e))return;throw e}},kc=Gs});import $d from"process";var Ks,tt,wd,ze;var Tc=L(()=>{bd();Ks={onError:kc.onChangeError},tt={onError:()=>{return}},wd=$d.getuid?!$d.getuid():!1,ze={isRetriable:kc.isRetriableError}});import ie from"fs";import{promisify as Ge}from"util";var LS,Me;var Ac=L(()=>{Rc();Rc();Tc();LS={attempt:{chmod:jt(Ge(ie.chmod),Ks),chown:jt(Ge(ie.chown),Ks),close:jt(Ge(ie.close),tt),fsync:jt(Ge(ie.fsync),tt),mkdir:jt(Ge(ie.mkdir),tt),realpath:jt(Ge(ie.realpath),tt),stat:jt(Ge(ie.stat),tt),unlink:jt(Ge(ie.unlink),tt),chmodSync:Rt(ie.chmodSync,Ks),chownSync:Rt(ie.chownSync,Ks),closeSync:Rt(ie.closeSync,tt),existsSync:Rt(ie.existsSync,tt),fsyncSync:Rt(ie.fsync,tt),mkdirSync:Rt(ie.mkdirSync,tt),realpathSync:Rt(ie.realpathSync,tt),statSync:Rt(ie.statSync,tt),unlinkSync:Rt(ie.unlinkSync,tt)},retry:{close:qt(Ge(ie.close),ze),fsync:qt(Ge(ie.fsync),ze),open:qt(Ge(ie.open),ze),readFile:qt(Ge(ie.readFile),ze),rename:qt(Ge(ie.rename),ze),stat:qt(Ge(ie.stat),ze),write:qt(Ge(ie.write),ze),writeFile:qt(Ge(ie.writeFile),ze),closeSync:Dt(ie.closeSync,ze),fsyncSync:Dt(ie.fsyncSync,ze),openSync:Dt(ie.openSync,ze),readFileSync:Dt(ie.readFileSync,ze),renameSync:Dt(ie.renameSync,ze),statSync:Dt(ie.statSync,ze),writeSync:Dt(ie.writeSync,ze),writeFileSync:Dt(ie.writeFileSync,ze)}},Me=LS});import En from"process";var Ed="utf8",Oc=438,Sd=511,xd,Rd,kd,Td=1000,Ad,yz,Nc=128;var Pc=L(()=>{xd={},Rd=En.geteuid?En.geteuid():-1,kd=En.getegid?En.getegid():-1,Ad=!!En.getuid,yz=En.getuid?!En.getuid():!1});var Od=(e)=>e instanceof Error&&("code"in e),Cc=(e)=>typeof e==="string",Jo=(e)=>e===void 0;var Nd=()=>{};var Pd=()=>{};import Cd from"process";var Id,Qo;var Ic=L(()=>{Id=Cd.platform==="linux",Qo=Cd.platform==="win32"});var jc,jd;var qd=L(()=>{Ic();jc=["SIGHUP","SIGINT","SIGTERM"];if(!Qo)jc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Id)jc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");jd=jc});import Fn from"process";class Dd{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(Qo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Fn.kill(Fn.pid,"SIGTERM");else Fn.kill(Fn.pid,e)},this.hook=()=>{Fn.once("exit",()=>this.exit());for(let e of jd)try{Fn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Md;var Ld=L(()=>{Ic();qd();Md=new Dd});var US,Ud;var Fd=L(()=>{Ld();US=Md.register,Ud=US});import FS from"path";var dt,Hs;var Vd=L(()=>{Ac();Fd();Pc();dt={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",s=`.tmp-${r}${t}`;return`${e}${s}`},get:(e,t,r=!0)=>{let n=dt.truncate(t(e));if(n in dt.store)return dt.get(e,t,r);return dt.store[n]=r,[n,()=>delete dt.store[n]]},purge:(e)=>{if(!dt.store[e])return;delete dt.store[e],Me.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],Me.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=FS.basename(e);if(t.length<=Nc)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Nc;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ud(dt.purgeSyncAll);Hs=dt});import VS from"path";function qc(e,t,r=xd){if(Cc(r))return qc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,a=null,i=null;try{let c=Me.attempt.realpathSync(e),u=!!c;e=c||e,[a,o]=Hs.get(e,r.tmpCreate||Hs.create,r.tmpPurge!==!1);let l=Ad&&Jo(r.chown),d=Jo(r.mode);if(u&&(l||d)){let m=Me.attempt.statSync(e);if(m){if(r={...r},l)r.chown={uid:m.uid,gid:m.gid};if(d)r.mode=m.mode}}if(!u){let m=VS.dirname(e);Me.attempt.mkdirSync(m,{mode:Sd,recursive:!0})}if(i=Me.retry.openSync(s)(a,"w",r.mode||Oc),r.tmpCreated)r.tmpCreated(a);if(Cc(t))Me.retry.writeSync(s)(i,t,0,r.encoding||Ed);else if(!Jo(t))Me.retry.writeSync(s)(i,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)Me.retry.fsyncSync(s)(i);else Me.attempt.fsync(i);if(Me.retry.closeSync(s)(i),i=null,r.chown&&(r.chown.uid!==Rd||r.chown.gid!==kd))Me.attempt.chownSync(a,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Oc)Me.attempt.chmodSync(a,r.mode);try{Me.retry.renameSync(s)(a,e)}catch(m){if(!Od(m))throw m;if(m.code!=="ENAMETOOLONG")throw m;Me.retry.renameSync(s)(a,Hs.truncate(e))}o(),a=null}finally{if(i)Me.attempt.closeSync(i);if(a)Hs.purge(a)}}var zd=L(()=>{Ac();Pc();Nd();Pd();Vd()});var Ws=g(function(Hd){Object.defineProperty(Hd,"__esModule",{value:!0});Hd.regexpCode=Hd.getEsmExportName=Hd.getProperty=Hd.safeStringify=Hd.stringify=Hd.strConcat=Hd.addCodeArg=Hd.str=Hd._=Hd.nil=Hd._Code=Hd.Name=Hd.IDENTIFIER=Hd._CodeOrName=void 0;class Zo{}Hd._CodeOrName=Zo;Hd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Vn extends Zo{constructor(e){super();if(!Hd.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}}}Hd.Name=Vn;class kt extends Zo{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof Vn)t[r.str]=(t[r.str]||0)+1;return t},{})}}Hd._Code=kt;Hd.nil=new kt("");function Gd(e,...t){let r=[e[0]],n=0;while(n<t.length)Mc(r,t[n]),r.push(e[++n]);return new kt(r)}Hd._=Gd;var Dc=new kt("+");function Kd(e,...t){let r=[Bs(e[0])],n=0;while(n<t.length)r.push(Dc),Mc(r,t[n]),r.push(Dc,Bs(e[++n]));return zS(r),new kt(r)}Hd.str=Kd;function Mc(e,t){if(t instanceof kt)e.push(...t._items);else if(t instanceof Vn)e.push(t);else e.push(HS(t))}Hd.addCodeArg=Mc;function zS(e){let t=1;while(t<e.length-1){if(e[t]===Dc){let r=GS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function GS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Vn||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 Vn))return`"${e}${t.slice(1)}`;return}function KS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Kd`${e}${t}`}Hd.strConcat=KS;function HS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Bs(Array.isArray(e)?e.join(","):e)}function BS(e){return new kt(Bs(e))}Hd.stringify=BS;function Bs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Hd.safeStringify=Bs;function WS(e){return typeof e=="string"&&Hd.IDENTIFIER.test(e)?new kt(`.${e}`):Gd`[${e}]`}Hd.getProperty=WS;function YS(e){if(typeof e=="string"&&Hd.IDENTIFIER.test(e))return new kt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Hd.getEsmExportName=YS;function XS(e){return new kt(e.toString())}Hd.regexpCode=XS});var Vc=g(function(Xd){Object.defineProperty(Xd,"__esModule",{value:!0});Xd.ValueScope=Xd.ValueScopeName=Xd.Scope=Xd.varKinds=Xd.UsedValueState=void 0;var pe=Ws();class Wd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ta;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ta||(Xd.UsedValueState=ta={}));Xd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Uc{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof pe.Name?e:this.name(e)}name(e){return new pe.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Xd.Scope=Uc;class Fc extends pe.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=pe._`.${new pe.Name(t)}[${r}]`}}Xd.ValueScopeName=Fc;var ux=pe._`\n`;class Yd extends Uc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ux:pe.nil}}get(){return this._scope}name(e){return new Fc(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,n);let i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return pe._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=pe.nil;for(let o in e){let a=e[o];if(!a)continue;let i=r[o]=r[o]||new Map;a.forEach((c)=>{if(i.has(c))return;i.set(c,ta.Started);let u=t(c);if(u){let l=this.opts.es5?Xd.varKinds.var:Xd.varKinds.const;s=pe._`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=pe._`${s}${u}${this.opts._n}`;else throw new Wd(c);i.set(c,ta.Completed)})}return s}}Xd.ValueScope=Yd});var Y=g(function(rt){Object.defineProperty(rt,"__esModule",{value:!0});rt.or=rt.and=rt.not=rt.CodeGen=rt.operators=rt.varKinds=rt.ValueScopeName=rt.ValueScope=rt.Scope=rt.Name=rt.regexpCode=rt.stringify=rt.getProperty=rt.nil=rt.strConcat=rt.str=rt._=void 0;var O=Ws(),Se=Vc(),Ar=Ws();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Ar._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Ar.str}});Object.defineProperty(rt,"strConcat",{enumerable:!0,get:function(){return Ar.strConcat}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Ar.nil}});Object.defineProperty(rt,"getProperty",{enumerable:!0,get:function(){return Ar.getProperty}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Ar.stringify}});Object.defineProperty(rt,"regexpCode",{enumerable:!0,get:function(){return Ar.regexpCode}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Ar.Name}});var ia=Vc();Object.defineProperty(rt,"Scope",{enumerable:!0,get:function(){return ia.Scope}});Object.defineProperty(rt,"ValueScope",{enumerable:!0,get:function(){return ia.ValueScope}});Object.defineProperty(rt,"ValueScopeName",{enumerable:!0,get:function(){return ia.ValueScopeName}});Object.defineProperty(rt,"varKinds",{enumerable:!0,get:function(){return ia.varKinds}});rt.operators={GT:new O._Code(">"),GTE:new O._Code(">="),LT:new O._Code("<"),LTE:new O._Code("<="),EQ:new O._Code("==="),NEQ:new O._Code("!=="),NOT:new O._Code("!"),OR:new O._Code("||"),AND:new O._Code("&&"),ADD:new O._Code("+")};class Or{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Qd extends Or{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Se.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Gn(this.rhs,e,t);return this}get names(){return this.rhs instanceof O._CodeOrName?this.rhs.names:{}}}class Kc extends Or{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof O.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Gn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof O.Name?{}:{...this.lhs.names};return aa(e,this.rhs)}}class Zd extends Kc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ef extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class tf extends Or{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class rf extends Or{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class nf extends Or{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=Gn(this.code,e,t),this}get names(){return this.code instanceof O._CodeOrName?this.code.names:{}}}class ca extends Or{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;px(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Sn(e,t.names),{})}}class Nr extends ca{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class sf extends ca{}class Ys extends Nr{}Ys.kind="else";class gr extends Nr{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ys(r):r}if(t){if(e===!1)return t instanceof gr?t:t.nodes;if(this.nodes.length)return this;return new gr(lf(e),t instanceof gr?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Gn(this.condition,e,t),this}get names(){let e=super.names;if(aa(e,this.condition),this.else)Sn(e,this.else.names);return e}}gr.kind="if";class zn extends Nr{}zn.kind="for";class of extends zn{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=Gn(this.iteration,e,t),this}get names(){return Sn(super.names,this.iteration.names)}}class af extends zn{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Se.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=aa(super.names,this.from);return aa(e,this.to)}}class zc extends zn{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Gn(this.iterable,e,t),this}get names(){return Sn(super.names,this.iterable.names)}}class ra extends Nr{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ra.kind="func";class na extends ca{render(e){return"return "+super.render(e)}}na.kind="return";class cf extends Nr{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Sn(e,this.catch.names);if(this.finally)Sn(e,this.finally.names);return e}}class sa extends Nr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}sa.kind="catch";class oa extends Nr{render(e){return"finally"+super.render(e)}}oa.kind="finally";class uf{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
4
|
+
`:""},this._extScope=e,this._scope=new Se.Scope({parent:e}),this._nodes=[new sf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Qd(e,s,r)),s}const(e,t,r){return this._def(Se.varKinds.const,e,t,r)}let(e,t,r){return this._def(Se.varKinds.let,e,t,r)}var(e,t,r){return this._def(Se.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Kc(e,t,r))}add(e,t){return this._leafNode(new Zd(e,rt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==O.nil)this._leafNode(new nf(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),O.addCodeArg(t,n)}return t.push("}"),new O._Code(t)}if(e,t,r){if(this._blockNode(new gr(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new gr(e))}else(){return this._elseNode(new Ys)}endIf(){return this._endBlockNode(gr,Ys)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new of(e),t)}forRange(e,t,r,n,s=this.opts.es5?Se.varKinds.var:Se.varKinds.let){let o=this._scope.toName(e);return this._for(new af(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Se.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof O.Name?t:this.var("_arr",t);return this.forRange("_i",0,O._`${o}.length`,(a)=>{this.var(s,O._`${o}[${a}]`),r(s)})}return this._for(new zc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Se.varKinds.var:Se.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,O._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new zc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(zn)}label(e){return this._leafNode(new ef(e))}break(e){return this._leafNode(new tf(e))}return(e){let t=new na;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(na)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new cf;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new sa(s),t(s)}if(r)this._currNode=n.finally=new oa,this.code(r);return this._endBlockNode(sa,oa)}throw(e){return this._leafNode(new rf(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=O.nil,r,n){if(this._blockNode(new ra(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ra)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof gr))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}}rt.CodeGen=uf;function Sn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function aa(e,t){return t instanceof O._CodeOrName?Sn(e,t.names):e}function Gn(e,t,r){if(e instanceof O.Name)return n(e);if(!s(e))return e;return new O._Code(e._items.reduce((o,a)=>{if(a instanceof O.Name)a=n(a);if(a instanceof O._Code)o.push(...a._items);else o.push(a);return o},[]));function n(o){let a=r[o.str];if(a===void 0||t[o.str]!==1)return o;return delete t[o.str],a}function s(o){return o instanceof O._Code&&o._items.some((a)=>a instanceof O.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function px(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function lf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:O._`!${Gc(e)}`}rt.not=lf;var mx=df(rt.operators.AND);function hx(...e){return e.reduce(mx)}rt.and=hx;var gx=df(rt.operators.OR);function yx(...e){return e.reduce(gx)}rt.or=yx;function df(e){return(t,r)=>t===O.nil?r:r===O.nil?t:O._`${Gc(t)} ${e} ${Gc(r)}`}function Gc(e){return e instanceof O.Name?e:O._`(${e})`}});var re=g(function(wf){Object.defineProperty(wf,"__esModule",{value:!0});wf.checkStrictMode=wf.getErrorPath=wf.Type=wf.useFunc=wf.setEvaluated=wf.evaluatedPropsToName=wf.mergeEvaluated=wf.eachItem=wf.unescapeJsonPointer=wf.escapeJsonPointer=wf.escapeFragment=wf.unescapeFragment=wf.schemaRefOrVal=wf.schemaHasRulesButRef=wf.schemaHasRules=wf.checkUnknownRules=wf.alwaysValidSchema=wf.toHash=void 0;var U=Y(),hf=Ws();function wx(e){let t={};for(let r of e)t[r]=!0;return t}wf.toHash=wx;function $x(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return gf(e,t),!yf(t,e.self.RULES.all)}wf.alwaysValidSchema=$x;function gf(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])bf(e,`unknown keyword: "${o}"`)}wf.checkUnknownRules=gf;function yf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}wf.schemaHasRules=yf;function Ex(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}wf.schemaHasRulesButRef=Ex;function Sx({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return U._`${r}`}return U._`${e}${t}${U.getProperty(n)}`}wf.schemaRefOrVal=Sx;function xx(e){return _f(decodeURIComponent(e))}wf.unescapeFragment=xx;function Rx(e){return encodeURIComponent(Bc(e))}wf.escapeFragment=Rx;function Bc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}wf.escapeJsonPointer=Bc;function _f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}wf.unescapeJsonPointer=_f;function kx(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}wf.eachItem=kx;function pf({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof U.Name?(o instanceof U.Name?e(s,o,a):t(s,o,a),a):o instanceof U.Name?(t(s,a,o),o):r(o,a);return i===U.Name&&!(c instanceof U.Name)?n(s,c):c}}wf.mergeEvaluated={props:pf({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>{e.if(U._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,U._`${r} || {}`).code(U._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,U._`${r} || {}`),Wc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:vf}),items:pf({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,U._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>e.assign(r,t===!0?!0:U._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function vf(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Wc(e,r,t);return r}wf.evaluatedPropsToName=vf;function Wc(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}wf.setEvaluated=Wc;var mf={};function Tx(e,t){return e.scopeValue("func",{ref:t,code:mf[t.code]||(mf[t.code]=new hf._Code(t.code))})}wf.useFunc=Tx;var Hc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Hc||(wf.Type=Hc={}));function Ax(e,t,r){if(e instanceof U.Name){let n=t===Hc.Num;return r?n?U._`"[" + ${e} + "]"`:U._`"['" + ${e} + "']"`:n?U._`"/" + ${e}`:U._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?U.getProperty(e).toString():"/"+Bc(e)}wf.getErrorPath=Ax;function bf(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}wf.checkStrictMode=bf});var pt=g(function(Ef){Object.defineProperty(Ef,"__esModule",{value:!0});var ue=Y(),Bx={data:new ue.Name("data"),valCxt:new ue.Name("valCxt"),instancePath:new ue.Name("instancePath"),parentData:new ue.Name("parentData"),parentDataProperty:new ue.Name("parentDataProperty"),rootData:new ue.Name("rootData"),dynamicAnchors:new ue.Name("dynamicAnchors"),vErrors:new ue.Name("vErrors"),errors:new ue.Name("errors"),this:new ue.Name("this"),self:new ue.Name("self"),scope:new ue.Name("scope"),json:new ue.Name("json"),jsonPos:new ue.Name("jsonPos"),jsonLen:new ue.Name("jsonLen"),jsonPart:new ue.Name("jsonPart")};Ef.default=Bx});var Xs=g(function(kf){Object.defineProperty(kf,"__esModule",{value:!0});kf.extendErrors=kf.resetErrorsCount=kf.reportExtraError=kf.reportError=kf.keyword$DataError=kf.keywordError=void 0;var C=Y(),Pr=re(),Xe=pt();kf.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};kf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function Yx(e,t=kf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:a,allErrors:i}=s,c=Rf(e,t,r);if(n!==null&&n!==void 0?n:a||i)Sf(o,c);else xf(s,C._`[${c}]`)}kf.reportError=Yx;function Xx(e,t=kf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:a}=n,i=Rf(e,t,r);if(Sf(s,i),!(o||a))xf(n,Xe.default.vErrors)}kf.reportExtraError=Xx;function Jx(e,t){e.assign(Xe.default.errors,t),e.if(C._`${Xe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Xe.default.vErrors}.length`,t),()=>e.assign(Xe.default.vErrors,null)))}kf.resetErrorsCount=Jx;function Qx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let a=e.name("err");e.forRange("i",s,Xe.default.errors,(i)=>{if(e.const(a,C._`${Xe.default.vErrors}[${i}]`),e.if(C._`${a}.instancePath === undefined`,()=>e.assign(C._`${a}.instancePath`,C.strConcat(Xe.default.instancePath,o.errorPath))),e.assign(C._`${a}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${a}.schema`,r),e.assign(C._`${a}.data`,n)})}kf.extendErrors=Qx;function Sf(e,t){let r=e.const("err",t);e.if(C._`${Xe.default.vErrors} === null`,()=>e.assign(Xe.default.vErrors,C._`[${r}]`),C._`${Xe.default.vErrors}.push(${r})`),e.code(C._`${Xe.default.errors}++`)}function xf(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(C._`new ${e.ValidationError}(${t})`);else r.assign(C._`${n}.errors`,t),r.return(!1)}var xn={keyword:new C.Name("keyword"),schemaPath:new C.Name("schemaPath"),params:new C.Name("params"),propertyName:new C.Name("propertyName"),message:new C.Name("message"),schema:new C.Name("schema"),parentSchema:new C.Name("parentSchema")};function Rf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return Zx(e,t,r)}function Zx(e,t,r={}){let{gen:n,it:s}=e,o=[eR(s,r),tR(e,r)];return rR(e,t,o),n.object(...o)}function eR({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Pr.getErrorPath(t,Pr.Type.Str)}`:e;return[Xe.default.instancePath,C.strConcat(Xe.default.instancePath,r)]}function tR({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Pr.getErrorPath(r,Pr.Type.Str)}`;return[xn.schemaPath,s]}function rR(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;if(n.push([xn.keyword,s],[xn.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([xn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([xn.schema,a],[xn.parentSchema,C._`${l}${d}`],[Xe.default.data,o]);if(u)n.push([xn.propertyName,u])}});var If=g(function(Pf){Object.defineProperty(Pf,"__esModule",{value:!0});Pf.boolOrEmptySchema=Pf.topBoolOrEmptySchema=void 0;var Af=Xs(),Of=Y(),iR=pt(),cR={message:"boolean schema is false"};function uR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Nf(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(iR.default.data);else t.assign(Of._`${n}.errors`,null),t.return(!0)}Pf.topBoolOrEmptySchema=uR;function lR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Nf(e);else r.var(t,!0)}Pf.boolOrEmptySchema=lR;function Nf(e,t){let{gen:r,data:n}=e;Af.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},cR,void 0,t)}});var Xc=g(function(jf){Object.defineProperty(jf,"__esModule",{value:!0});jf.getRules=jf.isJSONType=void 0;var fR=["string","number","integer","boolean","null","object","array"],pR=new Set(fR);function mR(e){return typeof e=="string"&&pR.has(e)}jf.isJSONType=mR;function hR(){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:{}}}jf.getRules=hR});var Jc=g(function(Lf){Object.defineProperty(Lf,"__esModule",{value:!0});Lf.shouldUseRule=Lf.shouldUseGroup=Lf.schemaHasRulesForType=void 0;function yR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Df(e,n)}Lf.schemaHasRulesForType=yR;function Df(e,t){return t.rules.some((r)=>Mf(e,r))}Lf.shouldUseGroup=Df;function Mf(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}Lf.shouldUseRule=Mf});var Js=g(function(Hf){Object.defineProperty(Hf,"__esModule",{value:!0});Hf.reportTypeError=Hf.checkDataTypes=Hf.checkDataType=Hf.coerceAndCheckDataType=Hf.getJSONTypes=Hf.getSchemaTypes=Hf.DataType=void 0;var Ff=Xc(),Vf=Jc(),zf=Xs(),x=Y(),la=re(),Kn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Kn||(Hf.DataType=Kn={}));function bR(e){let t=Gf(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}Hf.getSchemaTypes=bR;function Gf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Ff.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Hf.getJSONTypes=Gf;function wR(e,t){let{gen:r,data:n,opts:s}=e,o=$R(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&Vf.schemaHasRulesForType(e,t[0]));if(a){let i=Zc(t,n,s.strictNumbers,Kn.Wrong);r.if(i,()=>{if(o.length)ER(e,t,o);else eu(e)})}return a}Hf.coerceAndCheckDataType=wR;var Kf=new Set(["string","number","integer","boolean","null"]);function $R(e,t){return t?e.filter((r)=>Kf.has(r)||t==="array"&&r==="array"):[]}function ER(e,t,r){let{gen:n,data:s,opts:o}=e,a=n.let("dataType",x._`typeof ${s}`),i=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(a,x._`typeof ${s}`).if(Zc(t,s,o.strictNumbers),()=>n.assign(i,s)));n.if(x._`${i} !== undefined`);for(let u of r)if(Kf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),eu(e),n.endIf(),n.if(x._`${i} !== undefined`,()=>{n.assign(s,i),SR(e,i)});function c(u){switch(u){case"string":n.elseIf(x._`${a} == "number" || ${a} == "boolean"`).assign(i,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(i,x._`""`);return;case"number":n.elseIf(x._`${a} == "boolean" || ${s} === null
|
|
5
5
|
|| (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,x._`+${s}`);return;case"integer":n.elseIf(x._`${a} === "boolean" || ${s} === null
|
|
6
6
|
|| (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,x._`+${s}`);return;case"boolean":n.elseIf(x._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf(x._`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf(x._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf(x._`${a} === "string" || ${a} === "number"
|
|
7
|
-
|| ${a} === "boolean" || ${s} === null`).assign(i,x._`[${s}]`)}}}function ER({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Qc(e,t,r,n=Kn.Correct){let s=n===Kn.Correct?x.operators.EQ:x.operators.NEQ,o;switch(e){case"null":return x._`${t} ${s} null`;case"array":o=x._`Array.isArray(${t})`;break;case"object":o=x._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Kn.Correct?o:x.not(o);function a(i=x.nil){return x.and(x._`typeof ${t} == "number"`,i,r?x._`isFinite(${t})`:x.nil)}}Hf.checkDataType=Qc;function Zc(e,t,r,n){if(e.length===1)return Qc(e[0],t,r,n);let s,o=la.toHash(e);if(o.array&&o.object){let a=x._`typeof ${t} != "object"`;s=o.null?a:x._`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let a in o)s=x.and(s,Qc(a,t,r,n));return s}Hf.checkDataTypes=Zc;var SR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function eu(e){let t=xR(e);zf.reportError(t,SR)}Hf.reportTypeError=eu;function xR(e){let{gen:t,data:r,schema:n}=e,s=la.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Qf=g(function(Xf){Object.defineProperty(Xf,"__esModule",{value:!0});Xf.assignDefaults=void 0;var mt=Y(),Yf=re();function PR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Wf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Wf(e,o,s.default))}Xf.assignDefaults=PR;function Wf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;let i=mt._`${o}${mt.getProperty(t)}`;if(s){Yf.checkStrictMode(e,`default is ignored for: ${i}`);return}let c=mt._`${i} === undefined`;if(a.useDefaults==="empty")c=mt._`${c} || ${i} === null || ${i} === ""`;n.if(c,mt._`${i} = ${mt.stringify(r)}`)}});var ht=g(function(rp){Object.defineProperty(rp,"__esModule",{value:!0});rp.validateUnion=rp.validateArray=rp.usePattern=rp.callValidateCode=rp.schemaProperties=rp.allSchemaProperties=rp.noPropertyInData=rp.propertyInData=rp.isOwnProperty=rp.hasPropFunc=rp.reportMissingProp=rp.checkMissingProp=rp.checkReportMissingProp=void 0;var V=Y(),Hn=re(),Ir=pt(),Zf=re();function IR(e,t){let{gen:r,data:n,it:s}=e;r.if(ru(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}rp.checkReportMissingProp=IR;function CR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(ru(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}rp.checkMissingProp=CR;function jR(e,t){e.setParams({missingProperty:t},!0),e.error()}rp.reportMissingProp=jR;function ep(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}rp.hasPropFunc=ep;function tu(e,t,r){return V._`${ep(e)}.call(${t}, ${r})`}rp.isOwnProperty=tu;function qR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${tu(e,t,r)}`:s}rp.propertyInData=qR;function ru(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(tu(e,t,r))):s}rp.noPropertyInData=ru;function tp(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}rp.allSchemaProperties=tp;function DR(e,t){return tp(t).filter((r)=>!Hn.alwaysValidSchema(e,t[r]))}rp.schemaProperties=DR;function MR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?V._`${e}, ${t}, ${n}${s}`:t,d=[[Ir.default.instancePath,V.strConcat(Ir.default.instancePath,o)],[Ir.default.parentData,a.parentData],[Ir.default.parentDataProperty,a.parentDataProperty],[Ir.default.rootData,Ir.default.rootData]];if(a.opts.dynamicRef)d.push([Ir.default.dynamicAnchors,Ir.default.dynamicAnchors]);let m=V._`${l}, ${r.object(...d)}`;return c!==V.nil?V._`${i}.call(${c}, ${m})`:V._`${i}(${m})`}rp.callValidateCode=MR;var LR=V._`new RegExp`;function UR({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:V._`${s.code==="new RegExp"?LR:Zf.useFunc(e,s)}(${r}, ${n})`})}rp.usePattern=UR;function FR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:Hn.Type.Num},o),t.if(V.not(o),i)})}}rp.validateArray=FR;function VR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>Hn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);if(t.assign(a,V._`${a} || ${i}`),!e.mergeValidEvaluated(l,i))t.if(V.not(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}rp.validateUnion=VR});var lp=g(function(cp){Object.defineProperty(cp,"__esModule",{value:!0});cp.validateKeywordUsage=cp.validSchemaType=cp.funcKeywordCode=cp.macroKeywordCode=void 0;var de=Y(),Rn=pt(),op=ht(),ap=Xs();function tk(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=ip(r,n,i);if(a.opts.validateSchema!==!1)a.self.validateSchema(i,!0);let u=r.name("valid");e.subschema({schema:i,schemaPath:de.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}cp.macroKeywordCode=tk;function rk(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;sk(c,t);let u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=ip(n,s,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1){if(h(),t.modifying)sp(e);y(()=>e.error())}else{let v=t.async?f():p();if(t.modifying)sp(e);y(()=>nk(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>h(de._`await `),(A)=>n.assign(d,!1).if(de._`${A} instanceof ${c.ValidationError}`,()=>n.assign(v,de._`${A}.errors`),()=>n.throw(A))),v}function p(){let v=de._`${l}.errors`;return n.assign(v,null),h(de.nil),v}function h(v=t.async?de._`await `:de.nil){let A=c.opts.passContext?Rn.default.this:Rn.default.self,k=!(("compile"in t)&&!i||t.schema===!1);n.assign(d,de._`${v}${op.callValidateCode(e,l,A,k)}`,t.modifying)}function y(v){var A;n.if(de.not((A=t.valid)!==null&&A!==void 0?A:d),v)}}cp.funcKeywordCode=rk;function sp(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function nk(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(Rn.default.vErrors,de._`${Rn.default.vErrors} === null ? ${t} : ${Rn.default.vErrors}.concat(${t})`).assign(Rn.default.errors,de._`${Rn.default.vErrors}.length`),ap.extendErrors(e)},()=>e.error())}function sk({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ip(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:de.stringify(r)})}function ok(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}cp.validSchemaType=ok;function ak({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let a=s.dependencies;if(a===null||a===void 0?void 0:a.some((i)=>!Object.prototype.hasOwnProperty.call(e,i)))throw Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}cp.validateKeywordUsage=ak});var pp=g(function(dp){Object.defineProperty(dp,"__esModule",{value:!0});dp.extendSubschemaMode=dp.extendSubschemaData=dp.getSubschema=void 0;var qe=Y(),da=re();function lk(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let i=e.schema[t];return r===void 0?{schema:i,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${da.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}dp.getSubschema=lk;function dk(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=i.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(m),e.errorPath=qe.str`${u}${da.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:i.let("data",s,!0);if(c(u),a!==void 0)e.propertyName=a}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}dp.extendSubschemaData=dk;function fk(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}dp.extendSubschemaMode=fk});var Qs=g(function(g4,mp){mp.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var nu=g(function(y4,hp){var Cr=hp.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};fa(t,n,s,e,"",e)};Cr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Cr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Cr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Cr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function fa(e,t,r,n,s,o,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Cr.arrayKeywords)for(var m=0;m<d.length;m++)fa(e,t,r,d[m],s+"/"+l+"/"+m,o,s,l,n,m)}else if(l in Cr.propsKeywords){if(d&&typeof d=="object")for(var f in d)fa(e,t,r,d[f],s+"/"+l+"/"+hk(f),o,s,l,n,f)}else if(l in Cr.keywords||e.allKeys&&!(l in Cr.skipKeywords))fa(e,t,r,d,s+"/"+l,o,s,l,n)}r(n,s,o,a,i,c,u)}}function hk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Zs=g(function(bp){Object.defineProperty(bp,"__esModule",{value:!0});bp.getSchemaRefs=bp.resolveUrl=bp.normalizeId=bp._getFullPath=bp.getFullPath=bp.inlineRef=void 0;var gp=re(),gk=Qs(),yk=nu(),_k=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function vk(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!su(e);if(!t)return!1;return yp(e)<=t}bp.inlineRef=vk;var bk=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function su(e){for(let t in e){if(bk.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(su))return!0;if(typeof r=="object"&&su(r))return!0}return!1}function yp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,_k.has(r))continue;if(typeof e[r]=="object")gp.eachItem(e[r],(n)=>t+=yp(n));if(t===1/0)return 1/0}return t}function _p(e,t="",r){if(r!==!1)t=Bn(t);let n=e.parse(t);return vp(e,n)}bp.getFullPath=_p;function vp(e,t){return e.serialize(t).split("#")[0]+"#"}bp._getFullPath=vp;var wk=/#\/?$/;function Bn(e){return e?e.replace(wk,""):""}bp.normalizeId=Bn;function $k(e,t,r){return r=Bn(r),e.resolve(t,r)}bp.resolveUrl=$k;var Ek=/^[a-z_][-a-z0-9._]*$/i;function Sk(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Bn(e[r]||t),o={"":s},a=_p(n,s,!1),i={},c=new Set;return yk(e,{allKeys:!0},(d,m,f,p)=>{if(p===void 0)return;let h=a+m,y=o[p];if(typeof d[r]=="string")y=v.call(this,d[r]);A.call(this,d.$anchor),A.call(this,d.$dynamicAnchor),o[m]=y;function v(k){let M=this.opts.uriResolver.resolve;if(k=Bn(y?M(y,k):k),c.has(k))throw l(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(d,S.schema,k);else if(k!==Bn(h))if(k[0]==="#")u(d,i[k],k),i[k]=d;else this.refs[k]=h;return k}function A(k){if(typeof k=="string"){if(!Ek.test(k))throw Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),i;function u(d,m,f){if(m!==void 0&&!gk(d,m))throw l(f)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}bp.getSchemaRefs=Sk});var eo=g(function(qp){Object.defineProperty(qp,"__esModule",{value:!0});qp.getData=qp.KeywordCxt=qp.validateFunctionCode=void 0;var ma=Cf(),pa=Js(),Yn=Jc(),jr=Js(),xp=Qf(),Lt=lp(),Wn=pp(),b=Y(),H=pt(),Rp=Zs(),Le=re(),Mt=Xs();function Ok(e){if(Ap(e)){if(Op(e),Tp(e)){Ik(e);return}}kp(e,()=>ma.topBoolOrEmptySchema(e))}qp.validateFunctionCode=Ok;function kp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,b._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(b._`"use strict"; ${$p(r,s)}`),Pk(e,s),e.code(o)});else e.func(t,b._`${H.default.data}, ${Nk(s)}`,n.$async,()=>e.code($p(r,s)).code(o))}function Nk(e){return b._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?b._`, ${H.default.dynamicAnchors}={}`:b.nil}}={}`}function Pk(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,b._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,b._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,b._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,b._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,b._`""`),e.var(H.default.parentData,b._`undefined`),e.var(H.default.parentDataProperty,b._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`{}`)})}function Ik(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{if(r.$comment&&t.$comment)Pp(e);if(Mk(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)Ck(e);Np(e),Fk(e)});return}function Ck(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",b._`${r}.evaluated`),t.if(b._`${e.evaluated}.dynamicProps`,()=>t.assign(b._`${e.evaluated}.props`,b._`undefined`)),t.if(b._`${e.evaluated}.dynamicItems`,()=>t.assign(b._`${e.evaluated}.items`,b._`undefined`))}function $p(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?b._`/*# sourceURL=${r} */`:b.nil}function jk(e,t){if(Ap(e)){if(Op(e),Tp(e)){qk(e,t);return}}ma.boolOrEmptySchema(e,t)}function Tp({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Ap(e){return typeof e.schema!="boolean"}function qk(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Pp(e);Lk(e),Uk(e);let o=n.const("_errs",H.default.errors);Np(e,o),n.var(t,b._`${o} === ${H.default.errors}`)}function Op(e){Le.checkUnknownRules(e),Dk(e)}function Np(e,t){if(e.opts.jtd)return Ep(e,[],!1,t);let r=pa.getSchemaTypes(e.schema),n=pa.coerceAndCheckDataType(e,r);Ep(e,r,!n,t)}function Dk(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Le.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Mk(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Le.checkStrictMode(e,"default is ignored in the schema root")}function Lk(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Rp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function Uk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Pp({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(b._`${H.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let a=b.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(b._`${H.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function Fk(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(b._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(b._`new ${s}(${H.default.vErrors})`));else{if(t.assign(b._`${n}.errors`,H.default.vErrors),o.unevaluated)Vk(e);t.return(b._`${H.default.errors} === 0`)}}function Vk({gen:e,evaluated:t,props:r,items:n}){if(r instanceof b.Name)e.assign(b._`${t}.props`,r);if(n instanceof b.Name)e.assign(b._`${t}.items`,n)}function Ep(e,t,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,l))){s.block(()=>Cp(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)zk(e,t);s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){if(!Yn.shouldUseGroup(o,m))return;if(m.type){if(s.if(jr.checkDataType(m.type,a,c.strictNumbers)),Sp(e,m),t.length===1&&t[0]===m.type&&r)s.else(),jr.reportTypeError(e);s.endIf()}else Sp(e,m);if(!i)s.if(b._`${H.default.errors} === ${n||0}`)}}function Sp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)xp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Yn.shouldUseRule(n,o))Cp(e,o.keyword,o.definition,t.type)})}function zk(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Gk(e,t),!e.opts.allowUnionTypes)Kk(e,t);Hk(e,e.dataTypes)}function Gk(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Ip(e.dataTypes,r))ou(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Wk(e,t)}function Kk(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))ou(e,"use allowUnionTypes to allow union type keyword")}function Hk(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Yn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((a)=>Bk(t,a)))ou(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Bk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Ip(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Wk(e,t){let r=[];for(let n of e.dataTypes)if(Ip(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function ou(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class au{constructor(e,t,r){if(Lt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Le.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",jp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Lt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",H.default.errors)}result(e,t,r){this.failResult(b.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(b.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(b._`${t} !== undefined && (${b.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Mt.reportExtraError:Mt.reportError)(this,this.def.error,t)}$dataError(){Mt.reportError(this,this.def.$dataError||Mt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Mt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=b.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=b.nil,t=b.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(b.or(b._`${n} === undefined`,t)),e!==b.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==b.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return b.or(o(),a());function o(){if(r.length){if(!(t instanceof b.Name))throw Error("ajv implementation error");let i=Array.isArray(r)?r:[r];return b._`${jr.checkDataTypes(i,t,s.opts.strictNumbers,jr.DataType.Wrong)}`}return b.nil}function a(){if(n.validateSchema){let i=e.scopeValue("validate$data",{ref:n.validateSchema});return b._`!${i}(${t})`}return b.nil}}subschema(e,t){let r=Wn.getSubschema(this.it,e);Wn.extendSubschemaData(r,this.it,e),Wn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return jk(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Le.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Le.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,b.Name)),!0}}qp.KeywordCxt=au;function Cp(e,t,r,n){let s=new au(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Lt.funcKeywordCode(s,r);else if("macro"in r)Lt.macroKeywordCode(s,r);else if(r.compile||r.validate)Lt.funcKeywordCode(s,r)}var Yk=/^\/(?:[^~]|~0|~1)*$/,Xk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!Yk.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=Xk.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=t)throw Error(c("property/index",l));return n[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!s)return o}let a=o,i=s.split("/");for(let u of i)if(u)o=b._`${o}${b.getProperty(Le.unescapeJsonPointer(u))}`,a=b._`${a} && ${o}`;return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}qp.getData=jp});var ha=g(function(Lp){Object.defineProperty(Lp,"__esModule",{value:!0});class Mp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Lp.default=Mp});var to=g(function(Fp){Object.defineProperty(Fp,"__esModule",{value:!0});var Xn=Zs();class Up extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Xn.resolveUrl(e,t,r),this.missingSchema=Xn.normalizeId(Xn.getFullPath(e,this.missingRef))}}Fp.default=Up});var no=g(function(Gp){Object.defineProperty(Gp,"__esModule",{value:!0});Gp.resolveSchema=Gp.getCompilingSchema=Gp.resolveRef=Gp.compileSchema=Gp.SchemaEnv=void 0;var xe=Y(),tT=ha(),kn=pt(),Re=Zs(),ga=re(),Vp=eo();class ro{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Re.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}Gp.SchemaEnv=ro;function cu(e){let t=zp.call(this,e);if(t)return t;let r=Re.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new xe.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;if(e.$async)i=a.scopeValue("Error",{ref:tT.default,code:xe._`require("ajv/dist/runtime/validation_error").default`});let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:kn.default.data,parentData:kn.default.parentData,parentDataProperty:kn.default.parentDataProperty,dataNames:[kn.default.data],dataPathArr:[xe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:xe.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:xe.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:xe._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),Vp.validateFunctionCode(u),a.optimize(this.opts.code.optimize);let d=a.toString();if(l=`${a.scopeRefs(kn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let f=Function(`${kn.default.self}`,`${kn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:d,scopeValues:a._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(f.evaluated={props:p instanceof xe.Name?void 0:p,items:h instanceof xe.Name?void 0:h,dynamicProps:p instanceof xe.Name,dynamicItems:h instanceof xe.Name},f.source)f.source.evaluated=xe.stringify(f.evaluated)}return e.validate=f,e}catch(d){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}Gp.compileSchema=cu;function rT(e,t,r){var n;r=Re.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=oT.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;if(a)o=new ro({schema:a,schemaId:i,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=nT.call(this,o)}Gp.resolveRef=rT;function nT(e){if(Re.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:cu.call(this,e)}function zp(e){for(let t of this._compilations)if(sT(t,e))return t}Gp.getCompilingSchema=zp;function sT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function oT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ya.call(this,e,t)}function ya(e,t){let r=this.opts.uriResolver.parse(t),n=Re._getFullPath(this.opts.uriResolver,r),s=Re.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return iu.call(this,r,e);let o=Re.normalizeId(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=ya.call(this,e,a);if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;return iu.call(this,r,i)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)cu.call(this,a);if(o===Re.normalizeId(t)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];if(u)s=Re.resolveUrl(this.opts.uriResolver,s,u);return new ro({schema:i,schemaId:c,root:e,baseId:s})}return iu.call(this,r,a)}Gp.resolveSchema=ya;var aT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function iu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let i of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ga.unescapeFragment(i)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!aT.has(i)&&u)t=Re.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ga.schemaHasRulesButRef(r,this.RULES)){let i=Re.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ya.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new ro({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Hp=g(function(E4,dT){dT.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var lu=g(function(S4,Xp){var fT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Wp=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function uu(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var pT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Bp(e){return e.length=0,!0}function mT(e,t,r){if(e.length){let n=uu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function hT(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,a=!1,i=mT;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)a=!0;if(!i(s,n,r))break;if(++t>7){r.error=!0;break}if(c>0&&e[c-1]===":")o=!0;n.push(":");continue}else if(u==="%"){if(!i(s,n,r))break;i=Bp}else{s.push(u);continue}}if(s.length)if(i===Bp)r.zone=s.join("");else if(a)n.push(s.join(""));else n.push(uu(s));return r.address=n.join(""),r}function Yp(e){if(gT(e,":")<2)return{host:e,isIPV6:!1};let t=hT(e);if(!t.error){let{address:r,address:n}=t;if(t.zone)r+="%"+t.zone,n+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:n}}else return{host:e,isIPV6:!1}}function gT(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function yT(e){let t=e,r=[],n=-1,s=0;while(s=t.length){if(s===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(s===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(s===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function _T(e,t){let r=t!==!0?escape:unescape;if(e.scheme!==void 0)e.scheme=r(e.scheme);if(e.userinfo!==void 0)e.userinfo=r(e.userinfo);if(e.host!==void 0)e.host=r(e.host);if(e.path!==void 0)e.path=r(e.path);if(e.query!==void 0)e.query=r(e.query);if(e.fragment!==void 0)e.fragment=r(e.fragment);return e}function vT(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!Wp(r)){let n=Yp(r);if(n.isIPV6===!0)r=`[${n.escapedHost}]`;else r=e.host}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}Xp.exports={nonSimpleDomain:pT,recomposeAuthority:vT,normalizeComponentEncoding:_T,removeDotSegments:yT,isIPv4:Wp,isUUID:fT,normalizeIPv6:Yp,stringArrayToHexStripped:uu}});var tm=g(function(x4,em){var{isUUID:bT}=lu(),wT=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,$T=["http","https","ws","wss","urn","urn:uuid"];function ET(e){return $T.indexOf(e)!==-1}function du(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function Jp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Qp(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function ST(e){return e.secure=du(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function xT(e){if(e.port===(du(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function RT(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(wT);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,o=fu(s);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function kT(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=fu(s);if(o)e=o.serialize(e,t);let a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function TT(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!bT(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function AT(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Zp={scheme:"http",domainHost:!0,parse:Jp,serialize:Qp},OT={scheme:"https",domainHost:Zp.domainHost,parse:Jp,serialize:Qp},_a={scheme:"ws",domainHost:!0,parse:ST,serialize:xT},NT={scheme:"wss",domainHost:_a.domainHost,parse:_a.parse,serialize:_a.serialize},PT={scheme:"urn",parse:RT,serialize:kT,skipNormalize:!0},IT={scheme:"urn:uuid",parse:TT,serialize:AT,skipNormalize:!0},va={http:Zp,https:OT,ws:_a,wss:NT,urn:PT,"urn:uuid":IT};Object.setPrototypeOf(va,null);function fu(e){return e&&(va[e]||va[e.toLowerCase()])||void 0}em.exports={wsIsSecure:du,SCHEMES:va,isValidSchemeName:ET,getSchemeHandler:fu}});var mu=g(function(R4,wa){var{normalizeIPv6:CT,removeDotSegments:so,recomposeAuthority:jT,normalizeComponentEncoding:ba,isIPv4:qT,nonSimpleDomain:DT}=lu(),{SCHEMES:MT,getSchemeHandler:rm}=tm();function LT(e,t){if(typeof e==="string")e=Ut(yr(e,t),t);else if(typeof e==="object")e=yr(Ut(e,t),t);return e}function UT(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=nm(yr(e,n),yr(t,n),n,!0);return n.skipEscape=!0,Ut(s,n)}function nm(e,t,r,n){let s={};if(!n)e=yr(Ut(e,r),r),t=yr(Ut(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=so(t.path||""),s.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=so(t.path||""),s.query=t.query;else{if(!t.path)if(s.path=e.path,t.query!==void 0)s.query=t.query;else s.query=e.query;else{if(t.path[0]==="/")s.path=so(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)s.path="/"+t.path;else if(!e.path)s.path=t.path;else s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;s.path=so(s.path)}s.query=t.query}s.userinfo=e.userinfo,s.host=e.host,s.port=e.port}s.scheme=e.scheme}return s.fragment=t.fragment,s}function FT(e,t,r){if(typeof e==="string")e=unescape(e),e=Ut(ba(yr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Ut(ba(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Ut(ba(yr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Ut(ba(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Ut(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=rm(n.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,n);if(r.path!==void 0)if(!n.skipEscape){if(r.path=escape(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=unescape(r.path);if(n.reference!=="suffix"&&r.scheme)s.push(r.scheme,":");let a=jT(r);if(a!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(a),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let i=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))i=so(i);if(a===void 0&&i[0]==="/"&&i[1]==="/")i="/%2F"+i.slice(2);s.push(i)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var VT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let o=e.match(VT);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port))n.port=o[5];if(n.host)if(qT(n.host)===!1){let c=CT(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let a=rm(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)){if(n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&DT(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}}if(!a||a&&!a.skipNormalize){if(e.indexOf("%")!==-1){if(n.scheme!==void 0)n.scheme=unescape(n.scheme);if(n.host!==void 0)n.host=unescape(n.host)}if(n.path)n.path=escape(unescape(n.path));if(n.fragment)n.fragment=encodeURI(decodeURIComponent(n.fragment))}if(a&&a.parse)a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var pu={SCHEMES:MT,normalize:LT,resolve:UT,resolveComponent:nm,equal:FT,serialize:Ut,parse:yr};wa.exports=pu;wa.exports.default=pu;wa.exports.fastUri=pu});var am=g(function(om){Object.defineProperty(om,"__esModule",{value:!0});var sm=mu();sm.code='require("ajv/dist/runtime/uri").default';om.default=sm});var gm=g(function(_r){Object.defineProperty(_r,"__esModule",{value:!0});_r.CodeGen=_r.Name=_r.nil=_r.stringify=_r.str=_r._=_r.KeywordCxt=void 0;var GT=eo();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return GT.KeywordCxt}});var Qn=Y();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Qn._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Qn.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Qn.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Qn.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Qn.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Qn.CodeGen}});var KT=ha(),dm=to(),fm=Xc(),Ft=no(),pm=Y(),Vt=Zs(),qr=Js(),Jn=re(),im=Hp(),HT=am(),mm=(e,t)=>new RegExp(e,t);mm.code="new RegExp";var BT=["removeAdditional","useDefaults","coerceTypes"],WT=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),YT={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},XT={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},cm=200;function JT(e){var t,r,n,s,o,a,i,c,u,l,d,m,f,p,h,y,v,A,k,M,S,$e,je,kr,Ct;let Ve=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,hr=xt===!0||xt===void 0?1:xt||0,wn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:mm,Ln=(s=e.uriResolver)!==null&&s!==void 0?s:HT.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Ve)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:Ve)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ve)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&m!==void 0?m:"log",strictRequired:(p=(f=e.strictRequired)!==null&&f!==void 0?f:Ve)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:hr,regExp:wn}:{optimize:hr,regExp:wn},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:cm,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:cm,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(A=e.messages)!==null&&A!==void 0?A:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:($e=e.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(je=e.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(kr=e.unicodeRegExp)!==null&&kr!==void 0?kr:!0,int32range:(Ct=e.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:Ln}}class $a{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...JT(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new pm.ValueScope({scope:{},prefixes:WT,es5:t,lines:r}),this.logger=nA(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=fm.getRules(),um.call(this,YT,e,"NOT SUPPORTED"),um.call(this,XT,e,"DEPRECATED","warn"),this._metaOpts=tA.call(this),e.formats)ZT.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)eA.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);QT.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=im;if(r==="id")n={...im},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof dm.default))throw l;return a.call(this,l),await i.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function i(u){let l=await c.call(this,u);if(!this.refs[u])await s.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=Vt.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=lm.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ft.SchemaEnv({schema:{},schemaId:r});if(t=Ft.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=lm.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=Vt.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(oA.call(this,r,t),!t)return Jn.eachItem(r,(s)=>hu.call(this,s)),this;iA.call(this,t);let n={...t,type:qr.getJSONTypes(t.type),schemaType:qr.getJSONTypes(t.schemaType)};return Jn.eachItem(r,n.type.length===0?(s)=>hu.call(this,s,n):(s)=>n.type.forEach((o)=>hu.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let i=r[a];if(typeof i!="object")continue;let{$data:c}=i.definition,u=o[a];if(c&&u)o[a]=hm(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let i=this._cache.get(e);if(i!==void 0)return i;r=Vt.normalizeId(o||r);let c=Vt.getSchemaRefs.call(this,e,r);if(i=new Ft.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(n)this.validateSchema(e,!0);return i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Ft.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Ft.compileSchema.call(this,e)}finally{this.opts=t}}}$a.ValidationError=KT.default;$a.MissingRefError=dm.default;_r.default=$a;function um(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function lm(e){return e=Vt.normalizeId(e),this.schemas[e]||this.refs[e]}function QT(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function ZT(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function eA(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function tA(){let e={...this.opts};for(let t of BT)delete e[t];return e}var rA={log(){},warn(){},error(){}};function nA(e){if(e===!1)return rA;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var sA=/^[a-z_$][a-z0-9_$:-]*$/i;function oA(e,t){let{RULES:r}=this;if(Jn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!sA.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function hu(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=s?o.post:o.rules.find(({type:c})=>c===r);if(!a)a={type:r,rules:[]},o.rules.push(a);if(o.keywords[e]=!0,!t)return;let i={keyword:e,definition:{...t,type:qr.getJSONTypes(t.type),schemaType:qr.getJSONTypes(t.schemaType)}};if(t.before)aA.call(this,a,i,t.before);else a.rules.push(i);o.all[e]=i,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function aA(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function iA(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hm(t);e.validateSchema=this.compile(t,!0)}var cA={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hm(e){return{anyOf:[e,cA]}}});var _m=g(function(ym){Object.defineProperty(ym,"__esModule",{value:!0});var dA={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ym.default=dA});var Ra=g(function(bm){Object.defineProperty(bm,"__esModule",{value:!0});bm.callRef=bm.getValidate=void 0;var pA=to(),Sa=ht(),me=Y(),Zn=pt(),xa=no(),Dr=re(),mA={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=xa.resolveRef.call(c,u,s,r);if(l===void 0)throw new pA.default(n.opts.uriResolver,s,r);if(l instanceof xa.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return Ea(e,a,o,o.$async);let p=t.scopeValue("root",{ref:u});return Ea(e,me._`${p}.validate`,u,u.$async)}function m(p){let h=vm(e,p);Ea(e,h,p,p.$async)}function f(p){let h=t.scopeValue("schema",i.code.source===!0?{ref:p,code:me.stringify(p)}:{ref:p}),y=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:me.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function vm(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):me._`${r.scopeValue("wrapper",{ref:t})}.validate`}bm.getValidate=vm;function Ea(e,t,r,n){let{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?Zn.default.this:me.nil;if(n)l();else d();function l(){if(!i.$async)throw Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{if(s.code(me._`await ${Sa.callValidateCode(e,t,u)}`),f(t),!a)s.assign(p,!0)},(h)=>{if(s.if(me._`!(${h} instanceof ${o.ValidationError})`,()=>s.throw(h)),m(h),!a)s.assign(p,!1)}),e.ok(p)}function d(){e.result(Sa.callValidateCode(e,t,u),()=>f(t),()=>m(t))}function m(p){let h=me._`${p}.errors`;s.assign(Zn.default.vErrors,me._`${Zn.default.vErrors} === null ? ${h} : ${Zn.default.vErrors}.concat(${h})`),s.assign(Zn.default.errors,me._`${Zn.default.vErrors}.length`)}function f(p){var h;if(!o.opts.unevaluated)return;let y=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=Dr.mergeEvaluated.props(s,y.props,o.props)}else{let v=s.var("props",me._`${p}.evaluated.props`);o.props=Dr.mergeEvaluated.props(s,v,o.props,me.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=Dr.mergeEvaluated.items(s,y.items,o.items)}else{let v=s.var("items",me._`${p}.evaluated.items`);o.items=Dr.mergeEvaluated.items(s,v,o.items,me.Name)}}}bm.callRef=Ea;bm.default=mA});var Em=g(function($m){Object.defineProperty($m,"__esModule",{value:!0});var yA=_m(),_A=Ra(),vA=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yA.default,_A.default];$m.default=vA});var xm=g(function(Sm){Object.defineProperty(Sm,"__esModule",{value:!0});var Lr=Y(),Mr=Lr.operators,ka={maximum:{okStr:"<=",ok:Mr.LTE,fail:Mr.GT},minimum:{okStr:">=",ok:Mr.GTE,fail:Mr.LT},exclusiveMaximum:{okStr:"<",ok:Mr.LT,fail:Mr.GTE},exclusiveMinimum:{okStr:">",ok:Mr.GT,fail:Mr.LTE}},wA={message:({keyword:e,schemaCode:t})=>Lr.str`must be ${ka[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Lr._`{comparison: ${ka[e].okStr}, limit: ${t}}`},$A={keyword:Object.keys(ka),type:"number",schemaType:"number",$data:!0,error:wA,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Lr._`${r} ${ka[t].fail} ${n} || isNaN(${r})`)}};Sm.default=$A});var km=g(function(Rm){Object.defineProperty(Rm,"__esModule",{value:!0});var zt=Y(),SA={message:({schemaCode:e})=>zt.str`must be multiple of ${e}`,params:({schemaCode:e})=>zt._`{multipleOf: ${e}}`},xA={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:SA,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?zt._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:zt._`${a} !== parseInt(${a})`;e.fail$data(zt._`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Rm.default=xA});var Om=g(function(Am){Object.defineProperty(Am,"__esModule",{value:!0});function Tm(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}Am.default=Tm;Tm.code='require("ajv/dist/runtime/ucs2length").default'});var Im=g(function(Pm){Object.defineProperty(Pm,"__esModule",{value:!0});var nt=Y(),Nm=re(),TA=Om(),AA={message({keyword:e,schemaCode:t}){return nt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>nt._`{limit: ${e}}`},OA={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:AA,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?nt.operators.GT:nt.operators.LT,a=s.opts.unicode===!1?nt._`${r}.length`:nt._`${Nm.useFunc(e.gen,TA.default)}(${r})`;e.fail$data(nt._`${a} ${o} ${n}`)}};Pm.default=OA});var qm=g(function(jm){Object.defineProperty(jm,"__esModule",{value:!0});var Cm=ht(),Ur=Y(),PA={message:({schemaCode:e})=>Ur.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ur._`{pattern: ${e}}`},IA={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:PA,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"",i=r?Ur._`(new RegExp(${s}, ${a}))`:Cm.usePattern(e,n);e.fail$data(Ur._`!${i}.test(${t})`)}};jm.default=IA});var Mm=g(function(Dm){Object.defineProperty(Dm,"__esModule",{value:!0});var Gt=Y(),jA={message({keyword:e,schemaCode:t}){return Gt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Gt._`{limit: ${e}}`},qA={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jA,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Gt.operators.GT:Gt.operators.LT;e.fail$data(Gt._`Object.keys(${r}).length ${s} ${n}`)}};Dm.default=qA});var Fm=g(function(Um){Object.defineProperty(Um,"__esModule",{value:!0});var Kt=ht(),Ht=Y(),Lm=re(),MA={message:({params:{missingProperty:e}})=>Ht.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Ht._`{missingProperty: ${e}}`},LA={keyword:"required",type:"object",schemaType:"array",$data:!0,error:MA,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors)u();else l();if(i.strictRequired){let f=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((f===null||f===void 0?void 0:f[h])===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;Lm.checkStrictMode(a,v,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Ht.nil,d);else for(let f of r)Kt.checkReportMissingProp(e,f)}function l(){let f=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>m(f,p)),e.ok(p)}else t.if(Kt.checkMissingProp(e,r,f)),Kt.reportMissingProp(e,f),t.else()}function d(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Kt.noPropertyInData(t,s,f,i.ownProperties),()=>e.error())})}function m(f,p){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(p,Kt.propertyInData(t,s,f,i.ownProperties)),t.if(Ht.not(p),()=>{e.error(),t.break()})},Ht.nil)}}};Um.default=LA});var zm=g(function(Vm){Object.defineProperty(Vm,"__esModule",{value:!0});var Bt=Y(),FA={message({keyword:e,schemaCode:t}){return Bt.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Bt._`{limit: ${e}}`},VA={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:FA,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Bt.operators.GT:Bt.operators.LT;e.fail$data(Bt._`${r}.length ${s} ${n}`)}};Vm.default=VA});var Ta=g(function(Km){Object.defineProperty(Km,"__esModule",{value:!0});var Gm=Qs();Gm.code='require("ajv/dist/runtime/equal").default';Km.default=Gm});var Wm=g(function(Bm){Object.defineProperty(Bm,"__esModule",{value:!0});var es=Js(),oe=Y(),Hm=re(),KA=Ta(),HA={message:({params:{i:e,j:t}})=>oe.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>oe._`{i: ${e}, j: ${t}}`},BA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:HA,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?es.getSchemaTypes(o.items):[];e.block$data(c,l,oe._`${a} === false`),e.ok(c);function l(){let p=t.let("i",oe._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(oe._`${p} > 1`,()=>(d()?m:f)(p,h))}function d(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function m(p,h){let y=t.name("item"),v=es.checkDataTypes(u,y,i.opts.strictNumbers,es.DataType.Wrong),A=t.const("indices",oe._`{}`);t.for(oe._`;${p}--;`,()=>{if(t.let(y,oe._`${r}[${p}]`),t.if(v,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${A}[${y}] == "number"`,()=>{t.assign(h,oe._`${A}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${A}[${y}] = ${p}`)})}function f(p,h){let y=Hm.useFunc(t,KA.default),v=t.name("outer");t.label(v).for(oe._`;${p}--;`,()=>t.for(oe._`${h} = ${p}; ${h}--;`,()=>t.if(oe._`${y}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};Bm.default=BA});var Jm=g(function(Xm){Object.defineProperty(Xm,"__esModule",{value:!0});var ts=Y(),Ym=re(),YA=Ta(),XA={message:"must be equal to constant",params:({schemaCode:e})=>ts._`{allowedValue: ${e}}`},JA={keyword:"const",$data:!0,error:XA,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(ts._`!${Ym.useFunc(t,YA.default)}(${r}, ${s})`);else e.fail(ts._`${o} !== ${r}`)}};Xm.default=JA});var eh=g(function(Zm){Object.defineProperty(Zm,"__esModule",{value:!0});var Wt=Y(),Qm=re(),ZA=Ta(),eO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Wt._`{allowedValues: ${e}}`},tO={keyword:"enum",schemaType:"array",$data:!0,error:eO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Qm.useFunc(t,ZA.default),l;if(i||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);l=Wt.or(...s.map((p,h)=>m(f,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,(f)=>t.if(Wt._`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,p){let h=s[p];return typeof h==="object"&&h!==null?Wt._`${u()}(${r}, ${f}[${p}])`:Wt._`${r} === ${h}`}}};Zm.default=tO});var rh=g(function(th){Object.defineProperty(th,"__esModule",{value:!0});var nO=xm(),sO=km(),oO=Im(),aO=qm(),iO=Mm(),cO=Fm(),uO=zm(),lO=Wm(),dO=Jm(),fO=eh(),pO=[nO.default,sO.default,oO.default,aO.default,iO.default,cO.default,uO.default,lO.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},dO.default,fO.default];th.default=pO});var gu=g(function(sh){Object.defineProperty(sh,"__esModule",{value:!0});sh.validateAdditionalItems=void 0;var st=Y(),rs=re(),hO={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},gO={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:hO,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){rs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}nh(e,n)}};function nh(e,t){let{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;let i=r.const("len",st._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(st._`${i} <= ${t.length}`);else if(typeof n=="object"&&!rs.alwaysValidSchema(a,n)){let u=r.var("valid",st._`${i} <= ${t.length}`);r.if(st.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:rs.Type.Num},u),!a.allErrors)r.if(st.not(u),()=>r.break())})}}sh.validateAdditionalItems=nh;sh.default=gO});var yu=g(function(ch){Object.defineProperty(ch,"__esModule",{value:!0});ch.validateTuple=void 0;var Aa=Y(),Fr=re(),ah=ht(),_O={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return ih(e,"additionalItems",t);if(r.items=!0,Fr.alwaysValidSchema(r,t))return;e.ok(ah.validateArray(e))}};function ih(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;if(l(s),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=Fr.mergeEvaluated.items(n,r.length,i.items);let c=n.name("valid"),u=n.const("len",Aa._`${o}.length`);r.forEach((d,m)=>{if(Fr.alwaysValidSchema(i,d))return;n.if(Aa._`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c)});function l(d){let{opts:m,errSchemaPath:f}=i,p=r.length,h=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Fr.checkStrictMode(i,y,m.strictTuples)}}}ch.validateTuple=ih;ch.default=_O});var fh=g(function(dh){Object.defineProperty(dh,"__esModule",{value:!0});var lh=yu(),bO={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>lh.validateTuple(e,"items")};dh.default=bO});var yh=g(function(gh){Object.defineProperty(gh,"__esModule",{value:!0});var Oa=Y(),ph=re(),mh=ht(),hh=gu(),$O={message:({params:{len:e}})=>Oa.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Oa._`{limit: ${e}}`},EO={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:$O,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,ph.alwaysValidSchema(n,t))return;if(s)hh.validateAdditionalItems(e,s);else e.ok(mh.validateArray(e))}};gh.default=EO});var vh=g(function(_h){Object.defineProperty(_h,"__esModule",{value:!0});var _e=Y(),Vr=re(),xO={message:({params:{min:e,max:t}})=>t===void 0?_e.str`must contain at least ${e} valid item(s)`:_e.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?_e._`{minContains: ${e}}`:_e._`{minContains: ${e}, maxContains: ${t}}`},RO={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:xO,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,a,i,{minContains:c,maxContains:u}=n;if(o.opts.next)a=c===void 0?1:c,i=u;else a=1;let l=t.const("len",_e._`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){Vr.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){Vr.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Vr.alwaysValidSchema(o,r)){let h=_e._`${l} >= ${a}`;if(i!==void 0)h=_e._`${h} && ${l} <= ${i}`;e.pass(h);return}o.items=!0;let d=t.name("valid");if(i===void 0&&a===1)f(d,()=>t.if(d,()=>t.break()));else if(a===0){if(t.let(d,!0),i!==void 0)t.if(_e._`${s}.length > 0`,m)}else t.let(d,!1),m();e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);f(h,()=>t.if(h,()=>p(y)))}function f(h,y){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:Vr.Type.Num,compositeRule:!0},h),y()})}function p(h){if(t.code(_e._`${h}++`),i===void 0)t.if(_e._`${h} >= ${a}`,()=>t.assign(d,!0).break());else if(t.if(_e._`${h} > ${i}`,()=>t.assign(d,!1).break()),a===1)t.assign(d,!0);else t.if(_e._`${h} >= ${a}`,()=>t.assign(d,!0))}}};_h.default=RO});var Na=g(function(Eh){Object.defineProperty(Eh,"__esModule",{value:!0});Eh.validateSchemaDeps=Eh.validatePropertyDeps=Eh.error=void 0;var ns=Y(),bh=re(),Yt=ht();Eh.error={message:({params:{property:e,depsCount:t,deps:r}})=>ns.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>ns._`{property: ${e},
|
|
7
|
+
|| ${a} === "boolean" || ${s} === null`).assign(i,x._`[${s}]`)}}}function SR({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Qc(e,t,r,n=Kn.Correct){let s=n===Kn.Correct?x.operators.EQ:x.operators.NEQ,o;switch(e){case"null":return x._`${t} ${s} null`;case"array":o=x._`Array.isArray(${t})`;break;case"object":o=x._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Kn.Correct?o:x.not(o);function a(i=x.nil){return x.and(x._`typeof ${t} == "number"`,i,r?x._`isFinite(${t})`:x.nil)}}Hf.checkDataType=Qc;function Zc(e,t,r,n){if(e.length===1)return Qc(e[0],t,r,n);let s,o=la.toHash(e);if(o.array&&o.object){let a=x._`typeof ${t} != "object"`;s=o.null?a:x._`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let a in o)s=x.and(s,Qc(a,t,r,n));return s}Hf.checkDataTypes=Zc;var xR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function eu(e){let t=RR(e);zf.reportError(t,xR)}Hf.reportTypeError=eu;function RR(e){let{gen:t,data:r,schema:n}=e,s=la.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Qf=g(function(Xf){Object.defineProperty(Xf,"__esModule",{value:!0});Xf.assignDefaults=void 0;var mt=Y(),Yf=re();function CR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Wf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Wf(e,o,s.default))}Xf.assignDefaults=CR;function Wf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;let i=mt._`${o}${mt.getProperty(t)}`;if(s){Yf.checkStrictMode(e,`default is ignored for: ${i}`);return}let c=mt._`${i} === undefined`;if(a.useDefaults==="empty")c=mt._`${c} || ${i} === null || ${i} === ""`;n.if(c,mt._`${i} = ${mt.stringify(r)}`)}});var ht=g(function(rp){Object.defineProperty(rp,"__esModule",{value:!0});rp.validateUnion=rp.validateArray=rp.usePattern=rp.callValidateCode=rp.schemaProperties=rp.allSchemaProperties=rp.noPropertyInData=rp.propertyInData=rp.isOwnProperty=rp.hasPropFunc=rp.reportMissingProp=rp.checkMissingProp=rp.checkReportMissingProp=void 0;var V=Y(),Hn=re(),Cr=pt(),Zf=re();function IR(e,t){let{gen:r,data:n,it:s}=e;r.if(ru(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}rp.checkReportMissingProp=IR;function jR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(ru(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}rp.checkMissingProp=jR;function qR(e,t){e.setParams({missingProperty:t},!0),e.error()}rp.reportMissingProp=qR;function ep(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}rp.hasPropFunc=ep;function tu(e,t,r){return V._`${ep(e)}.call(${t}, ${r})`}rp.isOwnProperty=tu;function DR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${tu(e,t,r)}`:s}rp.propertyInData=DR;function ru(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(tu(e,t,r))):s}rp.noPropertyInData=ru;function tp(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}rp.allSchemaProperties=tp;function MR(e,t){return tp(t).filter((r)=>!Hn.alwaysValidSchema(e,t[r]))}rp.schemaProperties=MR;function LR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?V._`${e}, ${t}, ${n}${s}`:t,d=[[Cr.default.instancePath,V.strConcat(Cr.default.instancePath,o)],[Cr.default.parentData,a.parentData],[Cr.default.parentDataProperty,a.parentDataProperty],[Cr.default.rootData,Cr.default.rootData]];if(a.opts.dynamicRef)d.push([Cr.default.dynamicAnchors,Cr.default.dynamicAnchors]);let m=V._`${l}, ${r.object(...d)}`;return c!==V.nil?V._`${i}.call(${c}, ${m})`:V._`${i}(${m})`}rp.callValidateCode=LR;var UR=V._`new RegExp`;function FR({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:V._`${s.code==="new RegExp"?UR:Zf.useFunc(e,s)}(${r}, ${n})`})}rp.usePattern=FR;function VR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:Hn.Type.Num},o),t.if(V.not(o),i)})}}rp.validateArray=VR;function zR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>Hn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);if(t.assign(a,V._`${a} || ${i}`),!e.mergeValidEvaluated(l,i))t.if(V.not(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}rp.validateUnion=zR});var lp=g(function(cp){Object.defineProperty(cp,"__esModule",{value:!0});cp.validateKeywordUsage=cp.validSchemaType=cp.funcKeywordCode=cp.macroKeywordCode=void 0;var de=Y(),Rn=pt(),op=ht(),ap=Xs();function rk(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=ip(r,n,i);if(a.opts.validateSchema!==!1)a.self.validateSchema(i,!0);let u=r.name("valid");e.subschema({schema:i,schemaPath:de.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}cp.macroKeywordCode=rk;function nk(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;ok(c,t);let u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=ip(n,s,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1){if(h(),t.modifying)sp(e);y(()=>e.error())}else{let v=t.async?f():p();if(t.modifying)sp(e);y(()=>sk(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>h(de._`await `),(A)=>n.assign(d,!1).if(de._`${A} instanceof ${c.ValidationError}`,()=>n.assign(v,de._`${A}.errors`),()=>n.throw(A))),v}function p(){let v=de._`${l}.errors`;return n.assign(v,null),h(de.nil),v}function h(v=t.async?de._`await `:de.nil){let A=c.opts.passContext?Rn.default.this:Rn.default.self,k=!(("compile"in t)&&!i||t.schema===!1);n.assign(d,de._`${v}${op.callValidateCode(e,l,A,k)}`,t.modifying)}function y(v){var A;n.if(de.not((A=t.valid)!==null&&A!==void 0?A:d),v)}}cp.funcKeywordCode=nk;function sp(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function sk(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(Rn.default.vErrors,de._`${Rn.default.vErrors} === null ? ${t} : ${Rn.default.vErrors}.concat(${t})`).assign(Rn.default.errors,de._`${Rn.default.vErrors}.length`),ap.extendErrors(e)},()=>e.error())}function ok({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ip(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:de.stringify(r)})}function ak(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}cp.validSchemaType=ak;function ik({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let a=s.dependencies;if(a===null||a===void 0?void 0:a.some((i)=>!Object.prototype.hasOwnProperty.call(e,i)))throw Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}cp.validateKeywordUsage=ik});var pp=g(function(dp){Object.defineProperty(dp,"__esModule",{value:!0});dp.extendSubschemaMode=dp.extendSubschemaData=dp.getSubschema=void 0;var qe=Y(),da=re();function dk(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let i=e.schema[t];return r===void 0?{schema:i,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${da.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}dp.getSubschema=dk;function fk(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=i.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(m),e.errorPath=qe.str`${u}${da.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:i.let("data",s,!0);if(c(u),a!==void 0)e.propertyName=a}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}dp.extendSubschemaData=fk;function pk(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}dp.extendSubschemaMode=pk});var Qs=g(function(b4,mp){mp.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var nu=g(function(w4,hp){var Ir=hp.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};fa(t,n,s,e,"",e)};Ir.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ir.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ir.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ir.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function fa(e,t,r,n,s,o,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,a,i,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Ir.arrayKeywords)for(var m=0;m<d.length;m++)fa(e,t,r,d[m],s+"/"+l+"/"+m,o,s,l,n,m)}else if(l in Ir.propsKeywords){if(d&&typeof d=="object")for(var f in d)fa(e,t,r,d[f],s+"/"+l+"/"+gk(f),o,s,l,n,f)}else if(l in Ir.keywords||e.allKeys&&!(l in Ir.skipKeywords))fa(e,t,r,d,s+"/"+l,o,s,l,n)}r(n,s,o,a,i,c,u)}}function gk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Zs=g(function(bp){Object.defineProperty(bp,"__esModule",{value:!0});bp.getSchemaRefs=bp.resolveUrl=bp.normalizeId=bp._getFullPath=bp.getFullPath=bp.inlineRef=void 0;var gp=re(),yk=Qs(),_k=nu(),vk=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function bk(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!su(e);if(!t)return!1;return yp(e)<=t}bp.inlineRef=bk;var wk=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function su(e){for(let t in e){if(wk.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(su))return!0;if(typeof r=="object"&&su(r))return!0}return!1}function yp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,vk.has(r))continue;if(typeof e[r]=="object")gp.eachItem(e[r],(n)=>t+=yp(n));if(t===1/0)return 1/0}return t}function _p(e,t="",r){if(r!==!1)t=Bn(t);let n=e.parse(t);return vp(e,n)}bp.getFullPath=_p;function vp(e,t){return e.serialize(t).split("#")[0]+"#"}bp._getFullPath=vp;var $k=/#\/?$/;function Bn(e){return e?e.replace($k,""):""}bp.normalizeId=Bn;function Ek(e,t,r){return r=Bn(r),e.resolve(t,r)}bp.resolveUrl=Ek;var Sk=/^[a-z_][-a-z0-9._]*$/i;function xk(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Bn(e[r]||t),o={"":s},a=_p(n,s,!1),i={},c=new Set;return _k(e,{allKeys:!0},(d,m,f,p)=>{if(p===void 0)return;let h=a+m,y=o[p];if(typeof d[r]=="string")y=v.call(this,d[r]);A.call(this,d.$anchor),A.call(this,d.$dynamicAnchor),o[m]=y;function v(k){let M=this.opts.uriResolver.resolve;if(k=Bn(y?M(y,k):k),c.has(k))throw l(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(d,S.schema,k);else if(k!==Bn(h))if(k[0]==="#")u(d,i[k],k),i[k]=d;else this.refs[k]=h;return k}function A(k){if(typeof k=="string"){if(!Sk.test(k))throw Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),i;function u(d,m,f){if(m!==void 0&&!yk(d,m))throw l(f)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}bp.getSchemaRefs=xk});var eo=g(function(qp){Object.defineProperty(qp,"__esModule",{value:!0});qp.getData=qp.KeywordCxt=qp.validateFunctionCode=void 0;var ma=If(),pa=Js(),Yn=Jc(),jr=Js(),xp=Qf(),Lt=lp(),Wn=pp(),b=Y(),H=pt(),Rp=Zs(),Le=re(),Mt=Xs();function Nk(e){if(Ap(e)){if(Op(e),Tp(e)){Ik(e);return}}kp(e,()=>ma.topBoolOrEmptySchema(e))}qp.validateFunctionCode=Nk;function kp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,b._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(b._`"use strict"; ${$p(r,s)}`),Ck(e,s),e.code(o)});else e.func(t,b._`${H.default.data}, ${Pk(s)}`,n.$async,()=>e.code($p(r,s)).code(o))}function Pk(e){return b._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?b._`, ${H.default.dynamicAnchors}={}`:b.nil}}={}`}function Ck(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,b._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,b._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,b._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,b._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,b._`""`),e.var(H.default.parentData,b._`undefined`),e.var(H.default.parentDataProperty,b._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,b._`{}`)})}function Ik(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{if(r.$comment&&t.$comment)Pp(e);if(Lk(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)jk(e);Np(e),Vk(e)});return}function jk(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",b._`${r}.evaluated`),t.if(b._`${e.evaluated}.dynamicProps`,()=>t.assign(b._`${e.evaluated}.props`,b._`undefined`)),t.if(b._`${e.evaluated}.dynamicItems`,()=>t.assign(b._`${e.evaluated}.items`,b._`undefined`))}function $p(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?b._`/*# sourceURL=${r} */`:b.nil}function qk(e,t){if(Ap(e)){if(Op(e),Tp(e)){Dk(e,t);return}}ma.boolOrEmptySchema(e,t)}function Tp({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Ap(e){return typeof e.schema!="boolean"}function Dk(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Pp(e);Uk(e),Fk(e);let o=n.const("_errs",H.default.errors);Np(e,o),n.var(t,b._`${o} === ${H.default.errors}`)}function Op(e){Le.checkUnknownRules(e),Mk(e)}function Np(e,t){if(e.opts.jtd)return Ep(e,[],!1,t);let r=pa.getSchemaTypes(e.schema),n=pa.coerceAndCheckDataType(e,r);Ep(e,r,!n,t)}function Mk(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Le.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Lk(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Le.checkStrictMode(e,"default is ignored in the schema root")}function Uk(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Rp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function Fk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Pp({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(b._`${H.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let a=b.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(b._`${H.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function Vk(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(b._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(b._`new ${s}(${H.default.vErrors})`));else{if(t.assign(b._`${n}.errors`,H.default.vErrors),o.unevaluated)zk(e);t.return(b._`${H.default.errors} === 0`)}}function zk({gen:e,evaluated:t,props:r,items:n}){if(r instanceof b.Name)e.assign(b._`${t}.props`,r);if(n instanceof b.Name)e.assign(b._`${t}.items`,n)}function Ep(e,t,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,l))){s.block(()=>Ip(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)Gk(e,t);s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){if(!Yn.shouldUseGroup(o,m))return;if(m.type){if(s.if(jr.checkDataType(m.type,a,c.strictNumbers)),Sp(e,m),t.length===1&&t[0]===m.type&&r)s.else(),jr.reportTypeError(e);s.endIf()}else Sp(e,m);if(!i)s.if(b._`${H.default.errors} === ${n||0}`)}}function Sp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)xp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Yn.shouldUseRule(n,o))Ip(e,o.keyword,o.definition,t.type)})}function Gk(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Kk(e,t),!e.opts.allowUnionTypes)Hk(e,t);Bk(e,e.dataTypes)}function Kk(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Cp(e.dataTypes,r))ou(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Yk(e,t)}function Hk(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))ou(e,"use allowUnionTypes to allow union type keyword")}function Bk(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Yn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((a)=>Wk(t,a)))ou(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Wk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Cp(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Yk(e,t){let r=[];for(let n of e.dataTypes)if(Cp(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function ou(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class au{constructor(e,t,r){if(Lt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Le.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",jp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Lt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",H.default.errors)}result(e,t,r){this.failResult(b.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(b.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(b._`${t} !== undefined && (${b.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Mt.reportExtraError:Mt.reportError)(this,this.def.error,t)}$dataError(){Mt.reportError(this,this.def.$dataError||Mt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Mt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=b.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=b.nil,t=b.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(b.or(b._`${n} === undefined`,t)),e!==b.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==b.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return b.or(o(),a());function o(){if(r.length){if(!(t instanceof b.Name))throw Error("ajv implementation error");let i=Array.isArray(r)?r:[r];return b._`${jr.checkDataTypes(i,t,s.opts.strictNumbers,jr.DataType.Wrong)}`}return b.nil}function a(){if(n.validateSchema){let i=e.scopeValue("validate$data",{ref:n.validateSchema});return b._`!${i}(${t})`}return b.nil}}subschema(e,t){let r=Wn.getSubschema(this.it,e);Wn.extendSubschemaData(r,this.it,e),Wn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return qk(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Le.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Le.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,b.Name)),!0}}qp.KeywordCxt=au;function Ip(e,t,r,n){let s=new au(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Lt.funcKeywordCode(s,r);else if("macro"in r)Lt.macroKeywordCode(s,r);else if(r.compile||r.validate)Lt.funcKeywordCode(s,r)}var Xk=/^\/(?:[^~]|~0|~1)*$/,Jk=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!Xk.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=Jk.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=t)throw Error(c("property/index",l));return n[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!s)return o}let a=o,i=s.split("/");for(let u of i)if(u)o=b._`${o}${b.getProperty(Le.unescapeJsonPointer(u))}`,a=b._`${a} && ${o}`;return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}qp.getData=jp});var ha=g(function(Lp){Object.defineProperty(Lp,"__esModule",{value:!0});class Mp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Lp.default=Mp});var to=g(function(Fp){Object.defineProperty(Fp,"__esModule",{value:!0});var Xn=Zs();class Up extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Xn.resolveUrl(e,t,r),this.missingSchema=Xn.normalizeId(Xn.getFullPath(e,this.missingRef))}}Fp.default=Up});var no=g(function(Gp){Object.defineProperty(Gp,"__esModule",{value:!0});Gp.resolveSchema=Gp.getCompilingSchema=Gp.resolveRef=Gp.compileSchema=Gp.SchemaEnv=void 0;var xe=Y(),rT=ha(),kn=pt(),Re=Zs(),ga=re(),Vp=eo();class ro{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Re.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}Gp.SchemaEnv=ro;function cu(e){let t=zp.call(this,e);if(t)return t;let r=Re.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new xe.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;if(e.$async)i=a.scopeValue("Error",{ref:rT.default,code:xe._`require("ajv/dist/runtime/validation_error").default`});let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:kn.default.data,parentData:kn.default.parentData,parentDataProperty:kn.default.parentDataProperty,dataNames:[kn.default.data],dataPathArr:[xe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:xe.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:xe.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:xe._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),Vp.validateFunctionCode(u),a.optimize(this.opts.code.optimize);let d=a.toString();if(l=`${a.scopeRefs(kn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let f=Function(`${kn.default.self}`,`${kn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:d,scopeValues:a._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(f.evaluated={props:p instanceof xe.Name?void 0:p,items:h instanceof xe.Name?void 0:h,dynamicProps:p instanceof xe.Name,dynamicItems:h instanceof xe.Name},f.source)f.source.evaluated=xe.stringify(f.evaluated)}return e.validate=f,e}catch(d){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}Gp.compileSchema=cu;function nT(e,t,r){var n;r=Re.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=aT.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;if(a)o=new ro({schema:a,schemaId:i,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=sT.call(this,o)}Gp.resolveRef=nT;function sT(e){if(Re.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:cu.call(this,e)}function zp(e){for(let t of this._compilations)if(oT(t,e))return t}Gp.getCompilingSchema=zp;function oT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function aT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ya.call(this,e,t)}function ya(e,t){let r=this.opts.uriResolver.parse(t),n=Re._getFullPath(this.opts.uriResolver,r),s=Re.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return iu.call(this,r,e);let o=Re.normalizeId(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=ya.call(this,e,a);if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;return iu.call(this,r,i)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)cu.call(this,a);if(o===Re.normalizeId(t)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];if(u)s=Re.resolveUrl(this.opts.uriResolver,s,u);return new ro({schema:i,schemaId:c,root:e,baseId:s})}return iu.call(this,r,a)}Gp.resolveSchema=ya;var iT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function iu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let i of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ga.unescapeFragment(i)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!iT.has(i)&&u)t=Re.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ga.schemaHasRulesButRef(r,this.RULES)){let i=Re.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ya.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new ro({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Hp=g(function(k4,fT){fT.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var lu=g(function(T4,Xp){var pT=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Wp=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function uu(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var mT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Bp(e){return e.length=0,!0}function hT(e,t,r){if(e.length){let n=uu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function gT(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,a=!1,i=hT;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)a=!0;if(!i(s,n,r))break;if(++t>7){r.error=!0;break}if(c>0&&e[c-1]===":")o=!0;n.push(":");continue}else if(u==="%"){if(!i(s,n,r))break;i=Bp}else{s.push(u);continue}}if(s.length)if(i===Bp)r.zone=s.join("");else if(a)n.push(s.join(""));else n.push(uu(s));return r.address=n.join(""),r}function Yp(e){if(yT(e,":")<2)return{host:e,isIPV6:!1};let t=gT(e);if(!t.error){let{address:r,address:n}=t;if(t.zone)r+="%"+t.zone,n+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:n}}else return{host:e,isIPV6:!1}}function yT(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function _T(e){let t=e,r=[],n=-1,s=0;while(s=t.length){if(s===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(s===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(s===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function vT(e,t){let r=t!==!0?escape:unescape;if(e.scheme!==void 0)e.scheme=r(e.scheme);if(e.userinfo!==void 0)e.userinfo=r(e.userinfo);if(e.host!==void 0)e.host=r(e.host);if(e.path!==void 0)e.path=r(e.path);if(e.query!==void 0)e.query=r(e.query);if(e.fragment!==void 0)e.fragment=r(e.fragment);return e}function bT(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!Wp(r)){let n=Yp(r);if(n.isIPV6===!0)r=`[${n.escapedHost}]`;else r=e.host}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}Xp.exports={nonSimpleDomain:mT,recomposeAuthority:bT,normalizeComponentEncoding:vT,removeDotSegments:_T,isIPv4:Wp,isUUID:pT,normalizeIPv6:Yp,stringArrayToHexStripped:uu}});var tm=g(function(A4,em){var{isUUID:wT}=lu(),$T=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ET=["http","https","ws","wss","urn","urn:uuid"];function ST(e){return ET.indexOf(e)!==-1}function du(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function Jp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Qp(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function xT(e){return e.secure=du(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function RT(e){if(e.port===(du(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function kT(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match($T);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,o=fu(s);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function TT(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=fu(s);if(o)e=o.serialize(e,t);let a=e,i=e.nss;return a.path=`${n||t.nid}:${i}`,t.skipEscape=!0,a}function AT(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!wT(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function OT(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Zp={scheme:"http",domainHost:!0,parse:Jp,serialize:Qp},NT={scheme:"https",domainHost:Zp.domainHost,parse:Jp,serialize:Qp},_a={scheme:"ws",domainHost:!0,parse:xT,serialize:RT},PT={scheme:"wss",domainHost:_a.domainHost,parse:_a.parse,serialize:_a.serialize},CT={scheme:"urn",parse:kT,serialize:TT,skipNormalize:!0},IT={scheme:"urn:uuid",parse:AT,serialize:OT,skipNormalize:!0},va={http:Zp,https:NT,ws:_a,wss:PT,urn:CT,"urn:uuid":IT};Object.setPrototypeOf(va,null);function fu(e){return e&&(va[e]||va[e.toLowerCase()])||void 0}em.exports={wsIsSecure:du,SCHEMES:va,isValidSchemeName:ST,getSchemeHandler:fu}});var mu=g(function(O4,wa){var{normalizeIPv6:jT,removeDotSegments:so,recomposeAuthority:qT,normalizeComponentEncoding:ba,isIPv4:DT,nonSimpleDomain:MT}=lu(),{SCHEMES:LT,getSchemeHandler:rm}=tm();function UT(e,t){if(typeof e==="string")e=Ut(yr(e,t),t);else if(typeof e==="object")e=yr(Ut(e,t),t);return e}function FT(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=nm(yr(e,n),yr(t,n),n,!0);return n.skipEscape=!0,Ut(s,n)}function nm(e,t,r,n){let s={};if(!n)e=yr(Ut(e,r),r),t=yr(Ut(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=so(t.path||""),s.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=so(t.path||""),s.query=t.query;else{if(!t.path)if(s.path=e.path,t.query!==void 0)s.query=t.query;else s.query=e.query;else{if(t.path[0]==="/")s.path=so(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)s.path="/"+t.path;else if(!e.path)s.path=t.path;else s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;s.path=so(s.path)}s.query=t.query}s.userinfo=e.userinfo,s.host=e.host,s.port=e.port}s.scheme=e.scheme}return s.fragment=t.fragment,s}function VT(e,t,r){if(typeof e==="string")e=unescape(e),e=Ut(ba(yr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Ut(ba(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Ut(ba(yr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Ut(ba(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Ut(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=rm(n.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,n);if(r.path!==void 0)if(!n.skipEscape){if(r.path=escape(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=unescape(r.path);if(n.reference!=="suffix"&&r.scheme)s.push(r.scheme,":");let a=qT(r);if(a!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(a),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let i=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))i=so(i);if(a===void 0&&i[0]==="/"&&i[1]==="/")i="/%2F"+i.slice(2);s.push(i)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var zT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let o=e.match(zT);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port))n.port=o[5];if(n.host)if(DT(n.host)===!1){let c=jT(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let a=rm(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)){if(n.host&&(r.domainHost||a&&a.domainHost)&&s===!1&&MT(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i}}if(!a||a&&!a.skipNormalize){if(e.indexOf("%")!==-1){if(n.scheme!==void 0)n.scheme=unescape(n.scheme);if(n.host!==void 0)n.host=unescape(n.host)}if(n.path)n.path=escape(unescape(n.path));if(n.fragment)n.fragment=encodeURI(decodeURIComponent(n.fragment))}if(a&&a.parse)a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var pu={SCHEMES:LT,normalize:UT,resolve:FT,resolveComponent:nm,equal:VT,serialize:Ut,parse:yr};wa.exports=pu;wa.exports.default=pu;wa.exports.fastUri=pu});var am=g(function(om){Object.defineProperty(om,"__esModule",{value:!0});var sm=mu();sm.code='require("ajv/dist/runtime/uri").default';om.default=sm});var gm=g(function(_r){Object.defineProperty(_r,"__esModule",{value:!0});_r.CodeGen=_r.Name=_r.nil=_r.stringify=_r.str=_r._=_r.KeywordCxt=void 0;var KT=eo();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return KT.KeywordCxt}});var Qn=Y();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Qn._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Qn.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Qn.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Qn.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Qn.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Qn.CodeGen}});var HT=ha(),dm=to(),fm=Xc(),Ft=no(),pm=Y(),Vt=Zs(),qr=Js(),Jn=re(),im=Hp(),BT=am(),mm=(e,t)=>new RegExp(e,t);mm.code="new RegExp";var WT=["removeAdditional","useDefaults","coerceTypes"],YT=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XT={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},JT={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},cm=200;function QT(e){var t,r,n,s,o,a,i,c,u,l,d,m,f,p,h,y,v,A,k,M,S,$e,je,kr,It;let Ve=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,hr=xt===!0||xt===void 0?1:xt||0,wn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:mm,Ln=(s=e.uriResolver)!==null&&s!==void 0?s:BT.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Ve)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:Ve)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ve)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&m!==void 0?m:"log",strictRequired:(p=(f=e.strictRequired)!==null&&f!==void 0?f:Ve)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:hr,regExp:wn}:{optimize:hr,regExp:wn},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:cm,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:cm,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(A=e.messages)!==null&&A!==void 0?A:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:($e=e.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(je=e.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(kr=e.unicodeRegExp)!==null&&kr!==void 0?kr:!0,int32range:(It=e.int32range)!==null&&It!==void 0?It:!0,uriResolver:Ln}}class $a{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...QT(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new pm.ValueScope({scope:{},prefixes:YT,es5:t,lines:r}),this.logger=sA(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=fm.getRules(),um.call(this,XT,e,"NOT SUPPORTED"),um.call(this,JT,e,"DEPRECATED","warn"),this._metaOpts=rA.call(this),e.formats)eA.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)tA.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);ZT.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=im;if(r==="id")n={...im},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof dm.default))throw l;return a.call(this,l),await i.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function i(u){let l=await c.call(this,u);if(!this.refs[u])await s.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=Vt.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=lm.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ft.SchemaEnv({schema:{},schemaId:r});if(t=Ft.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=lm.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=Vt.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(aA.call(this,r,t),!t)return Jn.eachItem(r,(s)=>hu.call(this,s)),this;cA.call(this,t);let n={...t,type:qr.getJSONTypes(t.type),schemaType:qr.getJSONTypes(t.schemaType)};return Jn.eachItem(r,n.type.length===0?(s)=>hu.call(this,s,n):(s)=>n.type.forEach((o)=>hu.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let i=r[a];if(typeof i!="object")continue;let{$data:c}=i.definition,u=o[a];if(c&&u)o[a]=hm(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let i=this._cache.get(e);if(i!==void 0)return i;r=Vt.normalizeId(o||r);let c=Vt.getSchemaRefs.call(this,e,r);if(i=new Ft.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(n)this.validateSchema(e,!0);return i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Ft.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Ft.compileSchema.call(this,e)}finally{this.opts=t}}}$a.ValidationError=HT.default;$a.MissingRefError=dm.default;_r.default=$a;function um(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function lm(e){return e=Vt.normalizeId(e),this.schemas[e]||this.refs[e]}function ZT(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function eA(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function tA(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function rA(){let e={...this.opts};for(let t of WT)delete e[t];return e}var nA={log(){},warn(){},error(){}};function sA(e){if(e===!1)return nA;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var oA=/^[a-z_$][a-z0-9_$:-]*$/i;function aA(e,t){let{RULES:r}=this;if(Jn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!oA.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function hu(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=s?o.post:o.rules.find(({type:c})=>c===r);if(!a)a={type:r,rules:[]},o.rules.push(a);if(o.keywords[e]=!0,!t)return;let i={keyword:e,definition:{...t,type:qr.getJSONTypes(t.type),schemaType:qr.getJSONTypes(t.schemaType)}};if(t.before)iA.call(this,a,i,t.before);else a.rules.push(i);o.all[e]=i,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function iA(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function cA(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hm(t);e.validateSchema=this.compile(t,!0)}var uA={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hm(e){return{anyOf:[e,uA]}}});var _m=g(function(ym){Object.defineProperty(ym,"__esModule",{value:!0});var fA={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ym.default=fA});var Ra=g(function(bm){Object.defineProperty(bm,"__esModule",{value:!0});bm.callRef=bm.getValidate=void 0;var mA=to(),Sa=ht(),me=Y(),Zn=pt(),xa=no(),Dr=re(),hA={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=xa.resolveRef.call(c,u,s,r);if(l===void 0)throw new mA.default(n.opts.uriResolver,s,r);if(l instanceof xa.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return Ea(e,a,o,o.$async);let p=t.scopeValue("root",{ref:u});return Ea(e,me._`${p}.validate`,u,u.$async)}function m(p){let h=vm(e,p);Ea(e,h,p,p.$async)}function f(p){let h=t.scopeValue("schema",i.code.source===!0?{ref:p,code:me.stringify(p)}:{ref:p}),y=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:me.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function vm(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):me._`${r.scopeValue("wrapper",{ref:t})}.validate`}bm.getValidate=vm;function Ea(e,t,r,n){let{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?Zn.default.this:me.nil;if(n)l();else d();function l(){if(!i.$async)throw Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{if(s.code(me._`await ${Sa.callValidateCode(e,t,u)}`),f(t),!a)s.assign(p,!0)},(h)=>{if(s.if(me._`!(${h} instanceof ${o.ValidationError})`,()=>s.throw(h)),m(h),!a)s.assign(p,!1)}),e.ok(p)}function d(){e.result(Sa.callValidateCode(e,t,u),()=>f(t),()=>m(t))}function m(p){let h=me._`${p}.errors`;s.assign(Zn.default.vErrors,me._`${Zn.default.vErrors} === null ? ${h} : ${Zn.default.vErrors}.concat(${h})`),s.assign(Zn.default.errors,me._`${Zn.default.vErrors}.length`)}function f(p){var h;if(!o.opts.unevaluated)return;let y=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=Dr.mergeEvaluated.props(s,y.props,o.props)}else{let v=s.var("props",me._`${p}.evaluated.props`);o.props=Dr.mergeEvaluated.props(s,v,o.props,me.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=Dr.mergeEvaluated.items(s,y.items,o.items)}else{let v=s.var("items",me._`${p}.evaluated.items`);o.items=Dr.mergeEvaluated.items(s,v,o.items,me.Name)}}}bm.callRef=Ea;bm.default=hA});var Em=g(function($m){Object.defineProperty($m,"__esModule",{value:!0});var _A=_m(),vA=Ra(),bA=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_A.default,vA.default];$m.default=bA});var xm=g(function(Sm){Object.defineProperty(Sm,"__esModule",{value:!0});var Lr=Y(),Mr=Lr.operators,ka={maximum:{okStr:"<=",ok:Mr.LTE,fail:Mr.GT},minimum:{okStr:">=",ok:Mr.GTE,fail:Mr.LT},exclusiveMaximum:{okStr:"<",ok:Mr.LT,fail:Mr.GTE},exclusiveMinimum:{okStr:">",ok:Mr.GT,fail:Mr.LTE}},$A={message:({keyword:e,schemaCode:t})=>Lr.str`must be ${ka[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Lr._`{comparison: ${ka[e].okStr}, limit: ${t}}`},EA={keyword:Object.keys(ka),type:"number",schemaType:"number",$data:!0,error:$A,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Lr._`${r} ${ka[t].fail} ${n} || isNaN(${r})`)}};Sm.default=EA});var km=g(function(Rm){Object.defineProperty(Rm,"__esModule",{value:!0});var zt=Y(),xA={message:({schemaCode:e})=>zt.str`must be multiple of ${e}`,params:({schemaCode:e})=>zt._`{multipleOf: ${e}}`},RA={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:xA,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?zt._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:zt._`${a} !== parseInt(${a})`;e.fail$data(zt._`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Rm.default=RA});var Om=g(function(Am){Object.defineProperty(Am,"__esModule",{value:!0});function Tm(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}Am.default=Tm;Tm.code='require("ajv/dist/runtime/ucs2length").default'});var Cm=g(function(Pm){Object.defineProperty(Pm,"__esModule",{value:!0});var nt=Y(),Nm=re(),AA=Om(),OA={message({keyword:e,schemaCode:t}){return nt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>nt._`{limit: ${e}}`},NA={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:OA,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?nt.operators.GT:nt.operators.LT,a=s.opts.unicode===!1?nt._`${r}.length`:nt._`${Nm.useFunc(e.gen,AA.default)}(${r})`;e.fail$data(nt._`${a} ${o} ${n}`)}};Pm.default=NA});var qm=g(function(jm){Object.defineProperty(jm,"__esModule",{value:!0});var Im=ht(),Ur=Y(),CA={message:({schemaCode:e})=>Ur.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ur._`{pattern: ${e}}`},IA={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:CA,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"",i=r?Ur._`(new RegExp(${s}, ${a}))`:Im.usePattern(e,n);e.fail$data(Ur._`!${i}.test(${t})`)}};jm.default=IA});var Mm=g(function(Dm){Object.defineProperty(Dm,"__esModule",{value:!0});var Gt=Y(),qA={message({keyword:e,schemaCode:t}){return Gt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Gt._`{limit: ${e}}`},DA={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qA,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Gt.operators.GT:Gt.operators.LT;e.fail$data(Gt._`Object.keys(${r}).length ${s} ${n}`)}};Dm.default=DA});var Fm=g(function(Um){Object.defineProperty(Um,"__esModule",{value:!0});var Kt=ht(),Ht=Y(),Lm=re(),LA={message:({params:{missingProperty:e}})=>Ht.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Ht._`{missingProperty: ${e}}`},UA={keyword:"required",type:"object",schemaType:"array",$data:!0,error:LA,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors)u();else l();if(i.strictRequired){let f=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((f===null||f===void 0?void 0:f[h])===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;Lm.checkStrictMode(a,v,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Ht.nil,d);else for(let f of r)Kt.checkReportMissingProp(e,f)}function l(){let f=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>m(f,p)),e.ok(p)}else t.if(Kt.checkMissingProp(e,r,f)),Kt.reportMissingProp(e,f),t.else()}function d(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Kt.noPropertyInData(t,s,f,i.ownProperties),()=>e.error())})}function m(f,p){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(p,Kt.propertyInData(t,s,f,i.ownProperties)),t.if(Ht.not(p),()=>{e.error(),t.break()})},Ht.nil)}}};Um.default=UA});var zm=g(function(Vm){Object.defineProperty(Vm,"__esModule",{value:!0});var Bt=Y(),VA={message({keyword:e,schemaCode:t}){return Bt.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Bt._`{limit: ${e}}`},zA={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:VA,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Bt.operators.GT:Bt.operators.LT;e.fail$data(Bt._`${r}.length ${s} ${n}`)}};Vm.default=zA});var Ta=g(function(Km){Object.defineProperty(Km,"__esModule",{value:!0});var Gm=Qs();Gm.code='require("ajv/dist/runtime/equal").default';Km.default=Gm});var Wm=g(function(Bm){Object.defineProperty(Bm,"__esModule",{value:!0});var es=Js(),oe=Y(),Hm=re(),HA=Ta(),BA={message:({params:{i:e,j:t}})=>oe.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>oe._`{i: ${e}, j: ${t}}`},WA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:BA,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?es.getSchemaTypes(o.items):[];e.block$data(c,l,oe._`${a} === false`),e.ok(c);function l(){let p=t.let("i",oe._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(oe._`${p} > 1`,()=>(d()?m:f)(p,h))}function d(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function m(p,h){let y=t.name("item"),v=es.checkDataTypes(u,y,i.opts.strictNumbers,es.DataType.Wrong),A=t.const("indices",oe._`{}`);t.for(oe._`;${p}--;`,()=>{if(t.let(y,oe._`${r}[${p}]`),t.if(v,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${A}[${y}] == "number"`,()=>{t.assign(h,oe._`${A}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${A}[${y}] = ${p}`)})}function f(p,h){let y=Hm.useFunc(t,HA.default),v=t.name("outer");t.label(v).for(oe._`;${p}--;`,()=>t.for(oe._`${h} = ${p}; ${h}--;`,()=>t.if(oe._`${y}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};Bm.default=WA});var Jm=g(function(Xm){Object.defineProperty(Xm,"__esModule",{value:!0});var ts=Y(),Ym=re(),XA=Ta(),JA={message:"must be equal to constant",params:({schemaCode:e})=>ts._`{allowedValue: ${e}}`},QA={keyword:"const",$data:!0,error:JA,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(ts._`!${Ym.useFunc(t,XA.default)}(${r}, ${s})`);else e.fail(ts._`${o} !== ${r}`)}};Xm.default=QA});var eh=g(function(Zm){Object.defineProperty(Zm,"__esModule",{value:!0});var Wt=Y(),Qm=re(),eO=Ta(),tO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Wt._`{allowedValues: ${e}}`},rO={keyword:"enum",schemaType:"array",$data:!0,error:tO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Qm.useFunc(t,eO.default),l;if(i||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);l=Wt.or(...s.map((p,h)=>m(f,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,(f)=>t.if(Wt._`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,p){let h=s[p];return typeof h==="object"&&h!==null?Wt._`${u()}(${r}, ${f}[${p}])`:Wt._`${r} === ${h}`}}};Zm.default=rO});var rh=g(function(th){Object.defineProperty(th,"__esModule",{value:!0});var sO=xm(),oO=km(),aO=Cm(),iO=qm(),cO=Mm(),uO=Fm(),lO=zm(),dO=Wm(),fO=Jm(),pO=eh(),mO=[sO.default,oO.default,aO.default,iO.default,cO.default,uO.default,lO.default,dO.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},fO.default,pO.default];th.default=mO});var gu=g(function(sh){Object.defineProperty(sh,"__esModule",{value:!0});sh.validateAdditionalItems=void 0;var st=Y(),rs=re(),gO={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},yO={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:gO,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){rs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}nh(e,n)}};function nh(e,t){let{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;let i=r.const("len",st._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(st._`${i} <= ${t.length}`);else if(typeof n=="object"&&!rs.alwaysValidSchema(a,n)){let u=r.var("valid",st._`${i} <= ${t.length}`);r.if(st.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:rs.Type.Num},u),!a.allErrors)r.if(st.not(u),()=>r.break())})}}sh.validateAdditionalItems=nh;sh.default=yO});var yu=g(function(ch){Object.defineProperty(ch,"__esModule",{value:!0});ch.validateTuple=void 0;var Aa=Y(),Fr=re(),ah=ht(),vO={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return ih(e,"additionalItems",t);if(r.items=!0,Fr.alwaysValidSchema(r,t))return;e.ok(ah.validateArray(e))}};function ih(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;if(l(s),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=Fr.mergeEvaluated.items(n,r.length,i.items);let c=n.name("valid"),u=n.const("len",Aa._`${o}.length`);r.forEach((d,m)=>{if(Fr.alwaysValidSchema(i,d))return;n.if(Aa._`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c)});function l(d){let{opts:m,errSchemaPath:f}=i,p=r.length,h=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Fr.checkStrictMode(i,y,m.strictTuples)}}}ch.validateTuple=ih;ch.default=vO});var fh=g(function(dh){Object.defineProperty(dh,"__esModule",{value:!0});var lh=yu(),wO={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>lh.validateTuple(e,"items")};dh.default=wO});var yh=g(function(gh){Object.defineProperty(gh,"__esModule",{value:!0});var Oa=Y(),ph=re(),mh=ht(),hh=gu(),EO={message:({params:{len:e}})=>Oa.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Oa._`{limit: ${e}}`},SO={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:EO,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,ph.alwaysValidSchema(n,t))return;if(s)hh.validateAdditionalItems(e,s);else e.ok(mh.validateArray(e))}};gh.default=SO});var vh=g(function(_h){Object.defineProperty(_h,"__esModule",{value:!0});var _e=Y(),Vr=re(),RO={message:({params:{min:e,max:t}})=>t===void 0?_e.str`must contain at least ${e} valid item(s)`:_e.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?_e._`{minContains: ${e}}`:_e._`{minContains: ${e}, maxContains: ${t}}`},kO={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:RO,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,a,i,{minContains:c,maxContains:u}=n;if(o.opts.next)a=c===void 0?1:c,i=u;else a=1;let l=t.const("len",_e._`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){Vr.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){Vr.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Vr.alwaysValidSchema(o,r)){let h=_e._`${l} >= ${a}`;if(i!==void 0)h=_e._`${h} && ${l} <= ${i}`;e.pass(h);return}o.items=!0;let d=t.name("valid");if(i===void 0&&a===1)f(d,()=>t.if(d,()=>t.break()));else if(a===0){if(t.let(d,!0),i!==void 0)t.if(_e._`${s}.length > 0`,m)}else t.let(d,!1),m();e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);f(h,()=>t.if(h,()=>p(y)))}function f(h,y){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:Vr.Type.Num,compositeRule:!0},h),y()})}function p(h){if(t.code(_e._`${h}++`),i===void 0)t.if(_e._`${h} >= ${a}`,()=>t.assign(d,!0).break());else if(t.if(_e._`${h} > ${i}`,()=>t.assign(d,!1).break()),a===1)t.assign(d,!0);else t.if(_e._`${h} >= ${a}`,()=>t.assign(d,!0))}}};_h.default=kO});var Na=g(function(Eh){Object.defineProperty(Eh,"__esModule",{value:!0});Eh.validateSchemaDeps=Eh.validatePropertyDeps=Eh.error=void 0;var ns=Y(),bh=re(),Yt=ht();Eh.error={message:({params:{property:e,depsCount:t,deps:r}})=>ns.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>ns._`{property: ${e},
|
|
8
8
|
missingProperty: ${n},
|
|
9
9
|
depsCount: ${t},
|
|
10
|
-
deps: ${r}}`};var TO={keyword:"dependencies",type:"object",schemaType:"object",error:Eh.error,code(e){let[t,r]=AO(e);wh(e,t),$h(e,r)}};function AO({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function wh(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let i=t[a];if(i.length===0)continue;let c=Yt.propertyInData(r,n,a,s.opts.ownProperties);if(e.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of i)Yt.checkReportMissingProp(e,u)});else r.if(ns._`${c} && (${Yt.checkMissingProp(e,i,o)})`),Yt.reportMissingProp(e,o),r.else()}}Eh.validatePropertyDeps=wh;function $h(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,a=r.name("valid");for(let i in t){if(bh.alwaysValidSchema(o,t[i]))continue;r.if(Yt.propertyInData(r,n,i,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:i},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a)}}Eh.validateSchemaDeps=$h;Eh.default=TO});var Th=g(function(kh){Object.defineProperty(kh,"__esModule",{value:!0});var Pa=Y(),Rh=re(),PO={message:"property name must be valid",params:({params:e})=>Pa._`{propertyName: ${e.propertyName}}`},IO={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:PO,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(Rh.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(a)=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if(Pa.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};kh.default=IO});var _u=g(function(Ah){Object.defineProperty(Ah,"__esModule",{value:!0});var zr=ht(),ke=Y(),jO=pt(),Gr=re(),qO={message:"must NOT have additional properties",params:({params:e})=>ke._`{additionalProperty: ${e.additionalProperty}}`},DO={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qO,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&Gr.alwaysValidSchema(a,r))return;let u=zr.allSchemaProperties(n.properties),l=zr.allSchemaProperties(n.patternProperties);d(),e.ok(ke._`${o} === ${jO.default.errors}`);function d(){t.forIn("key",s,(y)=>{if(!u.length&&!l.length)p(y);else t.if(m(y),()=>p(y))})}function m(y){let v;if(u.length>8){let A=Gr.schemaRefOrVal(a,n.properties,"properties");v=zr.isOwnProperty(t,A,y)}else if(u.length)v=ke.or(...u.map((A)=>ke._`${y} === ${A}`));else v=ke.nil;if(l.length)v=ke.or(v,...l.map((A)=>ke._`${zr.usePattern(e,A)}.test(${y})`));return ke.not(v)}function f(y){t.code(ke._`delete ${s}[${y}]`)}function p(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!i)t.break();return}if(typeof r=="object"&&!Gr.alwaysValidSchema(a,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(y,v,!1),t.if(ke.not(v),()=>{e.reset(),f(y)});else if(h(y,v),!i)t.if(ke.not(v),()=>t.break())}}function h(y,v,A){let k={keyword:"additionalProperties",dataProp:y,dataPropType:Gr.Type.Str};if(A===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,v)}}};Ah.default=DO});var Ih=g(function(Ph){Object.defineProperty(Ph,"__esModule",{value:!0});var Nh=eo(),Ia=ht(),ss=re(),Oh=_u(),LO={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Oh.default.code(new Nh.KeywordCxt(o,Oh.default,"additionalProperties"));let a=Ia.allSchemaProperties(r);for(let d of a)o.definedProperties.add(d);if(o.opts.unevaluated&&a.length&&o.props!==!0)o.props=ss.mergeEvaluated.props(t,ss.toHash(a),o.props);let i=a.filter((d)=>!ss.alwaysValidSchema(o,r[d]));if(i.length===0)return;let c=t.name("valid");for(let d of i){if(u(d))l(d);else{if(t.if(Ia.propertyInData(t,s,d,o.opts.ownProperties)),l(d),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Ph.default=LO});var jh=g(function(Ch){Object.defineProperty(Ch,"__esModule",{value:!0});var Ca=ht(),Kr=Y(),ja=re(),qa=re(),FO={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=Ca.allSchemaProperties(r),c=i.filter((h)=>ja.alwaysValidSchema(o,r[h]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof Kr.Name))o.props=qa.evaluatedPropsToName(t,o.props);let{props:d}=o;m();function m(){for(let h of i){if(u)f(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function f(h){for(let y in u)if(new RegExp(h).test(y))ja.checkStrictMode(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",n,(y)=>{t.if(Kr._`${Ca.usePattern(e,h)}.test(${y})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:qa.Type.Str},l);if(o.opts.unevaluated&&d!==!0)t.assign(Kr._`${d}[${y}]`,!0);else if(!v&&!o.allErrors)t.if(Kr.not(l),()=>t.break())})})}}};Ch.default=FO});var Mh=g(function(Dh){Object.defineProperty(Dh,"__esModule",{value:!0});var qh=re(),zO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(qh.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Dh.default=zO});var Fh=g(function(Uh){Object.defineProperty(Uh,"__esModule",{value:!0});var Lh=ht(),KO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lh.validateUnion,error:{message:"must match a schema in anyOf"}};Uh.default=KO});var Gh=g(function(zh){Object.defineProperty(zh,"__esModule",{value:!0});var Hr=Y(),Vh=re(),BO={message:"must match exactly one schema in oneOf",params:({params:e})=>Hr._`{passingSchemas: ${e.passing}}`},WO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:BO,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;if(Vh.alwaysValidSchema(s,l))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(Hr._`${c} && ${a}`).assign(a,!1).assign(i,Hr._`[${i}, ${d}]`).else();t.if(c,()=>{if(t.assign(a,!0),t.assign(i,d),m)e.mergeEvaluated(m,Hr.Name)})})}}};zh.default=WO});var Bh=g(function(Hh){Object.defineProperty(Hh,"__esModule",{value:!0});var Kh=re(),XO={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,a)=>{if(Kh.alwaysValidSchema(n,o))return;let i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};Hh.default=XO});var Xh=g(function(Yh){Object.defineProperty(Yh,"__esModule",{value:!0});var Br=Y(),Da=re(),QO={message:({params:e})=>Br.str`must match "${e.ifClause}" schema`,params:({params:e})=>Br._`{failingKeyword: ${e.ifClause}}`},ZO={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:QO,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Da.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Wh(n,"then"),o=Wh(n,"else");if(!s&&!o)return;let a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(i,u("then",l),u("else",l))}else if(s)t.if(i,u("then"));else t.if(Br.not(i),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},i);if(t.assign(a,i),e.mergeValidEvaluated(m,a),d)t.assign(d,Br._`${l}`);else e.setParams({ifClause:l})}}}};function Wh(e,t){let r=e.schema[t];return r!==void 0&&!Da.alwaysValidSchema(e,r)}Yh.default=ZO});var Zh=g(function(Qh){Object.defineProperty(Qh,"__esModule",{value:!0});var Jh=re(),tN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Jh.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Qh.default=tN});var tg=g(function(eg){Object.defineProperty(eg,"__esModule",{value:!0});var nN=gu(),sN=fh(),oN=yu(),aN=yh(),iN=vh(),cN=Na(),uN=Th(),lN=_u(),dN=Ih(),fN=jh(),pN=Mh(),mN=Fh(),hN=Gh(),gN=Bh(),yN=Xh(),_N=Zh();function vN(e=!1){let t=[pN.default,mN.default,hN.default,gN.default,yN.default,_N.default,uN.default,lN.default,cN.default,dN.default,fN.default];if(e)t.push(sN.default,aN.default);else t.push(nN.default,oN.default);return t.push(iN.default),t}eg.default=vN});var vu=g(function(sg){Object.defineProperty(sg,"__esModule",{value:!0});sg.dynamicAnchor=void 0;var os=Y(),wN=pt(),Ma=no(),rg=Ra(),$N={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>ng(e,e.schema)};function ng(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=os._`${wN.default.dynamicAnchors}${os.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:EN(e);r.if(os._`!${s}`,()=>r.assign(s,o))}sg.dynamicAnchor=ng;function EN(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:a,meta:i}=t.root,{schemaId:c}=n.opts,u=new Ma.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:a,meta:i});return Ma.compileSchema.call(n,u),rg.getValidate(e,u)}sg.default=$N});var bu=g(function(ig){Object.defineProperty(ig,"__esModule",{value:!0});ig.dynamicRef=void 0;var La=Y(),xN=pt(),Ua=Ra(),RN={keyword:"$dynamicRef",schemaType:"string",code:(e)=>ag(e,e.schema)};function ag(e,t){let{gen:r,keyword:n,it:s}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let o=t.slice(1);if(s.allErrors)a();else{let c=r.let("valid",!1);a(c),e.ok(c)}function a(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",La._`${xN.default.dynamicAnchors}${La.getProperty(o)}`);r.if(u,i(u,c),i(s.validateName,c))}else i(s.validateName,c)()}function i(c,u){return u?()=>r.block(()=>{Ua.callRef(e,c),r.let(u,!0)}):()=>Ua.callRef(e,c)}}ig.dynamicRef=ag;ig.default=RN});var fg=g(function(dg){Object.defineProperty(dg,"__esModule",{value:!0});var ug=vu(),lg=re(),TN={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)ug.dynamicAnchor(e,"");else lg.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};dg.default=TN});var hg=g(function(mg){Object.defineProperty(mg,"__esModule",{value:!0});var pg=bu(),ON={keyword:"$recursiveRef",schemaType:"string",code:(e)=>pg.dynamicRef(e,e.schema)};mg.default=ON});var yg=g(function(gg){Object.defineProperty(gg,"__esModule",{value:!0});var PN=vu(),IN=bu(),CN=fg(),jN=hg(),qN=[PN.default,IN.default,CN.default,jN.default];gg.default=qN});var vg=g(function(_g){Object.defineProperty(_g,"__esModule",{value:!0});var Fa=Na(),MN={keyword:"dependentRequired",type:"object",schemaType:"object",error:Fa.error,code:(e)=>Fa.validatePropertyDeps(e)};_g.default=MN});var $g=g(function(wg){Object.defineProperty(wg,"__esModule",{value:!0});var bg=Na(),UN={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>bg.validateSchemaDeps(e)};wg.default=UN});var xg=g(function(Sg){Object.defineProperty(Sg,"__esModule",{value:!0});var Eg=re(),VN={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)Eg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};Sg.default=VN});var kg=g(function(Rg){Object.defineProperty(Rg,"__esModule",{value:!0});var GN=vg(),KN=$g(),HN=xg(),BN=[GN.default,KN.default,HN.default];Rg.default=BN});var Ag=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ke=Y(),Va=re(),YN=pt(),XN={message:"must NOT have unevaluated properties",params:({params:e})=>Ke._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},JN={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:XN,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,props:i}=o;if(i instanceof Ke.Name)t.if(Ke._`${i} !== true`,()=>t.forIn("key",n,(d)=>t.if(u(i,d),()=>c(d))));else if(i!==!0)t.forIn("key",n,(d)=>i===void 0?c(d):t.if(l(i,d),()=>c(d)));o.props=!0,e.ok(Ke._`${s} === ${YN.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!a)t.break();return}if(!Va.alwaysValidSchema(o,r)){let m=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:Va.Type.Str},m),!a)t.if(Ke.not(m),()=>t.break())}}function u(d,m){return Ke._`!${d} || !${d}[${m}]`}function l(d,m){let f=[];for(let p in d)if(d[p]===!0)f.push(Ke._`${m} !== ${p}`);return Ke.and(...f)}}};Tg.default=JN});var Ng=g(function(Og){Object.defineProperty(Og,"__esModule",{value:!0});var ot=Y(),za=re(),ZN={message:({params:{len:e}})=>ot.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ot._`{limit: ${e}}`},eP={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:ZN,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let a=t.const("len",ot._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(ot._`${a} > ${o}`);else if(typeof r=="object"&&!za.alwaysValidSchema(s,r)){let c=t.var("valid",ot._`${a} <= ${o}`);t.if(ot.not(c),()=>i(c,o)),e.ok(c)}s.items=!0;function i(c,u){t.forRange("i",u,a,(l)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:za.Type.Num},c),!s.allErrors)t.if(ot.not(c),()=>t.break())})}}};Og.default=eP});var Ig=g(function(Pg){Object.defineProperty(Pg,"__esModule",{value:!0});var rP=Ag(),nP=Ng(),sP=[rP.default,nP.default];Pg.default=sP});var jg=g(function(Cg){Object.defineProperty(Cg,"__esModule",{value:!0});var X=Y(),aP={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},iP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aP,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;if(s)m();else f();function m(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",X._`${p}[${a}]`),y=r.let("fType"),v=r.let("format");r.if(X._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,X._`${h}.type || "string"`).assign(v,X._`${h}.validate`),()=>r.assign(y,X._`"string"`).assign(v,h)),e.fail$data(X.or(A(),k()));function A(){if(c.strictSchema===!1)return X.nil;return X._`${a} && !${v}`}function k(){let M=l.$async?X._`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:X._`${v}(${n})`,S=X._`(typeof ${v} == "function" ? ${M} : ${v}.test(${n}))`;return X._`${v} && ${v} !== true && ${y} === ${t} && !${S}`}}function f(){let p=d.formats[o];if(!p){A();return}if(p===!0)return;let[h,y,v]=k(p);if(h===t)e.pass(M());function A(){if(c.strictSchema===!1){d.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let $e=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,je=r.scopeValue("formats",{key:o,ref:S,code:$e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${je}.validate`];return["string",S,je]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return X._`await ${v}(${n})`}return typeof y=="function"?X._`${v}(${n})`:X._`${v}.test(${n})`}}}};Cg.default=iP});var Dg=g(function(qg){Object.defineProperty(qg,"__esModule",{value:!0});var uP=jg(),lP=[uP.default];qg.default=lP});var Ug=g(function(Mg){Object.defineProperty(Mg,"__esModule",{value:!0});Mg.contentVocabulary=Mg.metadataVocabulary=void 0;Mg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Vg=g(function(Fg){Object.defineProperty(Fg,"__esModule",{value:!0});var pP=Em(),mP=rh(),hP=tg(),gP=yg(),yP=kg(),_P=Ig(),vP=Dg(),Ga=Ug(),bP=[gP.default,pP.default,mP.default,(0,hP.default)(!0),vP.default,Ga.metadataVocabulary,Ga.contentVocabulary,yP.default,_P.default];Fg.default=bP});var Hg=g(function(Gg){Object.defineProperty(Gg,"__esModule",{value:!0});Gg.DiscrError=void 0;var zg;(function(e){e.Tag="tag",e.Mapping="mapping"})(zg||(Gg.DiscrError=zg={}))});var Yg=g(function(Wg){Object.defineProperty(Wg,"__esModule",{value:!0});var gt=Y(),as=Hg(),Ka=no(),$P=to(),Bg=re(),EP={message:({params:{discrError:e,tagName:t}})=>e===as.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>gt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},SP={keyword:"discriminator",type:"object",schemaType:"object",error:EP,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!a)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",gt._`${r}${gt.getProperty(i)}`);t.if(gt._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:as.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function l(){let f=m();t.if(!1);for(let p in f)t.elseIf(gt._`${u} === ${p}`),t.assign(c,d(f[p]));t.else(),e.error(!1,{discrError:as.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function d(f){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:f},p);return e.mergeEvaluated(h,gt.Name),p}function m(){var f;let p={},h=v(s),y=!0;for(let M=0;M<a.length;M++){let S=a[M];if((S===null||S===void 0?void 0:S.$ref)&&!Bg.schemaHasRulesButRef(S,o.self.RULES)){let je=S.$ref;if(S=Ka.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,je),S instanceof Ka.SchemaEnv)S=S.schema;if(S===void 0)throw new $P.default(o.opts.uriResolver,o.baseId,je)}let $e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[i];if(typeof $e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);y=y&&(h||v(S)),A($e,M)}if(!y)throw Error(`discriminator: "${i}" must be required`);return p;function v({required:M}){return Array.isArray(M)&&M.includes(i)}function A(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let $e of M.enum)k($e,S);else throw Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in p)throw Error(`discriminator: "${i}" values must be unique strings`);p[M]=S}}}};Wg.default=SP});var Xg=g(function(PG,RP){RP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Jg=g(function(IG,kP){kP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Qg=g(function(CG,TP){TP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Zg=g(function(jG,AP){AP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var ey=g(function(qG,OP){OP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var ty=g(function(DG,NP){NP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ry=g(function(MG,PP){PP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var ny=g(function(LG,IP){IP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var oy=g(function(sy){Object.defineProperty(sy,"__esModule",{value:!0});var CP=Xg(),jP=Jg(),qP=Qg(),DP=Zg(),MP=ey(),LP=ty(),UP=ry(),FP=ny(),VP=["/properties"];function zP(e){return[CP,jP,qP,DP,MP,t(this,LP),UP,t(this,FP)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,VP):n}}sy.default=zP});var ay=g(function(at,$u){Object.defineProperty(at,"__esModule",{value:!0});at.MissingRefError=at.ValidationError=at.CodeGen=at.Name=at.nil=at.stringify=at.str=at._=at.KeywordCxt=at.Ajv2020=void 0;var KP=gm(),HP=Vg(),BP=Yg(),WP=oy(),wu="https://json-schema.org/draft/2020-12/schema";class oo extends KP.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),HP.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(BP.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;WP.default.call(this,e),this.refs["http://json-schema.org/schema"]=wu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wu)?wu:void 0)}}at.Ajv2020=oo;$u.exports=at=oo;$u.exports.Ajv2020=oo;Object.defineProperty(at,"__esModule",{value:!0});at.default=oo;var YP=eo();Object.defineProperty(at,"KeywordCxt",{enumerable:!0,get:function(){return YP.KeywordCxt}});var is=Y();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return is._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return is.str}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return is.stringify}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return is.nil}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return is.Name}});Object.defineProperty(at,"CodeGen",{enumerable:!0,get:function(){return is.CodeGen}});var XP=ha();Object.defineProperty(at,"ValidationError",{enumerable:!0,get:function(){return XP.default}});var JP=to();Object.defineProperty(at,"MissingRefError",{enumerable:!0,get:function(){return JP.default}})});var gy=g(function(my){Object.defineProperty(my,"__esModule",{value:!0});my.formatNames=my.fastFormats=my.fullFormats=void 0;function Xt(e,t){return{validate:e,compare:t}}my.fullFormats={date:Xt(ly,Ru),time:Xt(Su(!0),ku),"date-time":Xt(iy(!0),fy),"iso-time":Xt(Su(),dy),"iso-date-time":Xt(iy(),py),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:oI,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:fI,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:aI,int32:{type:"number",validate:uI},int64:{type:"number",validate:lI},float:{type:"number",validate:uy},double:{type:"number",validate:uy},password:!0,binary:!0};my.fastFormats={...my.fullFormats,date:Xt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ru),time:Xt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ku),"date-time":Xt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,fy),"iso-time":Xt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dy),"iso-date-time":Xt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,py),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};my.formatNames=Object.keys(my.fullFormats);function eI(e){return e%4===0&&(e%100!==0||e%400===0)}var tI=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,rI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ly(e){let t=tI.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&eI(r)?29:rI[n])}function Ru(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var Eu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Su(e){return function(r){let n=Eu.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],a=+n[3],i=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||e&&!i)return!1;if(s<=23&&o<=59&&a<60)return!0;let d=o-l*c,m=s-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function ku(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function dy(e,t){if(!(e&&t))return;let r=Eu.exec(e),n=Eu.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var xu=/t|\s/i;function iy(e){let t=Su(e);return function(n){let s=n.split(xu);return s.length===2&&ly(s[0])&&t(s[1])}}function fy(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function py(e,t){if(!(e&&t))return;let[r,n]=e.split(xu),[s,o]=t.split(xu),a=Ru(r,s);if(a===void 0)return;return a||ku(n,o)}var nI=/\/|:/,sI=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function oI(e){return nI.test(e)&&sI.test(e)}var cy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function aI(e){return cy.lastIndex=0,cy.test(e)}var iI=-2147483648,cI=2147483647;function uI(e){return Number.isInteger(e)&&e<=cI&&e>=iI}function lI(e){return Number.isInteger(e)}function uy(){return!0}var dI=/[^\\]\\Z/;function fI(e){if(dI.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(vy){Object.defineProperty(vy,"__esModule",{value:!0});vy.regexpCode=vy.getEsmExportName=vy.getProperty=vy.safeStringify=vy.stringify=vy.strConcat=vy.addCodeArg=vy.str=vy._=vy.nil=vy._Code=vy.Name=vy.IDENTIFIER=vy._CodeOrName=void 0;class Ha{}vy._CodeOrName=Ha;vy.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cs extends Ha{constructor(e){super();if(!vy.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}}}vy.Name=cs;class Tt extends Ha{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof cs)t[r.str]=(t[r.str]||0)+1;return t},{})}}vy._Code=Tt;vy.nil=new Tt("");function yy(e,...t){let r=[e[0]],n=0;while(n<t.length)Ou(r,t[n]),r.push(e[++n]);return new Tt(r)}vy._=yy;var Au=new Tt("+");function _y(e,...t){let r=[ao(e[0])],n=0;while(n<t.length)r.push(Au),Ou(r,t[n]),r.push(Au,ao(e[++n]));return mI(r),new Tt(r)}vy.str=_y;function Ou(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof cs)e.push(t);else e.push(yI(t))}vy.addCodeArg=Ou;function mI(e){let t=1;while(t<e.length-1){if(e[t]===Au){let r=hI(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function hI(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof cs||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 cs))return`"${e}${t.slice(1)}`;return}function gI(e,t){return t.emptyStr()?e:e.emptyStr()?t:_y`${e}${t}`}vy.strConcat=gI;function yI(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ao(Array.isArray(e)?e.join(","):e)}function _I(e){return new Tt(ao(e))}vy.stringify=_I;function ao(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}vy.safeStringify=ao;function vI(e){return typeof e=="string"&&vy.IDENTIFIER.test(e)?new Tt(`.${e}`):yy`[${e}]`}vy.getProperty=vI;function bI(e){if(typeof e=="string"&&vy.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}vy.getEsmExportName=bI;function wI(e){return new Tt(e.toString())}vy.regexpCode=wI});var Cu=g(function(Ey){Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueScope=Ey.ValueScopeName=Ey.Scope=Ey.varKinds=Ey.UsedValueState=void 0;var he=io();class wy extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Wa;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Wa||(Ey.UsedValueState=Wa={}));Ey.varKinds={const:new he.Name("const"),let:new he.Name("let"),var:new he.Name("var")};class Pu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof he.Name?e:this.name(e)}name(e){return new he.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Ey.Scope=Pu;class Iu extends he.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=he._`.${new he.Name(t)}[${r}]`}}Ey.ValueScopeName=Iu;var CI=he._`\n`;class $y extends Pu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?CI:he.nil}}get(){return this._scope}name(e){return new Iu(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,n);let i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return he._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=he.nil;for(let o in e){let a=e[o];if(!a)continue;let i=r[o]=r[o]||new Map;a.forEach((c)=>{if(i.has(c))return;i.set(c,Wa.Started);let u=t(c);if(u){let l=this.opts.es5?Ey.varKinds.var:Ey.varKinds.const;s=he._`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=he._`${s}${u}${this.opts._n}`;else throw new wy(c);i.set(c,Wa.Completed)})}return s}}Ey.ValueScope=$y});var ee=g(function(it){Object.defineProperty(it,"__esModule",{value:!0});it.or=it.and=it.not=it.CodeGen=it.operators=it.varKinds=it.ValueScopeName=it.ValueScope=it.Scope=it.Name=it.regexpCode=it.stringify=it.getProperty=it.nil=it.strConcat=it.str=it._=void 0;var N=io(),Te=Cu(),Wr=io();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Wr._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Wr.str}});Object.defineProperty(it,"strConcat",{enumerable:!0,get:function(){return Wr.strConcat}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Wr.nil}});Object.defineProperty(it,"getProperty",{enumerable:!0,get:function(){return Wr.getProperty}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Wr.stringify}});Object.defineProperty(it,"regexpCode",{enumerable:!0,get:function(){return Wr.regexpCode}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Wr.Name}});var ei=Cu();Object.defineProperty(it,"Scope",{enumerable:!0,get:function(){return ei.Scope}});Object.defineProperty(it,"ValueScope",{enumerable:!0,get:function(){return ei.ValueScope}});Object.defineProperty(it,"ValueScopeName",{enumerable:!0,get:function(){return ei.ValueScopeName}});Object.defineProperty(it,"varKinds",{enumerable:!0,get:function(){return ei.varKinds}});it.operators={GT:new N._Code(">"),GTE:new N._Code(">="),LT:new N._Code("<"),LTE:new N._Code("<="),EQ:new N._Code("==="),NEQ:new N._Code("!=="),NOT:new N._Code("!"),OR:new N._Code("||"),AND:new N._Code("&&"),ADD:new N._Code("+")};class Yr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xy extends Yr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Te.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=ls(this.rhs,e,t);return this}get names(){return this.rhs instanceof N._CodeOrName?this.rhs.names:{}}}class Du extends Yr{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof N.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ls(this.rhs,e,t),this}get names(){let e=this.lhs instanceof N.Name?{}:{...this.lhs.names};return Za(e,this.rhs)}}class Ry extends Du{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ky extends Yr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Yr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ay extends Yr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Oy extends Yr{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=ls(this.code,e,t),this}get names(){return this.code instanceof N._CodeOrName?this.code.names:{}}}class ti extends Yr{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;MI(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Tn(e,t.names),{})}}class Xr extends ti{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ny extends ti{}class co extends Xr{}co.kind="else";class vr extends Xr{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new co(r):r}if(t){if(e===!1)return t instanceof vr?t:t.nodes;if(this.nodes.length)return this;return new vr(qy(e),t instanceof vr?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=ls(this.condition,e,t),this}get names(){let e=super.names;if(Za(e,this.condition),this.else)Tn(e,this.else.names);return e}}vr.kind="if";class us extends Xr{}us.kind="for";class Py extends us{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=ls(this.iteration,e,t),this}get names(){return Tn(super.names,this.iteration.names)}}class Iy extends us{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Te.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Za(super.names,this.from);return Za(e,this.to)}}class ju extends us{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=ls(this.iterable,e,t),this}get names(){return Tn(super.names,this.iterable.names)}}class Ya extends Xr{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Ya.kind="func";class Xa extends ti{render(e){return"return "+super.render(e)}}Xa.kind="return";class Cy extends Xr{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Tn(e,this.catch.names);if(this.finally)Tn(e,this.finally.names);return e}}class Ja extends Xr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Ja.kind="catch";class Qa extends Xr{render(e){return"finally"+super.render(e)}}Qa.kind="finally";class jy{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
11
|
-
`:""},this._extScope=e,this._scope=new Te.Scope({parent:e}),this._nodes=[new Ny]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new xy(e,s,r)),s}const(e,t,r){return this._def(Te.varKinds.const,e,t,r)}let(e,t,r){return this._def(Te.varKinds.let,e,t,r)}var(e,t,r){return this._def(Te.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Du(e,t,r))}add(e,t){return this._leafNode(new Ry(e,it.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==N.nil)this._leafNode(new Oy(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),N.addCodeArg(t,n)}return t.push("}"),new N._Code(t)}if(e,t,r){if(this._blockNode(new vr(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new vr(e))}else(){return this._elseNode(new co)}endIf(){return this._endBlockNode(vr,co)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Py(e),t)}forRange(e,t,r,n,s=this.opts.es5?Te.varKinds.var:Te.varKinds.let){let o=this._scope.toName(e);return this._for(new Iy(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Te.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof N.Name?t:this.var("_arr",t);return this.forRange("_i",0,N._`${o}.length`,(a)=>{this.var(s,N._`${o}[${a}]`),r(s)})}return this._for(new ju("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Te.varKinds.var:Te.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,N._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new ju("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(us)}label(e){return this._leafNode(new ky(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Xa;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Xa)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Cy;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Ja(s),t(s)}if(r)this._currNode=n.finally=new Qa,this.code(r);return this._endBlockNode(Ja,Qa)}throw(e){return this._leafNode(new Ay(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=N.nil,r,n){if(this._blockNode(new Ya(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Ya)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof vr))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}}it.CodeGen=jy;function Tn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Za(e,t){return t instanceof N._CodeOrName?Tn(e,t.names):e}function ls(e,t,r){if(e instanceof N.Name)return n(e);if(!s(e))return e;return new N._Code(e._items.reduce((o,a)=>{if(a instanceof N.Name)a=n(a);if(a instanceof N._Code)o.push(...a._items);else o.push(a);return o},[]));function n(o){let a=r[o.str];if(a===void 0||t[o.str]!==1)return o;return delete t[o.str],a}function s(o){return o instanceof N._Code&&o._items.some((a)=>a instanceof N.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function MI(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function qy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:N._`!${qu(e)}`}it.not=qy;var LI=Dy(it.operators.AND);function UI(...e){return e.reduce(LI)}it.and=UI;var FI=Dy(it.operators.OR);function VI(...e){return e.reduce(FI)}it.or=VI;function Dy(e){return(t,r)=>t===N.nil?r:r===N.nil?t:N._`${qu(t)} ${e} ${qu(r)}`}function qu(e){return e instanceof N.Name?e:N._`(${e})`}});var ce=g(function(By){Object.defineProperty(By,"__esModule",{value:!0});By.checkStrictMode=By.getErrorPath=By.Type=By.useFunc=By.setEvaluated=By.evaluatedPropsToName=By.mergeEvaluated=By.eachItem=By.unescapeJsonPointer=By.escapeJsonPointer=By.escapeFragment=By.unescapeFragment=By.schemaRefOrVal=By.schemaHasRulesButRef=By.schemaHasRules=By.checkUnknownRules=By.alwaysValidSchema=By.toHash=void 0;var F=ee(),Fy=io();function HI(e){let t={};for(let r of e)t[r]=!0;return t}By.toHash=HI;function BI(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Vy(e,t),!zy(t,e.self.RULES.all)}By.alwaysValidSchema=BI;function Vy(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])Hy(e,`unknown keyword: "${o}"`)}By.checkUnknownRules=Vy;function zy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}By.schemaHasRules=zy;function WI(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}By.schemaHasRulesButRef=WI;function YI({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return F._`${r}`}return F._`${e}${t}${F.getProperty(n)}`}By.schemaRefOrVal=YI;function XI(e){return Gy(decodeURIComponent(e))}By.unescapeFragment=XI;function JI(e){return encodeURIComponent(Lu(e))}By.escapeFragment=JI;function Lu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}By.escapeJsonPointer=Lu;function Gy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}By.unescapeJsonPointer=Gy;function QI(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}By.eachItem=QI;function Ly({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof F.Name?(o instanceof F.Name?e(s,o,a):t(s,o,a),a):o instanceof F.Name?(t(s,a,o),o):r(o,a);return i===F.Name&&!(c instanceof F.Name)?n(s,c):c}}By.mergeEvaluated={props:Ly({mergeNames:(e,t,r)=>e.if(F._`${r} !== true && ${t} !== undefined`,()=>{e.if(F._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,F._`${r} || {}`).code(F._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(F._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,F._`${r} || {}`),Uu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ky}),items:Ly({mergeNames:(e,t,r)=>e.if(F._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,F._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(F._`${r} !== true`,()=>e.assign(r,t===!0?!0:F._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Ky(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",F._`{}`);if(t!==void 0)Uu(e,r,t);return r}By.evaluatedPropsToName=Ky;function Uu(e,t,r){Object.keys(r).forEach((n)=>e.assign(F._`${t}${F.getProperty(n)}`,!0))}By.setEvaluated=Uu;var Uy={};function ZI(e,t){return e.scopeValue("func",{ref:t,code:Uy[t.code]||(Uy[t.code]=new Fy._Code(t.code))})}By.useFunc=ZI;var Mu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mu||(By.Type=Mu={}));function eC(e,t,r){if(e instanceof F.Name){let n=t===Mu.Num;return r?n?F._`"[" + ${e} + "]"`:F._`"['" + ${e} + "']"`:n?F._`"/" + ${e}`:F._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?F.getProperty(e).toString():"/"+Lu(e)}By.getErrorPath=eC;function Hy(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}By.checkStrictMode=Hy});var br=g(function(Yy){Object.defineProperty(Yy,"__esModule",{value:!0});var le=ee(),_C={data:new le.Name("data"),valCxt:new le.Name("valCxt"),instancePath:new le.Name("instancePath"),parentData:new le.Name("parentData"),parentDataProperty:new le.Name("parentDataProperty"),rootData:new le.Name("rootData"),dynamicAnchors:new le.Name("dynamicAnchors"),vErrors:new le.Name("vErrors"),errors:new le.Name("errors"),this:new le.Name("this"),self:new le.Name("self"),scope:new le.Name("scope"),json:new le.Name("json"),jsonPos:new le.Name("jsonPos"),jsonLen:new le.Name("jsonLen"),jsonPart:new le.Name("jsonPart")};Yy.default=_C});var uo=g(function(Zy){Object.defineProperty(Zy,"__esModule",{value:!0});Zy.extendErrors=Zy.resetErrorsCount=Zy.reportExtraError=Zy.reportError=Zy.keyword$DataError=Zy.keywordError=void 0;var C=ee(),Jr=ce(),Je=br();Zy.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};Zy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function bC(e,t=Zy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:a,allErrors:i}=s,c=Qy(e,t,r);if(n!==null&&n!==void 0?n:a||i)Xy(o,c);else Jy(s,C._`[${c}]`)}Zy.reportError=bC;function wC(e,t=Zy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:a}=n,i=Qy(e,t,r);if(Xy(s,i),!(o||a))Jy(n,Je.default.vErrors)}Zy.reportExtraError=wC;function $C(e,t){e.assign(Je.default.errors,t),e.if(C._`${Je.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Je.default.vErrors}.length`,t),()=>e.assign(Je.default.vErrors,null)))}Zy.resetErrorsCount=$C;function EC({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let a=e.name("err");e.forRange("i",s,Je.default.errors,(i)=>{if(e.const(a,C._`${Je.default.vErrors}[${i}]`),e.if(C._`${a}.instancePath === undefined`,()=>e.assign(C._`${a}.instancePath`,C.strConcat(Je.default.instancePath,o.errorPath))),e.assign(C._`${a}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${a}.schema`,r),e.assign(C._`${a}.data`,n)})}Zy.extendErrors=EC;function Xy(e,t){let r=e.const("err",t);e.if(C._`${Je.default.vErrors} === null`,()=>e.assign(Je.default.vErrors,C._`[${r}]`),C._`${Je.default.vErrors}.push(${r})`),e.code(C._`${Je.default.errors}++`)}function Jy(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(C._`new ${e.ValidationError}(${t})`);else r.assign(C._`${n}.errors`,t),r.return(!1)}var An={keyword:new C.Name("keyword"),schemaPath:new C.Name("schemaPath"),params:new C.Name("params"),propertyName:new C.Name("propertyName"),message:new C.Name("message"),schema:new C.Name("schema"),parentSchema:new C.Name("parentSchema")};function Qy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return SC(e,t,r)}function SC(e,t,r={}){let{gen:n,it:s}=e,o=[xC(s,r),RC(e,r)];return kC(e,t,o),n.object(...o)}function xC({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Jr.getErrorPath(t,Jr.Type.Str)}`:e;return[Je.default.instancePath,C.strConcat(Je.default.instancePath,r)]}function RC({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Jr.getErrorPath(r,Jr.Type.Str)}`;return[An.schemaPath,s]}function kC(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;if(n.push([An.keyword,s],[An.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([An.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([An.schema,a],[An.parentSchema,C._`${l}${d}`],[Je.default.data,o]);if(u)n.push([An.propertyName,u])}});var a_=g(function(s_){Object.defineProperty(s_,"__esModule",{value:!0});s_.boolOrEmptySchema=s_.topBoolOrEmptySchema=void 0;var t_=uo(),r_=ee(),PC=br(),IC={message:"boolean schema is false"};function CC(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)n_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(PC.default.data);else t.assign(r_._`${n}.errors`,null),t.return(!0)}s_.topBoolOrEmptySchema=CC;function jC(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),n_(e);else r.var(t,!0)}s_.boolOrEmptySchema=jC;function n_(e,t){let{gen:r,data:n}=e;t_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},IC,void 0,t)}});var Vu=g(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});i_.getRules=i_.isJSONType=void 0;var DC=["string","number","integer","boolean","null","object","array"],MC=new Set(DC);function LC(e){return typeof e=="string"&&MC.has(e)}i_.isJSONType=LC;function UC(){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:{}}}i_.getRules=UC});var zu=g(function(d_){Object.defineProperty(d_,"__esModule",{value:!0});d_.shouldUseRule=d_.shouldUseGroup=d_.schemaHasRulesForType=void 0;function VC({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&u_(e,n)}d_.schemaHasRulesForType=VC;function u_(e,t){return t.rules.some((r)=>l_(e,r))}d_.shouldUseGroup=u_;function l_(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}d_.shouldUseRule=l_});var lo=g(function(__){Object.defineProperty(__,"__esModule",{value:!0});__.reportTypeError=__.checkDataTypes=__.checkDataType=__.coerceAndCheckDataType=__.getJSONTypes=__.getSchemaTypes=__.DataType=void 0;var p_=Vu(),m_=zu(),h_=uo(),R=ee(),ni=ce(),ds;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ds||(__.DataType=ds={}));function KC(e){let t=g_(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}__.getSchemaTypes=KC;function g_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(p_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}__.getJSONTypes=g_;function HC(e,t){let{gen:r,data:n,opts:s}=e,o=BC(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&m_.schemaHasRulesForType(e,t[0]));if(a){let i=Ku(t,n,s.strictNumbers,ds.Wrong);r.if(i,()=>{if(o.length)WC(e,t,o);else Hu(e)})}return a}__.coerceAndCheckDataType=HC;var y_=new Set(["string","number","integer","boolean","null"]);function BC(e,t){return t?e.filter((r)=>y_.has(r)||t==="array"&&r==="array"):[]}function WC(e,t,r){let{gen:n,data:s,opts:o}=e,a=n.let("dataType",R._`typeof ${s}`),i=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(a,R._`typeof ${s}`).if(Ku(t,s,o.strictNumbers),()=>n.assign(i,s)));n.if(R._`${i} !== undefined`);for(let u of r)if(y_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Hu(e),n.endIf(),n.if(R._`${i} !== undefined`,()=>{n.assign(s,i),YC(e,i)});function c(u){switch(u){case"string":n.elseIf(R._`${a} == "number" || ${a} == "boolean"`).assign(i,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(i,R._`""`);return;case"number":n.elseIf(R._`${a} == "boolean" || ${s} === null
|
|
10
|
+
deps: ${r}}`};var AO={keyword:"dependencies",type:"object",schemaType:"object",error:Eh.error,code(e){let[t,r]=OO(e);wh(e,t),$h(e,r)}};function OO({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function wh(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let i=t[a];if(i.length===0)continue;let c=Yt.propertyInData(r,n,a,s.opts.ownProperties);if(e.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of i)Yt.checkReportMissingProp(e,u)});else r.if(ns._`${c} && (${Yt.checkMissingProp(e,i,o)})`),Yt.reportMissingProp(e,o),r.else()}}Eh.validatePropertyDeps=wh;function $h(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,a=r.name("valid");for(let i in t){if(bh.alwaysValidSchema(o,t[i]))continue;r.if(Yt.propertyInData(r,n,i,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:i},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a)}}Eh.validateSchemaDeps=$h;Eh.default=AO});var Th=g(function(kh){Object.defineProperty(kh,"__esModule",{value:!0});var Pa=Y(),Rh=re(),CO={message:"property name must be valid",params:({params:e})=>Pa._`{propertyName: ${e.propertyName}}`},IO={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:CO,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(Rh.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(a)=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if(Pa.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};kh.default=IO});var _u=g(function(Ah){Object.defineProperty(Ah,"__esModule",{value:!0});var zr=ht(),ke=Y(),qO=pt(),Gr=re(),DO={message:"must NOT have additional properties",params:({params:e})=>ke._`{additionalProperty: ${e.additionalProperty}}`},MO={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:DO,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&Gr.alwaysValidSchema(a,r))return;let u=zr.allSchemaProperties(n.properties),l=zr.allSchemaProperties(n.patternProperties);d(),e.ok(ke._`${o} === ${qO.default.errors}`);function d(){t.forIn("key",s,(y)=>{if(!u.length&&!l.length)p(y);else t.if(m(y),()=>p(y))})}function m(y){let v;if(u.length>8){let A=Gr.schemaRefOrVal(a,n.properties,"properties");v=zr.isOwnProperty(t,A,y)}else if(u.length)v=ke.or(...u.map((A)=>ke._`${y} === ${A}`));else v=ke.nil;if(l.length)v=ke.or(v,...l.map((A)=>ke._`${zr.usePattern(e,A)}.test(${y})`));return ke.not(v)}function f(y){t.code(ke._`delete ${s}[${y}]`)}function p(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!i)t.break();return}if(typeof r=="object"&&!Gr.alwaysValidSchema(a,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(y,v,!1),t.if(ke.not(v),()=>{e.reset(),f(y)});else if(h(y,v),!i)t.if(ke.not(v),()=>t.break())}}function h(y,v,A){let k={keyword:"additionalProperties",dataProp:y,dataPropType:Gr.Type.Str};if(A===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,v)}}};Ah.default=MO});var Ch=g(function(Ph){Object.defineProperty(Ph,"__esModule",{value:!0});var Nh=eo(),Ca=ht(),ss=re(),Oh=_u(),UO={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Oh.default.code(new Nh.KeywordCxt(o,Oh.default,"additionalProperties"));let a=Ca.allSchemaProperties(r);for(let d of a)o.definedProperties.add(d);if(o.opts.unevaluated&&a.length&&o.props!==!0)o.props=ss.mergeEvaluated.props(t,ss.toHash(a),o.props);let i=a.filter((d)=>!ss.alwaysValidSchema(o,r[d]));if(i.length===0)return;let c=t.name("valid");for(let d of i){if(u(d))l(d);else{if(t.if(Ca.propertyInData(t,s,d,o.opts.ownProperties)),l(d),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Ph.default=UO});var jh=g(function(Ih){Object.defineProperty(Ih,"__esModule",{value:!0});var Ia=ht(),Kr=Y(),ja=re(),qa=re(),VO={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=Ia.allSchemaProperties(r),c=i.filter((h)=>ja.alwaysValidSchema(o,r[h]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof Kr.Name))o.props=qa.evaluatedPropsToName(t,o.props);let{props:d}=o;m();function m(){for(let h of i){if(u)f(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function f(h){for(let y in u)if(new RegExp(h).test(y))ja.checkStrictMode(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",n,(y)=>{t.if(Kr._`${Ia.usePattern(e,h)}.test(${y})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:qa.Type.Str},l);if(o.opts.unevaluated&&d!==!0)t.assign(Kr._`${d}[${y}]`,!0);else if(!v&&!o.allErrors)t.if(Kr.not(l),()=>t.break())})})}}};Ih.default=VO});var Mh=g(function(Dh){Object.defineProperty(Dh,"__esModule",{value:!0});var qh=re(),GO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(qh.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Dh.default=GO});var Fh=g(function(Uh){Object.defineProperty(Uh,"__esModule",{value:!0});var Lh=ht(),HO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lh.validateUnion,error:{message:"must match a schema in anyOf"}};Uh.default=HO});var Gh=g(function(zh){Object.defineProperty(zh,"__esModule",{value:!0});var Hr=Y(),Vh=re(),WO={message:"must match exactly one schema in oneOf",params:({params:e})=>Hr._`{passingSchemas: ${e.passing}}`},YO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:WO,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;if(Vh.alwaysValidSchema(s,l))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(Hr._`${c} && ${a}`).assign(a,!1).assign(i,Hr._`[${i}, ${d}]`).else();t.if(c,()=>{if(t.assign(a,!0),t.assign(i,d),m)e.mergeEvaluated(m,Hr.Name)})})}}};zh.default=YO});var Bh=g(function(Hh){Object.defineProperty(Hh,"__esModule",{value:!0});var Kh=re(),JO={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,a)=>{if(Kh.alwaysValidSchema(n,o))return;let i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};Hh.default=JO});var Xh=g(function(Yh){Object.defineProperty(Yh,"__esModule",{value:!0});var Br=Y(),Da=re(),ZO={message:({params:e})=>Br.str`must match "${e.ifClause}" schema`,params:({params:e})=>Br._`{failingKeyword: ${e.ifClause}}`},eN={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ZO,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Da.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Wh(n,"then"),o=Wh(n,"else");if(!s&&!o)return;let a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(i,u("then",l),u("else",l))}else if(s)t.if(i,u("then"));else t.if(Br.not(i),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},i);if(t.assign(a,i),e.mergeValidEvaluated(m,a),d)t.assign(d,Br._`${l}`);else e.setParams({ifClause:l})}}}};function Wh(e,t){let r=e.schema[t];return r!==void 0&&!Da.alwaysValidSchema(e,r)}Yh.default=eN});var Zh=g(function(Qh){Object.defineProperty(Qh,"__esModule",{value:!0});var Jh=re(),rN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Jh.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Qh.default=rN});var tg=g(function(eg){Object.defineProperty(eg,"__esModule",{value:!0});var sN=gu(),oN=fh(),aN=yu(),iN=yh(),cN=vh(),uN=Na(),lN=Th(),dN=_u(),fN=Ch(),pN=jh(),mN=Mh(),hN=Fh(),gN=Gh(),yN=Bh(),_N=Xh(),vN=Zh();function bN(e=!1){let t=[mN.default,hN.default,gN.default,yN.default,_N.default,vN.default,lN.default,dN.default,uN.default,fN.default,pN.default];if(e)t.push(oN.default,iN.default);else t.push(sN.default,aN.default);return t.push(cN.default),t}eg.default=bN});var vu=g(function(sg){Object.defineProperty(sg,"__esModule",{value:!0});sg.dynamicAnchor=void 0;var os=Y(),$N=pt(),Ma=no(),rg=Ra(),EN={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>ng(e,e.schema)};function ng(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=os._`${$N.default.dynamicAnchors}${os.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:SN(e);r.if(os._`!${s}`,()=>r.assign(s,o))}sg.dynamicAnchor=ng;function SN(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:a,meta:i}=t.root,{schemaId:c}=n.opts,u=new Ma.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:a,meta:i});return Ma.compileSchema.call(n,u),rg.getValidate(e,u)}sg.default=EN});var bu=g(function(ig){Object.defineProperty(ig,"__esModule",{value:!0});ig.dynamicRef=void 0;var La=Y(),RN=pt(),Ua=Ra(),kN={keyword:"$dynamicRef",schemaType:"string",code:(e)=>ag(e,e.schema)};function ag(e,t){let{gen:r,keyword:n,it:s}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let o=t.slice(1);if(s.allErrors)a();else{let c=r.let("valid",!1);a(c),e.ok(c)}function a(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",La._`${RN.default.dynamicAnchors}${La.getProperty(o)}`);r.if(u,i(u,c),i(s.validateName,c))}else i(s.validateName,c)()}function i(c,u){return u?()=>r.block(()=>{Ua.callRef(e,c),r.let(u,!0)}):()=>Ua.callRef(e,c)}}ig.dynamicRef=ag;ig.default=kN});var fg=g(function(dg){Object.defineProperty(dg,"__esModule",{value:!0});var ug=vu(),lg=re(),AN={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)ug.dynamicAnchor(e,"");else lg.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};dg.default=AN});var hg=g(function(mg){Object.defineProperty(mg,"__esModule",{value:!0});var pg=bu(),NN={keyword:"$recursiveRef",schemaType:"string",code:(e)=>pg.dynamicRef(e,e.schema)};mg.default=NN});var yg=g(function(gg){Object.defineProperty(gg,"__esModule",{value:!0});var CN=vu(),IN=bu(),jN=fg(),qN=hg(),DN=[CN.default,IN.default,jN.default,qN.default];gg.default=DN});var vg=g(function(_g){Object.defineProperty(_g,"__esModule",{value:!0});var Fa=Na(),LN={keyword:"dependentRequired",type:"object",schemaType:"object",error:Fa.error,code:(e)=>Fa.validatePropertyDeps(e)};_g.default=LN});var $g=g(function(wg){Object.defineProperty(wg,"__esModule",{value:!0});var bg=Na(),FN={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>bg.validateSchemaDeps(e)};wg.default=FN});var xg=g(function(Sg){Object.defineProperty(Sg,"__esModule",{value:!0});var Eg=re(),zN={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)Eg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};Sg.default=zN});var kg=g(function(Rg){Object.defineProperty(Rg,"__esModule",{value:!0});var KN=vg(),HN=$g(),BN=xg(),WN=[KN.default,HN.default,BN.default];Rg.default=WN});var Ag=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ke=Y(),Va=re(),XN=pt(),JN={message:"must NOT have unevaluated properties",params:({params:e})=>Ke._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},QN={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:JN,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,props:i}=o;if(i instanceof Ke.Name)t.if(Ke._`${i} !== true`,()=>t.forIn("key",n,(d)=>t.if(u(i,d),()=>c(d))));else if(i!==!0)t.forIn("key",n,(d)=>i===void 0?c(d):t.if(l(i,d),()=>c(d)));o.props=!0,e.ok(Ke._`${s} === ${XN.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!a)t.break();return}if(!Va.alwaysValidSchema(o,r)){let m=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:Va.Type.Str},m),!a)t.if(Ke.not(m),()=>t.break())}}function u(d,m){return Ke._`!${d} || !${d}[${m}]`}function l(d,m){let f=[];for(let p in d)if(d[p]===!0)f.push(Ke._`${m} !== ${p}`);return Ke.and(...f)}}};Tg.default=QN});var Ng=g(function(Og){Object.defineProperty(Og,"__esModule",{value:!0});var ot=Y(),za=re(),eP={message:({params:{len:e}})=>ot.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ot._`{limit: ${e}}`},tP={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:eP,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let a=t.const("len",ot._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(ot._`${a} > ${o}`);else if(typeof r=="object"&&!za.alwaysValidSchema(s,r)){let c=t.var("valid",ot._`${a} <= ${o}`);t.if(ot.not(c),()=>i(c,o)),e.ok(c)}s.items=!0;function i(c,u){t.forRange("i",u,a,(l)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:za.Type.Num},c),!s.allErrors)t.if(ot.not(c),()=>t.break())})}}};Og.default=tP});var Cg=g(function(Pg){Object.defineProperty(Pg,"__esModule",{value:!0});var nP=Ag(),sP=Ng(),oP=[nP.default,sP.default];Pg.default=oP});var jg=g(function(Ig){Object.defineProperty(Ig,"__esModule",{value:!0});var X=Y(),iP={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},cP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:iP,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;if(s)m();else f();function m(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",X._`${p}[${a}]`),y=r.let("fType"),v=r.let("format");r.if(X._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,X._`${h}.type || "string"`).assign(v,X._`${h}.validate`),()=>r.assign(y,X._`"string"`).assign(v,h)),e.fail$data(X.or(A(),k()));function A(){if(c.strictSchema===!1)return X.nil;return X._`${a} && !${v}`}function k(){let M=l.$async?X._`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:X._`${v}(${n})`,S=X._`(typeof ${v} == "function" ? ${M} : ${v}.test(${n}))`;return X._`${v} && ${v} !== true && ${y} === ${t} && !${S}`}}function f(){let p=d.formats[o];if(!p){A();return}if(p===!0)return;let[h,y,v]=k(p);if(h===t)e.pass(M());function A(){if(c.strictSchema===!1){d.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let $e=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,je=r.scopeValue("formats",{key:o,ref:S,code:$e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${je}.validate`];return["string",S,je]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return X._`await ${v}(${n})`}return typeof y=="function"?X._`${v}(${n})`:X._`${v}.test(${n})`}}}};Ig.default=cP});var Dg=g(function(qg){Object.defineProperty(qg,"__esModule",{value:!0});var lP=jg(),dP=[lP.default];qg.default=dP});var Ug=g(function(Mg){Object.defineProperty(Mg,"__esModule",{value:!0});Mg.contentVocabulary=Mg.metadataVocabulary=void 0;Mg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Vg=g(function(Fg){Object.defineProperty(Fg,"__esModule",{value:!0});var mP=Em(),hP=rh(),gP=tg(),yP=yg(),_P=kg(),vP=Cg(),bP=Dg(),Ga=Ug(),wP=[yP.default,mP.default,hP.default,(0,gP.default)(!0),bP.default,Ga.metadataVocabulary,Ga.contentVocabulary,_P.default,vP.default];Fg.default=wP});var Hg=g(function(Gg){Object.defineProperty(Gg,"__esModule",{value:!0});Gg.DiscrError=void 0;var zg;(function(e){e.Tag="tag",e.Mapping="mapping"})(zg||(Gg.DiscrError=zg={}))});var Yg=g(function(Wg){Object.defineProperty(Wg,"__esModule",{value:!0});var gt=Y(),as=Hg(),Ka=no(),EP=to(),Bg=re(),SP={message:({params:{discrError:e,tagName:t}})=>e===as.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>gt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},xP={keyword:"discriminator",type:"object",schemaType:"object",error:SP,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!a)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",gt._`${r}${gt.getProperty(i)}`);t.if(gt._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:as.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function l(){let f=m();t.if(!1);for(let p in f)t.elseIf(gt._`${u} === ${p}`),t.assign(c,d(f[p]));t.else(),e.error(!1,{discrError:as.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function d(f){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:f},p);return e.mergeEvaluated(h,gt.Name),p}function m(){var f;let p={},h=v(s),y=!0;for(let M=0;M<a.length;M++){let S=a[M];if((S===null||S===void 0?void 0:S.$ref)&&!Bg.schemaHasRulesButRef(S,o.self.RULES)){let je=S.$ref;if(S=Ka.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,je),S instanceof Ka.SchemaEnv)S=S.schema;if(S===void 0)throw new EP.default(o.opts.uriResolver,o.baseId,je)}let $e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[i];if(typeof $e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);y=y&&(h||v(S)),A($e,M)}if(!y)throw Error(`discriminator: "${i}" must be required`);return p;function v({required:M}){return Array.isArray(M)&&M.includes(i)}function A(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let $e of M.enum)k($e,S);else throw Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in p)throw Error(`discriminator: "${i}" values must be unique strings`);p[M]=S}}}};Wg.default=xP});var Xg=g(function(qG,kP){kP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Jg=g(function(DG,TP){TP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Qg=g(function(MG,AP){AP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Zg=g(function(LG,OP){OP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var ey=g(function(UG,NP){NP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var ty=g(function(FG,PP){PP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ry=g(function(VG,CP){CP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var ny=g(function(zG,IP){IP.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var oy=g(function(sy){Object.defineProperty(sy,"__esModule",{value:!0});var jP=Xg(),qP=Jg(),DP=Qg(),MP=Zg(),LP=ey(),UP=ty(),FP=ry(),VP=ny(),zP=["/properties"];function GP(e){return[jP,qP,DP,MP,LP,t(this,UP),FP,t(this,VP)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,zP):n}}sy.default=GP});var ay=g(function(at,$u){Object.defineProperty(at,"__esModule",{value:!0});at.MissingRefError=at.ValidationError=at.CodeGen=at.Name=at.nil=at.stringify=at.str=at._=at.KeywordCxt=at.Ajv2020=void 0;var HP=gm(),BP=Vg(),WP=Yg(),YP=oy(),wu="https://json-schema.org/draft/2020-12/schema";class oo extends HP.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),BP.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(WP.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;YP.default.call(this,e),this.refs["http://json-schema.org/schema"]=wu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wu)?wu:void 0)}}at.Ajv2020=oo;$u.exports=at=oo;$u.exports.Ajv2020=oo;Object.defineProperty(at,"__esModule",{value:!0});at.default=oo;var XP=eo();Object.defineProperty(at,"KeywordCxt",{enumerable:!0,get:function(){return XP.KeywordCxt}});var is=Y();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return is._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return is.str}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return is.stringify}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return is.nil}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return is.Name}});Object.defineProperty(at,"CodeGen",{enumerable:!0,get:function(){return is.CodeGen}});var JP=ha();Object.defineProperty(at,"ValidationError",{enumerable:!0,get:function(){return JP.default}});var QP=to();Object.defineProperty(at,"MissingRefError",{enumerable:!0,get:function(){return QP.default}})});var gy=g(function(my){Object.defineProperty(my,"__esModule",{value:!0});my.formatNames=my.fastFormats=my.fullFormats=void 0;function Xt(e,t){return{validate:e,compare:t}}my.fullFormats={date:Xt(ly,Ru),time:Xt(Su(!0),ku),"date-time":Xt(iy(!0),fy),"iso-time":Xt(Su(),dy),"iso-date-time":Xt(iy(),py),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:aC,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:pC,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:iC,int32:{type:"number",validate:lC},int64:{type:"number",validate:dC},float:{type:"number",validate:uy},double:{type:"number",validate:uy},password:!0,binary:!0};my.fastFormats={...my.fullFormats,date:Xt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ru),time:Xt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ku),"date-time":Xt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,fy),"iso-time":Xt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dy),"iso-date-time":Xt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,py),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};my.formatNames=Object.keys(my.fullFormats);function tC(e){return e%4===0&&(e%100!==0||e%400===0)}var rC=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,nC=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ly(e){let t=rC.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&tC(r)?29:nC[n])}function Ru(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var Eu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Su(e){return function(r){let n=Eu.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],a=+n[3],i=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||e&&!i)return!1;if(s<=23&&o<=59&&a<60)return!0;let d=o-l*c,m=s-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function ku(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function dy(e,t){if(!(e&&t))return;let r=Eu.exec(e),n=Eu.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var xu=/t|\s/i;function iy(e){let t=Su(e);return function(n){let s=n.split(xu);return s.length===2&&ly(s[0])&&t(s[1])}}function fy(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function py(e,t){if(!(e&&t))return;let[r,n]=e.split(xu),[s,o]=t.split(xu),a=Ru(r,s);if(a===void 0)return;return a||ku(n,o)}var sC=/\/|:/,oC=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function aC(e){return sC.test(e)&&oC.test(e)}var cy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function iC(e){return cy.lastIndex=0,cy.test(e)}var cC=-2147483648,uC=2147483647;function lC(e){return Number.isInteger(e)&&e<=uC&&e>=cC}function dC(e){return Number.isInteger(e)}function uy(){return!0}var fC=/[^\\]\\Z/;function pC(e){if(fC.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(vy){Object.defineProperty(vy,"__esModule",{value:!0});vy.regexpCode=vy.getEsmExportName=vy.getProperty=vy.safeStringify=vy.stringify=vy.strConcat=vy.addCodeArg=vy.str=vy._=vy.nil=vy._Code=vy.Name=vy.IDENTIFIER=vy._CodeOrName=void 0;class Ha{}vy._CodeOrName=Ha;vy.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cs extends Ha{constructor(e){super();if(!vy.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}}}vy.Name=cs;class Tt extends Ha{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof cs)t[r.str]=(t[r.str]||0)+1;return t},{})}}vy._Code=Tt;vy.nil=new Tt("");function yy(e,...t){let r=[e[0]],n=0;while(n<t.length)Ou(r,t[n]),r.push(e[++n]);return new Tt(r)}vy._=yy;var Au=new Tt("+");function _y(e,...t){let r=[ao(e[0])],n=0;while(n<t.length)r.push(Au),Ou(r,t[n]),r.push(Au,ao(e[++n]));return hC(r),new Tt(r)}vy.str=_y;function Ou(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof cs)e.push(t);else e.push(_C(t))}vy.addCodeArg=Ou;function hC(e){let t=1;while(t<e.length-1){if(e[t]===Au){let r=gC(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function gC(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof cs||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 cs))return`"${e}${t.slice(1)}`;return}function yC(e,t){return t.emptyStr()?e:e.emptyStr()?t:_y`${e}${t}`}vy.strConcat=yC;function _C(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ao(Array.isArray(e)?e.join(","):e)}function vC(e){return new Tt(ao(e))}vy.stringify=vC;function ao(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}vy.safeStringify=ao;function bC(e){return typeof e=="string"&&vy.IDENTIFIER.test(e)?new Tt(`.${e}`):yy`[${e}]`}vy.getProperty=bC;function wC(e){if(typeof e=="string"&&vy.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}vy.getEsmExportName=wC;function $C(e){return new Tt(e.toString())}vy.regexpCode=$C});var Iu=g(function(Ey){Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueScope=Ey.ValueScopeName=Ey.Scope=Ey.varKinds=Ey.UsedValueState=void 0;var he=io();class wy extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Wa;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Wa||(Ey.UsedValueState=Wa={}));Ey.varKinds={const:new he.Name("const"),let:new he.Name("let"),var:new he.Name("var")};class Pu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof he.Name?e:this.name(e)}name(e){return new he.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Ey.Scope=Pu;class Cu extends he.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=he._`.${new he.Name(t)}[${r}]`}}Ey.ValueScopeName=Cu;var jC=he._`\n`;class $y extends Pu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?jC:he.nil}}get(){return this._scope}name(e){return new Cu(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,n);let i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return he._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=he.nil;for(let o in e){let a=e[o];if(!a)continue;let i=r[o]=r[o]||new Map;a.forEach((c)=>{if(i.has(c))return;i.set(c,Wa.Started);let u=t(c);if(u){let l=this.opts.es5?Ey.varKinds.var:Ey.varKinds.const;s=he._`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=he._`${s}${u}${this.opts._n}`;else throw new wy(c);i.set(c,Wa.Completed)})}return s}}Ey.ValueScope=$y});var ee=g(function(it){Object.defineProperty(it,"__esModule",{value:!0});it.or=it.and=it.not=it.CodeGen=it.operators=it.varKinds=it.ValueScopeName=it.ValueScope=it.Scope=it.Name=it.regexpCode=it.stringify=it.getProperty=it.nil=it.strConcat=it.str=it._=void 0;var N=io(),Te=Iu(),Wr=io();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Wr._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Wr.str}});Object.defineProperty(it,"strConcat",{enumerable:!0,get:function(){return Wr.strConcat}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Wr.nil}});Object.defineProperty(it,"getProperty",{enumerable:!0,get:function(){return Wr.getProperty}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Wr.stringify}});Object.defineProperty(it,"regexpCode",{enumerable:!0,get:function(){return Wr.regexpCode}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Wr.Name}});var ei=Iu();Object.defineProperty(it,"Scope",{enumerable:!0,get:function(){return ei.Scope}});Object.defineProperty(it,"ValueScope",{enumerable:!0,get:function(){return ei.ValueScope}});Object.defineProperty(it,"ValueScopeName",{enumerable:!0,get:function(){return ei.ValueScopeName}});Object.defineProperty(it,"varKinds",{enumerable:!0,get:function(){return ei.varKinds}});it.operators={GT:new N._Code(">"),GTE:new N._Code(">="),LT:new N._Code("<"),LTE:new N._Code("<="),EQ:new N._Code("==="),NEQ:new N._Code("!=="),NOT:new N._Code("!"),OR:new N._Code("||"),AND:new N._Code("&&"),ADD:new N._Code("+")};class Yr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xy extends Yr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Te.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=ls(this.rhs,e,t);return this}get names(){return this.rhs instanceof N._CodeOrName?this.rhs.names:{}}}class Du extends Yr{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof N.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ls(this.rhs,e,t),this}get names(){let e=this.lhs instanceof N.Name?{}:{...this.lhs.names};return Za(e,this.rhs)}}class Ry extends Du{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class ky extends Yr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Yr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ay extends Yr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Oy extends Yr{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=ls(this.code,e,t),this}get names(){return this.code instanceof N._CodeOrName?this.code.names:{}}}class ti extends Yr{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;LC(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Tn(e,t.names),{})}}class Xr extends ti{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ny extends ti{}class co extends Xr{}co.kind="else";class vr extends Xr{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new co(r):r}if(t){if(e===!1)return t instanceof vr?t:t.nodes;if(this.nodes.length)return this;return new vr(qy(e),t instanceof vr?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=ls(this.condition,e,t),this}get names(){let e=super.names;if(Za(e,this.condition),this.else)Tn(e,this.else.names);return e}}vr.kind="if";class us extends Xr{}us.kind="for";class Py extends us{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=ls(this.iteration,e,t),this}get names(){return Tn(super.names,this.iteration.names)}}class Cy extends us{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Te.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Za(super.names,this.from);return Za(e,this.to)}}class ju extends us{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=ls(this.iterable,e,t),this}get names(){return Tn(super.names,this.iterable.names)}}class Ya extends Xr{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Ya.kind="func";class Xa extends ti{render(e){return"return "+super.render(e)}}Xa.kind="return";class Iy extends Xr{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Tn(e,this.catch.names);if(this.finally)Tn(e,this.finally.names);return e}}class Ja extends Xr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Ja.kind="catch";class Qa extends Xr{render(e){return"finally"+super.render(e)}}Qa.kind="finally";class jy{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
11
|
+
`:""},this._extScope=e,this._scope=new Te.Scope({parent:e}),this._nodes=[new Ny]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new xy(e,s,r)),s}const(e,t,r){return this._def(Te.varKinds.const,e,t,r)}let(e,t,r){return this._def(Te.varKinds.let,e,t,r)}var(e,t,r){return this._def(Te.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Du(e,t,r))}add(e,t){return this._leafNode(new Ry(e,it.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==N.nil)this._leafNode(new Oy(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),N.addCodeArg(t,n)}return t.push("}"),new N._Code(t)}if(e,t,r){if(this._blockNode(new vr(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new vr(e))}else(){return this._elseNode(new co)}endIf(){return this._endBlockNode(vr,co)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Py(e),t)}forRange(e,t,r,n,s=this.opts.es5?Te.varKinds.var:Te.varKinds.let){let o=this._scope.toName(e);return this._for(new Cy(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Te.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof N.Name?t:this.var("_arr",t);return this.forRange("_i",0,N._`${o}.length`,(a)=>{this.var(s,N._`${o}[${a}]`),r(s)})}return this._for(new ju("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Te.varKinds.var:Te.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,N._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new ju("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(us)}label(e){return this._leafNode(new ky(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Xa;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Xa)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Iy;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Ja(s),t(s)}if(r)this._currNode=n.finally=new Qa,this.code(r);return this._endBlockNode(Ja,Qa)}throw(e){return this._leafNode(new Ay(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=N.nil,r,n){if(this._blockNode(new Ya(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Ya)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof vr))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}}it.CodeGen=jy;function Tn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Za(e,t){return t instanceof N._CodeOrName?Tn(e,t.names):e}function ls(e,t,r){if(e instanceof N.Name)return n(e);if(!s(e))return e;return new N._Code(e._items.reduce((o,a)=>{if(a instanceof N.Name)a=n(a);if(a instanceof N._Code)o.push(...a._items);else o.push(a);return o},[]));function n(o){let a=r[o.str];if(a===void 0||t[o.str]!==1)return o;return delete t[o.str],a}function s(o){return o instanceof N._Code&&o._items.some((a)=>a instanceof N.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function LC(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function qy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:N._`!${qu(e)}`}it.not=qy;var UC=Dy(it.operators.AND);function FC(...e){return e.reduce(UC)}it.and=FC;var VC=Dy(it.operators.OR);function zC(...e){return e.reduce(VC)}it.or=zC;function Dy(e){return(t,r)=>t===N.nil?r:r===N.nil?t:N._`${qu(t)} ${e} ${qu(r)}`}function qu(e){return e instanceof N.Name?e:N._`(${e})`}});var ce=g(function(By){Object.defineProperty(By,"__esModule",{value:!0});By.checkStrictMode=By.getErrorPath=By.Type=By.useFunc=By.setEvaluated=By.evaluatedPropsToName=By.mergeEvaluated=By.eachItem=By.unescapeJsonPointer=By.escapeJsonPointer=By.escapeFragment=By.unescapeFragment=By.schemaRefOrVal=By.schemaHasRulesButRef=By.schemaHasRules=By.checkUnknownRules=By.alwaysValidSchema=By.toHash=void 0;var F=ee(),Fy=io();function BC(e){let t={};for(let r of e)t[r]=!0;return t}By.toHash=BC;function WC(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Vy(e,t),!zy(t,e.self.RULES.all)}By.alwaysValidSchema=WC;function Vy(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])Hy(e,`unknown keyword: "${o}"`)}By.checkUnknownRules=Vy;function zy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}By.schemaHasRules=zy;function YC(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}By.schemaHasRulesButRef=YC;function XC({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return F._`${r}`}return F._`${e}${t}${F.getProperty(n)}`}By.schemaRefOrVal=XC;function JC(e){return Gy(decodeURIComponent(e))}By.unescapeFragment=JC;function QC(e){return encodeURIComponent(Lu(e))}By.escapeFragment=QC;function Lu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}By.escapeJsonPointer=Lu;function Gy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}By.unescapeJsonPointer=Gy;function ZC(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}By.eachItem=ZC;function Ly({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,a,i)=>{let c=a===void 0?o:a instanceof F.Name?(o instanceof F.Name?e(s,o,a):t(s,o,a),a):o instanceof F.Name?(t(s,a,o),o):r(o,a);return i===F.Name&&!(c instanceof F.Name)?n(s,c):c}}By.mergeEvaluated={props:Ly({mergeNames:(e,t,r)=>e.if(F._`${r} !== true && ${t} !== undefined`,()=>{e.if(F._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,F._`${r} || {}`).code(F._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(F._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,F._`${r} || {}`),Uu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ky}),items:Ly({mergeNames:(e,t,r)=>e.if(F._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,F._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(F._`${r} !== true`,()=>e.assign(r,t===!0?!0:F._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Ky(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",F._`{}`);if(t!==void 0)Uu(e,r,t);return r}By.evaluatedPropsToName=Ky;function Uu(e,t,r){Object.keys(r).forEach((n)=>e.assign(F._`${t}${F.getProperty(n)}`,!0))}By.setEvaluated=Uu;var Uy={};function eI(e,t){return e.scopeValue("func",{ref:t,code:Uy[t.code]||(Uy[t.code]=new Fy._Code(t.code))})}By.useFunc=eI;var Mu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mu||(By.Type=Mu={}));function tI(e,t,r){if(e instanceof F.Name){let n=t===Mu.Num;return r?n?F._`"[" + ${e} + "]"`:F._`"['" + ${e} + "']"`:n?F._`"/" + ${e}`:F._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?F.getProperty(e).toString():"/"+Lu(e)}By.getErrorPath=tI;function Hy(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}By.checkStrictMode=Hy});var br=g(function(Yy){Object.defineProperty(Yy,"__esModule",{value:!0});var le=ee(),vI={data:new le.Name("data"),valCxt:new le.Name("valCxt"),instancePath:new le.Name("instancePath"),parentData:new le.Name("parentData"),parentDataProperty:new le.Name("parentDataProperty"),rootData:new le.Name("rootData"),dynamicAnchors:new le.Name("dynamicAnchors"),vErrors:new le.Name("vErrors"),errors:new le.Name("errors"),this:new le.Name("this"),self:new le.Name("self"),scope:new le.Name("scope"),json:new le.Name("json"),jsonPos:new le.Name("jsonPos"),jsonLen:new le.Name("jsonLen"),jsonPart:new le.Name("jsonPart")};Yy.default=vI});var uo=g(function(Zy){Object.defineProperty(Zy,"__esModule",{value:!0});Zy.extendErrors=Zy.resetErrorsCount=Zy.reportExtraError=Zy.reportError=Zy.keyword$DataError=Zy.keywordError=void 0;var I=ee(),Jr=ce(),Je=br();Zy.keywordError={message:({keyword:e})=>I.str`must pass "${e}" keyword validation`};Zy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?I.str`"${e}" keyword must be ${t} ($data)`:I.str`"${e}" keyword is invalid ($data)`};function wI(e,t=Zy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:a,allErrors:i}=s,c=Qy(e,t,r);if(n!==null&&n!==void 0?n:a||i)Xy(o,c);else Jy(s,I._`[${c}]`)}Zy.reportError=wI;function $I(e,t=Zy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:a}=n,i=Qy(e,t,r);if(Xy(s,i),!(o||a))Jy(n,Je.default.vErrors)}Zy.reportExtraError=$I;function EI(e,t){e.assign(Je.default.errors,t),e.if(I._`${Je.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(I._`${Je.default.vErrors}.length`,t),()=>e.assign(Je.default.vErrors,null)))}Zy.resetErrorsCount=EI;function SI({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let a=e.name("err");e.forRange("i",s,Je.default.errors,(i)=>{if(e.const(a,I._`${Je.default.vErrors}[${i}]`),e.if(I._`${a}.instancePath === undefined`,()=>e.assign(I._`${a}.instancePath`,I.strConcat(Je.default.instancePath,o.errorPath))),e.assign(I._`${a}.schemaPath`,I.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(I._`${a}.schema`,r),e.assign(I._`${a}.data`,n)})}Zy.extendErrors=SI;function Xy(e,t){let r=e.const("err",t);e.if(I._`${Je.default.vErrors} === null`,()=>e.assign(Je.default.vErrors,I._`[${r}]`),I._`${Je.default.vErrors}.push(${r})`),e.code(I._`${Je.default.errors}++`)}function Jy(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(I._`new ${e.ValidationError}(${t})`);else r.assign(I._`${n}.errors`,t),r.return(!1)}var An={keyword:new I.Name("keyword"),schemaPath:new I.Name("schemaPath"),params:new I.Name("params"),propertyName:new I.Name("propertyName"),message:new I.Name("message"),schema:new I.Name("schema"),parentSchema:new I.Name("parentSchema")};function Qy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return I._`{}`;return xI(e,t,r)}function xI(e,t,r={}){let{gen:n,it:s}=e,o=[RI(s,r),kI(e,r)];return TI(e,t,o),n.object(...o)}function RI({errorPath:e},{instancePath:t}){let r=t?I.str`${e}${Jr.getErrorPath(t,Jr.Type.Str)}`:e;return[Je.default.instancePath,I.strConcat(Je.default.instancePath,r)]}function kI({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:I.str`${t}/${e}`;if(r)s=I.str`${s}${Jr.getErrorPath(r,Jr.Type.Str)}`;return[An.schemaPath,s]}function TI(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:a,it:i}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;if(n.push([An.keyword,s],[An.params,typeof t=="function"?t(e):t||I._`{}`]),c.messages)n.push([An.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([An.schema,a],[An.parentSchema,I._`${l}${d}`],[Je.default.data,o]);if(u)n.push([An.propertyName,u])}});var a_=g(function(s_){Object.defineProperty(s_,"__esModule",{value:!0});s_.boolOrEmptySchema=s_.topBoolOrEmptySchema=void 0;var t_=uo(),r_=ee(),CI=br(),II={message:"boolean schema is false"};function jI(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)n_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(CI.default.data);else t.assign(r_._`${n}.errors`,null),t.return(!0)}s_.topBoolOrEmptySchema=jI;function qI(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),n_(e);else r.var(t,!0)}s_.boolOrEmptySchema=qI;function n_(e,t){let{gen:r,data:n}=e;t_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},II,void 0,t)}});var Vu=g(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});i_.getRules=i_.isJSONType=void 0;var MI=["string","number","integer","boolean","null","object","array"],LI=new Set(MI);function UI(e){return typeof e=="string"&&LI.has(e)}i_.isJSONType=UI;function FI(){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:{}}}i_.getRules=FI});var zu=g(function(d_){Object.defineProperty(d_,"__esModule",{value:!0});d_.shouldUseRule=d_.shouldUseGroup=d_.schemaHasRulesForType=void 0;function zI({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&u_(e,n)}d_.schemaHasRulesForType=zI;function u_(e,t){return t.rules.some((r)=>l_(e,r))}d_.shouldUseGroup=u_;function l_(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}d_.shouldUseRule=l_});var lo=g(function(__){Object.defineProperty(__,"__esModule",{value:!0});__.reportTypeError=__.checkDataTypes=__.checkDataType=__.coerceAndCheckDataType=__.getJSONTypes=__.getSchemaTypes=__.DataType=void 0;var p_=Vu(),m_=zu(),h_=uo(),R=ee(),ni=ce(),ds;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ds||(__.DataType=ds={}));function HI(e){let t=g_(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}__.getSchemaTypes=HI;function g_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(p_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}__.getJSONTypes=g_;function BI(e,t){let{gen:r,data:n,opts:s}=e,o=WI(t,s.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&m_.schemaHasRulesForType(e,t[0]));if(a){let i=Ku(t,n,s.strictNumbers,ds.Wrong);r.if(i,()=>{if(o.length)YI(e,t,o);else Hu(e)})}return a}__.coerceAndCheckDataType=BI;var y_=new Set(["string","number","integer","boolean","null"]);function WI(e,t){return t?e.filter((r)=>y_.has(r)||t==="array"&&r==="array"):[]}function YI(e,t,r){let{gen:n,data:s,opts:o}=e,a=n.let("dataType",R._`typeof ${s}`),i=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(a,R._`typeof ${s}`).if(Ku(t,s,o.strictNumbers),()=>n.assign(i,s)));n.if(R._`${i} !== undefined`);for(let u of r)if(y_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Hu(e),n.endIf(),n.if(R._`${i} !== undefined`,()=>{n.assign(s,i),XI(e,i)});function c(u){switch(u){case"string":n.elseIf(R._`${a} == "number" || ${a} == "boolean"`).assign(i,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(i,R._`""`);return;case"number":n.elseIf(R._`${a} == "boolean" || ${s} === null
|
|
12
12
|
|| (${a} == "string" && ${s} && ${s} == +${s})`).assign(i,R._`+${s}`);return;case"integer":n.elseIf(R._`${a} === "boolean" || ${s} === null
|
|
13
13
|
|| (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(i,R._`+${s}`);return;case"boolean":n.elseIf(R._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(i,!1).elseIf(R._`${s} === "true" || ${s} === 1`).assign(i,!0);return;case"null":n.elseIf(R._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(i,null);return;case"array":n.elseIf(R._`${a} === "string" || ${a} === "number"
|
|
14
|
-
|| ${a} === "boolean" || ${s} === null`).assign(i,R._`[${s}]`)}}}function YC({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function Gu(e,t,r,n=ds.Correct){let s=n===ds.Correct?R.operators.EQ:R.operators.NEQ,o;switch(e){case"null":return R._`${t} ${s} null`;case"array":o=R._`Array.isArray(${t})`;break;case"object":o=R._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return R._`typeof ${t} ${s} ${e}`}return n===ds.Correct?o:R.not(o);function a(i=R.nil){return R.and(R._`typeof ${t} == "number"`,i,r?R._`isFinite(${t})`:R.nil)}}__.checkDataType=Gu;function Ku(e,t,r,n){if(e.length===1)return Gu(e[0],t,r,n);let s,o=ni.toHash(e);if(o.array&&o.object){let a=R._`typeof ${t} != "object"`;s=o.null?a:R._`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let a in o)s=R.and(s,Gu(a,t,r,n));return s}__.checkDataTypes=Ku;var XC={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Hu(e){let t=JC(e);h_.reportError(t,XC)}__.reportTypeError=Hu;function JC(e){let{gen:t,data:r,schema:n}=e,s=ni.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var S_=g(function($_){Object.defineProperty($_,"__esModule",{value:!0});$_.assignDefaults=void 0;var yt=ee(),w_=ce();function s1(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)b_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>b_(e,o,s.default))}$_.assignDefaults=s1;function b_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;let i=yt._`${o}${yt.getProperty(t)}`;if(s){w_.checkStrictMode(e,`default is ignored for: ${i}`);return}let c=yt._`${i} === undefined`;if(a.useDefaults==="empty")c=yt._`${c} || ${i} === null || ${i} === ""`;n.if(c,yt._`${i} = ${yt.stringify(r)}`)}});var _t=g(function(T_){Object.defineProperty(T_,"__esModule",{value:!0});T_.validateUnion=T_.validateArray=T_.usePattern=T_.callValidateCode=T_.schemaProperties=T_.allSchemaProperties=T_.noPropertyInData=T_.propertyInData=T_.isOwnProperty=T_.hasPropFunc=T_.reportMissingProp=T_.checkMissingProp=T_.checkReportMissingProp=void 0;var z=ee(),fs=ce(),Qr=br(),x_=ce();function o1(e,t){let{gen:r,data:n,it:s}=e;r.if(Wu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=o1;function a1({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Wu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=a1;function i1(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=i1;function R_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=R_;function Bu(e,t,r){return z._`${R_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Bu;function c1(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Bu(e,t,r)}`:s}T_.propertyInData=c1;function Wu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Bu(e,t,r))):s}T_.noPropertyInData=Wu;function k_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=k_;function u1(e,t){return k_(t).filter((r)=>!fs.alwaysValidSchema(e,t[r]))}T_.schemaProperties=u1;function l1({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?z._`${e}, ${t}, ${n}${s}`:t,d=[[Qr.default.instancePath,z.strConcat(Qr.default.instancePath,o)],[Qr.default.parentData,a.parentData],[Qr.default.parentDataProperty,a.parentDataProperty],[Qr.default.rootData,Qr.default.rootData]];if(a.opts.dynamicRef)d.push([Qr.default.dynamicAnchors,Qr.default.dynamicAnchors]);let m=z._`${l}, ${r.object(...d)}`;return c!==z.nil?z._`${i}.call(${c}, ${m})`:z._`${i}(${m})`}T_.callValidateCode=l1;var d1=z._`new RegExp`;function f1({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:z._`${s.code==="new RegExp"?d1:x_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=f1;function p1(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:fs.Type.Num},o),t.if(z.not(o),i)})}}T_.validateArray=p1;function m1(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>fs.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);if(t.assign(a,z._`${a} || ${i}`),!e.mergeValidEvaluated(l,i))t.if(z.not(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=m1});var q_=g(function(C_){Object.defineProperty(C_,"__esModule",{value:!0});C_.validateKeywordUsage=C_.validSchemaType=C_.funcKeywordCode=C_.macroKeywordCode=void 0;var fe=ee(),On=br(),N_=_t(),P_=uo();function k1(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=I_(r,n,i);if(a.opts.validateSchema!==!1)a.self.validateSchema(i,!0);let u=r.name("valid");e.subschema({schema:i,schemaPath:fe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}C_.macroKeywordCode=k1;function T1(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;O1(c,t);let u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=I_(n,s,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1){if(h(),t.modifying)O_(e);y(()=>e.error())}else{let v=t.async?f():p();if(t.modifying)O_(e);y(()=>A1(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>h(fe._`await `),(A)=>n.assign(d,!1).if(fe._`${A} instanceof ${c.ValidationError}`,()=>n.assign(v,fe._`${A}.errors`),()=>n.throw(A))),v}function p(){let v=fe._`${l}.errors`;return n.assign(v,null),h(fe.nil),v}function h(v=t.async?fe._`await `:fe.nil){let A=c.opts.passContext?On.default.this:On.default.self,k=!(("compile"in t)&&!i||t.schema===!1);n.assign(d,fe._`${v}${N_.callValidateCode(e,l,A,k)}`,t.modifying)}function y(v){var A;n.if(fe.not((A=t.valid)!==null&&A!==void 0?A:d),v)}}C_.funcKeywordCode=T1;function O_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,fe._`${n.parentData}[${n.parentDataProperty}]`))}function A1(e,t){let{gen:r}=e;r.if(fe._`Array.isArray(${t})`,()=>{r.assign(On.default.vErrors,fe._`${On.default.vErrors} === null ? ${t} : ${On.default.vErrors}.concat(${t})`).assign(On.default.errors,fe._`${On.default.vErrors}.length`),P_.extendErrors(e)},()=>e.error())}function O1({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function I_(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:fe.stringify(r)})}function N1(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}C_.validSchemaType=N1;function P1({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let a=s.dependencies;if(a===null||a===void 0?void 0:a.some((i)=>!Object.prototype.hasOwnProperty.call(e,i)))throw Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}C_.validateKeywordUsage=P1});var L_=g(function(D_){Object.defineProperty(D_,"__esModule",{value:!0});D_.extendSubschemaMode=D_.extendSubschemaData=D_.getSubschema=void 0;var De=ee(),si=ce();function q1(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let i=e.schema[t];return r===void 0?{schema:i,schemaPath:De._`${e.schemaPath}${De.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:De._`${e.schemaPath}${De.getProperty(t)}${De.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${si.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}D_.getSubschema=q1;function D1(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=i.let("data",De._`${t.data}${De.getProperty(r)}`,!0);c(m),e.errorPath=De.str`${u}${si.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=De._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(s!==void 0){let u=s instanceof De.Name?s:i.let("data",s,!0);if(c(u),a!==void 0)e.propertyName=a}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}D_.extendSubschemaData=D1;function M1(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}D_.extendSubschemaMode=M1});var fo=g(function(G_){Object.defineProperty(G_,"__esModule",{value:!0});G_.getSchemaRefs=G_.resolveUrl=G_.normalizeId=G_._getFullPath=G_.getFullPath=G_.inlineRef=void 0;var U_=ce(),F1=Qs(),V1=nu(),z1=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function G1(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Yu(e);if(!t)return!1;return F_(e)<=t}G_.inlineRef=G1;var K1=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yu(e){for(let t in e){if(K1.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Yu))return!0;if(typeof r=="object"&&Yu(r))return!0}return!1}function F_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,z1.has(r))continue;if(typeof e[r]=="object")U_.eachItem(e[r],(n)=>t+=F_(n));if(t===1/0)return 1/0}return t}function V_(e,t="",r){if(r!==!1)t=ps(t);let n=e.parse(t);return z_(e,n)}G_.getFullPath=V_;function z_(e,t){return e.serialize(t).split("#")[0]+"#"}G_._getFullPath=z_;var H1=/#\/?$/;function ps(e){return e?e.replace(H1,""):""}G_.normalizeId=ps;function B1(e,t,r){return r=ps(r),e.resolve(t,r)}G_.resolveUrl=B1;var W1=/^[a-z_][-a-z0-9._]*$/i;function Y1(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(e[r]||t),o={"":s},a=V_(n,s,!1),i={},c=new Set;return V1(e,{allKeys:!0},(d,m,f,p)=>{if(p===void 0)return;let h=a+m,y=o[p];if(typeof d[r]=="string")y=v.call(this,d[r]);A.call(this,d.$anchor),A.call(this,d.$dynamicAnchor),o[m]=y;function v(k){let M=this.opts.uriResolver.resolve;if(k=ps(y?M(y,k):k),c.has(k))throw l(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(d,S.schema,k);else if(k!==ps(h))if(k[0]==="#")u(d,i[k],k),i[k]=d;else this.refs[k]=h;return k}function A(k){if(typeof k=="string"){if(!W1.test(k))throw Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),i;function u(d,m,f){if(m!==void 0&&!F1(d,m))throw l(f)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}G_.getSchemaRefs=Y1});var po=g(function(av){Object.defineProperty(av,"__esModule",{value:!0});av.getData=av.KeywordCxt=av.validateFunctionCode=void 0;var ai=a_(),oi=lo(),hs=zu(),Zr=lo(),Y_=S_(),Qt=q_(),ms=L_(),w=ee(),B=br(),X_=fo(),Ue=ce(),Jt=uo();function tj(e){if(Z_(e)){if(ev(e),Q_(e)){sj(e);return}}J_(e,()=>ai.topBoolOrEmptySchema(e))}av.validateFunctionCode=tj;function J_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,w._`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{e.code(w._`"use strict"; ${H_(r,s)}`),nj(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${rj(s)}`,n.$async,()=>e.code(H_(r,s)).code(o))}function rj(e){return w._`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${e.dynamicRef?w._`, ${B.default.dynamicAnchors}={}`:w.nil}}={}`}function nj(e,t){e.if(B.default.valCxt,()=>{if(e.var(B.default.instancePath,w._`${B.default.valCxt}.${B.default.instancePath}`),e.var(B.default.parentData,w._`${B.default.valCxt}.${B.default.parentData}`),e.var(B.default.parentDataProperty,w._`${B.default.valCxt}.${B.default.parentDataProperty}`),e.var(B.default.rootData,w._`${B.default.valCxt}.${B.default.rootData}`),t.dynamicRef)e.var(B.default.dynamicAnchors,w._`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{if(e.var(B.default.instancePath,w._`""`),e.var(B.default.parentData,w._`undefined`),e.var(B.default.parentDataProperty,w._`undefined`),e.var(B.default.rootData,B.default.data),t.dynamicRef)e.var(B.default.dynamicAnchors,w._`{}`)})}function sj(e){let{schema:t,opts:r,gen:n}=e;J_(e,()=>{if(r.$comment&&t.$comment)rv(e);if(uj(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)oj(e);tv(e),fj(e)});return}function oj(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",w._`${r}.evaluated`),t.if(w._`${e.evaluated}.dynamicProps`,()=>t.assign(w._`${e.evaluated}.props`,w._`undefined`)),t.if(w._`${e.evaluated}.dynamicItems`,()=>t.assign(w._`${e.evaluated}.items`,w._`undefined`))}function H_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?w._`/*# sourceURL=${r} */`:w.nil}function aj(e,t){if(Z_(e)){if(ev(e),Q_(e)){ij(e,t);return}}ai.boolOrEmptySchema(e,t)}function Q_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Z_(e){return typeof e.schema!="boolean"}function ij(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)rv(e);lj(e),dj(e);let o=n.const("_errs",B.default.errors);tv(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function ev(e){Ue.checkUnknownRules(e),cj(e)}function tv(e,t){if(e.opts.jtd)return B_(e,[],!1,t);let r=oi.getSchemaTypes(e.schema),n=oi.coerceAndCheckDataType(e,r);B_(e,r,!n,t)}function cj(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Ue.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function uj(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Ue.checkStrictMode(e,"default is ignored in the schema root")}function lj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=X_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function dj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function rv({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(w._`${B.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let a=w.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(w._`${B.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function fj(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(w._`${B.default.errors} === 0`,()=>t.return(B.default.data),()=>t.throw(w._`new ${s}(${B.default.vErrors})`));else{if(t.assign(w._`${n}.errors`,B.default.vErrors),o.unevaluated)pj(e);t.return(w._`${B.default.errors} === 0`)}}function pj({gen:e,evaluated:t,props:r,items:n}){if(r instanceof w.Name)e.assign(w._`${t}.props`,r);if(n instanceof w.Name)e.assign(w._`${t}.items`,n)}function B_(e,t,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Ue.schemaHasRulesButRef(o,l))){s.block(()=>sv(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)mj(e,t);s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){if(!hs.shouldUseGroup(o,m))return;if(m.type){if(s.if(Zr.checkDataType(m.type,a,c.strictNumbers)),W_(e,m),t.length===1&&t[0]===m.type&&r)s.else(),Zr.reportTypeError(e);s.endIf()}else W_(e,m);if(!i)s.if(w._`${B.default.errors} === ${n||0}`)}}function W_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Y_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(hs.shouldUseRule(n,o))sv(e,o.keyword,o.definition,t.type)})}function mj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(hj(e,t),!e.opts.allowUnionTypes)gj(e,t);yj(e,e.dataTypes)}function hj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!nv(e.dataTypes,r))Xu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),vj(e,t)}function gj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Xu(e,"use allowUnionTypes to allow union type keyword")}function yj(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&hs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((a)=>_j(t,a)))Xu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function _j(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function nv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function vj(e,t){let r=[];for(let n of e.dataTypes)if(nv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Xu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Ue.checkStrictMode(e,t,e.opts.strictTypes)}class Ju{constructor(e,t,r){if(Qt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Ue.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",ov(this.$data,e));else if(this.schemaCode=this.schemaValue,!Qt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",B.default.errors)}result(e,t,r){this.failResult(w.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(w.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(w._`${t} !== undefined && (${w.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Jt.reportExtraError:Jt.reportError)(this,this.def.error,t)}$dataError(){Jt.reportError(this,this.def.$dataError||Jt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Jt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=w.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=w.nil,t=w.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(w.or(w._`${n} === undefined`,t)),e!==w.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==w.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return w.or(o(),a());function o(){if(r.length){if(!(t instanceof w.Name))throw Error("ajv implementation error");let i=Array.isArray(r)?r:[r];return w._`${Zr.checkDataTypes(i,t,s.opts.strictNumbers,Zr.DataType.Wrong)}`}return w.nil}function a(){if(n.validateSchema){let i=e.scopeValue("validate$data",{ref:n.validateSchema});return w._`!${i}(${t})`}return w.nil}}subschema(e,t){let r=ms.getSubschema(this.it,e);ms.extendSubschemaData(r,this.it,e),ms.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return aj(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Ue.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Ue.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,w.Name)),!0}}av.KeywordCxt=Ju;function sv(e,t,r,n){let s=new Ju(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Qt.funcKeywordCode(s,r);else if("macro"in r)Qt.macroKeywordCode(s,r);else if(r.compile||r.validate)Qt.funcKeywordCode(s,r)}var bj=/^\/(?:[^~]|~0|~1)*$/,wj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ov(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!bj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=wj.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=t)throw Error(c("property/index",l));return n[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!s)return o}let a=o,i=s.split("/");for(let u of i)if(u)o=w._`${o}${w.getProperty(Ue.unescapeJsonPointer(u))}`,a=w._`${a} && ${o}`;return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}av.getData=ov});var ii=g(function(uv){Object.defineProperty(uv,"__esModule",{value:!0});class cv extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}uv.default=cv});var mo=g(function(dv){Object.defineProperty(dv,"__esModule",{value:!0});var gs=fo();class lv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=gs.resolveUrl(e,t,r),this.missingSchema=gs.normalizeId(gs.getFullPath(e,this.missingRef))}}dv.default=lv});var li=g(function(mv){Object.defineProperty(mv,"__esModule",{value:!0});mv.resolveSchema=mv.getCompilingSchema=mv.resolveRef=mv.compileSchema=mv.SchemaEnv=void 0;var Ae=ee(),Rj=ii(),Nn=br(),Oe=fo(),ci=ce(),fv=po();class ho{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Oe.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}mv.SchemaEnv=ho;function Zu(e){let t=pv.call(this,e);if(t)return t;let r=Oe.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;if(e.$async)i=a.scopeValue("Error",{ref:Rj.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Nn.default.data,parentData:Nn.default.parentData,parentDataProperty:Nn.default.parentDataProperty,dataNames:[Nn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ae.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Ae._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),fv.validateFunctionCode(u),a.optimize(this.opts.code.optimize);let d=a.toString();if(l=`${a.scopeRefs(Nn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let f=Function(`${Nn.default.self}`,`${Nn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:d,scopeValues:a._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(f.evaluated={props:p instanceof Ae.Name?void 0:p,items:h instanceof Ae.Name?void 0:h,dynamicProps:p instanceof Ae.Name,dynamicItems:h instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(d){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}mv.compileSchema=Zu;function kj(e,t,r){var n;r=Oe.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=Oj.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;if(a)o=new ho({schema:a,schemaId:i,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=Tj.call(this,o)}mv.resolveRef=kj;function Tj(e){if(Oe.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Zu.call(this,e)}function pv(e){for(let t of this._compilations)if(Aj(t,e))return t}mv.getCompilingSchema=pv;function Aj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Oj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ui.call(this,e,t)}function ui(e,t){let r=this.opts.uriResolver.parse(t),n=Oe._getFullPath(this.opts.uriResolver,r),s=Oe.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Qu.call(this,r,e);let o=Oe.normalizeId(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=ui.call(this,e,a);if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;return Qu.call(this,r,i)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)Zu.call(this,a);if(o===Oe.normalizeId(t)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];if(u)s=Oe.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:i,schemaId:c,root:e,baseId:s})}return Qu.call(this,r,a)}mv.resolveSchema=ui;var Nj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let i of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ci.unescapeFragment(i)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Nj.has(i)&&u)t=Oe.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ci.schemaHasRulesButRef(r,this.RULES)){let i=Oe.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ui.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new ho({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var gv=g(function(kK,qj){qj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var vv=g(function(_v){Object.defineProperty(_v,"__esModule",{value:!0});var yv=mu();yv.code='require("ajv/dist/runtime/uri").default';_v.default=yv});var Av=g(function(wr){Object.defineProperty(wr,"__esModule",{value:!0});wr.CodeGen=wr.Name=wr.nil=wr.stringify=wr.str=wr._=wr.KeywordCxt=void 0;var Mj=po();Object.defineProperty(wr,"KeywordCxt",{enumerable:!0,get:function(){return Mj.KeywordCxt}});var _s=ee();Object.defineProperty(wr,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(wr,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(wr,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(wr,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(wr,"Name",{enumerable:!0,get:function(){return _s.Name}});Object.defineProperty(wr,"CodeGen",{enumerable:!0,get:function(){return _s.CodeGen}});var Lj=ii(),Sv=mo(),xv=Vu(),Zt=li(),Rv=ee(),er=fo(),en=lo(),ys=ce(),bv=gv(),Uj=vv(),kv=(e,t)=>new RegExp(e,t);kv.code="new RegExp";var Fj=["removeAdditional","useDefaults","coerceTypes"],Vj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),zj={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Gj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wv=200;function Kj(e){var t,r,n,s,o,a,i,c,u,l,d,m,f,p,h,y,v,A,k,M,S,$e,je,kr,Ct;let Ve=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,hr=xt===!0||xt===void 0?1:xt||0,wn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:kv,Ln=(s=e.uriResolver)!==null&&s!==void 0?s:Uj.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Ve)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:Ve)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ve)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&m!==void 0?m:"log",strictRequired:(p=(f=e.strictRequired)!==null&&f!==void 0?f:Ve)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:hr,regExp:wn}:{optimize:hr,regExp:wn},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:wv,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:wv,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(A=e.messages)!==null&&A!==void 0?A:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:($e=e.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(je=e.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(kr=e.unicodeRegExp)!==null&&kr!==void 0?kr:!0,int32range:(Ct=e.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:Ln}}class di{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Kj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new Rv.ValueScope({scope:{},prefixes:Vj,es5:t,lines:r}),this.logger=Jj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=xv.getRules(),$v.call(this,zj,e,"NOT SUPPORTED"),$v.call(this,Gj,e,"DEPRECATED","warn"),this._metaOpts=Yj.call(this),e.formats)Bj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Wj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Hj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=bv;if(r==="id")n={...bv},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof Sv.default))throw l;return a.call(this,l),await i.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function i(u){let l=await c.call(this,u);if(!this.refs[u])await s.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=er.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=Ev.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Zt.SchemaEnv({schema:{},schemaId:r});if(t=Zt.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=Ev.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=er.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Zj.call(this,r,t),!t)return ys.eachItem(r,(s)=>el.call(this,s)),this;tq.call(this,t);let n={...t,type:en.getJSONTypes(t.type),schemaType:en.getJSONTypes(t.schemaType)};return ys.eachItem(r,n.type.length===0?(s)=>el.call(this,s,n):(s)=>n.type.forEach((o)=>el.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let i=r[a];if(typeof i!="object")continue;let{$data:c}=i.definition,u=o[a];if(c&&u)o[a]=Tv(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let i=this._cache.get(e);if(i!==void 0)return i;r=er.normalizeId(o||r);let c=er.getSchemaRefs.call(this,e,r);if(i=new Zt.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(n)this.validateSchema(e,!0);return i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Zt.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Zt.compileSchema.call(this,e)}finally{this.opts=t}}}di.ValidationError=Lj.default;di.MissingRefError=Sv.default;wr.default=di;function $v(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function Ev(e){return e=er.normalizeId(e),this.schemas[e]||this.refs[e]}function Hj(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Bj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Wj(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Yj(){let e={...this.opts};for(let t of Fj)delete e[t];return e}var Xj={log(){},warn(){},error(){}};function Jj(e){if(e===!1)return Xj;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Qj=/^[a-z_$][a-z0-9_$:-]*$/i;function Zj(e,t){let{RULES:r}=this;if(ys.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Qj.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function el(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=s?o.post:o.rules.find(({type:c})=>c===r);if(!a)a={type:r,rules:[]},o.rules.push(a);if(o.keywords[e]=!0,!t)return;let i={keyword:e,definition:{...t,type:en.getJSONTypes(t.type),schemaType:en.getJSONTypes(t.schemaType)}};if(t.before)eq.call(this,a,i,t.before);else a.rules.push(i);o.all[e]=i,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function eq(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function tq(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=Tv(t);e.validateSchema=this.compile(t,!0)}var rq={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,rq]}}});var Nv=g(function(Ov){Object.defineProperty(Ov,"__esModule",{value:!0});var oq={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ov.default=oq});var jv=g(function(Iv){Object.defineProperty(Iv,"__esModule",{value:!0});Iv.callRef=Iv.getValidate=void 0;var iq=mo(),pi=_t(),ge=ee(),vs=br(),mi=li(),tn=ce(),cq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=mi.resolveRef.call(c,u,s,r);if(l===void 0)throw new iq.default(n.opts.uriResolver,s,r);if(l instanceof mi.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return fi(e,a,o,o.$async);let p=t.scopeValue("root",{ref:u});return fi(e,ge._`${p}.validate`,u,u.$async)}function m(p){let h=Pv(e,p);fi(e,h,p,p.$async)}function f(p){let h=t.scopeValue("schema",i.code.source===!0?{ref:p,code:ge.stringify(p)}:{ref:p}),y=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:ge.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function Pv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ge._`${r.scopeValue("wrapper",{ref:t})}.validate`}Iv.getValidate=Pv;function fi(e,t,r,n){let{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?vs.default.this:ge.nil;if(n)l();else d();function l(){if(!i.$async)throw Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{if(s.code(ge._`await ${pi.callValidateCode(e,t,u)}`),f(t),!a)s.assign(p,!0)},(h)=>{if(s.if(ge._`!(${h} instanceof ${o.ValidationError})`,()=>s.throw(h)),m(h),!a)s.assign(p,!1)}),e.ok(p)}function d(){e.result(pi.callValidateCode(e,t,u),()=>f(t),()=>m(t))}function m(p){let h=ge._`${p}.errors`;s.assign(vs.default.vErrors,ge._`${vs.default.vErrors} === null ? ${h} : ${vs.default.vErrors}.concat(${h})`),s.assign(vs.default.errors,ge._`${vs.default.vErrors}.length`)}function f(p){var h;if(!o.opts.unevaluated)return;let y=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=tn.mergeEvaluated.props(s,y.props,o.props)}else{let v=s.var("props",ge._`${p}.evaluated.props`);o.props=tn.mergeEvaluated.props(s,v,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=tn.mergeEvaluated.items(s,y.items,o.items)}else{let v=s.var("items",ge._`${p}.evaluated.items`);o.items=tn.mergeEvaluated.items(s,v,o.items,ge.Name)}}}Iv.callRef=fi;Iv.default=cq});var Dv=g(function(qv){Object.defineProperty(qv,"__esModule",{value:!0});var dq=Nv(),fq=jv(),pq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",dq.default,fq.default];qv.default=pq});var Lv=g(function(Mv){Object.defineProperty(Mv,"__esModule",{value:!0});var nn=ee(),rn=nn.operators,hi={maximum:{okStr:"<=",ok:rn.LTE,fail:rn.GT},minimum:{okStr:">=",ok:rn.GTE,fail:rn.LT},exclusiveMaximum:{okStr:"<",ok:rn.LT,fail:rn.GTE},exclusiveMinimum:{okStr:">",ok:rn.GT,fail:rn.LTE}},hq={message:({keyword:e,schemaCode:t})=>nn.str`must be ${hi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>nn._`{comparison: ${hi[e].okStr}, limit: ${t}}`},gq={keyword:Object.keys(hi),type:"number",schemaType:"number",$data:!0,error:hq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(nn._`${r} ${hi[t].fail} ${n} || isNaN(${r})`)}};Mv.default=gq});var Fv=g(function(Uv){Object.defineProperty(Uv,"__esModule",{value:!0});var tr=ee(),_q={message:({schemaCode:e})=>tr.str`must be multiple of ${e}`,params:({schemaCode:e})=>tr._`{multipleOf: ${e}}`},vq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_q,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?tr._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:tr._`${a} !== parseInt(${a})`;e.fail$data(tr._`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Uv.default=vq});var Gv=g(function(zv){Object.defineProperty(zv,"__esModule",{value:!0});function Vv(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}zv.default=Vv;Vv.code='require("ajv/dist/runtime/ucs2length").default'});var Bv=g(function(Hv){Object.defineProperty(Hv,"__esModule",{value:!0});var ct=ee(),Kv=ce(),$q=Gv(),Eq={message({keyword:e,schemaCode:t}){return ct.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>ct._`{limit: ${e}}`},Sq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Eq,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?ct.operators.GT:ct.operators.LT,a=s.opts.unicode===!1?ct._`${r}.length`:ct._`${Kv.useFunc(e.gen,$q.default)}(${r})`;e.fail$data(ct._`${a} ${o} ${n}`)}};Hv.default=Sq});var Xv=g(function(Yv){Object.defineProperty(Yv,"__esModule",{value:!0});var Wv=_t(),sn=ee(),Rq={message:({schemaCode:e})=>sn.str`must match pattern "${e}"`,params:({schemaCode:e})=>sn._`{pattern: ${e}}`},kq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Rq,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"",i=r?sn._`(new RegExp(${s}, ${a}))`:Wv.usePattern(e,n);e.fail$data(sn._`!${i}.test(${t})`)}};Yv.default=kq});var Qv=g(function(Jv){Object.defineProperty(Jv,"__esModule",{value:!0});var rr=ee(),Aq={message({keyword:e,schemaCode:t}){return rr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>rr._`{limit: ${e}}`},Oq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Aq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?rr.operators.GT:rr.operators.LT;e.fail$data(rr._`Object.keys(${r}).length ${s} ${n}`)}};Jv.default=Oq});var t0=g(function(e0){Object.defineProperty(e0,"__esModule",{value:!0});var nr=_t(),sr=ee(),Zv=ce(),Pq={message:({params:{missingProperty:e}})=>sr.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>sr._`{missingProperty: ${e}}`},Iq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Pq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors)u();else l();if(i.strictRequired){let f=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((f===null||f===void 0?void 0:f[h])===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;Zv.checkStrictMode(a,v,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(sr.nil,d);else for(let f of r)nr.checkReportMissingProp(e,f)}function l(){let f=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>m(f,p)),e.ok(p)}else t.if(nr.checkMissingProp(e,r,f)),nr.reportMissingProp(e,f),t.else()}function d(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(nr.noPropertyInData(t,s,f,i.ownProperties),()=>e.error())})}function m(f,p){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(p,nr.propertyInData(t,s,f,i.ownProperties)),t.if(sr.not(p),()=>{e.error(),t.break()})},sr.nil)}}};e0.default=Iq});var n0=g(function(r0){Object.defineProperty(r0,"__esModule",{value:!0});var or=ee(),jq={message({keyword:e,schemaCode:t}){return or.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>or._`{limit: ${e}}`},qq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:jq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?or.operators.GT:or.operators.LT;e.fail$data(or._`${r}.length ${s} ${n}`)}};r0.default=qq});var gi=g(function(o0){Object.defineProperty(o0,"__esModule",{value:!0});var s0=Qs();s0.code='require("ajv/dist/runtime/equal").default';o0.default=s0});var c0=g(function(i0){Object.defineProperty(i0,"__esModule",{value:!0});var bs=lo(),ae=ee(),a0=ce(),Lq=gi(),Uq={message:({params:{i:e,j:t}})=>ae.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>ae._`{i: ${e}, j: ${t}}`},Fq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Uq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?bs.getSchemaTypes(o.items):[];e.block$data(c,l,ae._`${a} === false`),e.ok(c);function l(){let p=t.let("i",ae._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(ae._`${p} > 1`,()=>(d()?m:f)(p,h))}function d(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function m(p,h){let y=t.name("item"),v=bs.checkDataTypes(u,y,i.opts.strictNumbers,bs.DataType.Wrong),A=t.const("indices",ae._`{}`);t.for(ae._`;${p}--;`,()=>{if(t.let(y,ae._`${r}[${p}]`),t.if(v,ae._`continue`),u.length>1)t.if(ae._`typeof ${y} == "string"`,ae._`${y} += "_"`);t.if(ae._`typeof ${A}[${y}] == "number"`,()=>{t.assign(h,ae._`${A}[${y}]`),e.error(),t.assign(c,!1).break()}).code(ae._`${A}[${y}] = ${p}`)})}function f(p,h){let y=a0.useFunc(t,Lq.default),v=t.name("outer");t.label(v).for(ae._`;${p}--;`,()=>t.for(ae._`${h} = ${p}; ${h}--;`,()=>t.if(ae._`${y}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};i0.default=Fq});var d0=g(function(l0){Object.defineProperty(l0,"__esModule",{value:!0});var ws=ee(),u0=ce(),zq=gi(),Gq={message:"must be equal to constant",params:({schemaCode:e})=>ws._`{allowedValue: ${e}}`},Kq={keyword:"const",$data:!0,error:Gq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(ws._`!${u0.useFunc(t,zq.default)}(${r}, ${s})`);else e.fail(ws._`${o} !== ${r}`)}};l0.default=Kq});var m0=g(function(p0){Object.defineProperty(p0,"__esModule",{value:!0});var ar=ee(),f0=ce(),Bq=gi(),Wq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ar._`{allowedValues: ${e}}`},Yq={keyword:"enum",schemaType:"array",$data:!0,error:Wq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=f0.useFunc(t,Bq.default),l;if(i||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);l=ar.or(...s.map((p,h)=>m(f,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,(f)=>t.if(ar._`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,p){let h=s[p];return typeof h==="object"&&h!==null?ar._`${u()}(${r}, ${f}[${p}])`:ar._`${r} === ${h}`}}};p0.default=Yq});var g0=g(function(h0){Object.defineProperty(h0,"__esModule",{value:!0});var Jq=Lv(),Qq=Fv(),Zq=Bv(),eD=Xv(),tD=Qv(),rD=t0(),nD=n0(),sD=c0(),oD=d0(),aD=m0(),iD=[Jq.default,Qq.default,Zq.default,eD.default,tD.default,rD.default,nD.default,sD.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},oD.default,aD.default];h0.default=iD});var tl=g(function(_0){Object.defineProperty(_0,"__esModule",{value:!0});_0.validateAdditionalItems=void 0;var ut=ee(),$s=ce(),uD={message:({params:{len:e}})=>ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ut._`{limit: ${e}}`},lD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:uD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){$s.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}y0(e,n)}};function y0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;let i=r.const("len",ut._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ut._`${i} <= ${t.length}`);else if(typeof n=="object"&&!$s.alwaysValidSchema(a,n)){let u=r.var("valid",ut._`${i} <= ${t.length}`);r.if(ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:$s.Type.Num},u),!a.allErrors)r.if(ut.not(u),()=>r.break())})}}_0.validateAdditionalItems=y0;_0.default=lD});var rl=g(function($0){Object.defineProperty($0,"__esModule",{value:!0});$0.validateTuple=void 0;var yi=ee(),on=ce(),b0=_t(),fD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return w0(e,"additionalItems",t);if(r.items=!0,on.alwaysValidSchema(r,t))return;e.ok(b0.validateArray(e))}};function w0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;if(l(s),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=on.mergeEvaluated.items(n,r.length,i.items);let c=n.name("valid"),u=n.const("len",yi._`${o}.length`);r.forEach((d,m)=>{if(on.alwaysValidSchema(i,d))return;n.if(yi._`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c)});function l(d){let{opts:m,errSchemaPath:f}=i,p=r.length,h=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;on.checkStrictMode(i,y,m.strictTuples)}}}$0.validateTuple=w0;$0.default=fD});var R0=g(function(x0){Object.defineProperty(x0,"__esModule",{value:!0});var S0=rl(),mD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>S0.validateTuple(e,"items")};x0.default=mD});var N0=g(function(O0){Object.defineProperty(O0,"__esModule",{value:!0});var _i=ee(),k0=ce(),T0=_t(),A0=tl(),gD={message:({params:{len:e}})=>_i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>_i._`{limit: ${e}}`},yD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:gD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,k0.alwaysValidSchema(n,t))return;if(s)A0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};O0.default=yD});var I0=g(function(P0){Object.defineProperty(P0,"__esModule",{value:!0});var ve=ee(),an=ce(),vD={message:({params:{min:e,max:t}})=>t===void 0?ve.str`must contain at least ${e} valid item(s)`:ve.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?ve._`{minContains: ${e}}`:ve._`{minContains: ${e}, maxContains: ${t}}`},bD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,a,i,{minContains:c,maxContains:u}=n;if(o.opts.next)a=c===void 0?1:c,i=u;else a=1;let l=t.const("len",ve._`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){an.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){an.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(an.alwaysValidSchema(o,r)){let h=ve._`${l} >= ${a}`;if(i!==void 0)h=ve._`${h} && ${l} <= ${i}`;e.pass(h);return}o.items=!0;let d=t.name("valid");if(i===void 0&&a===1)f(d,()=>t.if(d,()=>t.break()));else if(a===0){if(t.let(d,!0),i!==void 0)t.if(ve._`${s}.length > 0`,m)}else t.let(d,!1),m();e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);f(h,()=>t.if(h,()=>p(y)))}function f(h,y){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:an.Type.Num,compositeRule:!0},h),y()})}function p(h){if(t.code(ve._`${h}++`),i===void 0)t.if(ve._`${h} >= ${a}`,()=>t.assign(d,!0).break());else if(t.if(ve._`${h} > ${i}`,()=>t.assign(d,!1).break()),a===1)t.assign(d,!0);else t.if(ve._`${h} >= ${a}`,()=>t.assign(d,!0))}}};P0.default=bD});var U0=g(function(D0){Object.defineProperty(D0,"__esModule",{value:!0});D0.validateSchemaDeps=D0.validatePropertyDeps=D0.error=void 0;var Es=ee(),C0=ce(),ir=_t();D0.error={message:({params:{property:e,depsCount:t,deps:r}})=>Es.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>Es._`{property: ${e},
|
|
14
|
+
|| ${a} === "boolean" || ${s} === null`).assign(i,R._`[${s}]`)}}}function XI({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function Gu(e,t,r,n=ds.Correct){let s=n===ds.Correct?R.operators.EQ:R.operators.NEQ,o;switch(e){case"null":return R._`${t} ${s} null`;case"array":o=R._`Array.isArray(${t})`;break;case"object":o=R._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return R._`typeof ${t} ${s} ${e}`}return n===ds.Correct?o:R.not(o);function a(i=R.nil){return R.and(R._`typeof ${t} == "number"`,i,r?R._`isFinite(${t})`:R.nil)}}__.checkDataType=Gu;function Ku(e,t,r,n){if(e.length===1)return Gu(e[0],t,r,n);let s,o=ni.toHash(e);if(o.array&&o.object){let a=R._`typeof ${t} != "object"`;s=o.null?a:R._`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let a in o)s=R.and(s,Gu(a,t,r,n));return s}__.checkDataTypes=Ku;var JI={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Hu(e){let t=QI(e);h_.reportError(t,JI)}__.reportTypeError=Hu;function QI(e){let{gen:t,data:r,schema:n}=e,s=ni.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var S_=g(function($_){Object.defineProperty($_,"__esModule",{value:!0});$_.assignDefaults=void 0;var yt=ee(),w_=ce();function o1(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)b_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>b_(e,o,s.default))}$_.assignDefaults=o1;function b_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:a}=e;if(r===void 0)return;let i=yt._`${o}${yt.getProperty(t)}`;if(s){w_.checkStrictMode(e,`default is ignored for: ${i}`);return}let c=yt._`${i} === undefined`;if(a.useDefaults==="empty")c=yt._`${c} || ${i} === null || ${i} === ""`;n.if(c,yt._`${i} = ${yt.stringify(r)}`)}});var _t=g(function(T_){Object.defineProperty(T_,"__esModule",{value:!0});T_.validateUnion=T_.validateArray=T_.usePattern=T_.callValidateCode=T_.schemaProperties=T_.allSchemaProperties=T_.noPropertyInData=T_.propertyInData=T_.isOwnProperty=T_.hasPropFunc=T_.reportMissingProp=T_.checkMissingProp=T_.checkReportMissingProp=void 0;var z=ee(),fs=ce(),Qr=br(),x_=ce();function a1(e,t){let{gen:r,data:n,it:s}=e;r.if(Wu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=a1;function i1({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Wu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=i1;function c1(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=c1;function R_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=R_;function Bu(e,t,r){return z._`${R_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Bu;function u1(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Bu(e,t,r)}`:s}T_.propertyInData=u1;function Wu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Bu(e,t,r))):s}T_.noPropertyInData=Wu;function k_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=k_;function l1(e,t){return k_(t).filter((r)=>!fs.alwaysValidSchema(e,t[r]))}T_.schemaProperties=l1;function d1({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:a},i,c,u){let l=u?z._`${e}, ${t}, ${n}${s}`:t,d=[[Qr.default.instancePath,z.strConcat(Qr.default.instancePath,o)],[Qr.default.parentData,a.parentData],[Qr.default.parentDataProperty,a.parentDataProperty],[Qr.default.rootData,Qr.default.rootData]];if(a.opts.dynamicRef)d.push([Qr.default.dynamicAnchors,Qr.default.dynamicAnchors]);let m=z._`${l}, ${r.object(...d)}`;return c!==z.nil?z._`${i}.call(${c}, ${m})`:z._`${i}(${m})`}T_.callValidateCode=d1;var f1=z._`new RegExp`;function p1({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:z._`${s.code==="new RegExp"?f1:x_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=p1;function m1(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let i=t.let("valid",!0);return a(()=>t.assign(i,!1)),i}return t.var(o,!0),a(()=>t.break()),o;function a(i){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:fs.Type.Num},o),t.if(z.not(o),i)})}}T_.validateArray=m1;function h1(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>fs.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),i=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},i);if(t.assign(a,z._`${a} || ${i}`),!e.mergeValidEvaluated(l,i))t.if(z.not(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=h1});var q_=g(function(I_){Object.defineProperty(I_,"__esModule",{value:!0});I_.validateKeywordUsage=I_.validSchemaType=I_.funcKeywordCode=I_.macroKeywordCode=void 0;var fe=ee(),On=br(),N_=_t(),P_=uo();function T1(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:a}=e,i=t.macro.call(a.self,s,o,a),c=C_(r,n,i);if(a.opts.validateSchema!==!1)a.self.validateSchema(i,!0);let u=r.name("valid");e.subschema({schema:i,schemaPath:fe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}I_.macroKeywordCode=T1;function A1(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:a,$data:i,it:c}=e;N1(c,t);let u=!i&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=C_(n,s,u),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1){if(h(),t.modifying)O_(e);y(()=>e.error())}else{let v=t.async?f():p();if(t.modifying)O_(e);y(()=>O1(e,v))}}function f(){let v=n.let("ruleErrs",null);return n.try(()=>h(fe._`await `),(A)=>n.assign(d,!1).if(fe._`${A} instanceof ${c.ValidationError}`,()=>n.assign(v,fe._`${A}.errors`),()=>n.throw(A))),v}function p(){let v=fe._`${l}.errors`;return n.assign(v,null),h(fe.nil),v}function h(v=t.async?fe._`await `:fe.nil){let A=c.opts.passContext?On.default.this:On.default.self,k=!(("compile"in t)&&!i||t.schema===!1);n.assign(d,fe._`${v}${N_.callValidateCode(e,l,A,k)}`,t.modifying)}function y(v){var A;n.if(fe.not((A=t.valid)!==null&&A!==void 0?A:d),v)}}I_.funcKeywordCode=A1;function O_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,fe._`${n.parentData}[${n.parentDataProperty}]`))}function O1(e,t){let{gen:r}=e;r.if(fe._`Array.isArray(${t})`,()=>{r.assign(On.default.vErrors,fe._`${On.default.vErrors} === null ? ${t} : ${On.default.vErrors}.concat(${t})`).assign(On.default.errors,fe._`${On.default.vErrors}.length`),P_.extendErrors(e)},()=>e.error())}function N1({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function C_(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:fe.stringify(r)})}function P1(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}I_.validSchemaType=P1;function C1({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let a=s.dependencies;if(a===null||a===void 0?void 0:a.some((i)=>!Object.prototype.hasOwnProperty.call(e,i)))throw Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}I_.validateKeywordUsage=C1});var L_=g(function(D_){Object.defineProperty(D_,"__esModule",{value:!0});D_.extendSubschemaMode=D_.extendSubschemaData=D_.getSubschema=void 0;var De=ee(),si=ce();function D1(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let i=e.schema[t];return r===void 0?{schema:i,schemaPath:De._`${e.schemaPath}${De.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:De._`${e.schemaPath}${De.getProperty(t)}${De.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${si.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||a===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}D_.getSubschema=D1;function M1(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:a}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,m=i.let("data",De._`${t.data}${De.getProperty(r)}`,!0);c(m),e.errorPath=De.str`${u}${si.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=De._`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(s!==void 0){let u=s instanceof De.Name?s:i.let("data",s,!0);if(c(u),a!==void 0)e.propertyName=a}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}D_.extendSubschemaData=M1;function L1(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}D_.extendSubschemaMode=L1});var fo=g(function(G_){Object.defineProperty(G_,"__esModule",{value:!0});G_.getSchemaRefs=G_.resolveUrl=G_.normalizeId=G_._getFullPath=G_.getFullPath=G_.inlineRef=void 0;var U_=ce(),V1=Qs(),z1=nu(),G1=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function K1(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Yu(e);if(!t)return!1;return F_(e)<=t}G_.inlineRef=K1;var H1=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yu(e){for(let t in e){if(H1.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Yu))return!0;if(typeof r=="object"&&Yu(r))return!0}return!1}function F_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,G1.has(r))continue;if(typeof e[r]=="object")U_.eachItem(e[r],(n)=>t+=F_(n));if(t===1/0)return 1/0}return t}function V_(e,t="",r){if(r!==!1)t=ps(t);let n=e.parse(t);return z_(e,n)}G_.getFullPath=V_;function z_(e,t){return e.serialize(t).split("#")[0]+"#"}G_._getFullPath=z_;var B1=/#\/?$/;function ps(e){return e?e.replace(B1,""):""}G_.normalizeId=ps;function W1(e,t,r){return r=ps(r),e.resolve(t,r)}G_.resolveUrl=W1;var Y1=/^[a-z_][-a-z0-9._]*$/i;function X1(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ps(e[r]||t),o={"":s},a=V_(n,s,!1),i={},c=new Set;return z1(e,{allKeys:!0},(d,m,f,p)=>{if(p===void 0)return;let h=a+m,y=o[p];if(typeof d[r]=="string")y=v.call(this,d[r]);A.call(this,d.$anchor),A.call(this,d.$dynamicAnchor),o[m]=y;function v(k){let M=this.opts.uriResolver.resolve;if(k=ps(y?M(y,k):k),c.has(k))throw l(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(d,S.schema,k);else if(k!==ps(h))if(k[0]==="#")u(d,i[k],k),i[k]=d;else this.refs[k]=h;return k}function A(k){if(typeof k=="string"){if(!Y1.test(k))throw Error(`invalid anchor "${k}"`);v.call(this,`#${k}`)}}}),i;function u(d,m,f){if(m!==void 0&&!V1(d,m))throw l(f)}function l(d){return Error(`reference "${d}" resolves to more than one schema`)}}G_.getSchemaRefs=X1});var po=g(function(av){Object.defineProperty(av,"__esModule",{value:!0});av.getData=av.KeywordCxt=av.validateFunctionCode=void 0;var ai=a_(),oi=lo(),hs=zu(),Zr=lo(),Y_=S_(),Qt=q_(),ms=L_(),w=ee(),B=br(),X_=fo(),Ue=ce(),Jt=uo();function rj(e){if(Z_(e)){if(ev(e),Q_(e)){oj(e);return}}J_(e,()=>ai.topBoolOrEmptySchema(e))}av.validateFunctionCode=rj;function J_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,w._`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{e.code(w._`"use strict"; ${H_(r,s)}`),sj(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${nj(s)}`,n.$async,()=>e.code(H_(r,s)).code(o))}function nj(e){return w._`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${e.dynamicRef?w._`, ${B.default.dynamicAnchors}={}`:w.nil}}={}`}function sj(e,t){e.if(B.default.valCxt,()=>{if(e.var(B.default.instancePath,w._`${B.default.valCxt}.${B.default.instancePath}`),e.var(B.default.parentData,w._`${B.default.valCxt}.${B.default.parentData}`),e.var(B.default.parentDataProperty,w._`${B.default.valCxt}.${B.default.parentDataProperty}`),e.var(B.default.rootData,w._`${B.default.valCxt}.${B.default.rootData}`),t.dynamicRef)e.var(B.default.dynamicAnchors,w._`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{if(e.var(B.default.instancePath,w._`""`),e.var(B.default.parentData,w._`undefined`),e.var(B.default.parentDataProperty,w._`undefined`),e.var(B.default.rootData,B.default.data),t.dynamicRef)e.var(B.default.dynamicAnchors,w._`{}`)})}function oj(e){let{schema:t,opts:r,gen:n}=e;J_(e,()=>{if(r.$comment&&t.$comment)rv(e);if(lj(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)aj(e);tv(e),pj(e)});return}function aj(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",w._`${r}.evaluated`),t.if(w._`${e.evaluated}.dynamicProps`,()=>t.assign(w._`${e.evaluated}.props`,w._`undefined`)),t.if(w._`${e.evaluated}.dynamicItems`,()=>t.assign(w._`${e.evaluated}.items`,w._`undefined`))}function H_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?w._`/*# sourceURL=${r} */`:w.nil}function ij(e,t){if(Z_(e)){if(ev(e),Q_(e)){cj(e,t);return}}ai.boolOrEmptySchema(e,t)}function Q_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Z_(e){return typeof e.schema!="boolean"}function cj(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)rv(e);dj(e),fj(e);let o=n.const("_errs",B.default.errors);tv(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function ev(e){Ue.checkUnknownRules(e),uj(e)}function tv(e,t){if(e.opts.jtd)return B_(e,[],!1,t);let r=oi.getSchemaTypes(e.schema),n=oi.coerceAndCheckDataType(e,r);B_(e,r,!n,t)}function uj(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Ue.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function lj(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Ue.checkStrictMode(e,"default is ignored in the schema root")}function dj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=X_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function fj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function rv({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(w._`${B.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let a=w.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(w._`${B.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function pj(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(w._`${B.default.errors} === 0`,()=>t.return(B.default.data),()=>t.throw(w._`new ${s}(${B.default.vErrors})`));else{if(t.assign(w._`${n}.errors`,B.default.vErrors),o.unevaluated)mj(e);t.return(w._`${B.default.errors} === 0`)}}function mj({gen:e,evaluated:t,props:r,items:n}){if(r instanceof w.Name)e.assign(w._`${t}.props`,r);if(n instanceof w.Name)e.assign(w._`${t}.items`,n)}function B_(e,t,r,n){let{gen:s,schema:o,data:a,allErrors:i,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Ue.schemaHasRulesButRef(o,l))){s.block(()=>sv(e,"$ref",l.all.$ref.definition));return}if(!c.jtd)hj(e,t);s.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){if(!hs.shouldUseGroup(o,m))return;if(m.type){if(s.if(Zr.checkDataType(m.type,a,c.strictNumbers)),W_(e,m),t.length===1&&t[0]===m.type&&r)s.else(),Zr.reportTypeError(e);s.endIf()}else W_(e,m);if(!i)s.if(w._`${B.default.errors} === ${n||0}`)}}function W_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Y_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(hs.shouldUseRule(n,o))sv(e,o.keyword,o.definition,t.type)})}function hj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(gj(e,t),!e.opts.allowUnionTypes)yj(e,t);_j(e,e.dataTypes)}function gj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!nv(e.dataTypes,r))Xu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),bj(e,t)}function yj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Xu(e,"use allowUnionTypes to allow union type keyword")}function _j(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&hs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((a)=>vj(t,a)))Xu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function vj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function nv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function bj(e,t){let r=[];for(let n of e.dataTypes)if(nv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Xu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Ue.checkStrictMode(e,t,e.opts.strictTypes)}class Ju{constructor(e,t,r){if(Qt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Ue.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",ov(this.$data,e));else if(this.schemaCode=this.schemaValue,!Qt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",B.default.errors)}result(e,t,r){this.failResult(w.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(w.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(w._`${t} !== undefined && (${w.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Jt.reportExtraError:Jt.reportError)(this,this.def.error,t)}$dataError(){Jt.reportError(this,this.def.$dataError||Jt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Jt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=w.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=w.nil,t=w.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(w.or(w._`${n} === undefined`,t)),e!==w.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==w.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return w.or(o(),a());function o(){if(r.length){if(!(t instanceof w.Name))throw Error("ajv implementation error");let i=Array.isArray(r)?r:[r];return w._`${Zr.checkDataTypes(i,t,s.opts.strictNumbers,Zr.DataType.Wrong)}`}return w.nil}function a(){if(n.validateSchema){let i=e.scopeValue("validate$data",{ref:n.validateSchema});return w._`!${i}(${t})`}return w.nil}}subschema(e,t){let r=ms.getSubschema(this.it,e);ms.extendSubschemaData(r,this.it,e),ms.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return ij(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Ue.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Ue.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,w.Name)),!0}}av.KeywordCxt=Ju;function sv(e,t,r,n){let s=new Ju(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Qt.funcKeywordCode(s,r);else if("macro"in r)Qt.macroKeywordCode(s,r);else if(r.compile||r.validate)Qt.funcKeywordCode(s,r)}var wj=/^\/(?:[^~]|~0|~1)*$/,$j=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ov(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!wj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=$j.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(s=u[2],s==="#"){if(l>=t)throw Error(c("property/index",l));return n[t-l]}if(l>t)throw Error(c("data",l));if(o=r[t-l],!s)return o}let a=o,i=s.split("/");for(let u of i)if(u)o=w._`${o}${w.getProperty(Ue.unescapeJsonPointer(u))}`,a=w._`${a} && ${o}`;return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}av.getData=ov});var ii=g(function(uv){Object.defineProperty(uv,"__esModule",{value:!0});class cv extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}uv.default=cv});var mo=g(function(dv){Object.defineProperty(dv,"__esModule",{value:!0});var gs=fo();class lv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=gs.resolveUrl(e,t,r),this.missingSchema=gs.normalizeId(gs.getFullPath(e,this.missingRef))}}dv.default=lv});var li=g(function(mv){Object.defineProperty(mv,"__esModule",{value:!0});mv.resolveSchema=mv.getCompilingSchema=mv.resolveRef=mv.compileSchema=mv.SchemaEnv=void 0;var Ae=ee(),kj=ii(),Nn=br(),Oe=fo(),ci=ce(),fv=po();class ho{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Oe.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}mv.SchemaEnv=ho;function Zu(e){let t=pv.call(this,e);if(t)return t;let r=Oe.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,a=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),i;if(e.$async)i=a.scopeValue("Error",{ref:kj.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Nn.default.data,parentData:Nn.default.parentData,parentDataProperty:Nn.default.parentDataProperty,dataNames:[Nn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ae.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Ae._`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),fv.validateFunctionCode(u),a.optimize(this.opts.code.optimize);let d=a.toString();if(l=`${a.scopeRefs(Nn.default.scope)}return ${d}`,this.opts.code.process)l=this.opts.code.process(l,e);let f=Function(`${Nn.default.self}`,`${Nn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:d,scopeValues:a._values};if(this.opts.unevaluated){let{props:p,items:h}=u;if(f.evaluated={props:p instanceof Ae.Name?void 0:p,items:h instanceof Ae.Name?void 0:h,dynamicProps:p instanceof Ae.Name,dynamicItems:h instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(d){if(delete e.validate,delete e.validateName,l)this.logger.error("Error compiling schema, function code:",l);throw d}finally{this._compilations.delete(e)}}mv.compileSchema=Zu;function Tj(e,t,r){var n;r=Oe.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=Nj.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;if(a)o=new ho({schema:a,schemaId:i,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=Aj.call(this,o)}mv.resolveRef=Tj;function Aj(e){if(Oe.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Zu.call(this,e)}function pv(e){for(let t of this._compilations)if(Oj(t,e))return t}mv.getCompilingSchema=pv;function Oj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Nj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ui.call(this,e,t)}function ui(e,t){let r=this.opts.uriResolver.parse(t),n=Oe._getFullPath(this.opts.uriResolver,r),s=Oe.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Qu.call(this,r,e);let o=Oe.normalizeId(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let i=ui.call(this,e,a);if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;return Qu.call(this,r,i)}if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;if(!a.validate)Zu.call(this,a);if(o===Oe.normalizeId(t)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];if(u)s=Oe.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:i,schemaId:c,root:e,baseId:s})}return Qu.call(this,r,a)}mv.resolveSchema=ui;var Pj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let i of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ci.unescapeFragment(i)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Pj.has(i)&&u)t=Oe.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ci.schemaHasRulesButRef(r,this.RULES)){let i=Oe.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ui.call(this,n,i)}let{schemaId:a}=this.opts;if(o=o||new ho({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var gv=g(function(NK,Dj){Dj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var vv=g(function(_v){Object.defineProperty(_v,"__esModule",{value:!0});var yv=mu();yv.code='require("ajv/dist/runtime/uri").default';_v.default=yv});var Av=g(function(wr){Object.defineProperty(wr,"__esModule",{value:!0});wr.CodeGen=wr.Name=wr.nil=wr.stringify=wr.str=wr._=wr.KeywordCxt=void 0;var Lj=po();Object.defineProperty(wr,"KeywordCxt",{enumerable:!0,get:function(){return Lj.KeywordCxt}});var _s=ee();Object.defineProperty(wr,"_",{enumerable:!0,get:function(){return _s._}});Object.defineProperty(wr,"str",{enumerable:!0,get:function(){return _s.str}});Object.defineProperty(wr,"stringify",{enumerable:!0,get:function(){return _s.stringify}});Object.defineProperty(wr,"nil",{enumerable:!0,get:function(){return _s.nil}});Object.defineProperty(wr,"Name",{enumerable:!0,get:function(){return _s.Name}});Object.defineProperty(wr,"CodeGen",{enumerable:!0,get:function(){return _s.CodeGen}});var Uj=ii(),Sv=mo(),xv=Vu(),Zt=li(),Rv=ee(),er=fo(),en=lo(),ys=ce(),bv=gv(),Fj=vv(),kv=(e,t)=>new RegExp(e,t);kv.code="new RegExp";var Vj=["removeAdditional","useDefaults","coerceTypes"],zj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Gj={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Kj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wv=200;function Hj(e){var t,r,n,s,o,a,i,c,u,l,d,m,f,p,h,y,v,A,k,M,S,$e,je,kr,It;let Ve=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,hr=xt===!0||xt===void 0?1:xt||0,wn=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:kv,Ln=(s=e.uriResolver)!==null&&s!==void 0?s:Fj.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Ve)!==null&&a!==void 0?a:!0,strictNumbers:(c=(i=e.strictNumbers)!==null&&i!==void 0?i:Ve)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Ve)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:Ve)!==null&&m!==void 0?m:"log",strictRequired:(p=(f=e.strictRequired)!==null&&f!==void 0?f:Ve)!==null&&p!==void 0?p:!1,code:e.code?{...e.code,optimize:hr,regExp:wn}:{optimize:hr,regExp:wn},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:wv,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:wv,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(A=e.messages)!==null&&A!==void 0?A:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:($e=e.validateSchema)!==null&&$e!==void 0?$e:!0,validateFormats:(je=e.validateFormats)!==null&&je!==void 0?je:!0,unicodeRegExp:(kr=e.unicodeRegExp)!==null&&kr!==void 0?kr:!0,int32range:(It=e.int32range)!==null&&It!==void 0?It:!0,uriResolver:Ln}}class di{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Hj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new Rv.ValueScope({scope:{},prefixes:zj,es5:t,lines:r}),this.logger=Qj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=xv.getRules(),$v.call(this,Gj,e,"NOT SUPPORTED"),$v.call(this,Kj,e,"DEPRECATED","warn"),this._metaOpts=Xj.call(this),e.formats)Wj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Yj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Bj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=bv;if(r==="id")n={...bv},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof Sv.default))throw l;return a.call(this,l),await i.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function i(u){let l=await c.call(this,u);if(!this.refs[u])await s.call(this,l.$schema);if(!this.refs[u])this.addSchema(l,u,t)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=er.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=Ev.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Zt.SchemaEnv({schema:{},schemaId:r});if(t=Zt.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=Ev.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=er.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(eq.call(this,r,t),!t)return ys.eachItem(r,(s)=>el.call(this,s)),this;rq.call(this,t);let n={...t,type:en.getJSONTypes(t.type),schemaType:en.getJSONTypes(t.schemaType)};return ys.eachItem(r,n.type.length===0?(s)=>el.call(this,s,n):(s)=>n.type.forEach((o)=>el.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in r){let i=r[a];if(typeof i!="object")continue;let{$data:c}=i.definition,u=o[a];if(c&&u)o[a]=Tv(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let i=this._cache.get(e);if(i!==void 0)return i;r=er.normalizeId(o||r);let c=er.getSchemaRefs.call(this,e,r);if(i=new Zt.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:c}),this._cache.set(i.schema,i),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=i}if(n)this.validateSchema(e,!0);return i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Zt.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Zt.compileSchema.call(this,e)}finally{this.opts=t}}}di.ValidationError=Uj.default;di.MissingRefError=Sv.default;wr.default=di;function $v(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function Ev(e){return e=er.normalizeId(e),this.schemas[e]||this.refs[e]}function Bj(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Wj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Yj(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Xj(){let e={...this.opts};for(let t of Vj)delete e[t];return e}var Jj={log(){},warn(){},error(){}};function Qj(e){if(e===!1)return Jj;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Zj=/^[a-z_$][a-z0-9_$:-]*$/i;function eq(e,t){let{RULES:r}=this;if(ys.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Zj.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function el(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=s?o.post:o.rules.find(({type:c})=>c===r);if(!a)a={type:r,rules:[]},o.rules.push(a);if(o.keywords[e]=!0,!t)return;let i={keyword:e,definition:{...t,type:en.getJSONTypes(t.type),schemaType:en.getJSONTypes(t.schemaType)}};if(t.before)tq.call(this,a,i,t.before);else a.rules.push(i);o.all[e]=i,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function tq(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function rq(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=Tv(t);e.validateSchema=this.compile(t,!0)}var nq={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,nq]}}});var Nv=g(function(Ov){Object.defineProperty(Ov,"__esModule",{value:!0});var aq={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ov.default=aq});var jv=g(function(Cv){Object.defineProperty(Cv,"__esModule",{value:!0});Cv.callRef=Cv.getValidate=void 0;var cq=mo(),pi=_t(),ge=ee(),vs=br(),mi=li(),tn=ce(),uq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:a,opts:i,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return d();let l=mi.resolveRef.call(c,u,s,r);if(l===void 0)throw new cq.default(n.opts.uriResolver,s,r);if(l instanceof mi.SchemaEnv)return m(l);return f(l);function d(){if(o===u)return fi(e,a,o,o.$async);let p=t.scopeValue("root",{ref:u});return fi(e,ge._`${p}.validate`,u,u.$async)}function m(p){let h=Pv(e,p);fi(e,h,p,p.$async)}function f(p){let h=t.scopeValue("schema",i.code.source===!0?{ref:p,code:ge.stringify(p)}:{ref:p}),y=t.name("valid"),v=e.subschema({schema:p,dataTypes:[],schemaPath:ge.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function Pv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ge._`${r.scopeValue("wrapper",{ref:t})}.validate`}Cv.getValidate=Pv;function fi(e,t,r,n){let{gen:s,it:o}=e,{allErrors:a,schemaEnv:i,opts:c}=o,u=c.passContext?vs.default.this:ge.nil;if(n)l();else d();function l(){if(!i.$async)throw Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{if(s.code(ge._`await ${pi.callValidateCode(e,t,u)}`),f(t),!a)s.assign(p,!0)},(h)=>{if(s.if(ge._`!(${h} instanceof ${o.ValidationError})`,()=>s.throw(h)),m(h),!a)s.assign(p,!1)}),e.ok(p)}function d(){e.result(pi.callValidateCode(e,t,u),()=>f(t),()=>m(t))}function m(p){let h=ge._`${p}.errors`;s.assign(vs.default.vErrors,ge._`${vs.default.vErrors} === null ? ${h} : ${vs.default.vErrors}.concat(${h})`),s.assign(vs.default.errors,ge._`${vs.default.vErrors}.length`)}function f(p){var h;if(!o.opts.unevaluated)return;let y=(h=r===null||r===void 0?void 0:r.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=tn.mergeEvaluated.props(s,y.props,o.props)}else{let v=s.var("props",ge._`${p}.evaluated.props`);o.props=tn.mergeEvaluated.props(s,v,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=tn.mergeEvaluated.items(s,y.items,o.items)}else{let v=s.var("items",ge._`${p}.evaluated.items`);o.items=tn.mergeEvaluated.items(s,v,o.items,ge.Name)}}}Cv.callRef=fi;Cv.default=uq});var Dv=g(function(qv){Object.defineProperty(qv,"__esModule",{value:!0});var fq=Nv(),pq=jv(),mq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",fq.default,pq.default];qv.default=mq});var Lv=g(function(Mv){Object.defineProperty(Mv,"__esModule",{value:!0});var nn=ee(),rn=nn.operators,hi={maximum:{okStr:"<=",ok:rn.LTE,fail:rn.GT},minimum:{okStr:">=",ok:rn.GTE,fail:rn.LT},exclusiveMaximum:{okStr:"<",ok:rn.LT,fail:rn.GTE},exclusiveMinimum:{okStr:">",ok:rn.GT,fail:rn.LTE}},gq={message:({keyword:e,schemaCode:t})=>nn.str`must be ${hi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>nn._`{comparison: ${hi[e].okStr}, limit: ${t}}`},yq={keyword:Object.keys(hi),type:"number",schemaType:"number",$data:!0,error:gq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(nn._`${r} ${hi[t].fail} ${n} || isNaN(${r})`)}};Mv.default=yq});var Fv=g(function(Uv){Object.defineProperty(Uv,"__esModule",{value:!0});var tr=ee(),vq={message:({schemaCode:e})=>tr.str`must be multiple of ${e}`,params:({schemaCode:e})=>tr._`{multipleOf: ${e}}`},bq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vq,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=t.let("res"),i=o?tr._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:tr._`${a} !== parseInt(${a})`;e.fail$data(tr._`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`)}};Uv.default=bq});var Gv=g(function(zv){Object.defineProperty(zv,"__esModule",{value:!0});function Vv(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}zv.default=Vv;Vv.code='require("ajv/dist/runtime/ucs2length").default'});var Bv=g(function(Hv){Object.defineProperty(Hv,"__esModule",{value:!0});var ct=ee(),Kv=ce(),Eq=Gv(),Sq={message({keyword:e,schemaCode:t}){return ct.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>ct._`{limit: ${e}}`},xq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Sq,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?ct.operators.GT:ct.operators.LT,a=s.opts.unicode===!1?ct._`${r}.length`:ct._`${Kv.useFunc(e.gen,Eq.default)}(${r})`;e.fail$data(ct._`${a} ${o} ${n}`)}};Hv.default=xq});var Xv=g(function(Yv){Object.defineProperty(Yv,"__esModule",{value:!0});var Wv=_t(),sn=ee(),kq={message:({schemaCode:e})=>sn.str`must match pattern "${e}"`,params:({schemaCode:e})=>sn._`{pattern: ${e}}`},Tq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:kq,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"",i=r?sn._`(new RegExp(${s}, ${a}))`:Wv.usePattern(e,n);e.fail$data(sn._`!${i}.test(${t})`)}};Yv.default=Tq});var Qv=g(function(Jv){Object.defineProperty(Jv,"__esModule",{value:!0});var rr=ee(),Oq={message({keyword:e,schemaCode:t}){return rr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>rr._`{limit: ${e}}`},Nq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Oq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?rr.operators.GT:rr.operators.LT;e.fail$data(rr._`Object.keys(${r}).length ${s} ${n}`)}};Jv.default=Nq});var t0=g(function(e0){Object.defineProperty(e0,"__esModule",{value:!0});var nr=_t(),sr=ee(),Zv=ce(),Cq={message:({params:{missingProperty:e}})=>sr.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>sr._`{missingProperty: ${e}}`},Iq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Cq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:a}=e,{opts:i}=a;if(!o&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors)u();else l();if(i.strictRequired){let f=e.parentSchema.properties,{definedProperties:p}=e.it;for(let h of r)if((f===null||f===void 0?void 0:f[h])===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;Zv.checkStrictMode(a,v,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(sr.nil,d);else for(let f of r)nr.checkReportMissingProp(e,f)}function l(){let f=t.let("missing");if(c||o){let p=t.let("valid",!0);e.block$data(p,()=>m(f,p)),e.ok(p)}else t.if(nr.checkMissingProp(e,r,f)),nr.reportMissingProp(e,f),t.else()}function d(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(nr.noPropertyInData(t,s,f,i.ownProperties),()=>e.error())})}function m(f,p){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(p,nr.propertyInData(t,s,f,i.ownProperties)),t.if(sr.not(p),()=>{e.error(),t.break()})},sr.nil)}}};e0.default=Iq});var n0=g(function(r0){Object.defineProperty(r0,"__esModule",{value:!0});var or=ee(),qq={message({keyword:e,schemaCode:t}){return or.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>or._`{limit: ${e}}`},Dq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:qq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?or.operators.GT:or.operators.LT;e.fail$data(or._`${r}.length ${s} ${n}`)}};r0.default=Dq});var gi=g(function(o0){Object.defineProperty(o0,"__esModule",{value:!0});var s0=Qs();s0.code='require("ajv/dist/runtime/equal").default';o0.default=s0});var c0=g(function(i0){Object.defineProperty(i0,"__esModule",{value:!0});var bs=lo(),ae=ee(),a0=ce(),Uq=gi(),Fq={message:({params:{i:e,j:t}})=>ae.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>ae._`{i: ${e}, j: ${t}}`},Vq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Fq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:a,it:i}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?bs.getSchemaTypes(o.items):[];e.block$data(c,l,ae._`${a} === false`),e.ok(c);function l(){let p=t.let("i",ae._`${r}.length`),h=t.let("j");e.setParams({i:p,j:h}),t.assign(c,!0),t.if(ae._`${p} > 1`,()=>(d()?m:f)(p,h))}function d(){return u.length>0&&!u.some((p)=>p==="object"||p==="array")}function m(p,h){let y=t.name("item"),v=bs.checkDataTypes(u,y,i.opts.strictNumbers,bs.DataType.Wrong),A=t.const("indices",ae._`{}`);t.for(ae._`;${p}--;`,()=>{if(t.let(y,ae._`${r}[${p}]`),t.if(v,ae._`continue`),u.length>1)t.if(ae._`typeof ${y} == "string"`,ae._`${y} += "_"`);t.if(ae._`typeof ${A}[${y}] == "number"`,()=>{t.assign(h,ae._`${A}[${y}]`),e.error(),t.assign(c,!1).break()}).code(ae._`${A}[${y}] = ${p}`)})}function f(p,h){let y=a0.useFunc(t,Uq.default),v=t.name("outer");t.label(v).for(ae._`;${p}--;`,()=>t.for(ae._`${h} = ${p}; ${h}--;`,()=>t.if(ae._`${y}(${r}[${p}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};i0.default=Vq});var d0=g(function(l0){Object.defineProperty(l0,"__esModule",{value:!0});var ws=ee(),u0=ce(),Gq=gi(),Kq={message:"must be equal to constant",params:({schemaCode:e})=>ws._`{allowedValue: ${e}}`},Hq={keyword:"const",$data:!0,error:Kq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(ws._`!${u0.useFunc(t,Gq.default)}(${r}, ${s})`);else e.fail(ws._`${o} !== ${r}`)}};l0.default=Hq});var m0=g(function(p0){Object.defineProperty(p0,"__esModule",{value:!0});var ar=ee(),f0=ce(),Wq=gi(),Yq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ar._`{allowedValues: ${e}}`},Xq={keyword:"enum",schemaType:"array",$data:!0,error:Yq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:a}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let i=s.length>=a.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=f0.useFunc(t,Wq.default),l;if(i||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);l=ar.or(...s.map((p,h)=>m(f,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,(f)=>t.if(ar._`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function m(f,p){let h=s[p];return typeof h==="object"&&h!==null?ar._`${u()}(${r}, ${f}[${p}])`:ar._`${r} === ${h}`}}};p0.default=Xq});var g0=g(function(h0){Object.defineProperty(h0,"__esModule",{value:!0});var Qq=Lv(),Zq=Fv(),eD=Bv(),tD=Xv(),rD=Qv(),nD=t0(),sD=n0(),oD=c0(),aD=d0(),iD=m0(),cD=[Qq.default,Zq.default,eD.default,tD.default,rD.default,nD.default,sD.default,oD.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},aD.default,iD.default];h0.default=cD});var tl=g(function(_0){Object.defineProperty(_0,"__esModule",{value:!0});_0.validateAdditionalItems=void 0;var ut=ee(),$s=ce(),lD={message:({params:{len:e}})=>ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ut._`{limit: ${e}}`},dD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:lD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){$s.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}y0(e,n)}};function y0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:a}=e;a.items=!0;let i=r.const("len",ut._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ut._`${i} <= ${t.length}`);else if(typeof n=="object"&&!$s.alwaysValidSchema(a,n)){let u=r.var("valid",ut._`${i} <= ${t.length}`);r.if(ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,i,(l)=>{if(e.subschema({keyword:o,dataProp:l,dataPropType:$s.Type.Num},u),!a.allErrors)r.if(ut.not(u),()=>r.break())})}}_0.validateAdditionalItems=y0;_0.default=dD});var rl=g(function($0){Object.defineProperty($0,"__esModule",{value:!0});$0.validateTuple=void 0;var yi=ee(),on=ce(),b0=_t(),pD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return w0(e,"additionalItems",t);if(r.items=!0,on.alwaysValidSchema(r,t))return;e.ok(b0.validateArray(e))}};function w0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:a,it:i}=e;if(l(s),i.opts.unevaluated&&r.length&&i.items!==!0)i.items=on.mergeEvaluated.items(n,r.length,i.items);let c=n.name("valid"),u=n.const("len",yi._`${o}.length`);r.forEach((d,m)=>{if(on.alwaysValidSchema(i,d))return;n.if(yi._`${u} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c)});function l(d){let{opts:m,errSchemaPath:f}=i,p=r.length,h=p===d.minItems&&(p===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;on.checkStrictMode(i,y,m.strictTuples)}}}$0.validateTuple=w0;$0.default=pD});var R0=g(function(x0){Object.defineProperty(x0,"__esModule",{value:!0});var S0=rl(),hD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>S0.validateTuple(e,"items")};x0.default=hD});var N0=g(function(O0){Object.defineProperty(O0,"__esModule",{value:!0});var _i=ee(),k0=ce(),T0=_t(),A0=tl(),yD={message:({params:{len:e}})=>_i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>_i._`{limit: ${e}}`},_D={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:yD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,k0.alwaysValidSchema(n,t))return;if(s)A0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};O0.default=_D});var C0=g(function(P0){Object.defineProperty(P0,"__esModule",{value:!0});var ve=ee(),an=ce(),bD={message:({params:{min:e,max:t}})=>t===void 0?ve.str`must contain at least ${e} valid item(s)`:ve.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?ve._`{minContains: ${e}}`:ve._`{minContains: ${e}, maxContains: ${t}}`},wD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:bD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,a,i,{minContains:c,maxContains:u}=n;if(o.opts.next)a=c===void 0?1:c,i=u;else a=1;let l=t.const("len",ve._`${s}.length`);if(e.setParams({min:a,max:i}),i===void 0&&a===0){an.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){an.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(an.alwaysValidSchema(o,r)){let h=ve._`${l} >= ${a}`;if(i!==void 0)h=ve._`${h} && ${l} <= ${i}`;e.pass(h);return}o.items=!0;let d=t.name("valid");if(i===void 0&&a===1)f(d,()=>t.if(d,()=>t.break()));else if(a===0){if(t.let(d,!0),i!==void 0)t.if(ve._`${s}.length > 0`,m)}else t.let(d,!1),m();e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);f(h,()=>t.if(h,()=>p(y)))}function f(h,y){t.forRange("i",0,l,(v)=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:an.Type.Num,compositeRule:!0},h),y()})}function p(h){if(t.code(ve._`${h}++`),i===void 0)t.if(ve._`${h} >= ${a}`,()=>t.assign(d,!0).break());else if(t.if(ve._`${h} > ${i}`,()=>t.assign(d,!1).break()),a===1)t.assign(d,!0);else t.if(ve._`${h} >= ${a}`,()=>t.assign(d,!0))}}};P0.default=wD});var U0=g(function(D0){Object.defineProperty(D0,"__esModule",{value:!0});D0.validateSchemaDeps=D0.validatePropertyDeps=D0.error=void 0;var Es=ee(),I0=ce(),ir=_t();D0.error={message:({params:{property:e,depsCount:t,deps:r}})=>Es.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>Es._`{property: ${e},
|
|
15
15
|
missingProperty: ${n},
|
|
16
16
|
depsCount: ${t},
|
|
17
|
-
deps: ${r}}`};var $D={keyword:"dependencies",type:"object",schemaType:"object",error:D0.error,code(e){let[t,r]=ED(e);j0(e,t),q0(e,r)}};function ED({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function j0(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let i=t[a];if(i.length===0)continue;let c=ir.propertyInData(r,n,a,s.opts.ownProperties);if(e.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of i)ir.checkReportMissingProp(e,u)});else r.if(Es._`${c} && (${ir.checkMissingProp(e,i,o)})`),ir.reportMissingProp(e,o),r.else()}}D0.validatePropertyDeps=j0;function q0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,a=r.name("valid");for(let i in t){if(C0.alwaysValidSchema(o,t[i]))continue;r.if(ir.propertyInData(r,n,i,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:i},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a)}}D0.validateSchemaDeps=q0;D0.default=$D});var z0=g(function(V0){Object.defineProperty(V0,"__esModule",{value:!0});var vi=ee(),F0=ce(),RD={message:"property name must be valid",params:({params:e})=>vi._`{propertyName: ${e.propertyName}}`},kD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:RD,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(F0.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(a)=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if(vi.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};V0.default=kD});var nl=g(function(G0){Object.defineProperty(G0,"__esModule",{value:!0});var cn=_t(),Ne=ee(),AD=br(),un=ce(),OD={message:"must NOT have additional properties",params:({params:e})=>Ne._`{additionalProperty: ${e.additionalProperty}}`},ND={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:OD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&un.alwaysValidSchema(a,r))return;let u=cn.allSchemaProperties(n.properties),l=cn.allSchemaProperties(n.patternProperties);d(),e.ok(Ne._`${o} === ${AD.default.errors}`);function d(){t.forIn("key",s,(y)=>{if(!u.length&&!l.length)p(y);else t.if(m(y),()=>p(y))})}function m(y){let v;if(u.length>8){let A=un.schemaRefOrVal(a,n.properties,"properties");v=cn.isOwnProperty(t,A,y)}else if(u.length)v=Ne.or(...u.map((A)=>Ne._`${y} === ${A}`));else v=Ne.nil;if(l.length)v=Ne.or(v,...l.map((A)=>Ne._`${cn.usePattern(e,A)}.test(${y})`));return Ne.not(v)}function f(y){t.code(Ne._`delete ${s}[${y}]`)}function p(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!i)t.break();return}if(typeof r=="object"&&!un.alwaysValidSchema(a,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(y,v,!1),t.if(Ne.not(v),()=>{e.reset(),f(y)});else if(h(y,v),!i)t.if(Ne.not(v),()=>t.break())}}function h(y,v,A){let k={keyword:"additionalProperties",dataProp:y,dataPropType:un.Type.Str};if(A===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,v)}}};G0.default=ND});var W0=g(function(B0){Object.defineProperty(B0,"__esModule",{value:!0});var H0=po(),bi=_t(),Ss=ce(),K0=nl(),ID={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)K0.default.code(new H0.KeywordCxt(o,K0.default,"additionalProperties"));let a=bi.allSchemaProperties(r);for(let d of a)o.definedProperties.add(d);if(o.opts.unevaluated&&a.length&&o.props!==!0)o.props=Ss.mergeEvaluated.props(t,Ss.toHash(a),o.props);let i=a.filter((d)=>!Ss.alwaysValidSchema(o,r[d]));if(i.length===0)return;let c=t.name("valid");for(let d of i){if(u(d))l(d);else{if(t.if(bi.propertyInData(t,s,d,o.opts.ownProperties)),l(d),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};B0.default=ID});var X0=g(function(Y0){Object.defineProperty(Y0,"__esModule",{value:!0});var wi=_t(),ln=ee(),$i=ce(),Ei=ce(),jD={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=wi.allSchemaProperties(r),c=i.filter((h)=>$i.alwaysValidSchema(o,r[h]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof ln.Name))o.props=Ei.evaluatedPropsToName(t,o.props);let{props:d}=o;m();function m(){for(let h of i){if(u)f(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function f(h){for(let y in u)if(new RegExp(h).test(y))$i.checkStrictMode(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",n,(y)=>{t.if(ln._`${wi.usePattern(e,h)}.test(${y})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:Ei.Type.Str},l);if(o.opts.unevaluated&&d!==!0)t.assign(ln._`${d}[${y}]`,!0);else if(!v&&!o.allErrors)t.if(ln.not(l),()=>t.break())})})}}};Y0.default=jD});var Z0=g(function(Q0){Object.defineProperty(Q0,"__esModule",{value:!0});var J0=ce(),DD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(J0.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Q0.default=DD});var rb=g(function(tb){Object.defineProperty(tb,"__esModule",{value:!0});var eb=_t(),LD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:eb.validateUnion,error:{message:"must match a schema in anyOf"}};tb.default=LD});var ob=g(function(sb){Object.defineProperty(sb,"__esModule",{value:!0});var dn=ee(),nb=ce(),FD={message:"must match exactly one schema in oneOf",params:({params:e})=>dn._`{passingSchemas: ${e.passing}}`},VD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:FD,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;if(nb.alwaysValidSchema(s,l))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(dn._`${c} && ${a}`).assign(a,!1).assign(i,dn._`[${i}, ${d}]`).else();t.if(c,()=>{if(t.assign(a,!0),t.assign(i,d),m)e.mergeEvaluated(m,dn.Name)})})}}};sb.default=VD});var cb=g(function(ib){Object.defineProperty(ib,"__esModule",{value:!0});var ab=ce(),GD={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,a)=>{if(ab.alwaysValidSchema(n,o))return;let i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};ib.default=GD});var db=g(function(lb){Object.defineProperty(lb,"__esModule",{value:!0});var fn=ee(),Si=ce(),HD={message:({params:e})=>fn.str`must match "${e.ifClause}" schema`,params:({params:e})=>fn._`{failingKeyword: ${e.ifClause}}`},BD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:HD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Si.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=ub(n,"then"),o=ub(n,"else");if(!s&&!o)return;let a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(i,u("then",l),u("else",l))}else if(s)t.if(i,u("then"));else t.if(fn.not(i),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},i);if(t.assign(a,i),e.mergeValidEvaluated(m,a),d)t.assign(d,fn._`${l}`);else e.setParams({ifClause:l})}}}};function ub(e,t){let r=e.schema[t];return r!==void 0&&!Si.alwaysValidSchema(e,r)}lb.default=BD});var mb=g(function(pb){Object.defineProperty(pb,"__esModule",{value:!0});var fb=ce(),YD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)fb.checkStrictMode(r,`"${e}" without "if" is ignored`)}};pb.default=YD});var gb=g(function(hb){Object.defineProperty(hb,"__esModule",{value:!0});var JD=tl(),QD=R0(),ZD=rl(),eM=N0(),tM=I0(),rM=U0(),nM=z0(),sM=nl(),oM=W0(),aM=X0(),iM=Z0(),cM=rb(),uM=ob(),lM=cb(),dM=db(),fM=mb();function pM(e=!1){let t=[iM.default,cM.default,uM.default,lM.default,dM.default,fM.default,nM.default,sM.default,rM.default,oM.default,aM.default];if(e)t.push(QD.default,eM.default);else t.push(JD.default,ZD.default);return t.push(tM.default),t}hb.default=pM});var _b=g(function(yb){Object.defineProperty(yb,"__esModule",{value:!0});var J=ee(),hM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},gM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;if(s)m();else f();function m(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",J._`${p}[${a}]`),y=r.let("fType"),v=r.let("format");r.if(J._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,J._`${h}.type || "string"`).assign(v,J._`${h}.validate`),()=>r.assign(y,J._`"string"`).assign(v,h)),e.fail$data(J.or(A(),k()));function A(){if(c.strictSchema===!1)return J.nil;return J._`${a} && !${v}`}function k(){let M=l.$async?J._`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:J._`${v}(${n})`,S=J._`(typeof ${v} == "function" ? ${M} : ${v}.test(${n}))`;return J._`${v} && ${v} !== true && ${y} === ${t} && !${S}`}}function f(){let p=d.formats[o];if(!p){A();return}if(p===!0)return;let[h,y,v]=k(p);if(h===t)e.pass(M());function A(){if(c.strictSchema===!1){d.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let $e=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,je=r.scopeValue("formats",{key:o,ref:S,code:$e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${je}.validate`];return["string",S,je]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return J._`await ${v}(${n})`}return typeof y=="function"?J._`${v}(${n})`:J._`${v}.test(${n})`}}}};yb.default=gM});var bb=g(function(vb){Object.defineProperty(vb,"__esModule",{value:!0});var _M=_b(),vM=[_M.default];vb.default=vM});var Eb=g(function(wb){Object.defineProperty(wb,"__esModule",{value:!0});wb.contentVocabulary=wb.metadataVocabulary=void 0;wb.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];wb.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var xb=g(function(Sb){Object.defineProperty(Sb,"__esModule",{value:!0});var $M=Dv(),EM=g0(),SM=gb(),xM=bb(),xi=Eb(),RM=[$M.default,EM.default,(0,SM.default)(),xM.default,xi.metadataVocabulary,xi.contentVocabulary];Sb.default=RM});var Ab=g(function(kb){Object.defineProperty(kb,"__esModule",{value:!0});kb.DiscrError=void 0;var Rb;(function(e){e.Tag="tag",e.Mapping="mapping"})(Rb||(kb.DiscrError=Rb={}))});var Pb=g(function(Nb){Object.defineProperty(Nb,"__esModule",{value:!0});var vt=ee(),xs=Ab(),Ri=li(),TM=mo(),Ob=ce(),AM={message:({params:{discrError:e,tagName:t}})=>e===xs.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>vt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},OM={keyword:"discriminator",type:"object",schemaType:"object",error:AM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!a)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",vt._`${r}${vt.getProperty(i)}`);t.if(vt._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:xs.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function l(){let f=m();t.if(!1);for(let p in f)t.elseIf(vt._`${u} === ${p}`),t.assign(c,d(f[p]));t.else(),e.error(!1,{discrError:xs.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function d(f){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:f},p);return e.mergeEvaluated(h,vt.Name),p}function m(){var f;let p={},h=v(s),y=!0;for(let M=0;M<a.length;M++){let S=a[M];if((S===null||S===void 0?void 0:S.$ref)&&!Ob.schemaHasRulesButRef(S,o.self.RULES)){let je=S.$ref;if(S=Ri.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,je),S instanceof Ri.SchemaEnv)S=S.schema;if(S===void 0)throw new TM.default(o.opts.uriResolver,o.baseId,je)}let $e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[i];if(typeof $e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);y=y&&(h||v(S)),A($e,M)}if(!y)throw Error(`discriminator: "${i}" must be required`);return p;function v({required:M}){return Array.isArray(M)&&M.includes(i)}function A(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let $e of M.enum)k($e,S);else throw Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in p)throw Error(`discriminator: "${i}" values must be unique strings`);p[M]=S}}}};Nb.default=OM});var Ib=g(function(wH,PM){PM.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var jb=g(function(lt,sl){Object.defineProperty(lt,"__esModule",{value:!0});lt.MissingRefError=lt.ValidationError=lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=lt.Ajv=void 0;var IM=Av(),CM=xb(),jM=Pb(),Cb=Ib(),qM=["/properties"],ki="http://json-schema.org/draft-07/schema";class go extends IM.default{_addVocabularies(){if(super._addVocabularies(),CM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(jM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Cb,qM):Cb;this.addMetaSchema(e,ki,!1),this.refs["http://json-schema.org/schema"]=ki}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ki)?ki:void 0)}}lt.Ajv=go;sl.exports=lt=go;sl.exports.Ajv=go;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=go;var DM=po();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return DM.KeywordCxt}});var Rs=ee();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return Rs._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return Rs.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return Rs.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return Rs.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return Rs.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return Rs.CodeGen}});var MM=ii();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return MM.default}});var LM=mo();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return LM.default}})});var Mb=g(function(Db){Object.defineProperty(Db,"__esModule",{value:!0});Db.formatLimitDefinition=void 0;var qb=jb(),Pe=ee(),pn=Pe.operators,Ti={formatMaximum:{okStr:"<=",ok:pn.LTE,fail:pn.GT},formatMinimum:{okStr:">=",ok:pn.GTE,fail:pn.LT},formatExclusiveMaximum:{okStr:"<",ok:pn.LT,fail:pn.GTE},formatExclusiveMinimum:{okStr:">",ok:pn.GT,fail:pn.LTE}},VM={message:({keyword:e,schemaCode:t})=>Pe.str`should be ${Ti[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pe._`{comparison: ${Ti[e].okStr}, limit: ${t}}`};Db.formatLimitDefinition={keyword:Object.keys(Ti),type:"string",schemaType:"string",$data:!0,error:VM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:a,self:i}=o;if(!a.validateFormats)return;let c=new qb.KeywordCxt(o,i.RULES.all.format.definition,"format");if(c.$data)u();else l();function u(){let m=t.scopeValue("formats",{ref:i.formats,code:a.code.formats}),f=t.const("fmt",Pe._`${m}[${c.schemaCode}]`);e.fail$data(Pe.or(Pe._`typeof ${f} != "object"`,Pe._`${f} instanceof RegExp`,Pe._`typeof ${f}.compare != "function"`,d(f)))}function l(){let m=c.schema,f=i.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${m}" does not define "compare" function`);let p=t.scopeValue("formats",{key:m,ref:f,code:a.code.formats?Pe._`${a.code.formats}${Pe.getProperty(m)}`:void 0});e.fail$data(d(p))}function d(m){return Pe._`${m}.compare(${r}, ${n}) ${Ti[s].fail} 0`}},dependencies:["format"]};var zM=(e)=>(e.addKeyword(Db.formatLimitDefinition),e);Db.default=zM});var Vb=g(function(yo,Fb){Object.defineProperty(yo,"__esModule",{value:!0});var bt=gy(),KM=Mb(),ks=ee(),Lb=new ks.Name("fullFormats"),HM=new ks.Name("fastFormats"),al=(e,t={keywords:!0})=>{if(Array.isArray(t))return Ub(e,t,bt.fullFormats,Lb),e;let[r,n]=t.mode==="fast"?[bt.fastFormats,HM]:[bt.fullFormats,Lb],s=t.formats||bt.formatNames;if(Ub(e,s,r,n),t.keywords)(0,KM.default)(e);return e};al.get=(e,t="full")=>{let n=(t==="fast"?bt.fastFormats:bt.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function Ub(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=ks._`require("ajv-formats/dist/formats").${n}`);for(let a of t)e.addFormat(a,r[a])}Fb.exports=yo=al;Object.defineProperty(yo,"__esModule",{value:!0});yo.default=al});function il(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))BM(e,t,s,r);return YM(e,t),ZM(e,t,n),e}var BM=(e,t,r,n)=>{if(r==="length"||r==="prototype")return;if(r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);if(!WM(s,o)&&n)return;Object.defineProperty(e,r,o)},WM=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},YM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},XM=(e,t)=>`/* Wrapped ${e}*/
|
|
18
|
-
${t}`,JM,QM,ZM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=XM.bind(null,n,t.toString());Object.defineProperty(s,"name",QM);let{writable:o,enumerable:a,configurable:i}=JM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:a,configurable:i})};var zb=L(()=>{JM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),QM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var eL=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:o=!0}=t;if(r<0||n<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!s&&!o)throw Error("Both `before` and `after` are false, function wouldn't be called.");let a,i,c,u=function(...l){let d=this,m=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(d,l)},f=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(d,l)},p=s&&!a;if(clearTimeout(a),a=setTimeout(m,r),n>0&&n!==Number.POSITIVE_INFINITY&&!i)i=setTimeout(f,n);if(p)c=e.apply(d,l);return c};return il(u,e),u.cancel=()=>{if(a)clearTimeout(a),a=void 0;if(i)clearTimeout(i),i=void 0},u},cl;var Gb=L(()=>{zb();cl=eL});var _o=g(function(CH,Kb){var tL=Number.MAX_SAFE_INTEGER||9007199254740991,rL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Kb.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:tL,RELEASE_TYPES:rL,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vo=g(function(jH,Hb){var nL=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Hb.exports=nL});var Ts=g(function(cr,Bb){var{MAX_SAFE_COMPONENT_LENGTH:ul,MAX_SAFE_BUILD_LENGTH:sL,MAX_LENGTH:oL}=_o(),aL=vo();cr=Bb.exports={};var iL=cr.re=[],cL=cr.safeRe=[],j=cr.src=[],uL=cr.safeSrc=[],q=cr.t={},lL=0,ll="[a-zA-Z0-9-]",dL=[["\\s",1],["\\d",oL],[ll,sL]],fL=(e)=>{for(let[t,r]of dL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=fL(t),s=lL++;aL(e,s,t),q[e]=s,j[s]=t,uL[s]=n,iL[s]=new RegExp(t,r?"g":void 0),cL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ll}*`);W("MAINVERSION",`(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})`);W("MAINVERSIONLOOSE",`(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASEIDENTIFIER",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIER]})`);W("PRERELEASEIDENTIFIERLOOSE",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASE",`(?:-(${j[q.PRERELEASEIDENTIFIER]}(?:\\.${j[q.PRERELEASEIDENTIFIER]})*))`);W("PRERELEASELOOSE",`(?:-?(${j[q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[q.PRERELEASEIDENTIFIERLOOSE]})*))`);W("BUILDIDENTIFIER",`${ll}+`);W("BUILD",`(?:\\+(${j[q.BUILDIDENTIFIER]}(?:\\.${j[q.BUILDIDENTIFIER]})*))`);W("FULLPLAIN",`v?${j[q.MAINVERSION]}${j[q.PRERELEASE]}?${j[q.BUILD]}?`);W("FULL",`^${j[q.FULLPLAIN]}$`);W("LOOSEPLAIN",`[v=\\s]*${j[q.MAINVERSIONLOOSE]}${j[q.PRERELEASELOOSE]}?${j[q.BUILD]}?`);W("LOOSE",`^${j[q.LOOSEPLAIN]}$`);W("GTLT","((?:<|>)?=?)");W("XRANGEIDENTIFIERLOOSE",`${j[q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);W("XRANGEIDENTIFIER",`${j[q.NUMERICIDENTIFIER]}|x|X|\\*`);W("XRANGEPLAIN",`[v=\\s]*(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:${j[q.PRERELEASE]})?${j[q.BUILD]}?)?)?`);W("XRANGEPLAINLOOSE",`[v=\\s]*(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:${j[q.PRERELEASELOOSE]})?${j[q.BUILD]}?)?)?`);W("XRANGE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAIN]}$`);W("XRANGELOOSE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAINLOOSE]}$`);W("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ul}})(?:\\.(\\d{1,${ul}}))?(?:\\.(\\d{1,${ul}}))?`);W("COERCE",`${j[q.COERCEPLAIN]}(?:$|[^\\d])`);W("COERCEFULL",j[q.COERCEPLAIN]+`(?:${j[q.PRERELEASE]})?(?:${j[q.BUILD]})?(?:$|[^\\d])`);W("COERCERTL",j[q.COERCE],!0);W("COERCERTLFULL",j[q.COERCEFULL],!0);W("LONETILDE","(?:~>?)");W("TILDETRIM",`(\\s*)${j[q.LONETILDE]}\\s+`,!0);cr.tildeTrimReplace="$1~";W("TILDE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAIN]}$`);W("TILDELOOSE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAINLOOSE]}$`);W("LONECARET","(?:\\^)");W("CARETTRIM",`(\\s*)${j[q.LONECARET]}\\s+`,!0);cr.caretTrimReplace="$1^";W("CARET",`^${j[q.LONECARET]}${j[q.XRANGEPLAIN]}$`);W("CARETLOOSE",`^${j[q.LONECARET]}${j[q.XRANGEPLAINLOOSE]}$`);W("COMPARATORLOOSE",`^${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]})$|^$`);W("COMPARATOR",`^${j[q.GTLT]}\\s*(${j[q.FULLPLAIN]})$|^$`);W("COMPARATORTRIM",`(\\s*)${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]}|${j[q.XRANGEPLAIN]})`,!0);cr.comparatorTrimReplace="$1$2$3";W("HYPHENRANGE",`^\\s*(${j[q.XRANGEPLAIN]})\\s+-\\s+(${j[q.XRANGEPLAIN]})\\s*$`);W("HYPHENRANGELOOSE",`^\\s*(${j[q.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[q.XRANGEPLAINLOOSE]})\\s*$`);W("STAR","(<|>)?=?\\s*\\*");W("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");W("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ai=g(function(qH,Wb){var pL=Object.freeze({loose:!0}),mL=Object.freeze({}),hL=(e)=>{if(!e)return mL;if(typeof e!=="object")return pL;return e};Wb.exports=hL});var dl=g(function(DH,Jb){var Yb=/^[0-9]+$/,Xb=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Yb.test(e),n=Yb.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},gL=(e,t)=>Xb(t,e);Jb.exports={compareIdentifiers:Xb,rcompareIdentifiers:gL}});var He=g(function(MH,Zb){var Oi=vo(),{MAX_LENGTH:Qb,MAX_SAFE_INTEGER:Ni}=_o(),{safeRe:Pi,t:Ii}=Ts(),yL=Ai(),{compareIdentifiers:fl}=dl();class At{constructor(e,t){if(t=yL(t),e instanceof At)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Qb)throw TypeError(`version is longer than ${Qb} characters`);Oi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Pi[Ii.LOOSE]:Pi[Ii.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ni||this.major<0)throw TypeError("Invalid major version");if(this.minor>Ni||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Ni||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<Ni)return s}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Oi("SemVer.compare",this.version,this.options,e),!(e instanceof At)){if(typeof e==="string"&&e===this.version)return 0;e=new At(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof At))e=new At(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof At))e=new At(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Oi("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return fl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof At))e=new At(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Oi("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return fl(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Pi[Ii.PRERELEASELOOSE]:Pi[Ii.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];if(r===!1)s=[t];if(fl(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1]))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Zb.exports=At});var Pn=g(function(LH,tw){var ew=He(),_L=(e,t,r=!1)=>{if(e instanceof ew)return e;try{return new ew(e,t)}catch(n){if(!r)return null;throw n}};tw.exports=_L});var nw=g(function(UH,rw){var vL=Pn(),bL=(e,t)=>{let r=vL(e,t);return r?r.version:null};rw.exports=bL});var ow=g(function(FH,sw){var wL=Pn(),$L=(e,t)=>{let r=wL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};sw.exports=$L});var cw=g(function(VH,iw){var aw=He(),EL=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new aw(e instanceof aw?e.version:e,r).inc(t,n,s).version}catch(o){return null}};iw.exports=EL});var dw=g(function(zH,lw){var uw=Pn(),SL=(e,t)=>{let r=uw(e,null,!0),n=uw(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,a=o?r:n,i=o?n:r,c=!!a.prerelease.length;if(!!i.prerelease.length&&!c){if(!i.patch&&!i.minor)return"major";if(i.compareMain(a)===0){if(i.minor&&!i.patch)return"minor";return"patch"}}let l=c?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};lw.exports=SL});var pw=g(function(GH,fw){var xL=He(),RL=(e,t)=>new xL(e,t).major;fw.exports=RL});var hw=g(function(KH,mw){var kL=He(),TL=(e,t)=>new kL(e,t).minor;mw.exports=TL});var yw=g(function(HH,gw){var AL=He(),OL=(e,t)=>new AL(e,t).patch;gw.exports=OL});var vw=g(function(BH,_w){var NL=Pn(),PL=(e,t)=>{let r=NL(e,t);return r&&r.prerelease.length?r.prerelease:null};_w.exports=PL});var wt=g(function(WH,ww){var bw=He(),IL=(e,t,r)=>new bw(e,r).compare(new bw(t,r));ww.exports=IL});var Ew=g(function(YH,$w){var CL=wt(),jL=(e,t,r)=>CL(t,e,r);$w.exports=jL});var xw=g(function(XH,Sw){var qL=wt(),DL=(e,t)=>qL(e,t,!0);Sw.exports=DL});var Ci=g(function(JH,kw){var Rw=He(),ML=(e,t,r)=>{let n=new Rw(e,r),s=new Rw(t,r);return n.compare(s)||n.compareBuild(s)};kw.exports=ML});var Aw=g(function(QH,Tw){var LL=Ci(),UL=(e,t)=>e.sort((r,n)=>LL(r,n,t));Tw.exports=UL});var Nw=g(function(ZH,Ow){var FL=Ci(),VL=(e,t)=>e.sort((r,n)=>FL(n,r,t));Ow.exports=VL});var bo=g(function(e5,Pw){var zL=wt(),GL=(e,t,r)=>zL(e,t,r)>0;Pw.exports=GL});var ji=g(function(t5,Iw){var KL=wt(),HL=(e,t,r)=>KL(e,t,r)<0;Iw.exports=HL});var pl=g(function(r5,Cw){var BL=wt(),WL=(e,t,r)=>BL(e,t,r)===0;Cw.exports=WL});var ml=g(function(n5,jw){var YL=wt(),XL=(e,t,r)=>YL(e,t,r)!==0;jw.exports=XL});var qi=g(function(s5,qw){var JL=wt(),QL=(e,t,r)=>JL(e,t,r)>=0;qw.exports=QL});var Di=g(function(o5,Dw){var ZL=wt(),eU=(e,t,r)=>ZL(e,t,r)<=0;Dw.exports=eU});var hl=g(function(a5,Mw){var tU=pl(),rU=ml(),nU=bo(),sU=qi(),oU=ji(),aU=Di(),iU=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return tU(e,r,n);case"!=":return rU(e,r,n);case">":return nU(e,r,n);case">=":return sU(e,r,n);case"<":return oU(e,r,n);case"<=":return aU(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Mw.exports=iU});var Uw=g(function(i5,Lw){var cU=He(),uU=Pn(),{safeRe:Mi,t:Li}=Ts(),lU=(e,t)=>{if(e instanceof cU)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Mi[Li.COERCEFULL]:Mi[Li.COERCE]);else{let c=t.includePrerelease?Mi[Li.COERCERTLFULL]:Mi[Li.COERCERTL],u;while((u=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||u.index+u[0].length!==r.index+r[0].length)r=u;c.lastIndex=u.index+u[1].length+u[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",i=t.includePrerelease&&r[6]?`+${r[6]}`:"";return uU(`${n}.${s}.${o}${a}${i}`,t)};Lw.exports=lU});var zw=g(function(c5,Vw){class Fw{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}Vw.exports=Fw});var $t=g(function(u5,Bw){var dU=/\s+/g;class wo{constructor(e,t){if(t=pU(t),e instanceof wo)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new wo(e.raw,t);if(e instanceof Ui)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(dU," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Kw(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&bU(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&_U)|(this.options.loose&&vU))+":"+e,n=Gw.get(r);if(n)return n;let s=this.options.loose,o=s?Qe[Be.HYPHENRANGELOOSE]:Qe[Be.HYPHENRANGE];e=e.replace(o,OU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Qe[Be.COMPARATORTRIM],hU),ye("comparator trim",e),e=e.replace(Qe[Be.TILDETRIM],gU),ye("tilde trim",e),e=e.replace(Qe[Be.CARETTRIM],yU),ye("caret trim",e);let a=e.split(" ").map((l)=>wU(l,this.options)).join(" ").split(/\s+/).map((l)=>AU(l,this.options));if(s)a=a.filter((l)=>(ye("loose invalid filter",l,this.options),!!l.match(Qe[Be.COMPARATORLOOSE])));ye("range list",a);let i=new Map,c=a.map((l)=>new Ui(l,this.options));for(let l of c){if(Kw(l))return[l];i.set(l.value,l)}if(i.size>1&&i.has(""))i.delete("");let u=[...i.values()];return Gw.set(r,u),u}intersects(e,t){if(!(e instanceof wo))throw TypeError("a Range is required");return this.set.some((r)=>Hw(r,t)&&e.set.some((n)=>Hw(n,t)&&r.every((s)=>n.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new mU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(NU(this.set[t],e,this.options))return!0;return!1}}Bw.exports=wo;var fU=zw(),Gw=new fU,pU=Ai(),Ui=$o(),ye=vo(),mU=He(),{safeRe:Qe,t:Be,comparatorTrimReplace:hU,tildeTrimReplace:gU,caretTrimReplace:yU}=Ts(),{FLAG_INCLUDE_PRERELEASE:_U,FLAG_LOOSE:vU}=_o(),Kw=(e)=>e.value==="<0.0.0-0",bU=(e)=>e.value==="",Hw=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();while(r&&n.length)r=n.every((o)=>s.intersects(o,t)),s=n.pop();return r},wU=(e,t)=>(e=e.replace(Qe[Be.BUILD],""),ye("comp",e,t),e=SU(e,t),ye("caret",e),e=$U(e,t),ye("tildes",e),e=RU(e,t),ye("xrange",e),e=TU(e,t),ye("stars",e),e),Ze=(e)=>!e||e.toLowerCase()==="x"||e==="*",$U=(e,t)=>e.trim().split(/\s+/).map((r)=>EU(r,t)).join(" "),EU=(e,t)=>{let r=t.loose?Qe[Be.TILDELOOSE]:Qe[Be.TILDE];return e.replace(r,(n,s,o,a,i)=>{ye("tilde",e,n,s,o,a,i);let c;if(Ze(s))c="";else if(Ze(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Ze(a))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(i)ye("replaceTilde pr",i),c=`>=${s}.${o}.${a}-${i} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},SU=(e,t)=>e.trim().split(/\s+/).map((r)=>xU(r,t)).join(" "),xU=(e,t)=>{ye("caret",e,t);let r=t.loose?Qe[Be.CARETLOOSE]:Qe[Be.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,a,i,c)=>{ye("caret",e,s,o,a,i,c);let u;if(Ze(o))u="";else if(Ze(a))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Ze(i))if(o==="0")u=`>=${o}.${a}.0${n} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(a==="0")u=`>=${o}.${a}.${i}-${c} <${o}.${a}.${+i+1}-0`;else u=`>=${o}.${a}.${i}-${c} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.${i}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(a==="0")u=`>=${o}.${a}.${i}${n} <${o}.${a}.${+i+1}-0`;else u=`>=${o}.${a}.${i}${n} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.${i} <${+o+1}.0.0-0`;return ye("caret return",u),u})},RU=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>kU(r,t)).join(" ")),kU=(e,t)=>{e=e.trim();let r=t.loose?Qe[Be.XRANGELOOSE]:Qe[Be.XRANGE];return e.replace(r,(n,s,o,a,i,c)=>{ye("xRange",e,n,s,o,a,i,c);let u=Ze(o),l=u||Ze(a),d=l||Ze(i),m=d;if(s==="="&&m)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&m){if(l)a=0;if(i=0,s===">")if(s=">=",l)o=+o+1,a=0,i=0;else a=+a+1,i=0;else if(s==="<=")if(s="<",l)o=+o+1;else a=+a+1;if(s==="<")c="-0";n=`${s+o}.${a}.${i}${c}`}else if(l)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(d)n=`>=${o}.${a}.0${c} <${o}.${+a+1}.0-0`;return ye("xRange return",n),n})},TU=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Qe[Be.STAR],"")),AU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Qe[t.includePrerelease?Be.GTE0PRE:Be.GTE0],"")),OU=(e)=>(t,r,n,s,o,a,i,c,u,l,d,m)=>{if(Ze(n))r="";else if(Ze(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Ze(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(a)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Ze(u))c="";else if(Ze(l))c=`<${+u+1}.0.0-0`;else if(Ze(d))c=`<${u}.${+l+1}.0-0`;else if(m)c=`<=${u}.${l}.${d}-${m}`;else if(e)c=`<${u}.${l}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},NU=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(ye(e[n].semver),e[n].semver===Ui.ANY)continue;if(e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var $o=g(function(l5,Zw){var Eo=Symbol("SemVer ANY");class Fi{static get ANY(){return Eo}constructor(e,t){if(t=Ww(t),e instanceof Fi)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),yl("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Eo)this.value="";else this.value=this.operator+this.semver.version;yl("comp",this)}parse(e){let t=this.options.loose?Yw[Xw.COMPARATORLOOSE]:Yw[Xw.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Eo;else this.semver=new Jw(r[2],this.options.loose)}toString(){return this.value}test(e){if(yl("Comparator.test",e,this.options.loose),this.semver===Eo||e===Eo)return!0;if(typeof e==="string")try{e=new Jw(e,this.options)}catch(t){return!1}return gl(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Fi))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Qw(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Qw(this.value,t).test(e.semver)}if(t=Ww(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(gl(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(gl(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Zw.exports=Fi;var Ww=Ai(),{safeRe:Yw,t:Xw}=Ts(),gl=hl(),yl=vo(),Jw=He(),Qw=$t()});var So=g(function(d5,e$){var PU=$t(),IU=(e,t,r)=>{try{t=new PU(t,r)}catch(n){return!1}return t.test(e)};e$.exports=IU});var r$=g(function(f5,t$){var CU=$t(),jU=(e,t)=>new CU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));t$.exports=jU});var s$=g(function(p5,n$){var qU=He(),DU=$t(),MU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new DU(t,r)}catch(a){return null}return e.forEach((a)=>{if(o.test(a)){if(!n||s.compare(a)===-1)n=a,s=new qU(n,r)}}),n};n$.exports=MU});var a$=g(function(m5,o$){var LU=He(),UU=$t(),FU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new UU(t,r)}catch(a){return null}return e.forEach((a)=>{if(o.test(a)){if(!n||s.compare(a)===1)n=a,s=new LU(n,r)}}),n};o$.exports=FU});var u$=g(function(h5,c$){var _l=He(),VU=$t(),i$=bo(),zU=(e,t)=>{e=new VU(e,t);let r=new _l("0.0.0");if(e.test(r))return r;if(r=new _l("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],o=null;if(s.forEach((a)=>{let i=new _l(a.semver.version);switch(a.operator){case">":if(i.prerelease.length===0)i.patch++;else i.prerelease.push(0);i.raw=i.format();case"":case">=":if(!o||i$(i,o))o=i;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${a.operator}`)}}),o&&(!r||i$(r,o)))r=o}if(r&&e.test(r))return r;return null};c$.exports=zU});var d$=g(function(g5,l$){var GU=$t(),KU=(e,t)=>{try{return new GU(e,t).range||"*"}catch(r){return null}};l$.exports=KU});var Vi=g(function(y5,h$){var HU=He(),m$=$o(),{ANY:BU}=m$,WU=$t(),YU=So(),f$=bo(),p$=ji(),XU=Di(),JU=qi(),QU=(e,t,r,n)=>{e=new HU(e,n),t=new WU(t,n);let s,o,a,i,c;switch(r){case">":s=f$,o=XU,a=p$,i=">",c=">=";break;case"<":s=p$,o=JU,a=f$,i="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(YU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],d=null,m=null;if(l.forEach((f)=>{if(f.semver===BU)f=new m$(">=0.0.0");if(d=d||f,m=m||f,s(f.semver,d.semver,n))d=f;else if(a(f.semver,m.semver,n))m=f}),d.operator===i||d.operator===c)return!1;if((!m.operator||m.operator===i)&&o(e,m.semver))return!1;else if(m.operator===c&&a(e,m.semver))return!1}return!0};h$.exports=QU});var y$=g(function(_5,g$){var ZU=Vi(),e2=(e,t,r)=>ZU(e,t,">",r);g$.exports=e2});var v$=g(function(v5,_$){var t2=Vi(),r2=(e,t,r)=>t2(e,t,"<",r);_$.exports=r2});var $$=g(function(b5,w$){var b$=$t(),n2=(e,t,r)=>(e=new b$(e,r),t=new b$(t,r),e.intersects(t,r));w$.exports=n2});var S$=g(function(w5,E$){var s2=So(),o2=wt();E$.exports=(e,t,r)=>{let n=[],s=null,o=null,a=e.sort((l,d)=>o2(l,d,r));for(let l of a)if(s2(l,t,r)){if(o=l,!s)s=l}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let i=[];for(let[l,d]of n)if(l===d)i.push(l);else if(!d&&l===a[0])i.push("*");else if(!d)i.push(`>=${l}`);else if(l===a[0])i.push(`<=${d}`);else i.push(`${l} - ${d}`);let c=i.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var O$=g(function($5,A$){var x$=$t(),bl=$o(),{ANY:vl}=bl,xo=So(),wl=wt(),a2=(e,t,r={})=>{if(e===t)return!0;e=new x$(e,r),t=new x$(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let a=c2(s,o,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},i2=[new bl(">=0.0.0-0")],R$=[new bl(">=0.0.0")],c2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vl)if(t.length===1&&t[0].semver===vl)return!0;else if(r.includePrerelease)e=i2;else e=R$;if(t.length===1&&t[0].semver===vl)if(r.includePrerelease)return!0;else t=R$;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=k$(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=T$(o,f,r);else n.add(f.semver);if(n.size>1)return null;let a;if(s&&o){if(a=wl(s.semver,o.semver,r),a>0)return null;else if(a===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!xo(f,String(s),r))return null;if(o&&!xo(f,String(o),r))return null;for(let p of t)if(!xo(f,String(p),r))return!1;return!0}let i,c,u,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0)d=!1;for(let f of t){if(l=l||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(m){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===m.major&&f.semver.minor===m.minor&&f.semver.patch===m.patch)m=!1}if(f.operator===">"||f.operator===">="){if(i=k$(s,f,r),i===f&&i!==s)return!1}else if(s.operator===">="&&!xo(s.semver,String(f),r))return!1}if(o){if(d){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch)d=!1}if(f.operator==="<"||f.operator==="<="){if(c=T$(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!xo(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&a!==0)return!1}if(s&&u&&!o&&a!==0)return!1;if(o&&l&&!s&&a!==0)return!1;if(m||d)return!1;return!0},k$=(e,t,r)=>{if(!e)return t;let n=wl(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},T$=(e,t,r)=>{if(!e)return t;let n=wl(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};A$.exports=a2});var P$=g(function(E5,N$){var As=Ts(),zi=_o(),u2=He(),Gi=dl(),l2=Pn(),d2=nw(),f2=ow(),p2=cw(),m2=dw(),h2=pw(),g2=hw(),y2=yw(),_2=vw(),v2=wt(),b2=Ew(),w2=xw(),$2=Ci(),E2=Aw(),S2=Nw(),x2=bo(),R2=ji(),k2=pl(),T2=ml(),A2=qi(),O2=Di(),N2=hl(),P2=Uw(),I2=$o(),C2=$t(),j2=So(),q2=r$(),D2=s$(),M2=a$(),L2=u$(),U2=d$(),F2=Vi(),V2=y$(),z2=v$(),G2=$$(),K2=S$(),H2=O$();N$.exports={parse:l2,valid:d2,clean:f2,inc:p2,diff:m2,major:h2,minor:g2,patch:y2,prerelease:_2,compare:v2,rcompare:b2,compareLoose:w2,compareBuild:$2,sort:E2,rsort:S2,gt:x2,lt:R2,eq:k2,neq:T2,gte:A2,lte:O2,cmp:N2,coerce:P2,Comparator:I2,Range:C2,satisfies:j2,toComparators:q2,maxSatisfying:D2,minSatisfying:M2,minVersion:L2,validRange:U2,outside:F2,gtr:V2,ltr:z2,intersects:G2,simplifyRange:K2,subset:H2,SemVer:u2,re:As.re,src:As.src,tokens:As.t,SEMVER_SPEC_VERSION:zi.SEMVER_SPEC_VERSION,RELEASE_TYPES:zi.RELEASE_TYPES,compareIdentifiers:Gi.compareIdentifiers,rcompareIdentifiers:Gi.rcompareIdentifiers}});function C$(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return B2.call(e)===r}function j$(e){return C$(e,Uint8Array,"[object Uint8Array]")}function W2(e){return C$(e,ArrayBuffer,"[object ArrayBuffer]")}function Y2(e){return j$(e)||W2(e)}function X2(e){if(!j$(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function J2(e){if(!Y2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function $l(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((s,o)=>s+o.length,0);let r=new Uint8Array(t),n=0;for(let s of e)X2(s),r.set(s,n),n+=s.length;return r}function El(e,t="utf8"){return J2(e),I$[t]??=new globalThis.TextDecoder(t),I$[t].decode(e)}function Q2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function Ki(e){return Q2(e),Z2.encode(e)}var B2,I$,Z2,S5;var q$=L(()=>{B2=Object.prototype.toString;I$={utf8:new globalThis.TextDecoder("utf8")};Z2=new globalThis.TextEncoder;S5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as eF}from"util";import D$ from"process";import In from"fs";import M$ from"path";import Ro from"crypto";import tF from"assert";var U$,F$,Cn,rF,L$="aes-256-cbc",Os=()=>Object.create(null),nF=(e)=>e!==void 0&&e!==null,sF=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},Hi="__internal__",Sl,Bi;var V$=L(()=>{dd();pd();zd();Gb();q$();U$=vc(ay(),1),F$=vc(Vb(),1),Cn=vc(P$(),1),rF=F$.default.default,Sl=`${Hi}.migrations.version`;Bi=class Bi{path;events;#n;#t;#e;#r={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=xc(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let o=new U$.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});rF(o);let a={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(a);for(let[i,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[i]=c.default}if(t.defaults)this.#r={...this.#r,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let r=t.fileExtension?`.${t.fileExtension}`:"";this.path=M$.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(Os(),t.defaults,n);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(s);try{tF.deepEqual(n,s)}catch{this.store=s}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:r}=this;return e in r?r[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${Hi} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(sF(s,o),this.#e.accessPropertiesByDotNotation)$c(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,a]of Object.entries(s))n(o,a)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return ld(this.store,e);return e in this.store}reset(...e){for(let t of e)if(nF(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)ud(t,e);else delete t[e];this.store=t}clear(){this.store=Os();for(let e of Object.keys(this.#r))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=In.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Os(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Os();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Os();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:El(e);try{let t=e.slice(0,16),r=Ro.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=Ro.createDecipheriv(L$,r,t),s=e.slice(17),o=typeof s==="string"?Ki(s):s;return El($l([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(eF(o,s))return;r=o,t.call(this,o,s)};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#n)return;if(this.#n(e)||!this.#n.errors)return;let r=this.#n.errors.map(({instancePath:n,message:s=""})=>`\`${n.slice(1)}\` ${s}`);throw Error("Config schema violation: "+r.join("; "))}_ensureDirectory(){In.mkdirSync(M$.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=Ro.randomBytes(16),n=Ro.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=Ro.createCipheriv(L$,n,r);t=$l([r,Ki(":"),s.update(Ki(t)),s.final()])}if(D$.env.SNAP)In.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{qc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){In.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!In.existsSync(this.path))this._write(Os());if(D$.platform==="win32")In.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else In.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(Sl,"0.0.0"),s=Object.keys(e).filter((a)=>this._shouldPerformMigration(a,n,t)),o={...this.store};for(let a of s)try{if(r)r(this,{fromVersion:n,toVersion:a,finalVersion:t,versions:s});let i=e[a];i?.(this),this._set(Sl,a),n=a,o={...this.store}}catch(i){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${i}`)}if(this._isVersionInRangeFormat(n)||!Cn.default.eq(n,t))this._set(Sl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Hi)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Hi}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return Cn.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&Cn.default.satisfies(t,e))return!1;return Cn.default.satisfies(r,e)}if(Cn.default.lte(e,t))return!1;if(Cn.default.gt(e,r))return!1;return!0}_get(e,t){return cd(this.store,e,t)}_set(e,t){let{store:r}=this;$c(r,e,t),this.store=r}}});var se,z$,P,$r=(e)=>{switch(typeof e){case"undefined":return P.undefined;case"string":return P.string;case"number":return Number.isNaN(e)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":if(Array.isArray(e))return P.array;if(e===null)return P.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return P.promise;if(typeof Map<"u"&&e instanceof Map)return P.map;if(typeof Set<"u"&&e instanceof Set)return P.set;if(typeof Date<"u"&&e instanceof Date)return P.date;return P.object;default:return P.unknown}};var ko=L(()=>{(function(e){e.assertEqual=(s)=>{};function t(s){}e.assertIs=t;function r(s){throw Error()}e.assertNever=r,e.arrayToEnum=(s)=>{let o={};for(let a of s)o[a]=a;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((i)=>typeof s[s[i]]!=="number"),a={};for(let i of o)a[i]=s[i];return e.objectValues(a)},e.objectValues=(s)=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys==="function"?(s)=>Object.keys(s):(s)=>{let o=[];for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a))o.push(a);return o},e.find=(s,o)=>{for(let a of s)if(o(a))return a;return},e.isInteger=typeof Number.isInteger==="function"?(s)=>Number.isInteger(s):(s)=>typeof s==="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map((a)=>typeof a==="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(se||(se={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(z$||(z$={}));P=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var E,ft;var Wi=L(()=>{ko();E=se.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"]);ft=class ft extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},r={_errors:[]},n=(s)=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let a=r,i=0;while(i<o.path.length){let c=o.path[i];if(i!==o.path.length-1)a[c]=a[c]||{_errors:[]};else a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o));a=a[c],i++}}};return n(this),r}static assert(e){if(!(e instanceof ft))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ft.create=(e)=>new ft(e)});var oF=(e,t)=>{let r;switch(e.code){case E.invalid_type:if(e.received===P.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else se.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case E.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case E.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,se.assertNever(e)}return{message:r}},mn;var xl=L(()=>{Wi();ko();mn=oF});function To(){return aF}var aF;var Yi=L(()=>{xl();aF=mn});function T(e,t){let r=To(),n=Xi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===mn?void 0:mn].filter((s)=>!!s)});e.common.issues.push(n)}class We{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return G;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let s=await n.key,o=await n.value;r.push({key:s,value:o})}return We.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:s,value:o}=n;if(s.status==="aborted")return G;if(o.status==="aborted")return G;if(s.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(s.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet))r[s.value]=o.value}return{status:e.value,value:r}}}var Xi=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)i=u(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}},G,Ns=(e)=>({status:"dirty",value:e}),et=(e)=>({status:"valid",value:e}),Rl=(e)=>e.status==="aborted",kl=(e)=>e.status==="dirty",jn=(e)=>e.status==="valid",Ao=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=L(()=>{Yi();xl();G=Object.freeze({status:"aborted"})});var G$=()=>{};var D;var K$=L(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class Ot{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Q(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:s};return{errorMap:(a,i)=>{let{message:c}=e;if(a.code==="invalid_enum_value")return{message:c??i.defaultError};if(typeof i.data>"u")return{message:c??n??i.defaultError};if(a.code!=="invalid_type")return{message:i.defaultError};return{message:c??r??i.defaultError}},description:s}}class te{get description(){return this._def.description}_getType(e){return $r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new We,ctx:{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ao(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)},n=this._parseSync({data:e,path:r.path,parent:r});return H$(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return jn(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>jn(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(Ao(n)?n:Promise.resolve(n));return H$(r,s)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,s)=>{let o=e(n),a=()=>s.addIssue({code:E.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((i)=>{if(!i)return a(),!1;else return!0});if(!o)return a(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new dr({schema:this,typeName:K.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 lr.create(this,this._def)}nullable(){return hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ur.create(this)}promise(){return qs.create(this,this._def)}or(e){return Co.create([this,e],this._def)}and(e){return jo.create(this,e,this._def)}transform(e){return new dr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Lo({...Q(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new Pl({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Uo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return sc.create(this,e)}readonly(){return Fo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function W$(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function EF(e){return new RegExp(`^${W$(e)}$`)}function SF(e){let t=`${B$}T${W$(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function xF(e,t){if((t==="v4"||!t)&&gF.test(e))return!0;if((t==="v6"||!t)&&_F.test(e))return!0;return!1}function RF(e,t){if(!fF.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));if(typeof s!=="object"||s===null)return!1;if("typ"in s&&s?.typ!=="JWT")return!1;if(!s.alg)return!1;if(t&&s.alg!==t)return!1;return!0}catch{return!1}}function kF(e,t){if((t==="v4"||!t)&&yF.test(e))return!0;if((t==="v6"||!t)&&vF.test(e))return!0;return!1}function TF(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}function Ps(e){if(e instanceof Ie){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=lr.create(Ps(n))}return new Ie({...e._def,shape:()=>t})}else if(e instanceof ur)return new ur({...e._def,type:Ps(e.element)});else if(e instanceof lr)return lr.create(Ps(e.unwrap()));else if(e instanceof hn)return hn.create(Ps(e.unwrap()));else if(e instanceof Rr)return Rr.create(e.items.map((t)=>Ps(t)));else return e}function Ol(e,t){let r=$r(e),n=$r(t);if(e===t)return{valid:!0,data:e};else if(r===P.object&&n===P.object){let s=se.objectKeys(t),o=se.objectKeys(e).filter((i)=>s.indexOf(i)!==-1),a={...e,...t};for(let i of o){let c=Ol(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===P.array&&n===P.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let a=e[o],i=t[o],c=Ol(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===P.date&&n===P.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Y$(e,t){return new Dn({values:e,typeName:K.ZodEnum,...Q(t)})}var H$=(e,t)=>{if(jn(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ft(e.common.issues);return this._error=r,this._error}}}},iF,cF,uF,lF,dF,fF,pF,mF,hF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Al,gF,yF,_F,vF,bF,wF,B$="((\\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])))",$F,Sr,Is,Cs,Ji,No,Qi,Po,Io,Zi,qn,xr,ec,ur,Ie,Co,Er=(e)=>{if(e instanceof qo)return Er(e.schema);else if(e instanceof dr)return Er(e.innerType());else if(e instanceof Do)return[e.value];else if(e instanceof Dn)return e.options;else if(e instanceof Mo)return se.objectValues(e.enum);else if(e instanceof Lo)return Er(e._def.innerType);else if(e instanceof Po)return[void 0];else if(e instanceof Io)return[null];else if(e instanceof lr)return[void 0,...Er(e.unwrap())];else if(e instanceof hn)return[null,...Er(e.unwrap())];else if(e instanceof Pl)return Er(e.unwrap());else if(e instanceof Fo)return Er(e.unwrap());else if(e instanceof Uo)return Er(e._def.innerType);else return[]},Nl,jo,Rr,tc,rc,js,Oo,qo,Do,Dn,Mo,qs,dr,lr,hn,Lo,Uo,nc,t3,Pl,sc,Fo,r3,K,_,ne,n3,s3,Ce,o3,a3,i3,c3,u3,l3,d3,f3,Ye,Z,p3,AF,X$,m3,h3,OF,g3,y3,_3,v3,gn,Fe,b3,w3,$3,E3,S3,x3,R3;var J$=L(()=>{Wi();Yi();K$();Tl();ko();iF=/^c[^\s-]{8,}$/i,cF=/^[0-9a-z]+$/,uF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lF=/^[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,dF=/^[a-z0-9_-]{21}$/i,fF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pF=/^[-+]?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)?)??$/,mF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gF=/^(?:(?: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])$/,yF=/^(?:(?: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])$/,_F=/^(([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]))$/,vF=/^(([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])$/,bF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$F=new RegExp(`^${B$}$`);Sr=class Sr extends te{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==P.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.string,received:s.parsedType}),G}let r=new We,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.length<s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="max"){if(e.data.length>s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;if(o||a){if(n=this._getOrReturnCtx(e,n),o)T(n,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(a)T(n,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!mF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"email",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!Al)Al=new RegExp(hF,"u");if(!Al.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"emoji",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!lF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"uuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!dF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"nanoid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!iF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!cF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid2",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!uF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"ulid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),T(n,{validation:"url",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="regex"){if(s.regex.lastIndex=0,!s.regex.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"regex",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="trim")e.data=e.data.trim();else if(s.kind==="includes"){if(!e.data.includes(s.value,s.position))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()}else if(s.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(s.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(s.kind==="startsWith"){if(!e.data.startsWith(s.value))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="endsWith"){if(!e.data.endsWith(s.value))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!SF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!$F.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!EF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!pF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"duration",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!xF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"ip",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!RF(e.data,s.alg))n=this._getOrReturnCtx(e,n),T(n,{validation:"jwt",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!kF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"cidr",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!bF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!wF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64url",code:E.invalid_string,message:s.message}),r.dirty()}else se.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:E.invalid_string,...D.errToObj(r)})}_addCheck(e){return new Sr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...D.errToObj(e)})}url(e){return this._addCheck({kind:"url",...D.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...D.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...D.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...D.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...D.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...D.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...D.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...D.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...D.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...D.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...D.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...D.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,...D.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,...D.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...D.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...D.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...D.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...D.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...D.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...D.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...D.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...D.errToObj(t)})}nonempty(e){return this.min(1,D.errToObj(e))}trim(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sr({...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}};Sr.create=(e)=>new Sr({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Q(e)});Is=class Is extends te{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)!==P.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.number,received:s.parsedType}),G}let r=void 0,n=new We;for(let s of this._def.checks)if(s.kind==="int"){if(!se.isInteger(e.data))r=this._getOrReturnCtx(e,r),T(r,{code:E.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()}else if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(TF(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),T(r,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else if(s.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),T(r,{code:E.not_finite,message:s.message}),n.dirty()}else se.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new Is({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Is({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:D.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:D.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.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"&&se.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};Is.create=(e)=>new Is({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Cs=class Cs extends te{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)!==P.bigint)return this._getInvalidInput(e);let r=void 0,n=new We;for(let s of this._def.checks)if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(e.data%s.value!==BigInt(0))r=this._getOrReturnCtx(e,r),T(r,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else se.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:P.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new Cs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Cs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.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}};Cs.create=(e)=>new Cs({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Ji=class Ji extends te{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==P.boolean){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.boolean,received:r.parsedType}),G}return et(e.data)}};Ji.create=(e)=>new Ji({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});No=class No extends te{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==P.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),G}let r=new We,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.getTime()<s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()}else if(s.kind==="max"){if(e.data.getTime()>s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()}else se.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new No({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:D.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:D.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}};No.create=(e)=>new No({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Qi=class Qi extends te{_parse(e){if(this._getType(e)!==P.symbol){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.symbol,received:r.parsedType}),G}return et(e.data)}};Qi.create=(e)=>new Qi({typeName:K.ZodSymbol,...Q(e)});Po=class Po extends te{_parse(e){if(this._getType(e)!==P.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.undefined,received:r.parsedType}),G}return et(e.data)}};Po.create=(e)=>new Po({typeName:K.ZodUndefined,...Q(e)});Io=class Io extends te{_parse(e){if(this._getType(e)!==P.null){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.null,received:r.parsedType}),G}return et(e.data)}};Io.create=(e)=>new Io({typeName:K.ZodNull,...Q(e)});Zi=class Zi extends te{constructor(){super(...arguments);this._any=!0}_parse(e){return et(e.data)}};Zi.create=(e)=>new Zi({typeName:K.ZodAny,...Q(e)});qn=class qn extends te{constructor(){super(...arguments);this._unknown=!0}_parse(e){return et(e.data)}};qn.create=(e)=>new qn({typeName:K.ZodUnknown,...Q(e)});xr=class xr extends te{_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:P.never,received:t.parsedType}),G}};xr.create=(e)=>new xr({typeName:K.ZodNever,...Q(e)});ec=class ec extends te{_parse(e){if(this._getType(e)!==P.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.void,received:r.parsedType}),G}return et(e.data)}};ec.create=(e)=>new ec({typeName:K.ZodVoid,...Q(e)});ur=class ur extends te{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==P.array)return T(t,{code:E.invalid_type,expected:P.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;if(o||a)T(t,{code:o?E.too_big:E.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)T(t,{code:E.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)T(t,{code:E.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,a)=>n.type._parseAsync(new Ot(t,o,t.path,a)))).then((o)=>We.mergeArray(r,o));let s=[...t.data].map((o,a)=>n.type._parseSync(new Ot(t,o,t.path,a)));return We.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new ur({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new ur({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new ur({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};ur.create=(e,t)=>new ur({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ie=class Ie extends te{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=se.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==P.object){let c=this._getOrReturnCtx(e);return T(c,{code:E.invalid_type,expected:P.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))a.push(c)}let i=[];for(let c of o){let u=s[c],l=n.data[c];i.push({key:{status:"valid",value:c},value:u._parse(new Ot(n,l,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof xr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)i.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(a.length>0)T(n,{code:E.unrecognized_keys,keys:a}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let l=n.data[u];i.push({key:{status:"valid",value:u},value:c._parse(new Ot(n,l,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of i){let l=await u.key,d=await u.value;c.push({key:l,value:d,alwaysSet:u.alwaysSet})}return c}).then((c)=>We.mergeObjectSync(r,c));else return We.mergeObjectSync(r,i)}get shape(){return this._def.shape()}strict(e){return D.errToObj,new Ie({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:D.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ie({...this._def,catchall:e})}pick(e){let t={};for(let r of se.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new Ie({...this._def,shape:()=>t})}omit(e){let t={};for(let r of se.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ie({...this._def,shape:()=>t})}deepPartial(){return Ps(this)}partial(e){let t={};for(let r of se.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new Ie({...this._def,shape:()=>t})}required(e){let t={};for(let r of se.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof lr)s=s._def.innerType;t[r]=s}return new Ie({...this._def,shape:()=>t})}keyof(){return Y$(se.objectKeys(this.shape))}};Ie.create=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ie.strictCreate=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ie.lazycreate=(e,t)=>new Ie({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Co=class Co extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map((a)=>new ft(a.ctx.common.issues));return T(t,{code:E.invalid_union,unionErrors:o}),G}if(t.common.async)return Promise.all(r.map(async(s)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);else{let s=void 0,o=[];for(let i of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=i._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!s)s={result:u,ctx:c};if(c.common.issues.length)o.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map((i)=>new ft(i));return T(t,{code:E.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}};Co.create=(e,t)=>new Co({options:e,typeName:K.ZodUnion,...Q(t)});Nl=class Nl extends te{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.object)return T(t,{code:E.invalid_type,expected:P.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return T(t,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),G;if(t.common.async)return s._parseAsync({data:t.data,path:t.path,parent:t});else return s._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let s of t){let o=Er(s.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(n.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new Nl({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};jo=class jo extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(Rl(s)||Rl(o))return G;let a=Ol(s.value,o.value);if(!a.valid)return T(r,{code:E.invalid_intersection_types}),G;if(kl(s)||kl(o))t.dirty();return{status:t.value,value:a.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>n(s,o));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};jo.create=(e,t,r)=>new jo({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});Rr=class Rr extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.array)return T(r,{code:E.invalid_type,expected:P.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return T(r,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;if(!this._def.rest&&r.data.length>this._def.items.length)T(r,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let s=[...r.data].map((o,a)=>{let i=this._def.items[a]||this._def.rest;if(!i)return null;return i._parse(new Ot(r,o,r.path,a))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>We.mergeArray(t,o));else return We.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Rr({...this._def,rest:e})}};Rr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rr({items:e,typeName:K.ZodTuple,rest:null,...Q(t)})};tc=class tc extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.object)return T(r,{code:E.invalid_type,expected:P.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in r.data)n.push({key:s._parse(new Ot(r,a,r.path,a)),value:o._parse(new Ot(r,r.data[a],r.path,a)),alwaysSet:a in r.data});if(r.common.async)return We.mergeObjectAsync(t,n);else return We.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof te)return new tc({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new tc({keyType:Sr.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};rc=class rc extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.map)return T(r,{code:E.invalid_type,expected:P.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,i],c)=>({key:n._parse(new Ot(r,a,r.path,[c,"key"])),value:s._parse(new Ot(r,i,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let i of o){let c=await i.key,u=await i.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();a.set(c.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let i of o){let{key:c,value:u}=i;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();a.set(c.value,u.value)}return{status:t.value,value:a}}}};rc.create=(e,t,r)=>new rc({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});js=class js extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.set)return T(r,{code:E.invalid_type,expected:P.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)T(r,{code:E.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)T(r,{code:E.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let s=this._def.valueType;function o(i){let c=new Set;for(let u of i){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let a=[...r.data.values()].map((i,c)=>s._parse(new Ot(r,i,r.path,c)));if(r.common.async)return Promise.all(a).then((i)=>o(i));else return o(a)}min(e,t){return new js({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new js({...this._def,maxSize:{value:e,message:D.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};js.create=(e,t)=>new js({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends te{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.function)return T(t,{code:E.invalid_type,expected:P.function,received:t.parsedType}),G;function r(a,i){return Xi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),mn].filter((c)=>!!c),issueData:{code:E.invalid_arguments,argumentsError:i}})}function n(a,i){return Xi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),mn].filter((c)=>!!c),issueData:{code:E.invalid_return_type,returnTypeError:i}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof qs){let a=this;return et(async function(...i){let c=new ft([]),u=await a._def.args.parseAsync(i,s).catch((m)=>{throw c.addIssue(r(i,m)),c}),l=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(l,s).catch((m)=>{throw c.addIssue(n(l,m)),c})})}else{let a=this;return et(function(...i){let c=a._def.args.safeParse(i,s);if(!c.success)throw new ft([r(i,c.error)]);let u=Reflect.apply(o,this,c.data),l=a._def.returns.safeParse(u,s);if(!l.success)throw new ft([n(u,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:Rr.create(e).rest(qn.create())})}returns(e){return new Oo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Oo({args:e?e:Rr.create([]).rest(qn.create()),returns:t||qn.create(),typeName:K.ZodFunction,...Q(r)})}};qo=class qo extends te{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})}};qo.create=(e,t)=>new qo({getter:e,typeName:K.ZodLazy,...Q(t)});Do=class Do extends te{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return T(t,{received:t.data,code:E.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};Do.create=(e,t)=>new Do({value:e,typeName:K.ZodLiteral,...Q(t)});Dn=class Dn extends te{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{expected:se.joinValues(r),received:t.parsedType,code:E.invalid_type}),G}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{received:t.data,code:E.invalid_enum_value,options:r}),G}return et(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 Dn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Dn.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};Dn.create=Y$;Mo=class Mo extends te{_parse(e){let t=se.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==P.string&&r.parsedType!==P.number){let n=se.objectValues(t);return T(r,{expected:se.joinValues(n),received:r.parsedType,code:E.invalid_type}),G}if(!this._cache)this._cache=new Set(se.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=se.objectValues(t);return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),G}return et(e.data)}get enum(){return this._def.values}};Mo.create=(e,t)=>new Mo({values:e,typeName:K.ZodNativeEnum,...Q(t)});qs=class qs extends te{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.promise&&t.common.async===!1)return T(t,{code:E.invalid_type,expected:P.promise,received:t.parsedType}),G;let r=t.parsedType===P.promise?t.data:Promise.resolve(t.data);return et(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};qs.create=(e,t)=>new qs({type:e,typeName:K.ZodPromise,...Q(t)});dr=class dr extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:(o)=>{if(T(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async(a)=>{if(t.value==="aborted")return G;let i=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return Ns(i.value);if(t.value==="dirty")return Ns(i.value);return i});else{if(t.value==="aborted")return G;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return Ns(a.value);if(t.value==="dirty")return Ns(a.value);return a}}if(n.type==="refinement"){let o=(a)=>{let i=n.refinement(a,s);if(r.common.async)return Promise.resolve(i);if(i instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")t.dirty();return o(a.value),{status:t.value,value:a.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((a)=>{if(a.status==="aborted")return G;if(a.status==="dirty")t.dirty();return o(a.value).then(()=>({status:t.value,value:a.value}))})}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!jn(o))return G;let a=n.transform(o.value,s);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!jn(o))return G;return Promise.resolve(n.transform(o.value,s)).then((a)=>({status:t.value,value:a}))});se.assertNever(n)}};dr.create=(e,t,r)=>new dr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});dr.createWithPreprocess=(e,t,r)=>new dr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});lr=class lr extends te{_parse(e){if(this._getType(e)===P.undefined)return et(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:K.ZodOptional,...Q(t)});hn=class hn extends te{_parse(e){if(this._getType(e)===P.null)return et(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hn.create=(e,t)=>new hn({innerType:e,typeName:K.ZodNullable,...Q(t)});Lo=class Lo extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===P.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Uo=class Uo extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Ao(n))return n.then((s)=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});nc=class nc extends te{_parse(e){if(this._getType(e)!==P.nan){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};nc.create=(e)=>new nc({typeName:K.ZodNaN,...Q(e)});t3=Symbol("zod_brand");Pl=class Pl extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};sc=class sc extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return G;if(s.status==="dirty")return t.dirty(),Ns(s.value);else return this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return G;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new sc({in:e,out:t,typeName:K.ZodPipeline})}};Fo=class Fo extends te{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(jn(n))n.value=Object.freeze(n.value);return n};return Ao(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Fo.create=(e,t)=>new Fo({innerType:e,typeName:K.ZodReadonly,...Q(t)});r3={object:Ie.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"})(K||(K={}));_=Sr.create,ne=Is.create,n3=nc.create,s3=Cs.create,Ce=Ji.create,o3=No.create,a3=Qi.create,i3=Po.create,c3=Io.create,u3=Zi.create,l3=qn.create,d3=xr.create,f3=ec.create,Ye=ur.create,Z=Ie.create,p3=Ie.strictCreate,AF=Co.create,X$=Nl.create,m3=jo.create,h3=Rr.create,OF=tc.create,g3=rc.create,y3=js.create,_3=Oo.create,v3=qo.create,gn=Do.create,Fe=Dn.create,b3=Mo.create,w3=qs.create,$3=dr.create,E3=lr.create,S3=hn.create,x3=dr.createWithPreprocess,R3=sc.create});var Il=L(()=>{Yi();Tl();G$();ko();J$();Wi()});var _n=L(()=>{Il();Il()});function D3(e){return PF.includes(e)}var NF,Mn,PF,M3,IF,Q$,CF,Z$,jF,qF,L3,DF,U3,F3,V3,z3,MF,eE,LF,tE,G3=20,K3=500,UF,H3;var oc=L(()=>{_n();NF=Fe(["pending","verified","approved","revoked"]),Mn=Fe(["person","service","test"]),PF=Mn.options;M3={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"},IF=Fe(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Q$=IF.options,CF=Fe(["active","pending","revoked"]),Z$=Z({field:_(),blocks:Ye(_()).optional(),set_on:Ye(_()).optional()}).passthrough(),jF=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:ne().int().optional(),sandbox_completed:Ce().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:Ce().optional(),status:NF.optional(),email_verified:Ce().optional(),orcid_verified:Ce().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:Ye(Z$).optional(),username_auto_assigned:Ce().optional(),account_kind:Mn.optional(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional()}).passthrough(),qF=Z({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),L3=Z({user:jF,token:qF.optional()}).passthrough(),DF=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:ne().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:ne().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:Mn.optional(),matched_in:Ye(_()).optional(),match_kind:_().optional()}).passthrough(),U3=Z({users:Ye(DF),count:ne().int()}).passthrough(),F3=Fe(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),V3=Fe(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),z3=Z({suggestion:_().nullable(),based_on:Fe(["name","unavailable","exhausted"])}).passthrough(),MF=Fe(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),eE=MF.options,LF=Fe(["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"]),tE=LF.options,UF=Z({id:ne().int(),email:_(),username:_().nullable(),role:_(),status:CF,email_verified:Ce(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:Ce(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:Ce(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:Ye(Z$),username_auto_assigned:Ce(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional()}).passthrough(),H3=Z({user:UF.nullable()}).passthrough()});function fr(e){if(e instanceof Error)return e.message;return String(e)}function W3(e){if(!(e instanceof pr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var pr,Cl;var jl=L(()=>{pr=class pr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;retryAfterSeconds;constructor(e,t,r,n,s,o){super(t);this.statusCode=e;this.details=r;this.step=n;this.blockReason=s;this.missing=o;this.name="ApiError"}};Cl=class Cl extends pr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function zF(){let e=new Map;for(let[t,r]of Object.entries(be)){for(let[n,s]of Object.entries(r))be[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=be[n],e.set(s[0],s[1]);Object.defineProperty(be,t,{value:r,enumerable:!1})}return Object.defineProperty(be,"codes",{value:e,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=rE(),be.color.ansi256=nE(),be.color.ansi16m=sE(),be.bgColor.ansi=rE(10),be.bgColor.ansi256=nE(10),be.bgColor.ansi16m=sE(10),Object.defineProperties(be,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((o)=>o+o).join("");let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:(t)=>be.rgbToAnsi256(...be.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,s;if(t>=232)r=((t-232)*10+8)/255,n=r,s=r;else{t-=16;let i=t%36;r=Math.floor(t/36)/5,n=Math.floor(i/6)/5,s=i%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let a=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)a+=60;return a},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>be.ansi256ToAnsi(be.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>be.ansi256ToAnsi(be.hexToAnsi256(t)),enumerable:!1}}),be}var rE=(e=0)=>(t)=>`\x1B[${t+e}m`,nE=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,sE=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,be,X3,FF,VF,J3,GF,Nt;var oE=L(()=>{be={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},X3=Object.keys(be.modifier),FF=Object.keys(be.color),VF=Object.keys(be.bgColor),J3=[...FF,...VF];GF=zF(),Nt=GF});import ql from"process";import KF from"os";import aE from"tty";function Et(e,t=globalThis.Deno?globalThis.Deno.args:ql.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function HF(){if("FORCE_COLOR"in we){if(we.FORCE_COLOR==="true")return 1;if(we.FORCE_COLOR==="false")return 0;return we.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(we.FORCE_COLOR,10),3)}}function BF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function WF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=HF();if(n!==void 0)ac=n;let s=r?ac:n;if(s===0)return 0;if(r){if(Et("color=16m")||Et("color=full")||Et("color=truecolor"))return 3;if(Et("color=256"))return 2}if("TF_BUILD"in we&&"AGENT_NAME"in we)return 1;if(e&&!t&&s===void 0)return 0;let o=s||0;if(we.TERM==="dumb")return o;if(ql.platform==="win32"){let a=KF.release().split(".");if(Number(a[0])>=10&&Number(a[2])>=10586)return Number(a[2])>=14931?3:2;return 1}if("CI"in we){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((a)=>(a in we)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((a)=>(a in we))||we.CI_NAME==="codeship")return 1;return o}if("TEAMCITY_VERSION"in we)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(we.TEAMCITY_VERSION)?1:0;if(we.COLORTERM==="truecolor")return 3;if(we.TERM==="xterm-kitty")return 3;if(we.TERM==="xterm-ghostty")return 3;if(we.TERM==="wezterm")return 3;if("TERM_PROGRAM"in we){let a=Number.parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(we.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(we.TERM))return 1;if("COLORTERM"in we)return 1;return o}function iE(e,t={}){let r=WF(e,{streamIsTTY:e&&e.isTTY,...t});return BF(r)}var we,ac,YF,cE;var uE=L(()=>{({env:we}=ql);if(Et("no-color")||Et("no-colors")||Et("color=false")||Et("color=never"))ac=0;else if(Et("color")||Et("colors")||Et("color=true")||Et("color=always"))ac=1;YF={stdout:iE({isTTY:aE.isatty(1)}),stderr:iE({isTTY:aE.isatty(2)})},cE=YF});function lE(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,a="";do a+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return a+=e.slice(o),a}function dE(e,t,r,n){let s=0,o="";do{let a=e[n-1]==="\r";o+=e.slice(s,a?n-1:n)+t+(a?`\r
|
|
17
|
+
deps: ${r}}`};var ED={keyword:"dependencies",type:"object",schemaType:"object",error:D0.error,code(e){let[t,r]=SD(e);j0(e,t),q0(e,r)}};function SD({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function j0(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let i=t[a];if(i.length===0)continue;let c=ir.propertyInData(r,n,a,s.opts.ownProperties);if(e.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of i)ir.checkReportMissingProp(e,u)});else r.if(Es._`${c} && (${ir.checkMissingProp(e,i,o)})`),ir.reportMissingProp(e,o),r.else()}}D0.validatePropertyDeps=j0;function q0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,a=r.name("valid");for(let i in t){if(I0.alwaysValidSchema(o,t[i]))continue;r.if(ir.propertyInData(r,n,i,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:i},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a)}}D0.validateSchemaDeps=q0;D0.default=ED});var z0=g(function(V0){Object.defineProperty(V0,"__esModule",{value:!0});var vi=ee(),F0=ce(),kD={message:"property name must be valid",params:({params:e})=>vi._`{propertyName: ${e.propertyName}}`},TD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:kD,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(F0.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(a)=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if(vi.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};V0.default=TD});var nl=g(function(G0){Object.defineProperty(G0,"__esModule",{value:!0});var cn=_t(),Ne=ee(),OD=br(),un=ce(),ND={message:"must NOT have additional properties",params:({params:e})=>Ne._`{additionalProperty: ${e.additionalProperty}}`},PD={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:ND,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:a}=e;if(!o)throw Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&un.alwaysValidSchema(a,r))return;let u=cn.allSchemaProperties(n.properties),l=cn.allSchemaProperties(n.patternProperties);d(),e.ok(Ne._`${o} === ${OD.default.errors}`);function d(){t.forIn("key",s,(y)=>{if(!u.length&&!l.length)p(y);else t.if(m(y),()=>p(y))})}function m(y){let v;if(u.length>8){let A=un.schemaRefOrVal(a,n.properties,"properties");v=cn.isOwnProperty(t,A,y)}else if(u.length)v=Ne.or(...u.map((A)=>Ne._`${y} === ${A}`));else v=Ne.nil;if(l.length)v=Ne.or(v,...l.map((A)=>Ne._`${cn.usePattern(e,A)}.test(${y})`));return Ne.not(v)}function f(y){t.code(Ne._`delete ${s}[${y}]`)}function p(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!i)t.break();return}if(typeof r=="object"&&!un.alwaysValidSchema(a,r)){let v=t.name("valid");if(c.removeAdditional==="failing")h(y,v,!1),t.if(Ne.not(v),()=>{e.reset(),f(y)});else if(h(y,v),!i)t.if(Ne.not(v),()=>t.break())}}function h(y,v,A){let k={keyword:"additionalProperties",dataProp:y,dataPropType:un.Type.Str};if(A===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,v)}}};G0.default=PD});var W0=g(function(B0){Object.defineProperty(B0,"__esModule",{value:!0});var H0=po(),bi=_t(),Ss=ce(),K0=nl(),ID={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)K0.default.code(new H0.KeywordCxt(o,K0.default,"additionalProperties"));let a=bi.allSchemaProperties(r);for(let d of a)o.definedProperties.add(d);if(o.opts.unevaluated&&a.length&&o.props!==!0)o.props=Ss.mergeEvaluated.props(t,Ss.toHash(a),o.props);let i=a.filter((d)=>!Ss.alwaysValidSchema(o,r[d]));if(i.length===0)return;let c=t.name("valid");for(let d of i){if(u(d))l(d);else{if(t.if(bi.propertyInData(t,s,d,o.opts.ownProperties)),l(d),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};B0.default=ID});var X0=g(function(Y0){Object.defineProperty(Y0,"__esModule",{value:!0});var wi=_t(),ln=ee(),$i=ce(),Ei=ce(),qD={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:a}=o,i=wi.allSchemaProperties(r),c=i.filter((h)=>$i.alwaysValidSchema(o,r[h]));if(i.length===0||c.length===i.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,l=t.name("valid");if(o.props!==!0&&!(o.props instanceof ln.Name))o.props=Ei.evaluatedPropsToName(t,o.props);let{props:d}=o;m();function m(){for(let h of i){if(u)f(h);if(o.allErrors)p(h);else t.var(l,!0),p(h),t.if(l)}}function f(h){for(let y in u)if(new RegExp(h).test(y))$i.checkStrictMode(o,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function p(h){t.forIn("key",n,(y)=>{t.if(ln._`${wi.usePattern(e,h)}.test(${y})`,()=>{let v=c.includes(h);if(!v)e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:Ei.Type.Str},l);if(o.opts.unevaluated&&d!==!0)t.assign(ln._`${d}[${y}]`,!0);else if(!v&&!o.allErrors)t.if(ln.not(l),()=>t.break())})})}}};Y0.default=qD});var Z0=g(function(Q0){Object.defineProperty(Q0,"__esModule",{value:!0});var J0=ce(),MD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(J0.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Q0.default=MD});var rb=g(function(tb){Object.defineProperty(tb,"__esModule",{value:!0});var eb=_t(),UD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:eb.validateUnion,error:{message:"must match a schema in anyOf"}};tb.default=UD});var ob=g(function(sb){Object.defineProperty(sb,"__esModule",{value:!0});var dn=ee(),nb=ce(),VD={message:"must match exactly one schema in oneOf",params:({params:e})=>dn._`{passingSchemas: ${e.passing}}`},zD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:VD,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,a=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let m;if(nb.alwaysValidSchema(s,l))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(dn._`${c} && ${a}`).assign(a,!1).assign(i,dn._`[${i}, ${d}]`).else();t.if(c,()=>{if(t.assign(a,!0),t.assign(i,d),m)e.mergeEvaluated(m,dn.Name)})})}}};sb.default=zD});var cb=g(function(ib){Object.defineProperty(ib,"__esModule",{value:!0});var ab=ce(),KD={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,a)=>{if(ab.alwaysValidSchema(n,o))return;let i=e.subschema({keyword:"allOf",schemaProp:a},s);e.ok(s),e.mergeEvaluated(i)})}};ib.default=KD});var db=g(function(lb){Object.defineProperty(lb,"__esModule",{value:!0});var fn=ee(),Si=ce(),BD={message:({params:e})=>fn.str`must match "${e.ifClause}" schema`,params:({params:e})=>fn._`{failingKeyword: ${e.ifClause}}`},WD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:BD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Si.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=ub(n,"then"),o=ub(n,"else");if(!s&&!o)return;let a=t.let("valid",!0),i=t.name("_valid");if(c(),e.reset(),s&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(i,u("then",l),u("else",l))}else if(s)t.if(i,u("then"));else t.if(fn.not(i),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(l)}function u(l,d){return()=>{let m=e.subschema({keyword:l},i);if(t.assign(a,i),e.mergeValidEvaluated(m,a),d)t.assign(d,fn._`${l}`);else e.setParams({ifClause:l})}}}};function ub(e,t){let r=e.schema[t];return r!==void 0&&!Si.alwaysValidSchema(e,r)}lb.default=WD});var mb=g(function(pb){Object.defineProperty(pb,"__esModule",{value:!0});var fb=ce(),XD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)fb.checkStrictMode(r,`"${e}" without "if" is ignored`)}};pb.default=XD});var gb=g(function(hb){Object.defineProperty(hb,"__esModule",{value:!0});var QD=tl(),ZD=R0(),eM=rl(),tM=N0(),rM=C0(),nM=U0(),sM=z0(),oM=nl(),aM=W0(),iM=X0(),cM=Z0(),uM=rb(),lM=ob(),dM=cb(),fM=db(),pM=mb();function mM(e=!1){let t=[cM.default,uM.default,lM.default,dM.default,fM.default,pM.default,sM.default,oM.default,nM.default,aM.default,iM.default];if(e)t.push(ZD.default,tM.default);else t.push(QD.default,eM.default);return t.push(rM.default),t}hb.default=mM});var _b=g(function(yb){Object.defineProperty(yb,"__esModule",{value:!0});var J=ee(),gM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},yM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:gM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:i}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;if(s)m();else f();function m(){let p=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",J._`${p}[${a}]`),y=r.let("fType"),v=r.let("format");r.if(J._`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,J._`${h}.type || "string"`).assign(v,J._`${h}.validate`),()=>r.assign(y,J._`"string"`).assign(v,h)),e.fail$data(J.or(A(),k()));function A(){if(c.strictSchema===!1)return J.nil;return J._`${a} && !${v}`}function k(){let M=l.$async?J._`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:J._`${v}(${n})`,S=J._`(typeof ${v} == "function" ? ${M} : ${v}.test(${n}))`;return J._`${v} && ${v} !== true && ${y} === ${t} && !${S}`}}function f(){let p=d.formats[o];if(!p){A();return}if(p===!0)return;let[h,y,v]=k(p);if(h===t)e.pass(M());function A(){if(c.strictSchema===!1){d.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let $e=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,je=r.scopeValue("formats",{key:o,ref:S,code:$e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${je}.validate`];return["string",S,je]}function M(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!l.$async)throw Error("async format in sync schema");return J._`await ${v}(${n})`}return typeof y=="function"?J._`${v}(${n})`:J._`${v}.test(${n})`}}}};yb.default=yM});var bb=g(function(vb){Object.defineProperty(vb,"__esModule",{value:!0});var vM=_b(),bM=[vM.default];vb.default=bM});var Eb=g(function(wb){Object.defineProperty(wb,"__esModule",{value:!0});wb.contentVocabulary=wb.metadataVocabulary=void 0;wb.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];wb.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var xb=g(function(Sb){Object.defineProperty(Sb,"__esModule",{value:!0});var EM=Dv(),SM=g0(),xM=gb(),RM=bb(),xi=Eb(),kM=[EM.default,SM.default,(0,xM.default)(),RM.default,xi.metadataVocabulary,xi.contentVocabulary];Sb.default=kM});var Ab=g(function(kb){Object.defineProperty(kb,"__esModule",{value:!0});kb.DiscrError=void 0;var Rb;(function(e){e.Tag="tag",e.Mapping="mapping"})(Rb||(kb.DiscrError=Rb={}))});var Pb=g(function(Nb){Object.defineProperty(Nb,"__esModule",{value:!0});var vt=ee(),xs=Ab(),Ri=li(),AM=mo(),Ob=ce(),OM={message:({params:{discrError:e,tagName:t}})=>e===xs.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>vt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},NM={keyword:"discriminator",type:"object",schemaType:"object",error:OM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:a}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!a)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",vt._`${r}${vt.getProperty(i)}`);t.if(vt._`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:xs.DiscrError.Tag,tag:u,tagName:i})),e.ok(c);function l(){let f=m();t.if(!1);for(let p in f)t.elseIf(vt._`${u} === ${p}`),t.assign(c,d(f[p]));t.else(),e.error(!1,{discrError:xs.DiscrError.Mapping,tag:u,tagName:i}),t.endIf()}function d(f){let p=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:f},p);return e.mergeEvaluated(h,vt.Name),p}function m(){var f;let p={},h=v(s),y=!0;for(let M=0;M<a.length;M++){let S=a[M];if((S===null||S===void 0?void 0:S.$ref)&&!Ob.schemaHasRulesButRef(S,o.self.RULES)){let je=S.$ref;if(S=Ri.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,je),S instanceof Ri.SchemaEnv)S=S.schema;if(S===void 0)throw new AM.default(o.opts.uriResolver,o.baseId,je)}let $e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[i];if(typeof $e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);y=y&&(h||v(S)),A($e,M)}if(!y)throw Error(`discriminator: "${i}" must be required`);return p;function v({required:M}){return Array.isArray(M)&&M.includes(i)}function A(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let $e of M.enum)k($e,S);else throw Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in p)throw Error(`discriminator: "${i}" values must be unique strings`);p[M]=S}}}};Nb.default=NM});var Cb=g(function(xH,CM){CM.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var jb=g(function(lt,sl){Object.defineProperty(lt,"__esModule",{value:!0});lt.MissingRefError=lt.ValidationError=lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=lt.Ajv=void 0;var IM=Av(),jM=xb(),qM=Pb(),Ib=Cb(),DM=["/properties"],ki="http://json-schema.org/draft-07/schema";class go extends IM.default{_addVocabularies(){if(super._addVocabularies(),jM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(qM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ib,DM):Ib;this.addMetaSchema(e,ki,!1),this.refs["http://json-schema.org/schema"]=ki}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ki)?ki:void 0)}}lt.Ajv=go;sl.exports=lt=go;sl.exports.Ajv=go;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=go;var MM=po();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return MM.KeywordCxt}});var Rs=ee();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return Rs._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return Rs.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return Rs.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return Rs.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return Rs.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return Rs.CodeGen}});var LM=ii();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return LM.default}});var UM=mo();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return UM.default}})});var Mb=g(function(Db){Object.defineProperty(Db,"__esModule",{value:!0});Db.formatLimitDefinition=void 0;var qb=jb(),Pe=ee(),pn=Pe.operators,Ti={formatMaximum:{okStr:"<=",ok:pn.LTE,fail:pn.GT},formatMinimum:{okStr:">=",ok:pn.GTE,fail:pn.LT},formatExclusiveMaximum:{okStr:"<",ok:pn.LT,fail:pn.GTE},formatExclusiveMinimum:{okStr:">",ok:pn.GT,fail:pn.LTE}},zM={message:({keyword:e,schemaCode:t})=>Pe.str`should be ${Ti[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pe._`{comparison: ${Ti[e].okStr}, limit: ${t}}`};Db.formatLimitDefinition={keyword:Object.keys(Ti),type:"string",schemaType:"string",$data:!0,error:zM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:a,self:i}=o;if(!a.validateFormats)return;let c=new qb.KeywordCxt(o,i.RULES.all.format.definition,"format");if(c.$data)u();else l();function u(){let m=t.scopeValue("formats",{ref:i.formats,code:a.code.formats}),f=t.const("fmt",Pe._`${m}[${c.schemaCode}]`);e.fail$data(Pe.or(Pe._`typeof ${f} != "object"`,Pe._`${f} instanceof RegExp`,Pe._`typeof ${f}.compare != "function"`,d(f)))}function l(){let m=c.schema,f=i.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${m}" does not define "compare" function`);let p=t.scopeValue("formats",{key:m,ref:f,code:a.code.formats?Pe._`${a.code.formats}${Pe.getProperty(m)}`:void 0});e.fail$data(d(p))}function d(m){return Pe._`${m}.compare(${r}, ${n}) ${Ti[s].fail} 0`}},dependencies:["format"]};var GM=(e)=>(e.addKeyword(Db.formatLimitDefinition),e);Db.default=GM});var Vb=g(function(yo,Fb){Object.defineProperty(yo,"__esModule",{value:!0});var bt=gy(),HM=Mb(),ks=ee(),Lb=new ks.Name("fullFormats"),BM=new ks.Name("fastFormats"),al=(e,t={keywords:!0})=>{if(Array.isArray(t))return Ub(e,t,bt.fullFormats,Lb),e;let[r,n]=t.mode==="fast"?[bt.fastFormats,BM]:[bt.fullFormats,Lb],s=t.formats||bt.formatNames;if(Ub(e,s,r,n),t.keywords)(0,HM.default)(e);return e};al.get=(e,t="full")=>{let n=(t==="fast"?bt.fastFormats:bt.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function Ub(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=ks._`require("ajv-formats/dist/formats").${n}`);for(let a of t)e.addFormat(a,r[a])}Fb.exports=yo=al;Object.defineProperty(yo,"__esModule",{value:!0});yo.default=al});function il(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))WM(e,t,s,r);return XM(e,t),eL(e,t,n),e}var WM=(e,t,r,n)=>{if(r==="length"||r==="prototype")return;if(r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);if(!YM(s,o)&&n)return;Object.defineProperty(e,r,o)},YM=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},XM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},JM=(e,t)=>`/* Wrapped ${e}*/
|
|
18
|
+
${t}`,QM,ZM,eL=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=JM.bind(null,n,t.toString());Object.defineProperty(s,"name",ZM);let{writable:o,enumerable:a,configurable:i}=QM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:a,configurable:i})};var zb=L(()=>{QM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ZM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var tL=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:o=!0}=t;if(r<0||n<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!s&&!o)throw Error("Both `before` and `after` are false, function wouldn't be called.");let a,i,c,u=function(...l){let d=this,m=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(d,l)},f=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(d,l)},p=s&&!a;if(clearTimeout(a),a=setTimeout(m,r),n>0&&n!==Number.POSITIVE_INFINITY&&!i)i=setTimeout(f,n);if(p)c=e.apply(d,l);return c};return il(u,e),u.cancel=()=>{if(a)clearTimeout(a),a=void 0;if(i)clearTimeout(i),i=void 0},u},cl;var Gb=L(()=>{zb();cl=tL});var _o=g(function(MH,Kb){var rL=Number.MAX_SAFE_INTEGER||9007199254740991,nL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Kb.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:rL,RELEASE_TYPES:nL,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vo=g(function(LH,Hb){var sL=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Hb.exports=sL});var Ts=g(function(cr,Bb){var{MAX_SAFE_COMPONENT_LENGTH:ul,MAX_SAFE_BUILD_LENGTH:oL,MAX_LENGTH:aL}=_o(),iL=vo();cr=Bb.exports={};var cL=cr.re=[],uL=cr.safeRe=[],j=cr.src=[],lL=cr.safeSrc=[],q=cr.t={},dL=0,ll="[a-zA-Z0-9-]",fL=[["\\s",1],["\\d",aL],[ll,oL]],pL=(e)=>{for(let[t,r]of fL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=pL(t),s=dL++;iL(e,s,t),q[e]=s,j[s]=t,lL[s]=n,cL[s]=new RegExp(t,r?"g":void 0),uL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ll}*`);W("MAINVERSION",`(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})`);W("MAINVERSIONLOOSE",`(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASEIDENTIFIER",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIER]})`);W("PRERELEASEIDENTIFIERLOOSE",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASE",`(?:-(${j[q.PRERELEASEIDENTIFIER]}(?:\\.${j[q.PRERELEASEIDENTIFIER]})*))`);W("PRERELEASELOOSE",`(?:-?(${j[q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[q.PRERELEASEIDENTIFIERLOOSE]})*))`);W("BUILDIDENTIFIER",`${ll}+`);W("BUILD",`(?:\\+(${j[q.BUILDIDENTIFIER]}(?:\\.${j[q.BUILDIDENTIFIER]})*))`);W("FULLPLAIN",`v?${j[q.MAINVERSION]}${j[q.PRERELEASE]}?${j[q.BUILD]}?`);W("FULL",`^${j[q.FULLPLAIN]}$`);W("LOOSEPLAIN",`[v=\\s]*${j[q.MAINVERSIONLOOSE]}${j[q.PRERELEASELOOSE]}?${j[q.BUILD]}?`);W("LOOSE",`^${j[q.LOOSEPLAIN]}$`);W("GTLT","((?:<|>)?=?)");W("XRANGEIDENTIFIERLOOSE",`${j[q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);W("XRANGEIDENTIFIER",`${j[q.NUMERICIDENTIFIER]}|x|X|\\*`);W("XRANGEPLAIN",`[v=\\s]*(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:${j[q.PRERELEASE]})?${j[q.BUILD]}?)?)?`);W("XRANGEPLAINLOOSE",`[v=\\s]*(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:${j[q.PRERELEASELOOSE]})?${j[q.BUILD]}?)?)?`);W("XRANGE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAIN]}$`);W("XRANGELOOSE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAINLOOSE]}$`);W("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ul}})(?:\\.(\\d{1,${ul}}))?(?:\\.(\\d{1,${ul}}))?`);W("COERCE",`${j[q.COERCEPLAIN]}(?:$|[^\\d])`);W("COERCEFULL",j[q.COERCEPLAIN]+`(?:${j[q.PRERELEASE]})?(?:${j[q.BUILD]})?(?:$|[^\\d])`);W("COERCERTL",j[q.COERCE],!0);W("COERCERTLFULL",j[q.COERCEFULL],!0);W("LONETILDE","(?:~>?)");W("TILDETRIM",`(\\s*)${j[q.LONETILDE]}\\s+`,!0);cr.tildeTrimReplace="$1~";W("TILDE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAIN]}$`);W("TILDELOOSE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAINLOOSE]}$`);W("LONECARET","(?:\\^)");W("CARETTRIM",`(\\s*)${j[q.LONECARET]}\\s+`,!0);cr.caretTrimReplace="$1^";W("CARET",`^${j[q.LONECARET]}${j[q.XRANGEPLAIN]}$`);W("CARETLOOSE",`^${j[q.LONECARET]}${j[q.XRANGEPLAINLOOSE]}$`);W("COMPARATORLOOSE",`^${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]})$|^$`);W("COMPARATOR",`^${j[q.GTLT]}\\s*(${j[q.FULLPLAIN]})$|^$`);W("COMPARATORTRIM",`(\\s*)${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]}|${j[q.XRANGEPLAIN]})`,!0);cr.comparatorTrimReplace="$1$2$3";W("HYPHENRANGE",`^\\s*(${j[q.XRANGEPLAIN]})\\s+-\\s+(${j[q.XRANGEPLAIN]})\\s*$`);W("HYPHENRANGELOOSE",`^\\s*(${j[q.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[q.XRANGEPLAINLOOSE]})\\s*$`);W("STAR","(<|>)?=?\\s*\\*");W("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");W("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ai=g(function(UH,Wb){var mL=Object.freeze({loose:!0}),hL=Object.freeze({}),gL=(e)=>{if(!e)return hL;if(typeof e!=="object")return mL;return e};Wb.exports=gL});var dl=g(function(FH,Jb){var Yb=/^[0-9]+$/,Xb=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Yb.test(e),n=Yb.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},yL=(e,t)=>Xb(t,e);Jb.exports={compareIdentifiers:Xb,rcompareIdentifiers:yL}});var He=g(function(VH,Zb){var Oi=vo(),{MAX_LENGTH:Qb,MAX_SAFE_INTEGER:Ni}=_o(),{safeRe:Pi,t:Ci}=Ts(),_L=Ai(),{compareIdentifiers:fl}=dl();class At{constructor(e,t){if(t=_L(t),e instanceof At)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Qb)throw TypeError(`version is longer than ${Qb} characters`);Oi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Pi[Ci.LOOSE]:Pi[Ci.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ni||this.major<0)throw TypeError("Invalid major version");if(this.minor>Ni||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Ni||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<Ni)return s}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Oi("SemVer.compare",this.version,this.options,e),!(e instanceof At)){if(typeof e==="string"&&e===this.version)return 0;e=new At(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof At))e=new At(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof At))e=new At(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Oi("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return fl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof At))e=new At(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Oi("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return fl(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Pi[Ci.PRERELEASELOOSE]:Pi[Ci.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];if(r===!1)s=[t];if(fl(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1]))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Zb.exports=At});var Pn=g(function(zH,tw){var ew=He(),vL=(e,t,r=!1)=>{if(e instanceof ew)return e;try{return new ew(e,t)}catch(n){if(!r)return null;throw n}};tw.exports=vL});var nw=g(function(GH,rw){var bL=Pn(),wL=(e,t)=>{let r=bL(e,t);return r?r.version:null};rw.exports=wL});var ow=g(function(KH,sw){var $L=Pn(),EL=(e,t)=>{let r=$L(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};sw.exports=EL});var cw=g(function(HH,iw){var aw=He(),SL=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new aw(e instanceof aw?e.version:e,r).inc(t,n,s).version}catch(o){return null}};iw.exports=SL});var dw=g(function(BH,lw){var uw=Pn(),xL=(e,t)=>{let r=uw(e,null,!0),n=uw(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,a=o?r:n,i=o?n:r,c=!!a.prerelease.length;if(!!i.prerelease.length&&!c){if(!i.patch&&!i.minor)return"major";if(i.compareMain(a)===0){if(i.minor&&!i.patch)return"minor";return"patch"}}let l=c?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};lw.exports=xL});var pw=g(function(WH,fw){var RL=He(),kL=(e,t)=>new RL(e,t).major;fw.exports=kL});var hw=g(function(YH,mw){var TL=He(),AL=(e,t)=>new TL(e,t).minor;mw.exports=AL});var yw=g(function(XH,gw){var OL=He(),NL=(e,t)=>new OL(e,t).patch;gw.exports=NL});var vw=g(function(JH,_w){var PL=Pn(),CL=(e,t)=>{let r=PL(e,t);return r&&r.prerelease.length?r.prerelease:null};_w.exports=CL});var wt=g(function(QH,ww){var bw=He(),IL=(e,t,r)=>new bw(e,r).compare(new bw(t,r));ww.exports=IL});var Ew=g(function(ZH,$w){var jL=wt(),qL=(e,t,r)=>jL(t,e,r);$w.exports=qL});var xw=g(function(e5,Sw){var DL=wt(),ML=(e,t)=>DL(e,t,!0);Sw.exports=ML});var Ii=g(function(t5,kw){var Rw=He(),LL=(e,t,r)=>{let n=new Rw(e,r),s=new Rw(t,r);return n.compare(s)||n.compareBuild(s)};kw.exports=LL});var Aw=g(function(r5,Tw){var UL=Ii(),FL=(e,t)=>e.sort((r,n)=>UL(r,n,t));Tw.exports=FL});var Nw=g(function(n5,Ow){var VL=Ii(),zL=(e,t)=>e.sort((r,n)=>VL(n,r,t));Ow.exports=zL});var bo=g(function(s5,Pw){var GL=wt(),KL=(e,t,r)=>GL(e,t,r)>0;Pw.exports=KL});var ji=g(function(o5,Cw){var HL=wt(),BL=(e,t,r)=>HL(e,t,r)<0;Cw.exports=BL});var pl=g(function(a5,Iw){var WL=wt(),YL=(e,t,r)=>WL(e,t,r)===0;Iw.exports=YL});var ml=g(function(i5,jw){var XL=wt(),JL=(e,t,r)=>XL(e,t,r)!==0;jw.exports=JL});var qi=g(function(c5,qw){var QL=wt(),ZL=(e,t,r)=>QL(e,t,r)>=0;qw.exports=ZL});var Di=g(function(u5,Dw){var eU=wt(),tU=(e,t,r)=>eU(e,t,r)<=0;Dw.exports=tU});var hl=g(function(l5,Mw){var rU=pl(),nU=ml(),sU=bo(),oU=qi(),aU=ji(),iU=Di(),cU=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return rU(e,r,n);case"!=":return nU(e,r,n);case">":return sU(e,r,n);case">=":return oU(e,r,n);case"<":return aU(e,r,n);case"<=":return iU(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Mw.exports=cU});var Uw=g(function(d5,Lw){var uU=He(),lU=Pn(),{safeRe:Mi,t:Li}=Ts(),dU=(e,t)=>{if(e instanceof uU)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Mi[Li.COERCEFULL]:Mi[Li.COERCE]);else{let c=t.includePrerelease?Mi[Li.COERCERTLFULL]:Mi[Li.COERCERTL],u;while((u=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||u.index+u[0].length!==r.index+r[0].length)r=u;c.lastIndex=u.index+u[1].length+u[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",i=t.includePrerelease&&r[6]?`+${r[6]}`:"";return lU(`${n}.${s}.${o}${a}${i}`,t)};Lw.exports=dU});var zw=g(function(f5,Vw){class Fw{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}Vw.exports=Fw});var $t=g(function(p5,Bw){var fU=/\s+/g;class wo{constructor(e,t){if(t=mU(t),e instanceof wo)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new wo(e.raw,t);if(e instanceof Ui)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(fU," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Kw(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&wU(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&vU)|(this.options.loose&&bU))+":"+e,n=Gw.get(r);if(n)return n;let s=this.options.loose,o=s?Qe[Be.HYPHENRANGELOOSE]:Qe[Be.HYPHENRANGE];e=e.replace(o,NU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Qe[Be.COMPARATORTRIM],gU),ye("comparator trim",e),e=e.replace(Qe[Be.TILDETRIM],yU),ye("tilde trim",e),e=e.replace(Qe[Be.CARETTRIM],_U),ye("caret trim",e);let a=e.split(" ").map((l)=>$U(l,this.options)).join(" ").split(/\s+/).map((l)=>OU(l,this.options));if(s)a=a.filter((l)=>(ye("loose invalid filter",l,this.options),!!l.match(Qe[Be.COMPARATORLOOSE])));ye("range list",a);let i=new Map,c=a.map((l)=>new Ui(l,this.options));for(let l of c){if(Kw(l))return[l];i.set(l.value,l)}if(i.size>1&&i.has(""))i.delete("");let u=[...i.values()];return Gw.set(r,u),u}intersects(e,t){if(!(e instanceof wo))throw TypeError("a Range is required");return this.set.some((r)=>Hw(r,t)&&e.set.some((n)=>Hw(n,t)&&r.every((s)=>n.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new hU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(PU(this.set[t],e,this.options))return!0;return!1}}Bw.exports=wo;var pU=zw(),Gw=new pU,mU=Ai(),Ui=$o(),ye=vo(),hU=He(),{safeRe:Qe,t:Be,comparatorTrimReplace:gU,tildeTrimReplace:yU,caretTrimReplace:_U}=Ts(),{FLAG_INCLUDE_PRERELEASE:vU,FLAG_LOOSE:bU}=_o(),Kw=(e)=>e.value==="<0.0.0-0",wU=(e)=>e.value==="",Hw=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();while(r&&n.length)r=n.every((o)=>s.intersects(o,t)),s=n.pop();return r},$U=(e,t)=>(e=e.replace(Qe[Be.BUILD],""),ye("comp",e,t),e=xU(e,t),ye("caret",e),e=EU(e,t),ye("tildes",e),e=kU(e,t),ye("xrange",e),e=AU(e,t),ye("stars",e),e),Ze=(e)=>!e||e.toLowerCase()==="x"||e==="*",EU=(e,t)=>e.trim().split(/\s+/).map((r)=>SU(r,t)).join(" "),SU=(e,t)=>{let r=t.loose?Qe[Be.TILDELOOSE]:Qe[Be.TILDE];return e.replace(r,(n,s,o,a,i)=>{ye("tilde",e,n,s,o,a,i);let c;if(Ze(s))c="";else if(Ze(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Ze(a))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(i)ye("replaceTilde pr",i),c=`>=${s}.${o}.${a}-${i} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},xU=(e,t)=>e.trim().split(/\s+/).map((r)=>RU(r,t)).join(" "),RU=(e,t)=>{ye("caret",e,t);let r=t.loose?Qe[Be.CARETLOOSE]:Qe[Be.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,a,i,c)=>{ye("caret",e,s,o,a,i,c);let u;if(Ze(o))u="";else if(Ze(a))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Ze(i))if(o==="0")u=`>=${o}.${a}.0${n} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(a==="0")u=`>=${o}.${a}.${i}-${c} <${o}.${a}.${+i+1}-0`;else u=`>=${o}.${a}.${i}-${c} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.${i}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(a==="0")u=`>=${o}.${a}.${i}${n} <${o}.${a}.${+i+1}-0`;else u=`>=${o}.${a}.${i}${n} <${o}.${+a+1}.0-0`;else u=`>=${o}.${a}.${i} <${+o+1}.0.0-0`;return ye("caret return",u),u})},kU=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>TU(r,t)).join(" ")),TU=(e,t)=>{e=e.trim();let r=t.loose?Qe[Be.XRANGELOOSE]:Qe[Be.XRANGE];return e.replace(r,(n,s,o,a,i,c)=>{ye("xRange",e,n,s,o,a,i,c);let u=Ze(o),l=u||Ze(a),d=l||Ze(i),m=d;if(s==="="&&m)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&m){if(l)a=0;if(i=0,s===">")if(s=">=",l)o=+o+1,a=0,i=0;else a=+a+1,i=0;else if(s==="<=")if(s="<",l)o=+o+1;else a=+a+1;if(s==="<")c="-0";n=`${s+o}.${a}.${i}${c}`}else if(l)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(d)n=`>=${o}.${a}.0${c} <${o}.${+a+1}.0-0`;return ye("xRange return",n),n})},AU=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Qe[Be.STAR],"")),OU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Qe[t.includePrerelease?Be.GTE0PRE:Be.GTE0],"")),NU=(e)=>(t,r,n,s,o,a,i,c,u,l,d,m)=>{if(Ze(n))r="";else if(Ze(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Ze(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(a)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Ze(u))c="";else if(Ze(l))c=`<${+u+1}.0.0-0`;else if(Ze(d))c=`<${u}.${+l+1}.0-0`;else if(m)c=`<=${u}.${l}.${d}-${m}`;else if(e)c=`<${u}.${l}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},PU=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(ye(e[n].semver),e[n].semver===Ui.ANY)continue;if(e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var $o=g(function(m5,Zw){var Eo=Symbol("SemVer ANY");class Fi{static get ANY(){return Eo}constructor(e,t){if(t=Ww(t),e instanceof Fi)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),yl("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Eo)this.value="";else this.value=this.operator+this.semver.version;yl("comp",this)}parse(e){let t=this.options.loose?Yw[Xw.COMPARATORLOOSE]:Yw[Xw.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Eo;else this.semver=new Jw(r[2],this.options.loose)}toString(){return this.value}test(e){if(yl("Comparator.test",e,this.options.loose),this.semver===Eo||e===Eo)return!0;if(typeof e==="string")try{e=new Jw(e,this.options)}catch(t){return!1}return gl(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Fi))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Qw(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Qw(this.value,t).test(e.semver)}if(t=Ww(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(gl(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(gl(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Zw.exports=Fi;var Ww=Ai(),{safeRe:Yw,t:Xw}=Ts(),gl=hl(),yl=vo(),Jw=He(),Qw=$t()});var So=g(function(h5,e$){var CU=$t(),IU=(e,t,r)=>{try{t=new CU(t,r)}catch(n){return!1}return t.test(e)};e$.exports=IU});var r$=g(function(g5,t$){var jU=$t(),qU=(e,t)=>new jU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));t$.exports=qU});var s$=g(function(y5,n$){var DU=He(),MU=$t(),LU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new MU(t,r)}catch(a){return null}return e.forEach((a)=>{if(o.test(a)){if(!n||s.compare(a)===-1)n=a,s=new DU(n,r)}}),n};n$.exports=LU});var a$=g(function(_5,o$){var UU=He(),FU=$t(),VU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new FU(t,r)}catch(a){return null}return e.forEach((a)=>{if(o.test(a)){if(!n||s.compare(a)===1)n=a,s=new UU(n,r)}}),n};o$.exports=VU});var u$=g(function(v5,c$){var _l=He(),zU=$t(),i$=bo(),GU=(e,t)=>{e=new zU(e,t);let r=new _l("0.0.0");if(e.test(r))return r;if(r=new _l("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],o=null;if(s.forEach((a)=>{let i=new _l(a.semver.version);switch(a.operator){case">":if(i.prerelease.length===0)i.patch++;else i.prerelease.push(0);i.raw=i.format();case"":case">=":if(!o||i$(i,o))o=i;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${a.operator}`)}}),o&&(!r||i$(r,o)))r=o}if(r&&e.test(r))return r;return null};c$.exports=GU});var d$=g(function(b5,l$){var KU=$t(),HU=(e,t)=>{try{return new KU(e,t).range||"*"}catch(r){return null}};l$.exports=HU});var Vi=g(function(w5,h$){var BU=He(),m$=$o(),{ANY:WU}=m$,YU=$t(),XU=So(),f$=bo(),p$=ji(),JU=Di(),QU=qi(),ZU=(e,t,r,n)=>{e=new BU(e,n),t=new YU(t,n);let s,o,a,i,c;switch(r){case">":s=f$,o=JU,a=p$,i=">",c=">=";break;case"<":s=p$,o=QU,a=f$,i="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(XU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],d=null,m=null;if(l.forEach((f)=>{if(f.semver===WU)f=new m$(">=0.0.0");if(d=d||f,m=m||f,s(f.semver,d.semver,n))d=f;else if(a(f.semver,m.semver,n))m=f}),d.operator===i||d.operator===c)return!1;if((!m.operator||m.operator===i)&&o(e,m.semver))return!1;else if(m.operator===c&&a(e,m.semver))return!1}return!0};h$.exports=ZU});var y$=g(function($5,g$){var e2=Vi(),t2=(e,t,r)=>e2(e,t,">",r);g$.exports=t2});var v$=g(function(E5,_$){var r2=Vi(),n2=(e,t,r)=>r2(e,t,"<",r);_$.exports=n2});var $$=g(function(S5,w$){var b$=$t(),s2=(e,t,r)=>(e=new b$(e,r),t=new b$(t,r),e.intersects(t,r));w$.exports=s2});var S$=g(function(x5,E$){var o2=So(),a2=wt();E$.exports=(e,t,r)=>{let n=[],s=null,o=null,a=e.sort((l,d)=>a2(l,d,r));for(let l of a)if(o2(l,t,r)){if(o=l,!s)s=l}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let i=[];for(let[l,d]of n)if(l===d)i.push(l);else if(!d&&l===a[0])i.push("*");else if(!d)i.push(`>=${l}`);else if(l===a[0])i.push(`<=${d}`);else i.push(`${l} - ${d}`);let c=i.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var O$=g(function(R5,A$){var x$=$t(),bl=$o(),{ANY:vl}=bl,xo=So(),wl=wt(),i2=(e,t,r={})=>{if(e===t)return!0;e=new x$(e,r),t=new x$(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let a=u2(s,o,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},c2=[new bl(">=0.0.0-0")],R$=[new bl(">=0.0.0")],u2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vl)if(t.length===1&&t[0].semver===vl)return!0;else if(r.includePrerelease)e=c2;else e=R$;if(t.length===1&&t[0].semver===vl)if(r.includePrerelease)return!0;else t=R$;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=k$(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=T$(o,f,r);else n.add(f.semver);if(n.size>1)return null;let a;if(s&&o){if(a=wl(s.semver,o.semver,r),a>0)return null;else if(a===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!xo(f,String(s),r))return null;if(o&&!xo(f,String(o),r))return null;for(let p of t)if(!xo(f,String(p),r))return!1;return!0}let i,c,u,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0)d=!1;for(let f of t){if(l=l||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(m){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===m.major&&f.semver.minor===m.minor&&f.semver.patch===m.patch)m=!1}if(f.operator===">"||f.operator===">="){if(i=k$(s,f,r),i===f&&i!==s)return!1}else if(s.operator===">="&&!xo(s.semver,String(f),r))return!1}if(o){if(d){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch)d=!1}if(f.operator==="<"||f.operator==="<="){if(c=T$(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!xo(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&a!==0)return!1}if(s&&u&&!o&&a!==0)return!1;if(o&&l&&!s&&a!==0)return!1;if(m||d)return!1;return!0},k$=(e,t,r)=>{if(!e)return t;let n=wl(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},T$=(e,t,r)=>{if(!e)return t;let n=wl(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};A$.exports=i2});var P$=g(function(k5,N$){var As=Ts(),zi=_o(),l2=He(),Gi=dl(),d2=Pn(),f2=nw(),p2=ow(),m2=cw(),h2=dw(),g2=pw(),y2=hw(),_2=yw(),v2=vw(),b2=wt(),w2=Ew(),$2=xw(),E2=Ii(),S2=Aw(),x2=Nw(),R2=bo(),k2=ji(),T2=pl(),A2=ml(),O2=qi(),N2=Di(),P2=hl(),C2=Uw(),I2=$o(),j2=$t(),q2=So(),D2=r$(),M2=s$(),L2=a$(),U2=u$(),F2=d$(),V2=Vi(),z2=y$(),G2=v$(),K2=$$(),H2=S$(),B2=O$();N$.exports={parse:d2,valid:f2,clean:p2,inc:m2,diff:h2,major:g2,minor:y2,patch:_2,prerelease:v2,compare:b2,rcompare:w2,compareLoose:$2,compareBuild:E2,sort:S2,rsort:x2,gt:R2,lt:k2,eq:T2,neq:A2,gte:O2,lte:N2,cmp:P2,coerce:C2,Comparator:I2,Range:j2,satisfies:q2,toComparators:D2,maxSatisfying:M2,minSatisfying:L2,minVersion:U2,validRange:F2,outside:V2,gtr:z2,ltr:G2,intersects:K2,simplifyRange:H2,subset:B2,SemVer:l2,re:As.re,src:As.src,tokens:As.t,SEMVER_SPEC_VERSION:zi.SEMVER_SPEC_VERSION,RELEASE_TYPES:zi.RELEASE_TYPES,compareIdentifiers:Gi.compareIdentifiers,rcompareIdentifiers:Gi.rcompareIdentifiers}});function I$(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return W2.call(e)===r}function j$(e){return I$(e,Uint8Array,"[object Uint8Array]")}function Y2(e){return I$(e,ArrayBuffer,"[object ArrayBuffer]")}function X2(e){return j$(e)||Y2(e)}function J2(e){if(!j$(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function Q2(e){if(!X2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function $l(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((s,o)=>s+o.length,0);let r=new Uint8Array(t),n=0;for(let s of e)J2(s),r.set(s,n),n+=s.length;return r}function El(e,t="utf8"){return Q2(e),C$[t]??=new globalThis.TextDecoder(t),C$[t].decode(e)}function Z2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function Ki(e){return Z2(e),eF.encode(e)}var W2,C$,eF,T5;var q$=L(()=>{W2=Object.prototype.toString;C$={utf8:new globalThis.TextDecoder("utf8")};eF=new globalThis.TextEncoder;T5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as tF}from"util";import D$ from"process";import Cn from"fs";import M$ from"path";import Ro from"crypto";import rF from"assert";var U$,F$,In,nF,L$="aes-256-cbc",Os=()=>Object.create(null),sF=(e)=>e!==void 0&&e!==null,oF=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},Hi="__internal__",Sl,Bi;var V$=L(()=>{dd();pd();zd();Gb();q$();U$=vc(ay(),1),F$=vc(Vb(),1),In=vc(P$(),1),nF=F$.default.default,Sl=`${Hi}.migrations.version`;Bi=class Bi{path;events;#n;#t;#e;#r={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=xc(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let o=new U$.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});nF(o);let a={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(a);for(let[i,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[i]=c.default}if(t.defaults)this.#r={...this.#r,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let r=t.fileExtension?`.${t.fileExtension}`:"";this.path=M$.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(Os(),t.defaults,n);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(s);try{rF.deepEqual(n,s)}catch{this.store=s}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:r}=this;return e in r?r[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${Hi} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(oF(s,o),this.#e.accessPropertiesByDotNotation)$c(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,a]of Object.entries(s))n(o,a)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return ld(this.store,e);return e in this.store}reset(...e){for(let t of e)if(sF(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)ud(t,e);else delete t[e];this.store=t}clear(){this.store=Os();for(let e of Object.keys(this.#r))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=Cn.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Os(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Os();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Os();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:El(e);try{let t=e.slice(0,16),r=Ro.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=Ro.createDecipheriv(L$,r,t),s=e.slice(17),o=typeof s==="string"?Ki(s):s;return El($l([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(tF(o,s))return;r=o,t.call(this,o,s)};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#n)return;if(this.#n(e)||!this.#n.errors)return;let r=this.#n.errors.map(({instancePath:n,message:s=""})=>`\`${n.slice(1)}\` ${s}`);throw Error("Config schema violation: "+r.join("; "))}_ensureDirectory(){Cn.mkdirSync(M$.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=Ro.randomBytes(16),n=Ro.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=Ro.createCipheriv(L$,n,r);t=$l([r,Ki(":"),s.update(Ki(t)),s.final()])}if(D$.env.SNAP)Cn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{qc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){Cn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!Cn.existsSync(this.path))this._write(Os());if(D$.platform==="win32")Cn.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else Cn.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(Sl,"0.0.0"),s=Object.keys(e).filter((a)=>this._shouldPerformMigration(a,n,t)),o={...this.store};for(let a of s)try{if(r)r(this,{fromVersion:n,toVersion:a,finalVersion:t,versions:s});let i=e[a];i?.(this),this._set(Sl,a),n=a,o={...this.store}}catch(i){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${i}`)}if(this._isVersionInRangeFormat(n)||!In.default.eq(n,t))this._set(Sl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Hi)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Hi}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return In.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&In.default.satisfies(t,e))return!1;return In.default.satisfies(r,e)}if(In.default.lte(e,t))return!1;if(In.default.gt(e,r))return!1;return!0}_get(e,t){return cd(this.store,e,t)}_set(e,t){let{store:r}=this;$c(r,e,t),this.store=r}}});var se,z$,P,$r=(e)=>{switch(typeof e){case"undefined":return P.undefined;case"string":return P.string;case"number":return Number.isNaN(e)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":if(Array.isArray(e))return P.array;if(e===null)return P.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return P.promise;if(typeof Map<"u"&&e instanceof Map)return P.map;if(typeof Set<"u"&&e instanceof Set)return P.set;if(typeof Date<"u"&&e instanceof Date)return P.date;return P.object;default:return P.unknown}};var ko=L(()=>{(function(e){e.assertEqual=(s)=>{};function t(s){}e.assertIs=t;function r(s){throw Error()}e.assertNever=r,e.arrayToEnum=(s)=>{let o={};for(let a of s)o[a]=a;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((i)=>typeof s[s[i]]!=="number"),a={};for(let i of o)a[i]=s[i];return e.objectValues(a)},e.objectValues=(s)=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys==="function"?(s)=>Object.keys(s):(s)=>{let o=[];for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a))o.push(a);return o},e.find=(s,o)=>{for(let a of s)if(o(a))return a;return},e.isInteger=typeof Number.isInteger==="function"?(s)=>Number.isInteger(s):(s)=>typeof s==="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map((a)=>typeof a==="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(se||(se={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(z$||(z$={}));P=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var E,ft;var Wi=L(()=>{ko();E=se.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"]);ft=class ft extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},r={_errors:[]},n=(s)=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let a=r,i=0;while(i<o.path.length){let c=o.path[i];if(i!==o.path.length-1)a[c]=a[c]||{_errors:[]};else a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o));a=a[c],i++}}};return n(this),r}static assert(e){if(!(e instanceof ft))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ft.create=(e)=>new ft(e)});var aF=(e,t)=>{let r;switch(e.code){case E.invalid_type:if(e.received===P.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else se.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case E.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case E.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=t.defaultError,se.assertNever(e)}return{message:r}},mn;var xl=L(()=>{Wi();ko();mn=aF});function To(){return iF}var iF;var Yi=L(()=>{xl();iF=mn});function T(e,t){let r=To(),n=Xi({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===mn?void 0:mn].filter((s)=>!!s)});e.common.issues.push(n)}class We{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return G;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let s=await n.key,o=await n.value;r.push({key:s,value:o})}return We.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:s,value:o}=n;if(s.status==="aborted")return G;if(o.status==="aborted")return G;if(s.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(s.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet))r[s.value]=o.value}return{status:e.value,value:r}}}var Xi=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let i="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)i=u(a,{data:t,defaultError:i}).message;return{...s,path:o,message:i}},G,Ns=(e)=>({status:"dirty",value:e}),et=(e)=>({status:"valid",value:e}),Rl=(e)=>e.status==="aborted",kl=(e)=>e.status==="dirty",jn=(e)=>e.status==="valid",Ao=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=L(()=>{Yi();xl();G=Object.freeze({status:"aborted"})});var G$=()=>{};var D;var K$=L(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class Ot{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Q(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:s};return{errorMap:(a,i)=>{let{message:c}=e;if(a.code==="invalid_enum_value")return{message:c??i.defaultError};if(typeof i.data>"u")return{message:c??n??i.defaultError};if(a.code!=="invalid_type")return{message:i.defaultError};return{message:c??r??i.defaultError}},description:s}}class te{get description(){return this._def.description}_getType(e){return $r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new We,ctx:{common:e.parent.common,data:e.data,parsedType:$r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ao(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)},n=this._parseSync({data:e,path:r.path,parent:r});return H$(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return jn(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>jn(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$r(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(Ao(n)?n:Promise.resolve(n));return H$(r,s)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,s)=>{let o=e(n),a=()=>s.addIssue({code:E.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((i)=>{if(!i)return a(),!1;else return!0});if(!o)return a(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new dr({schema:this,typeName:K.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 lr.create(this,this._def)}nullable(){return hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ur.create(this)}promise(){return qs.create(this,this._def)}or(e){return Io.create([this,e],this._def)}and(e){return jo.create(this,e,this._def)}transform(e){return new dr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Lo({...Q(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new Pl({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Uo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return sc.create(this,e)}readonly(){return Fo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function W$(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function SF(e){return new RegExp(`^${W$(e)}$`)}function xF(e){let t=`${B$}T${W$(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function RF(e,t){if((t==="v4"||!t)&&yF.test(e))return!0;if((t==="v6"||!t)&&vF.test(e))return!0;return!1}function kF(e,t){if(!pF.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));if(typeof s!=="object"||s===null)return!1;if("typ"in s&&s?.typ!=="JWT")return!1;if(!s.alg)return!1;if(t&&s.alg!==t)return!1;return!0}catch{return!1}}function TF(e,t){if((t==="v4"||!t)&&_F.test(e))return!0;if((t==="v6"||!t)&&bF.test(e))return!0;return!1}function AF(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}function Ps(e){if(e instanceof Ce){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=lr.create(Ps(n))}return new Ce({...e._def,shape:()=>t})}else if(e instanceof ur)return new ur({...e._def,type:Ps(e.element)});else if(e instanceof lr)return lr.create(Ps(e.unwrap()));else if(e instanceof hn)return hn.create(Ps(e.unwrap()));else if(e instanceof Rr)return Rr.create(e.items.map((t)=>Ps(t)));else return e}function Ol(e,t){let r=$r(e),n=$r(t);if(e===t)return{valid:!0,data:e};else if(r===P.object&&n===P.object){let s=se.objectKeys(t),o=se.objectKeys(e).filter((i)=>s.indexOf(i)!==-1),a={...e,...t};for(let i of o){let c=Ol(e[i],t[i]);if(!c.valid)return{valid:!1};a[i]=c.data}return{valid:!0,data:a}}else if(r===P.array&&n===P.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let a=e[o],i=t[o],c=Ol(a,i);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===P.date&&n===P.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Y$(e,t){return new Dn({values:e,typeName:K.ZodEnum,...Q(t)})}var H$=(e,t)=>{if(jn(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ft(e.common.issues);return this._error=r,this._error}}}},cF,uF,lF,dF,fF,pF,mF,hF,gF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Al,yF,_F,vF,bF,wF,$F,B$="((\\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])))",EF,Sr,Cs,Is,Ji,No,Qi,Po,Co,Zi,qn,xr,ec,ur,Ce,Io,Er=(e)=>{if(e instanceof qo)return Er(e.schema);else if(e instanceof dr)return Er(e.innerType());else if(e instanceof Do)return[e.value];else if(e instanceof Dn)return e.options;else if(e instanceof Mo)return se.objectValues(e.enum);else if(e instanceof Lo)return Er(e._def.innerType);else if(e instanceof Po)return[void 0];else if(e instanceof Co)return[null];else if(e instanceof lr)return[void 0,...Er(e.unwrap())];else if(e instanceof hn)return[null,...Er(e.unwrap())];else if(e instanceof Pl)return Er(e.unwrap());else if(e instanceof Fo)return Er(e.unwrap());else if(e instanceof Uo)return Er(e._def.innerType);else return[]},Nl,jo,Rr,tc,rc,js,Oo,qo,Do,Dn,Mo,qs,dr,lr,hn,Lo,Uo,nc,o3,Pl,sc,Fo,a3,K,_,ne,i3,c3,Ie,u3,l3,d3,f3,p3,m3,h3,g3,Ye,Z,y3,OF,X$,_3,v3,NF,b3,w3,$3,E3,gn,Fe,S3,x3,R3,k3,T3,A3,O3;var J$=L(()=>{Wi();Yi();K$();Tl();ko();cF=/^c[^\s-]{8,}$/i,uF=/^[0-9a-z]+$/,lF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,dF=/^[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,fF=/^[a-z0-9_-]{21}$/i,pF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mF=/^[-+]?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)?)??$/,hF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yF=/^(?:(?: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])$/,_F=/^(?:(?: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])$/,vF=/^(([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]))$/,bF=/^(([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])$/,wF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$F=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,EF=new RegExp(`^${B$}$`);Sr=class Sr extends te{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==P.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.string,received:s.parsedType}),G}let r=new We,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.length<s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="max"){if(e.data.length>s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;if(o||a){if(n=this._getOrReturnCtx(e,n),o)T(n,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(a)T(n,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!hF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"email",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!Al)Al=new RegExp(gF,"u");if(!Al.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"emoji",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!dF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"uuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!fF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"nanoid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!cF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!uF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"cuid2",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!lF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"ulid",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),T(n,{validation:"url",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="regex"){if(s.regex.lastIndex=0,!s.regex.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"regex",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="trim")e.data=e.data.trim();else if(s.kind==="includes"){if(!e.data.includes(s.value,s.position))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()}else if(s.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(s.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(s.kind==="startsWith"){if(!e.data.startsWith(s.value))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="endsWith"){if(!e.data.endsWith(s.value))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!xF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!EF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!SF(s).test(e.data))n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!mF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"duration",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!RF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"ip",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!kF(e.data,s.alg))n=this._getOrReturnCtx(e,n),T(n,{validation:"jwt",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!TF(e.data,s.version))n=this._getOrReturnCtx(e,n),T(n,{validation:"cidr",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!wF.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64",code:E.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!$F.test(e.data))n=this._getOrReturnCtx(e,n),T(n,{validation:"base64url",code:E.invalid_string,message:s.message}),r.dirty()}else se.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:E.invalid_string,...D.errToObj(r)})}_addCheck(e){return new Sr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...D.errToObj(e)})}url(e){return this._addCheck({kind:"url",...D.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...D.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...D.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...D.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...D.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...D.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...D.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...D.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...D.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...D.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...D.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...D.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,...D.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,...D.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...D.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...D.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...D.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...D.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...D.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...D.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...D.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...D.errToObj(t)})}nonempty(e){return this.min(1,D.errToObj(e))}trim(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sr({...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}};Sr.create=(e)=>new Sr({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Q(e)});Cs=class Cs extends te{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)!==P.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.number,received:s.parsedType}),G}let r=void 0,n=new We;for(let s of this._def.checks)if(s.kind==="int"){if(!se.isInteger(e.data))r=this._getOrReturnCtx(e,r),T(r,{code:E.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()}else if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(AF(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),T(r,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else if(s.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),T(r,{code:E.not_finite,message:s.message}),n.dirty()}else se.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new Cs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Cs({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:D.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:D.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.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"&&se.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};Cs.create=(e)=>new Cs({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Is=class Is extends te{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)!==P.bigint)return this._getInvalidInput(e);let r=void 0,n=new We;for(let s of this._def.checks)if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),T(r,{code:E.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(e.data%s.value!==BigInt(0))r=this._getOrReturnCtx(e,r),T(r,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else se.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:P.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new Is({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Is({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.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}};Is.create=(e)=>new Is({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Ji=class Ji extends te{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==P.boolean){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.boolean,received:r.parsedType}),G}return et(e.data)}};Ji.create=(e)=>new Ji({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});No=class No extends te{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==P.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:P.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),G}let r=new We,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.getTime()<s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()}else if(s.kind==="max"){if(e.data.getTime()>s.value)n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()}else se.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new No({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:D.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:D.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}};No.create=(e)=>new No({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Qi=class Qi extends te{_parse(e){if(this._getType(e)!==P.symbol){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.symbol,received:r.parsedType}),G}return et(e.data)}};Qi.create=(e)=>new Qi({typeName:K.ZodSymbol,...Q(e)});Po=class Po extends te{_parse(e){if(this._getType(e)!==P.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.undefined,received:r.parsedType}),G}return et(e.data)}};Po.create=(e)=>new Po({typeName:K.ZodUndefined,...Q(e)});Co=class Co extends te{_parse(e){if(this._getType(e)!==P.null){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.null,received:r.parsedType}),G}return et(e.data)}};Co.create=(e)=>new Co({typeName:K.ZodNull,...Q(e)});Zi=class Zi extends te{constructor(){super(...arguments);this._any=!0}_parse(e){return et(e.data)}};Zi.create=(e)=>new Zi({typeName:K.ZodAny,...Q(e)});qn=class qn extends te{constructor(){super(...arguments);this._unknown=!0}_parse(e){return et(e.data)}};qn.create=(e)=>new qn({typeName:K.ZodUnknown,...Q(e)});xr=class xr extends te{_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:P.never,received:t.parsedType}),G}};xr.create=(e)=>new xr({typeName:K.ZodNever,...Q(e)});ec=class ec extends te{_parse(e){if(this._getType(e)!==P.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.void,received:r.parsedType}),G}return et(e.data)}};ec.create=(e)=>new ec({typeName:K.ZodVoid,...Q(e)});ur=class ur extends te{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==P.array)return T(t,{code:E.invalid_type,expected:P.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;if(o||a)T(t,{code:o?E.too_big:E.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)T(t,{code:E.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)T(t,{code:E.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,a)=>n.type._parseAsync(new Ot(t,o,t.path,a)))).then((o)=>We.mergeArray(r,o));let s=[...t.data].map((o,a)=>n.type._parseSync(new Ot(t,o,t.path,a)));return We.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new ur({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new ur({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new ur({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};ur.create=(e,t)=>new ur({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ce=class Ce extends te{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=se.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==P.object){let c=this._getOrReturnCtx(e);return T(c,{code:E.invalid_type,expected:P.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))a.push(c)}let i=[];for(let c of o){let u=s[c],l=n.data[c];i.push({key:{status:"valid",value:c},value:u._parse(new Ot(n,l,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof xr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)i.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(a.length>0)T(n,{code:E.unrecognized_keys,keys:a}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let l=n.data[u];i.push({key:{status:"valid",value:u},value:c._parse(new Ot(n,l,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of i){let l=await u.key,d=await u.value;c.push({key:l,value:d,alwaysSet:u.alwaysSet})}return c}).then((c)=>We.mergeObjectSync(r,c));else return We.mergeObjectSync(r,i)}get shape(){return this._def.shape()}strict(e){return D.errToObj,new Ce({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:D.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new Ce({...this._def,unknownKeys:"strip"})}passthrough(){return new Ce({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ce({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ce({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ce({...this._def,catchall:e})}pick(e){let t={};for(let r of se.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}omit(e){let t={};for(let r of se.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}deepPartial(){return Ps(this)}partial(e){let t={};for(let r of se.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new Ce({...this._def,shape:()=>t})}required(e){let t={};for(let r of se.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof lr)s=s._def.innerType;t[r]=s}return new Ce({...this._def,shape:()=>t})}keyof(){return Y$(se.objectKeys(this.shape))}};Ce.create=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ce.strictCreate=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Ce.lazycreate=(e,t)=>new Ce({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:K.ZodObject,...Q(t)});Io=class Io extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map((a)=>new ft(a.ctx.common.issues));return T(t,{code:E.invalid_union,unionErrors:o}),G}if(t.common.async)return Promise.all(r.map(async(s)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);else{let s=void 0,o=[];for(let i of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=i._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!s)s={result:u,ctx:c};if(c.common.issues.length)o.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map((i)=>new ft(i));return T(t,{code:E.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}};Io.create=(e,t)=>new Io({options:e,typeName:K.ZodUnion,...Q(t)});Nl=class Nl extends te{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.object)return T(t,{code:E.invalid_type,expected:P.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return T(t,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),G;if(t.common.async)return s._parseAsync({data:t.data,path:t.path,parent:t});else return s._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let s of t){let o=Er(s.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(n.has(a))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new Nl({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};jo=class jo extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(Rl(s)||Rl(o))return G;let a=Ol(s.value,o.value);if(!a.valid)return T(r,{code:E.invalid_intersection_types}),G;if(kl(s)||kl(o))t.dirty();return{status:t.value,value:a.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>n(s,o));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};jo.create=(e,t,r)=>new jo({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});Rr=class Rr extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.array)return T(r,{code:E.invalid_type,expected:P.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return T(r,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;if(!this._def.rest&&r.data.length>this._def.items.length)T(r,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let s=[...r.data].map((o,a)=>{let i=this._def.items[a]||this._def.rest;if(!i)return null;return i._parse(new Ot(r,o,r.path,a))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>We.mergeArray(t,o));else return We.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Rr({...this._def,rest:e})}};Rr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rr({items:e,typeName:K.ZodTuple,rest:null,...Q(t)})};tc=class tc extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.object)return T(r,{code:E.invalid_type,expected:P.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in r.data)n.push({key:s._parse(new Ot(r,a,r.path,a)),value:o._parse(new Ot(r,r.data[a],r.path,a)),alwaysSet:a in r.data});if(r.common.async)return We.mergeObjectAsync(t,n);else return We.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof te)return new tc({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new tc({keyType:Sr.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};rc=class rc extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.map)return T(r,{code:E.invalid_type,expected:P.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,i],c)=>({key:n._parse(new Ot(r,a,r.path,[c,"key"])),value:s._parse(new Ot(r,i,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let i of o){let c=await i.key,u=await i.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();a.set(c.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let i of o){let{key:c,value:u}=i;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();a.set(c.value,u.value)}return{status:t.value,value:a}}}};rc.create=(e,t,r)=>new rc({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});js=class js extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==P.set)return T(r,{code:E.invalid_type,expected:P.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)T(r,{code:E.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)T(r,{code:E.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let s=this._def.valueType;function o(i){let c=new Set;for(let u of i){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let a=[...r.data.values()].map((i,c)=>s._parse(new Ot(r,i,r.path,c)));if(r.common.async)return Promise.all(a).then((i)=>o(i));else return o(a)}min(e,t){return new js({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new js({...this._def,maxSize:{value:e,message:D.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};js.create=(e,t)=>new js({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends te{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.function)return T(t,{code:E.invalid_type,expected:P.function,received:t.parsedType}),G;function r(a,i){return Xi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),mn].filter((c)=>!!c),issueData:{code:E.invalid_arguments,argumentsError:i}})}function n(a,i){return Xi({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),mn].filter((c)=>!!c),issueData:{code:E.invalid_return_type,returnTypeError:i}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof qs){let a=this;return et(async function(...i){let c=new ft([]),u=await a._def.args.parseAsync(i,s).catch((m)=>{throw c.addIssue(r(i,m)),c}),l=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(l,s).catch((m)=>{throw c.addIssue(n(l,m)),c})})}else{let a=this;return et(function(...i){let c=a._def.args.safeParse(i,s);if(!c.success)throw new ft([r(i,c.error)]);let u=Reflect.apply(o,this,c.data),l=a._def.returns.safeParse(u,s);if(!l.success)throw new ft([n(u,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:Rr.create(e).rest(qn.create())})}returns(e){return new Oo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Oo({args:e?e:Rr.create([]).rest(qn.create()),returns:t||qn.create(),typeName:K.ZodFunction,...Q(r)})}};qo=class qo extends te{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})}};qo.create=(e,t)=>new qo({getter:e,typeName:K.ZodLazy,...Q(t)});Do=class Do extends te{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return T(t,{received:t.data,code:E.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};Do.create=(e,t)=>new Do({value:e,typeName:K.ZodLiteral,...Q(t)});Dn=class Dn extends te{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{expected:se.joinValues(r),received:t.parsedType,code:E.invalid_type}),G}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{received:t.data,code:E.invalid_enum_value,options:r}),G}return et(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 Dn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Dn.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};Dn.create=Y$;Mo=class Mo extends te{_parse(e){let t=se.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==P.string&&r.parsedType!==P.number){let n=se.objectValues(t);return T(r,{expected:se.joinValues(n),received:r.parsedType,code:E.invalid_type}),G}if(!this._cache)this._cache=new Set(se.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=se.objectValues(t);return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),G}return et(e.data)}get enum(){return this._def.values}};Mo.create=(e,t)=>new Mo({values:e,typeName:K.ZodNativeEnum,...Q(t)});qs=class qs extends te{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.promise&&t.common.async===!1)return T(t,{code:E.invalid_type,expected:P.promise,received:t.parsedType}),G;let r=t.parsedType===P.promise?t.data:Promise.resolve(t.data);return et(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};qs.create=(e,t)=>new qs({type:e,typeName:K.ZodPromise,...Q(t)});dr=class dr extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:(o)=>{if(T(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async(a)=>{if(t.value==="aborted")return G;let i=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return Ns(i.value);if(t.value==="dirty")return Ns(i.value);return i});else{if(t.value==="aborted")return G;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return Ns(a.value);if(t.value==="dirty")return Ns(a.value);return a}}if(n.type==="refinement"){let o=(a)=>{let i=n.refinement(a,s);if(r.common.async)return Promise.resolve(i);if(i instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")t.dirty();return o(a.value),{status:t.value,value:a.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((a)=>{if(a.status==="aborted")return G;if(a.status==="dirty")t.dirty();return o(a.value).then(()=>({status:t.value,value:a.value}))})}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!jn(o))return G;let a=n.transform(o.value,s);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!jn(o))return G;return Promise.resolve(n.transform(o.value,s)).then((a)=>({status:t.value,value:a}))});se.assertNever(n)}};dr.create=(e,t,r)=>new dr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});dr.createWithPreprocess=(e,t,r)=>new dr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});lr=class lr extends te{_parse(e){if(this._getType(e)===P.undefined)return et(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};lr.create=(e,t)=>new lr({innerType:e,typeName:K.ZodOptional,...Q(t)});hn=class hn extends te{_parse(e){if(this._getType(e)===P.null)return et(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hn.create=(e,t)=>new hn({innerType:e,typeName:K.ZodNullable,...Q(t)});Lo=class Lo extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===P.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Uo=class Uo extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Ao(n))return n.then((s)=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});nc=class nc extends te{_parse(e){if(this._getType(e)!==P.nan){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:P.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};nc.create=(e)=>new nc({typeName:K.ZodNaN,...Q(e)});o3=Symbol("zod_brand");Pl=class Pl extends te{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};sc=class sc extends te{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return G;if(s.status==="dirty")return t.dirty(),Ns(s.value);else return this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return G;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new sc({in:e,out:t,typeName:K.ZodPipeline})}};Fo=class Fo extends te{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(jn(n))n.value=Object.freeze(n.value);return n};return Ao(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Fo.create=(e,t)=>new Fo({innerType:e,typeName:K.ZodReadonly,...Q(t)});a3={object:Ce.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"})(K||(K={}));_=Sr.create,ne=Cs.create,i3=nc.create,c3=Is.create,Ie=Ji.create,u3=No.create,l3=Qi.create,d3=Po.create,f3=Co.create,p3=Zi.create,m3=qn.create,h3=xr.create,g3=ec.create,Ye=ur.create,Z=Ce.create,y3=Ce.strictCreate,OF=Io.create,X$=Nl.create,_3=jo.create,v3=Rr.create,NF=tc.create,b3=rc.create,w3=js.create,$3=Oo.create,E3=qo.create,gn=Do.create,Fe=Dn.create,S3=Mo.create,x3=qs.create,R3=dr.create,k3=lr.create,T3=hn.create,A3=dr.createWithPreprocess,O3=sc.create});var Cl=L(()=>{Yi();Tl();G$();ko();J$();Wi()});var _n=L(()=>{Cl();Cl()});function F3(e){return CF.includes(e)}var PF,Mn,CF,V3,IF,Q$,jF,Z$,qF,DF,z3,MF,G3,K3,H3,B3,LF,eE,UF,tE,W3=20,Y3=500,FF,X3;var oc=L(()=>{_n();PF=Fe(["pending","verified","approved","revoked"]),Mn=Fe(["person","service","test"]),CF=Mn.options;V3={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"},IF=Fe(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Q$=IF.options,jF=Fe(["active","pending","revoked"]),Z$=Z({field:_(),blocks:Ye(_()).optional(),set_on:Ye(_()).optional()}).passthrough(),qF=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),orcid:_().nullable().optional(),created_at:_().optional(),approved_at:_().nullable().optional(),dataset_count:ne().int().optional(),sandbox_completed:Ie().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),service_access:Ie().optional(),status:PF.optional(),email_verified:Ie().optional(),orcid_verified:Ie().optional(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),profile_gaps:Ye(Z$).optional(),username_auto_assigned:Ie().optional(),account_kind:Mn.optional(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional()}).passthrough(),DF=Z({prefix:_(),created_at:_(),last_used_at:_().nullable()}).passthrough().nullable(),z3=Z({user:qF,token:DF.optional()}).passthrough(),MF=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),email_verified:ne().int().nullable().optional(),role:_().nullable(),created_at:_(),approved_at:_().nullable().optional(),revoked_at:_().nullable().optional(),signup_source:_().nullable().optional(),service_access:ne().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:Mn.optional(),matched_in:Ye(_()).optional(),match_kind:_().optional()}).passthrough(),G3=Z({users:Ye(MF),count:ne().int()}).passthrough(),K3=Fe(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),H3=Fe(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),B3=Z({suggestion:_().nullable(),based_on:Fe(["name","unavailable","exhausted"])}).passthrough(),LF=Fe(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),eE=LF.options,UF=Fe(["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"]),tE=UF.options,FF=Z({id:ne().int(),email:_(),username:_().nullable(),role:_(),status:jF,email_verified:Ie(),given_name:_().nullable(),family_name:_().nullable(),orcid:_().nullable(),orcid_verified:Ie(),github_username:_().nullable(),city:_().nullable(),country:_().nullable(),affiliation:_().nullable(),service_access:Ie(),service_access_granted_at:_().nullable(),upload_access_requested_at:_().nullable(),profile_gaps:Ye(Z$),username_auto_assigned:Ie(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional()}).passthrough(),X3=Z({user:FF.nullable()}).passthrough()});function fr(e){if(e instanceof Error)return e.message;return String(e)}function Q3(e){if(!(e instanceof pr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var pr,Il;var jl=L(()=>{pr=class pr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;retryAfterSeconds;constructor(e,t,r,n,s,o){super(t);this.statusCode=e;this.details=r;this.step=n;this.blockReason=s;this.missing=o;this.name="ApiError"}};Il=class Il extends pr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function GF(){let e=new Map;for(let[t,r]of Object.entries(be)){for(let[n,s]of Object.entries(r))be[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=be[n],e.set(s[0],s[1]);Object.defineProperty(be,t,{value:r,enumerable:!1})}return Object.defineProperty(be,"codes",{value:e,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=rE(),be.color.ansi256=nE(),be.color.ansi16m=sE(),be.bgColor.ansi=rE(10),be.bgColor.ansi256=nE(10),be.bgColor.ansi16m=sE(10),Object.defineProperties(be,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((o)=>o+o).join("");let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:(t)=>be.rgbToAnsi256(...be.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,s;if(t>=232)r=((t-232)*10+8)/255,n=r,s=r;else{t-=16;let i=t%36;r=Math.floor(t/36)/5,n=Math.floor(i/6)/5,s=i%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let a=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)a+=60;return a},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>be.ansi256ToAnsi(be.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>be.ansi256ToAnsi(be.hexToAnsi256(t)),enumerable:!1}}),be}var rE=(e=0)=>(t)=>`\x1B[${t+e}m`,nE=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,sE=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,be,eB,VF,zF,tB,KF,Nt;var oE=L(()=>{be={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},eB=Object.keys(be.modifier),VF=Object.keys(be.color),zF=Object.keys(be.bgColor),tB=[...VF,...zF];KF=GF(),Nt=KF});import ql from"process";import HF from"os";import aE from"tty";function Et(e,t=globalThis.Deno?globalThis.Deno.args:ql.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function BF(){if("FORCE_COLOR"in we){if(we.FORCE_COLOR==="true")return 1;if(we.FORCE_COLOR==="false")return 0;return we.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(we.FORCE_COLOR,10),3)}}function WF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function YF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=BF();if(n!==void 0)ac=n;let s=r?ac:n;if(s===0)return 0;if(r){if(Et("color=16m")||Et("color=full")||Et("color=truecolor"))return 3;if(Et("color=256"))return 2}if("TF_BUILD"in we&&"AGENT_NAME"in we)return 1;if(e&&!t&&s===void 0)return 0;let o=s||0;if(we.TERM==="dumb")return o;if(ql.platform==="win32"){let a=HF.release().split(".");if(Number(a[0])>=10&&Number(a[2])>=10586)return Number(a[2])>=14931?3:2;return 1}if("CI"in we){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((a)=>(a in we)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((a)=>(a in we))||we.CI_NAME==="codeship")return 1;return o}if("TEAMCITY_VERSION"in we)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(we.TEAMCITY_VERSION)?1:0;if(we.COLORTERM==="truecolor")return 3;if(we.TERM==="xterm-kitty")return 3;if(we.TERM==="xterm-ghostty")return 3;if(we.TERM==="wezterm")return 3;if("TERM_PROGRAM"in we){let a=Number.parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(we.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(we.TERM))return 1;if("COLORTERM"in we)return 1;return o}function iE(e,t={}){let r=YF(e,{streamIsTTY:e&&e.isTTY,...t});return WF(r)}var we,ac,XF,cE;var uE=L(()=>{({env:we}=ql);if(Et("no-color")||Et("no-colors")||Et("color=false")||Et("color=never"))ac=0;else if(Et("color")||Et("colors")||Et("color=true")||Et("color=always"))ac=1;XF={stdout:iE({isTTY:aE.isatty(1)}),stderr:iE({isTTY:aE.isatty(2)})},cE=XF});function lE(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,a="";do a+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return a+=e.slice(o),a}function dE(e,t,r,n){let s=0,o="";do{let a=e[n-1]==="\r";o+=e.slice(s,a?n-1:n)+t+(a?`\r
|
|
19
19
|
`:`
|
|
20
20
|
`)+r,s=n+1,n=e.indexOf(`
|
|
21
|
-
`,s)}while(n!==-1);return o+=e.slice(s),o}function zo(e){return
|
|
22
|
-
`);if(o!==-1)t=dE(t,s,n,o);return n+t+s},
|
|
23
|
-
`)}var Vl=!1;var{spawn:
|
|
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
|
|
21
|
+
`,s)}while(n!==-1);return o+=e.slice(s),o}function zo(e){return QF(e)}var fE,pE,Ml,Ds,Vo,mE,Ms,JF=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=fE?fE.level:0;e.level=t.level===void 0?r:t.level},QF=(e)=>{let t=(...r)=>r.join(" ");return JF(t,e),Object.setPrototypeOf(t,zo.prototype),t},Ll=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return Nt[r].ansi16m(...n);if(t==="ansi256")return Nt[r].ansi256(Nt.rgbToAnsi256(...n));return Nt[r].ansi(Nt.rgbToAnsi(...n))}if(e==="hex")return Ll("rgb",t,r,...Nt.hexToRgb(...n));return Nt[r][e](...n)},ZF,eV,Ul=(e,t,r)=>{let n,s;if(r===void 0)n=e,s=t;else n=r.openAll+e,s=t+r.closeAll;return{open:e,close:t,openAll:n,closeAll:s,parent:r}},ic=(e,t,r)=>{let n=(...s)=>tV(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,eV),n[Ml]=e,n[Ds]=t,n[Vo]=r,n},tV=(e,t)=>{if(e.level<=0||!t)return e[Vo]?"":t;let r=e[Ds];if(r===void 0)return t;let{openAll:n,closeAll:s}=r;if(t.includes("\x1B"))while(r!==void 0)t=lE(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
|
|
22
|
+
`);if(o!==-1)t=dE(t,s,n,o);return n+t+s},rV,dB,Pt;var Fl=L(()=>{oE();uE();({stdout:fE,stderr:pE}=cE),Ml=Symbol("GENERATOR"),Ds=Symbol("STYLER"),Vo=Symbol("IS_EMPTY"),mE=["ansi","ansi","ansi256","ansi16m"],Ms=Object.create(null);Object.setPrototypeOf(zo.prototype,Function.prototype);for(let[e,t]of Object.entries(Nt))Ms[e]={get(){let r=ic(this,Ul(t.open,t.close,this[Ds]),this[Vo]);return Object.defineProperty(this,e,{value:r}),r}};Ms.visible={get(){let e=ic(this,this[Ds],!0);return Object.defineProperty(this,"visible",{value:e}),e}};ZF=["rgb","hex","ansi256"];for(let e of ZF){Ms[e]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,mE[r],"color",...n),Nt.color.close,this[Ds]);return ic(this,s,this[Vo])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Ms[t]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,mE[r],"bgColor",...n),Nt.bgColor.close,this[Ds]);return ic(this,s,this[Vo])}}}}eV=Object.defineProperties(()=>{},{...Ms,level:{enumerable:!0,get(){return this[Ml].level},set(e){this[Ml].level=e}}});Object.defineProperties(zo.prototype,Ms);rV=zo(),dB=zo({level:pE?pE.level:0}),Pt=rV});function pB(e){Vl=e}function cc(){return Vl}function Ls(e){if(Vl)process.stderr.write(`${e}
|
|
23
|
+
`)}var Vl=!1;var{spawn:nV}=globalThis.Bun;function zl(e,t=[]){let r=e.replace(sV,'("$1","<redacted>")');for(let n of t)if(n.length>=oV)r=r.split(n).join("<redacted>");return r}function iV(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 hE(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:a}=await r.read();if(o)break;if(a.byteLength===0)continue;t(),s+=n.decode(a,{stream:!0})}return s+n.decode()}async function gE(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=nV({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,a,i=performance.now(),c=()=>{if(a!==void 0)clearTimeout(a),a=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),a=setTimeout(()=>{a=void 0;try{t.onInactivityWarning?.(performance.now()-i)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??aV)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let l=cc()?[...iV(r),...t.redact??[]]:[];if(cc()){let y=t.cwd?` (cwd=${t.cwd})`:"";Ls(Pt.dim(zl(`$ ${e.join(" ")}${y}`,l)))}let d=()=>{i=performance.now(),u()},m,f,p,h=n.exited.then((y)=>(c(),y));try{[m,f,p]=await Promise.all([hE(n.stdout,d),hE(n.stderr,d),h])}finally{if(c(),o)clearTimeout(o)}if(cc()){if(t.sensitiveOutput)Ls(Pt.dim("[sensitive subprocess output suppressed]"));else{if(m.trim())Ls(Pt.dim(zl(m.trimEnd(),l)));if(f.trim())Ls(Pt.yellow(zl(f.trimEnd(),l)))}Ls(Pt.dim(`(exit ${p})`))}if(s)return{stdout:m,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:p??1,timedOut:!0};return{stdout:m,stderr:f,exitCode:p,timedOut:!1}}var sV,oV=8,aV=120000;var yE=L(()=>{Fl();sV=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function uV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function vE(e,t=uV()){return e.installInstructions[t]}function lV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function fV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:dV}async function bE(e){try{let{exitCode:t,stdout:r,timedOut:n}=await gE(e.cmd,{timeout:fV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:lV(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 Gl(){let e=Object.entries(_E);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await bE(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:vE(r)}}))}async function bB(){let t=(await Gl()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
|
|
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 wB(e){let r=cV[e].map((a)=>_E[a]).filter(Boolean),n=await Promise.all(r.map(async(a)=>{let i=await bE(a);return{check:a,available:i.available,timedOut:i.timedOut}}));for(let a of n)if(a.timedOut&&a.check.required)console.warn(`Warning: ${a.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((a)=>!a.available&&!a.timedOut&&a.check.required).map((a)=>({tool:a.check.name,installInstruction:vE(a.check)}));if(s.length===0)return;let o=[`
|
|
25
25
|
Missing required tools:`];for(let a of s)o.push(` ${a.tool} not installed`),o.push(` Install: ${a.installInstruction}`);throw Error(o.join(`
|
|
26
|
-
`))}var _E,
|
|
27
|
-
`)}function
|
|
28
|
-
`)}async function
|
|
26
|
+
`))}var _E,cV,dV=4000;var wE=L(()=>{yE();_E={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)"}}},cV={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 EE;var $E=L(()=>{EE={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-dev.4754",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 uc;var Kl=L(()=>{$E();uc=EE.version});import{mkdirSync as mV,readdirSync as hV,unlinkSync as gV,writeFileSync as yV}from"fs";import{join as Hl}from"path";function PB(){Us=!0}function fc(){return Us}function CB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function IB(e){TE=e,mr(`Step: ${e}`)}function jB(){RE=!0}function qB(){return RE}function DB(){if(kE)return;Wl=!0}function MB(){Wl=!1,kE=!0}function LB(){return Wl}function mr(e){if(Us)process.stderr.write(`[debug] ${e}
|
|
27
|
+
`)}function wV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=bV.has(r.toLowerCase())?"[REDACTED]":n;return t}function OE(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Bl(e,t,r=0){if(r>EV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Bl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Bl(s,o,r+1);return n}if(typeof t==="string"){if($V.test(e))return"[REDACTED]";return t.replace(AE,OE)}return t}function Yl(e){return e.replace(SV,"Bearer [REDACTED]").replace(xV,"[REDACTED_AWS_KEY]").replace(RV,"$1[REDACTED]").replace(kV,"$1$2=[REDACTED]").replace(AE,OE)}function TV(e){return Yl(e)}function SE(e,t=vV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Bl("",n))}catch{}if(r=Yl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function pc(e){if(!Us)return;let t=TV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?wV(e.requestHeaders):void 0,requestBody:SE(e.requestBody),responseBody:SE(e.responseBody)};dc.push(r),mr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=fr(r);dc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),mr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function AV(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${uc}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${fr(t)})`)}e.push(""),e.push("Active account:");try{let t=vn();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: ${fr(t)})`)}e.push(""),e.push("External tools:");try{let t=await Gl();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: ${fr(t)})`)}return e}async function OV(){return(await AV()).join(`
|
|
28
|
+
`)}async function UB(){if(!Us||lc!==void 0)return;try{lc=await OV()}catch(e){let t=fr(e);lc=`(could not build environment report: ${t})`,mr(`environment snapshot failed: ${t}`)}}function NE(e){if(xE.has(e))return{flag:e};for(let t of xE){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 NV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(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 PV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function CV(e){let t=[];for(let n of PV(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 IV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Yl(NV(e).join(" "))}`),r.push(""),r.push(lc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),dc.length===0)r.push(" (none)");else dc.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: ${TE??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
|
|
29
29
|
`)}
|
|
30
|
-
`}function
|
|
30
|
+
`}function jV(e,t){let r;try{r=hV(e).filter((s)=>s.startsWith("nemar-")&&s.endsWith(".log"))}catch(s){if(s.code!=="ENOENT")mr(`could not list ${e} for log rotation: ${fr(s)}`);return}r.sort();let n=r.length-t;for(let s=0;s<n;s++)try{gV(Hl(e,r[s]))}catch(o){if(o.code!=="ENOENT")mr(`could not remove old log ${r[s]}: ${fr(o)}`)}}function FB(){return Go}function VB(e,t){if(!Us)return null;let r=Hl(Jl(),"logs");try{mV(r,{recursive:!0})}catch(a){return Go=fr(a),mr(`could not create log directory ${r}: ${Go}`),null}let s=`nemar-${new Date().toISOString().replace(/[:.]/g,"-")}-${CV(e)}.log`,o=Hl(r,s);try{yV(o,IV(e,t),"utf8")}catch(a){return Go=fr(a),mr(`could not write log file ${o}: ${Go}`),null}return jV(r,_V),o}var _V=10,vV=2048,Us=!1,RE=!1,Wl=!1,kE=!1,TE,lc,dc,bV,$V,AE,EV=32,SV,xV,RV,kV,xE,Go;var Xl=L(()=>{jl();mc();wE();Kl();dc=[];bV=new Set(["authorization","cookie","set-cookie","x-api-key","x-approval-dispatch-token"]);$V=/^(api[_-]?key|apikey|password|token|secret|access[_-]?key(_id)?|secret[_-]?access[_-]?key|session|session[_-]?token|authorization|ssh[_-]?key|private[_-]?key|device[_-]?code|dispatch[_-]?token|client[_-]?secret)$/i,AE=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;SV=/Bearer\s+[A-Za-z0-9\-._~+/=]+/gi,xV=/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,RV=/((?:aws_)?secret_access_key["']?\s*[:=]\s*["']?)[A-Za-z0-9/+=]{20,}/gi,kV=/([?&])(X-Amz-Signature|X-Amz-Security-Token|X-Amz-Credential|Signature|AWSAccessKeyId)=[^&\s"']+/gi;xE=new Set(["-k","--key","--password","--api-key"])});import{chmodSync as qV,copyFileSync as DV,existsSync as Ql,mkdirSync as MV,statSync as LV}from"fs";import{homedir as hc}from"os";import{join as Fs}from"path";function FV(e){let t=e.trim().replace(/\/+$/,"");try{let r=new URL(t);return r.protocol=r.protocol.toLowerCase(),r.host=r.host.toLowerCase(),r.toString().replace(/\/+$/,"")}catch{return console.error(`[nemar] could not parse stored apiUrl ${JSON.stringify(e)}; leaving as-is`),t}}function Jl(){return process.env.NEMAR_CONFIG_DIR||Fs(hc(),".config","nemar")}function zV(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Fs(e,"config.json");if(Ql(t))return;let r=[];if(process.platform==="darwin")r.push(Fs(hc(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Fs(hc(),"AppData","Roaming");r.push(Fs(n,"nemar-nodejs","config.json"))}r.push(Fs(hc(),".config","nemar-nodejs","config.json"));for(let n of r)if(Ql(n))try{MV(e,{recursive:!0}),DV(n,t),console.error(`[nemar] Config migrated from ${n} to ${t}
|
|
31
31
|
[nemar] You can safely remove the old file.`);return}catch(s){console.error(`[nemar] Failed to migrate config from ${n}:`,s,`
|
|
32
|
-
[nemar] You can manually copy ${n} to ${t}`)}}function St(){let e=Jl();if(Ko&&PE===e)return Ko;if(VV(e),Ko=new Bi({projectName:"nemar",configFileMode:Zl,schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:e}),PE=e,!IE.has(e))IE.add(e),zV(Ko.path),KV(),HV();return Ko}function zV(e){if(process.platform==="win32")return;if(!Ql(e))return;try{if((MV(e).mode&511)!==Zl)jV(e,Zl)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function KV(){let e=St(),t=e.get("accounts");if(t&&Object.keys(t).length>0)return;let r=e.get("apiKey"),n=e.get("username");if(!r&&!n)return;try{let s=n||"default",o={};for(let a of GV){let i=e.get(a);if(i!==void 0)o[a]=i}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function HV(){let e=St(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,a]of Object.entries(r)){let i=a?.apiUrl;if(!i)continue;if(LV.has(UV(i)))r[o]={...a,apiUrl:Vs},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${i} -> ${Vs}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...a}=t;try{e.store=a,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(i){console.error("API URL cleanup failed (config file unchanged):",i)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ho(){return St().get("activeAccount")}function bn(){return St().get("accounts")||{}}function vn(){let e={apiUrl:Vs},t=Ho();if(!t)return e;return bn()[t]||e}function WB(e,t){let r=St(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Vs};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function YB(e){let t=Ho();if(!t)return;let r=bn();if(r[t])delete r[t][e],St().set("accounts",r)}function XB(){let e=St(),t=Ho();if(!t){e.clear();return}let r=bn();delete r[t];let n=Object.keys(r);if(n.length>0)e.store={...e.store,accounts:r,activeAccount:n[0]};else e.clear()}function JB(){St().clear()}function QB(){return!!vn().apiKey}function ZB(){return St().path}function e6(){let e=bn(),t=Ho();return Object.entries(e).map(([r,n])=>({key:r,username:n.username,email:n.email,githubUsername:n.githubUsername,active:r===t,keySource:n.keySource}))}function t6(e){return e.username?.trim()||e.email}function BV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(bn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){mr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function r6(e,t){let r=St(),n=bn(),s;if(n[e])s=e;else if(t.email)s=BV(t.email);let o=s?n[s]:void 0,a={...o??{apiUrl:Vs},...t};if(s&&s!==e)delete n[s];return n[e]=a,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function n6(e){let t=e.trim();if(!t)return"unchanged";let r=St(),n=Ho();if(!n||n===t)return"unchanged";let s=bn(),o=s[n];if(!o)return"unchanged";if(s[t])return"key_taken";return delete s[n],s[t]={...o,username:t},r.store={...r.store,accounts:s,activeAccount:t},"renamed"}function s6(e){let t=St(),r=bn();if(r[e])return t.store={...t.store,activeAccount:e},r[e];for(let[n,s]of Object.entries(r))if(s.githubUsername===e)return t.store={...t.store,activeAccount:n},s;return null}var Vs="https://nemar-api-dev.sccn-org.workers.dev",Zl=384,LV,FV,BB,Ko=null,PE=null,IE,GV;var mc=L(()=>{V$();_n();oc();Xl();LV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);FV=Z({field:_(),blocks:Ye(_()).optional(),set_on:Ye(_()).optional()}).passthrough(),BB=Z({apiKey:_().optional(),apiUrl:_().url().default(Vs),username:_().optional(),email:_().email().optional(),githubUsername:_().optional(),sandboxCompleted:Ce().optional(),sandboxDatasetId:_().optional(),dismissedNoticeIds:Ye(ne()).optional(),serviceAccess:Ce().optional(),profileGaps:Ye(FV).optional(),orcidVerified:Ce().optional(),role:_().optional(),accountKind:Mn.optional(),pendingEmailChange:_().email().optional()});IE=new Set;GV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var WV,YV,c6,XV,u6,JV,CE,l6,d6=8,f6=100,jE,p6,QV,m6;var qE=L(()=>{_n();oc();WV=["given_name","family_name","affiliation","city","country"],YV=["username","github_username","email","orcid"],c6=[...WV,...YV],XV={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()},u6=Z(XV),JV=Fe(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),CE=JV.options,l6=["exact","name","prefix","substring","fuzzy"],jE=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Mn.optional(),email_verified:ne().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:ne().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:ne().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:ne().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_notified_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional(),compute_access_granted_by:ne().int().nullable().optional(),compute_terms_version:_().nullable().optional(),compute_terms_accepted_at:_().nullable().optional(),identity_conflict:ne().int().nullable().optional(),username_auto_assigned:ne().int().nullable().optional(),sandbox_completed:ne().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:ne().int().optional(),active_tokens:ne().int().optional(),linked_identities:Ye(_()).optional()}).passthrough(),p6=Z({user:jE}).passthrough(),QV=Z({from:_().nullable(),to:_().nullable()}),m6=Z({message:_(),changed:OF(_(),QV),notes:Ye(_()).optional(),old_address_notified:Ce().optional(),user:jE}).passthrough()});function _6(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<32&&r!==9&&r!==10||r===127)return!0}return!1}var y6=20,ZV=1000,v6,e9,DE,b6,w6=500,$6=200,ME,E6,t9,S6;var LE=L(()=>{_n();v6=Z({purpose:_().max(ZV*4).optional().default(""),accept_terms_version:_().max(64).optional().default("")}),e9=Fe(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),DE=e9.options,b6=Z({ok:gn(!0),already_requested:Ce(),requested_at:_().nullable().optional(),email_sent:Ce().optional(),admins_notified:ne().int().nullable().optional()}).passthrough(),ME=Z({id:ne().int(),username:_().nullable(),email:_(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),orcid:_().nullable().optional(),account_kind:_().optional(),compute_access:_(),compute_access_requested_at:_().nullable().optional(),compute_access_notified_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional(),compute_access_granted_by:ne().int().nullable().optional(),compute_purpose:_().nullable().optional(),compute_terms_version:_().nullable().optional(),compute_terms_accepted_at:_().nullable().optional()}).passthrough(),E6=Z({accounts:Ye(ME),next_after:ne().int().nullable().optional()}).passthrough(),t9=Z({granted:Ce(),cpu_milli:ne().int(),gpu_milli:ne().int(),reason:_().nullable().optional(),policy_version:ne().int().nullable().optional()}).passthrough(),S6=Z({decision:_(),from:_(),to:_(),account:ME,allocation:t9.optional(),email_sent:Ce().optional()}).passthrough()});var k6=120,T6=64,A6="unnamed machine",r9=25,UE,O6,zs,FE,N6,P6,I6,n9,s9,C6,ed,j6,q6,D6,M6,L6;var VE=L(()=>{_n();UE=Fe(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),O6={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."},zs=Fe(["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"]),FE=zs.options,N6={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 ${r9} 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."},P6=Z({error:zs,message:_()}).passthrough(),I6=Z({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:ne().int(),interval:ne().int()}).passthrough(),n9=X$("error",[Z({error:gn("authorization_pending"),message:_()}).passthrough(),Z({error:gn("slow_down"),message:_()}).passthrough()]),s9=X$("error",[Z({error:gn("expired_token"),reason:zs,message:_()}).passthrough(),Z({error:gn("access_denied"),reason:zs,message:_()}).passthrough(),Z({error:gn("invalid_grant"),reason:zs,message:_()}).passthrough()]),C6=AF([n9,s9]),ed=Z({id:ne().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:Ce()}).passthrough(),j6=Z({api_key:_(),key:ed,user:Z({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:Ce(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),q6=Z({user_code:_(),machine_name:_(),requested_at:_(),expires_in:ne().int(),account:Z({username:_().nullable(),email_masked:_()}).passthrough(),refusal:Z({code:zs,message:_()}).passthrough().nullable()}).passthrough(),D6=Z({ok:gn(!0),machine_name:_()}).passthrough(),M6=Z({keys:Ye(ed)}).passthrough(),L6=Z({api_key:_(),key:ed}).passthrough()});var o9,zE,Bo="https://nemar.org/settings",V6,a9,i9,c9,z6,G6;var GE=L(()=>{_n();o9=Fe(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),zE=o9.options,V6={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, ${Bo}).`,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, ${Bo}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Bo}), 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, ${Bo}).`,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, ${Bo}).`,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."},a9=Fe(["orcid","email","github"]),i9=Z({id:ne().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:Ce(),dataset_count:ne().int(),identity_conflict:ne().int(),canonical:Ce()}).passthrough(),c9=Z({kind:a9,value:_(),canonical_user_id:ne().int(),accounts:Ye(i9)}).passthrough(),z6=Z({groups:Ye(c9),group_count:ne().int(),flagged_count:ne().int()}).passthrough(),G6=Z({ok:gn(!0),id:ne().int(),cleared:Ce()}).passthrough()});function H6(e){return Wo[e]}function B6(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Wo;var KE=L(()=>{Wo={"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","compute_access.section.title":"Compute access","compute_access.section.lede":"A separate grant from upload access. An admin reviews each request against export-control and local-jurisdiction rules and the purpose you state, and a grant lets you use compute within the limits an administrator sets.","compute_access.state.none":"Not requested","compute_access.state.requested":"Requested","compute_access.state.active":"Active","compute_access.state.suspended":"Suspended","compute_access.state.denied":"Not granted","compute_access.state.revoked":"Ended","compute_access.request.cta":"Request compute access","compute_access.request.form_body":"Tell us what you plan to compute. An admin reviews this alongside your name, affiliation and location, then answers once. You also accept the compute terms.","compute_access.request.purpose_label":"What do you intend to compute?","compute_access.request.purpose_hint":"Describe what you intend to compute in 20-1000 characters","compute_access.request.terms_label":"I accept the compute terms","compute_access.requested.title":"Your compute request is with an admin","compute_access.requested.lede":"An admin is reviewing your request.","compute_access.requested.lede_dated":"An admin is reviewing your request from {date}.","compute_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","compute_access.granted.body":"Compute access is active. Your balances are on your compute page, and you submit jobs with the `nemar compute` command line.","compute_access.granted.link":"Open your compute page","compute_access.closed.body":"This request has been answered and cannot be asked again. If you think that is a mistake, contact support and an admin will take another look.","compute_access.suspended.body":"Your compute access is paused. Contact support to find out why or to ask for it to be lifted.","compute_access.terms_unpublished.body":"Compute access is not open yet: the compute terms are not published. Please check back later.","compute_access.docs_link":"How compute access works","compute_page.frozen.body":"Your pools are frozen, so new jobs are refused. Contact support to find out why.","compute_page.units_note":"Amounts are service units (SU).","compute_page.available_note":"Available is granted minus held minus charged and can be negative after an overrun.","compute_page.queue_note":"It describes the queue of the whole platform, not yours, and it is a recent average, not a promise.","compute_page.usage_note":"Net charge by UTC day of the charge, not the day a job was created. A day with no charge has no bar.","compute_page.unreported_note":"NEMAR has not heard from the cluster about this job for a while. It may still finish.","compute_admin.page.title":"Compute","compute_admin.page.lede":"Compute access requests, and a read-only view of pools, usage, flagged jobs and reconciliation. A grant opens an allocation the person can spend, so each request is decided by a person, one at a time.","compute_admin.page.cli_note":"Owner policy, legal holds, record reads, moving a charge, pool grants and adjustments, and canceling a job are done with the nemar admin compute command in the command line, not here.","compute_admin.page.order_note":"Accounts are listed in the order they were created, not the order they asked in.","compute_admin.view.nav":"Compute views","compute_admin.view.requests":"Requests","compute_admin.view.pools":"Pools","compute_admin.view.usage":"Usage","compute_admin.view.flagged":"Flagged jobs","compute_admin.view.drift":"Reconciliation","compute_admin.state.nav":"Filter requests by state","compute_admin.state.requested":"Requested","compute_admin.state.active":"Active","compute_admin.state.suspended":"Suspended","compute_admin.state.denied":"Denied","compute_admin.state.revoked":"Revoked","compute_admin.state.all":"All","compute_admin.requests.none":"No accounts in this view.","compute_admin.pager.next":"Next page","compute_admin.pager.first":"First page","compute_admin.row.not_set":"not set","compute_admin.row.no_username":"no username","compute_admin.row.account_kind":"{kind} account","compute_admin.row.stated_country":"Stated country","compute_admin.row.stated_country_hint":"Check this against the export-control rules before granting. This page does not rule on it.","compute_admin.row.city":"City","compute_admin.row.affiliation":"Affiliation","compute_admin.row.email":"Email","compute_admin.row.orcid":"ORCID iD","compute_admin.row.requested":"Requested","compute_admin.row.terms":"Terms accepted","compute_admin.row.terms_value":"{version}, {date}","compute_admin.row.purpose":"Stated purpose","compute_admin.row.show_full_purpose":"Show full purpose","compute_admin.row.granted":"Granted {date} by account #{id}","compute_admin.row.not_notified":"No administrator has been emailed about this request yet.","compute_admin.row.open_in_users":"Open in Users","compute_admin.action.grant":"Grant","compute_admin.action.grant_again":"Grant again","compute_admin.action.lift_suspension":"Lift suspension","compute_admin.action.deny":"Deny","compute_admin.action.suspend":"Suspend","compute_admin.action.revoke":"Revoke","compute_admin.self_grant.disabled":"You cannot grant your own compute access. Ask another administrator or an owner.","compute_admin.dialog.title.grant":"Grant compute access?","compute_admin.dialog.title.deny":"Deny this request?","compute_admin.dialog.title.suspend":"Suspend compute access?","compute_admin.dialog.title.revoke":"Revoke compute access?","compute_admin.dialog.consequence.grant":"Opens the owner\u2019s default allocation once for this account (a repeat grant adds nothing), unfreezes the account\u2019s pools, and allows the person to use compute when it is available. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.deny":"Closes this request. The person cannot ask again; only an administrator can grant later. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.suspend":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. A grant lifts the suspension. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.revoke":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. Only a new grant restores access. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.reason_label":"Reason (optional)","compute_admin.dialog.reason_hint":"Recorded in the audit log. The person is not sent it.","compute_admin.dialog.reason_count":"{count} of {max}","compute_admin.dialog.ack_export_review":"Confirm that you have reviewed this person\u2019s name, affiliation and stated country against the export-control rules","compute_admin.dialog.type_word":"Type {word} to confirm","compute_admin.dialog.cancel":"Cancel","compute_admin.result.working":"Working","compute_admin.result.granted":"Granted.","compute_admin.result.granted_opened":"Granted. Opened {cpu} CPU SU and {gpu} GPU SU.","compute_admin.result.granted_zero_default":"Granted. The owner\u2019s default allocation is zero, so nothing was opened.","compute_admin.result.granted_already":"Granted. An earlier grant already opened the default allocation, so nothing more was opened.","compute_admin.result.granted_other":"Granted. The allocation answered: {reason}.","compute_admin.result.denied":"Denied.","compute_admin.result.suspended":"Suspended. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.revoked":"Revoked. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.email_not_sent":"The decision stands, but the person could not be emailed. Tell them.","compute_admin.result.state_changed":"Someone else may have decided this first. The row shows the current state.","compute_admin.result.unconfirmed":"The result is not confirmed. The row shows what the server says now.","compute_admin.result.check_email":"The decision is in place, but the answer was lost, so check that the person was emailed and tell them if not.","compute_admin.result.stale":"This account was not found. Reload the page.","compute_admin.result.reread_failed":"The current state could not be read. Reload the page before deciding again.","compute_admin.result.signed_out":"You are signed out. Sign in again, then retry.","compute_admin.error.malformed":"The server sent an answer this page could not read.","compute_admin.error.unreachable":"The server could not be reached. Check your connection and try again.","compute_admin.error.redirect":"The server answered in a way this page cannot follow. Try again later.","compute_admin.error.origin":"This page was not accepted as the source of the request. Reload and try again.","compute_admin.error.rate_limited":"Too many requests. Wait a moment, then try again.","compute_admin.error.timeout":"The server did not answer in time. Try again.","compute_admin.error.failed":"The request failed ({status}). Try again.","compute_admin.error.generic":"Something went wrong. Try again.","compute_admin.error.bad_id":"That is not an account id.","compute_admin.error.bad_decision":"That is not a decision.","compute_admin.error.reason_too_long":"A reason is at most {max} characters.","compute_admin.error.bad_quarter":"A quarter is written like 2026Q4.","compute_admin.section.failed":"Could not load {what}: {reason}","compute_admin.col.holder":"Holder","compute_admin.col.pool":"Pool","compute_admin.col.granted":"Granted (SU)","compute_admin.col.held":"Held (SU)","compute_admin.col.charged":"Charged (SU)","compute_admin.col.available":"Available (SU)","compute_admin.col.frozen":"Frozen","compute_admin.col.updated":"Updated","compute_admin.col.partition":"Partition","compute_admin.col.source":"Front door","compute_admin.col.users":"Distinct people","compute_admin.col.jobs":"Jobs","compute_admin.col.job":"Job","compute_admin.col.account":"Account","compute_admin.col.state":"State","compute_admin.col.flags":"Flags","compute_admin.col.failure":"Failure","compute_admin.col.created":"Created","compute_admin.col.ended":"Ended","compute_admin.col.slurm":"Scheduler job","compute_admin.col.elapsed":"Elapsed (s)","compute_admin.col.resources":"Nodes, CPUs, GPUs","compute_admin.col.ingested":"Ingested","compute_admin.ref.account":"account #{id}","compute_admin.ref.no_account":"no account","compute_admin.pools.platform":"Platform budgets","compute_admin.pools.partner":"Partner pools","compute_admin.pools.account":"Account pools","compute_admin.pools.none_platform":"No platform budgets are recorded.","compute_admin.pools.none":"No pools are recorded in this group.","compute_admin.pools.truncated":"Showing the first {shown} pools of this group; more exist.","compute_admin.pools.frozen":"Frozen","compute_admin.pools.open":"Open","compute_admin.usage.quarter":"Quarter","compute_admin.usage.counts_note":"These are counts of people and jobs, not service units. A person is counted once however many jobs they ran, and jobs that skipped the reservation or could not be attributed are left out.","compute_admin.usage.totals":"Total","compute_admin.usage.none":"No jobs were recorded in this quarter.","compute_admin.flag.nav":"Filter jobs by flag","compute_admin.flag.unreserved":"Unreserved","compute_admin.flag.unattributed":"Unattributed","compute_admin.flag.mismatch":"Mismatch","compute_admin.flag.overrun":"Overrun","compute_admin.flag.meaning.unreserved":"The job skipped the reservation. Its charge went to a partner pool and not to a person.","compute_admin.flag.meaning.unattributed":"The job skipped the reservation and its owner maps to no active account.","compute_admin.flag.meaning.mismatch":"NEMAR\u2019s record and the scheduler\u2019s accounting disagree for this job, or a partner\u2019s report for it was refused or could not be checked, or a partner job used more than its hold and was capped.","compute_admin.flag.meaning.overrun":"The job used more than its hold, and the excess is recorded as an overrun in the ledger.","compute_admin.flag.followup":"Moving the charge of an unreserved job to a person is an owner action in the command line.","compute_admin.flagged.none":"No jobs carry this flag. That is a fact about this read only.","compute_admin.flagged.platform_failure":"NEMAR\u2019s fault","compute_admin.flagged.partner":"Partner: {state}, {flag}","compute_admin.drift.paused":"Reconciliation is paused while compute is off. An empty list below does not mean nothing is unmatched.","compute_admin.drift.pause_unknown":"Whether reconciliation is running is not known, so an empty list does not mean nothing is unmatched.","compute_admin.drift.status":"Status","compute_admin.drift.compute_on":"Compute is on.","compute_admin.drift.compute_off":"Compute is off.","compute_admin.drift.tapis":"Scheduler gateway: token {token}, health {health}.","compute_admin.drift.attention":"Needs a person to look","compute_admin.drift.attention_none":"No attention count is positive.","compute_admin.drift.unmatched":"Accounting rows no job claims","compute_admin.drift.unmatched_shown":"Showing the newest {shown} of {total}.","compute_admin.drift.unmatched_none":"No accounting rows are waiting for a job.","compute_admin.drift.not_priced":"not priced","compute_admin.drift.mismatch":"Jobs flagged mismatch","compute_admin.drift.mismatch_more":"See the Flagged jobs view for the rest","compute_admin.unavailable.title":"Not available yet","compute_admin.unavailable.usage_by_day":"Service units charged by day, partition and front door across the platform are not served by any admin read yet.","compute_admin.unavailable.drift_difference":"The difference between NEMAR\u2019s ledger and the supercomputer\u2019s accounting, per job or per day, and the tolerance it is measured against are not served by any admin read yet. No row is marked over tolerance because this page has no tolerance to apply.","compute_admin.unavailable.link":"Tracking issue","compute_admin.badge.awaiting_decision":"awaiting decision","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.compute_access":"to request compute 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.compute_access":"compute 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.affiliation.label":"Affiliation","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.affiliation.set_on.web":"Settings","gap.field.affiliation.set_on.cli":"nemar auth profile set-affiliation","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.","mail.category.news.label":"News","mail.category.news.description":"New features, data and events.","mail.category.rfcs.label":"Requests for comments","mail.category.rfcs.description":"A new NEMAR request for comments is open for discussion.","mail.category.maintenance.label":"Maintenance","mail.category.maintenance.description":"Planned downtime and changes to the service.","mail.category.recall.label":"Recalls","mail.category.recall.description":"A dataset, release or credential NEMAR distributed has a problem you need to act on.","mail.recall.why":"Recalls cannot be turned off: they tell you to stop using, delete or replace something NEMAR distributed or issued, because continuing to use it can cause harm.","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.compute_access.cta":"Ask for it with `nemar compute request-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 J6(e){return typeof e==="string"&&u9.includes(e)}function Q6(e){return typeof e==="string"&&HE.includes(e)}function Z6(e){return Wo[`mail.category.${e}.label`]}function eW(e){return Wo[`mail.category.${e}.description`]}function tW(){return Wo["mail.recall.why"]}function d9(e){return e.replace(/\r\n?/g,`
|
|
33
|
-
`).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function
|
|
32
|
+
[nemar] You can manually copy ${n} to ${t}`)}}function St(){let e=Jl();if(Ko&&PE===e)return Ko;if(zV(e),Ko=new Bi({projectName:"nemar",configFileMode:Zl,schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:e}),PE=e,!CE.has(e))CE.add(e),GV(Ko.path),HV(),BV();return Ko}function GV(e){if(process.platform==="win32")return;if(!Ql(e))return;try{if((LV(e).mode&511)!==Zl)qV(e,Zl)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function HV(){let e=St(),t=e.get("accounts");if(t&&Object.keys(t).length>0)return;let r=e.get("apiKey"),n=e.get("username");if(!r&&!n)return;try{let s=n||"default",o={};for(let a of KV){let i=e.get(a);if(i!==void 0)o[a]=i}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function BV(){let e=St(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,a]of Object.entries(r)){let i=a?.apiUrl;if(!i)continue;if(UV.has(FV(i)))r[o]={...a,apiUrl:Vs},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${i} -> ${Vs}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...a}=t;try{e.store=a,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(i){console.error("API URL cleanup failed (config file unchanged):",i)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ho(){return St().get("activeAccount")}function bn(){return St().get("accounts")||{}}function vn(){let e={apiUrl:Vs},t=Ho();if(!t)return e;return bn()[t]||e}function QB(e,t){let r=St(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Vs};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function ZB(e){let t=Ho();if(!t)return;let r=bn();if(r[t])delete r[t][e],St().set("accounts",r)}function e6(){let e=St(),t=Ho();if(!t){e.clear();return}let r=bn();delete r[t];let n=Object.keys(r);if(n.length>0)e.store={...e.store,accounts:r,activeAccount:n[0]};else e.clear()}function t6(){St().clear()}function r6(){return!!vn().apiKey}function n6(){return St().path}function s6(){let e=bn(),t=Ho();return Object.entries(e).map(([r,n])=>({key:r,username:n.username,email:n.email,githubUsername:n.githubUsername,active:r===t,keySource:n.keySource}))}function o6(e){return e.username?.trim()||e.email}function WV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(bn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){mr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function a6(e,t){let r=St(),n=bn(),s;if(n[e])s=e;else if(t.email)s=WV(t.email);let o=s?n[s]:void 0,a={...o??{apiUrl:Vs},...t};if(s&&s!==e)delete n[s];return n[e]=a,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function i6(e){let t=e.trim();if(!t)return"unchanged";let r=St(),n=Ho();if(!n||n===t)return"unchanged";let s=bn(),o=s[n];if(!o)return"unchanged";if(s[t])return"key_taken";return delete s[n],s[t]={...o,username:t},r.store={...r.store,accounts:s,activeAccount:t},"renamed"}function c6(e){let t=St(),r=bn();if(r[e])return t.store={...t.store,activeAccount:e},r[e];for(let[n,s]of Object.entries(r))if(s.githubUsername===e)return t.store={...t.store,activeAccount:n},s;return null}var Vs="https://nemar-api-dev.sccn-org.workers.dev",Zl=384,UV,VV,JB,Ko=null,PE=null,CE,KV;var mc=L(()=>{V$();_n();oc();Xl();UV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);VV=Z({field:_(),blocks:Ye(_()).optional(),set_on:Ye(_()).optional()}).passthrough(),JB=Z({apiKey:_().optional(),apiUrl:_().url().default(Vs),username:_().optional(),email:_().email().optional(),githubUsername:_().optional(),sandboxCompleted:Ie().optional(),sandboxDatasetId:_().optional(),dismissedNoticeIds:Ye(ne()).optional(),serviceAccess:Ie().optional(),profileGaps:Ye(VV).optional(),orcidVerified:Ie().optional(),role:_().optional(),accountKind:Mn.optional(),pendingEmailChange:_().email().optional()});CE=new Set;KV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var YV,XV,f6,JV,p6,QV,IE,m6,h6=8,g6=100,jE,y6,ZV,_6;var qE=L(()=>{_n();oc();YV=["given_name","family_name","affiliation","city","country"],XV=["username","github_username","email","orcid"],f6=[...YV,...XV],JV={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()},p6=Z(JV),QV=Fe(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),IE=QV.options,m6=["exact","name","prefix","substring","fuzzy"],jE=Z({id:ne().int(),username:_().nullable(),email:_(),github_username:_().nullable(),status:_(),role:_().nullable(),account_kind:Mn.optional(),email_verified:ne().int().nullable().optional(),orcid:_().nullable().optional(),orcid_verified:ne().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:ne().int().nullable().optional(),service_access_granted_at:_().nullable().optional(),service_access_granted_by:ne().int().nullable().optional(),upload_access_requested_at:_().nullable().optional(),upload_access_notified_at:_().nullable().optional(),compute_access:_().optional(),compute_access_requested_at:_().nullable().optional(),compute_access_notified_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional(),compute_access_granted_by:ne().int().nullable().optional(),compute_terms_version:_().nullable().optional(),compute_terms_accepted_at:_().nullable().optional(),identity_conflict:ne().int().nullable().optional(),username_auto_assigned:ne().int().nullable().optional(),sandbox_completed:ne().int().nullable().optional(),sandbox_completed_at:_().nullable().optional(),sandbox_dataset_id:_().nullable().optional(),aws_iam_username:_().nullable().optional(),dataset_count:ne().int().optional(),active_tokens:ne().int().optional(),linked_identities:Ye(_()).optional()}).passthrough(),y6=Z({user:jE}).passthrough(),ZV=Z({from:_().nullable(),to:_().nullable()}),_6=Z({message:_(),changed:NF(_(),ZV),notes:Ye(_()).optional(),old_address_notified:Ie().optional(),user:jE}).passthrough()});function t9(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<32&&r!==9&&r!==10||r===127)return!0}return!1}function x6(e,t){let r=s9[e];if(r==="refused")return t===void 0?null:"notice_refused";let n=t?.trim()??"";if(n==="")return r==="required"?"notice_required":null;if([...n].length>ME)return"notice_too_long";if(t9(n))return"notice_control_char";return null}var w6=20,e9=1000,$6,r9,DE,E6,n9=500,S6=200,ME=1000,s9,R6,LE,k6,o9,T6;var UE=L(()=>{_n();$6=Z({purpose:_().max(e9*4).optional().default(""),accept_terms_version:_().max(64).optional().default("")}),r9=Fe(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),DE=r9.options,E6=Z({ok:gn(!0),already_requested:Ie(),requested_at:_().nullable().optional(),email_sent:Ie().optional(),admins_notified:ne().int().nullable().optional()}).passthrough(),s9={grant:"refused",deny:"optional",suspend:"required",revoke:"required"};R6={reason:_().max(n9).optional(),notice:_().max(ME*4,{message:"notice_too_long"}).optional()},LE=Z({id:ne().int(),username:_().nullable(),email:_(),given_name:_().nullable().optional(),family_name:_().nullable().optional(),affiliation:_().nullable().optional(),city:_().nullable().optional(),country:_().nullable().optional(),orcid:_().nullable().optional(),account_kind:_().optional(),compute_access:_(),compute_access_requested_at:_().nullable().optional(),compute_access_notified_at:_().nullable().optional(),compute_access_granted_at:_().nullable().optional(),compute_access_granted_by:ne().int().nullable().optional(),compute_purpose:_().nullable().optional(),compute_terms_version:_().nullable().optional(),compute_terms_accepted_at:_().nullable().optional()}).passthrough(),k6=Z({accounts:Ye(LE),next_after:ne().int().nullable().optional()}).passthrough(),o9=Z({granted:Ie(),cpu_milli:ne().int(),gpu_milli:ne().int(),reason:_().nullable().optional(),policy_version:ne().int().nullable().optional()}).passthrough(),T6=Z({decision:_(),from:_(),to:_(),account:LE,allocation:o9.optional(),email_sent:Ie().optional()}).passthrough()});var N6=120,P6=64,C6="unnamed machine",a9=25,FE,I6,zs,VE,j6,q6,D6,i9,c9,M6,ed,L6,U6,F6,V6,z6;var zE=L(()=>{_n();FE=Fe(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),I6={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."},zs=Fe(["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"]),VE=zs.options,j6={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 ${a9} 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."},q6=Z({error:zs,message:_()}).passthrough(),D6=Z({device_code:_(),user_code:_(),verification_uri:_(),verification_uri_complete:_(),expires_in:ne().int(),interval:ne().int()}).passthrough(),i9=X$("error",[Z({error:gn("authorization_pending"),message:_()}).passthrough(),Z({error:gn("slow_down"),message:_()}).passthrough()]),c9=X$("error",[Z({error:gn("expired_token"),reason:zs,message:_()}).passthrough(),Z({error:gn("access_denied"),reason:zs,message:_()}).passthrough(),Z({error:gn("invalid_grant"),reason:zs,message:_()}).passthrough()]),M6=OF([i9,c9]),ed=Z({id:ne().int(),name:_().nullable(),prefix:_(),created_at:_(),last_used_at:_().nullable(),current:Ie()}).passthrough(),L6=Z({api_key:_(),key:ed,user:Z({username:_().nullable(),email:_(),github_username:_().nullable(),role:_(),sandbox_completed:Ie(),sandbox_dataset_id:_().nullable()}).passthrough()}).passthrough(),U6=Z({user_code:_(),machine_name:_(),requested_at:_(),expires_in:ne().int(),account:Z({username:_().nullable(),email_masked:_()}).passthrough(),refusal:Z({code:zs,message:_()}).passthrough().nullable()}).passthrough(),F6=Z({ok:gn(!0),machine_name:_()}).passthrough(),V6=Z({keys:Ye(ed)}).passthrough(),z6=Z({api_key:_(),key:ed}).passthrough()});var u9,GE,Bo="https://nemar.org/settings",H6,l9,d9,f9,B6,W6;var KE=L(()=>{_n();u9=Fe(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),GE=u9.options,H6={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, ${Bo}).`,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, ${Bo}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Bo}), 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, ${Bo}).`,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, ${Bo}).`,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."},l9=Fe(["orcid","email","github"]),d9=Z({id:ne().int(),username:_().nullable(),email:_(),created_at:_(),has_oauth_identity:Ie(),dataset_count:ne().int(),identity_conflict:ne().int(),canonical:Ie()}).passthrough(),f9=Z({kind:l9,value:_(),canonical_user_id:ne().int(),accounts:Ye(d9)}).passthrough(),B6=Z({groups:Ye(f9),group_count:ne().int(),flagged_count:ne().int()}).passthrough(),W6=Z({ok:gn(!0),id:ne().int(),cleared:Ie()}).passthrough()});function X6(e){return Wo[e]}function J6(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Wo;var HE=L(()=>{Wo={"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","compute_access.section.title":"Compute access","compute_access.section.lede":"A separate grant from upload access. An admin reviews each request against export-control and local-jurisdiction rules and the purpose you state, and a grant lets you use compute within the limits an administrator sets.","compute_access.state.none":"Not requested","compute_access.state.requested":"Requested","compute_access.state.active":"Active","compute_access.state.suspended":"Suspended","compute_access.state.denied":"Not granted","compute_access.state.revoked":"Ended","compute_access.request.cta":"Request compute access","compute_access.request.form_body":"Tell us what you plan to compute. An admin reviews this alongside your name, affiliation and location, then answers once. You also accept the compute terms.","compute_access.request.purpose_label":"What do you intend to compute?","compute_access.request.purpose_hint":"Describe what you intend to compute in 20-1000 characters","compute_access.request.terms_label":"I accept the compute terms","compute_access.requested.title":"Your compute request is with an admin","compute_access.requested.lede":"An admin is reviewing your request.","compute_access.requested.lede_dated":"An admin is reviewing your request from {date}.","compute_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","compute_access.granted.body":"Compute access is active. Your balances are on your compute page, and you submit jobs with the `nemar compute` command line.","compute_access.granted.link":"Open your compute page","compute_access.closed.body":"This request has been answered and cannot be asked again. If you think that is a mistake, contact support and an admin will take another look.","compute_access.suspended.body":"Your compute access is paused. Contact support to find out why or to ask for it to be lifted.","compute_access.terms_unpublished.body":"Compute access is not open yet: the compute terms are not published. Please check back later.","compute_access.docs_link":"How compute access works","compute_page.frozen.body":"Your pools are frozen, so new jobs are refused. Contact support to find out why.","compute_page.units_note":"Amounts are service units (SU).","compute_page.available_note":"Available is granted minus held minus charged and can be negative after an overrun.","compute_page.queue_note":"It describes the queue of the whole platform, not yours, and it is a recent average, not a promise.","compute_page.usage_note":"Net charge by UTC day of the charge, not the day a job was created. A day with no charge has no bar.","compute_page.unreported_note":"NEMAR has not heard from the cluster about this job for a while. It may still finish.","compute_admin.page.title":"Compute","compute_admin.page.lede":"Compute access requests, and a read-only view of pools, usage, flagged jobs and reconciliation. A grant opens an allocation the person can spend, so each request is decided by a person, one at a time.","compute_admin.page.cli_note":"Owner policy, legal holds, record reads, moving a charge, pool grants and adjustments, and canceling a job are done with the nemar admin compute command in the command line, not here.","compute_admin.page.order_note":"Accounts are listed in the order they were created, not the order they asked in.","compute_admin.view.nav":"Compute views","compute_admin.view.requests":"Requests","compute_admin.view.pools":"Pools","compute_admin.view.usage":"Usage","compute_admin.view.flagged":"Flagged jobs","compute_admin.view.drift":"Reconciliation","compute_admin.state.nav":"Filter requests by state","compute_admin.state.requested":"Requested","compute_admin.state.active":"Active","compute_admin.state.suspended":"Suspended","compute_admin.state.denied":"Denied","compute_admin.state.revoked":"Revoked","compute_admin.state.all":"All","compute_admin.requests.none":"No accounts in this view.","compute_admin.pager.next":"Next page","compute_admin.pager.first":"First page","compute_admin.row.not_set":"not set","compute_admin.row.no_username":"no username","compute_admin.row.account_kind":"{kind} account","compute_admin.row.stated_country":"Stated country","compute_admin.row.stated_country_hint":"Check this against the export-control rules before granting. This page does not rule on it.","compute_admin.row.city":"City","compute_admin.row.affiliation":"Affiliation","compute_admin.row.email":"Email","compute_admin.row.orcid":"ORCID iD","compute_admin.row.requested":"Requested","compute_admin.row.terms":"Terms accepted","compute_admin.row.terms_value":"{version}, {date}","compute_admin.row.purpose":"Stated purpose","compute_admin.row.show_full_purpose":"Show full purpose","compute_admin.row.granted":"Granted {date} by account #{id}","compute_admin.row.not_notified":"No administrator has been emailed about this request yet.","compute_admin.row.open_in_users":"Open in Users","compute_admin.action.grant":"Grant","compute_admin.action.grant_again":"Grant again","compute_admin.action.lift_suspension":"Lift suspension","compute_admin.action.deny":"Deny","compute_admin.action.suspend":"Suspend","compute_admin.action.revoke":"Revoke","compute_admin.self_grant.disabled":"You cannot grant your own compute access. Ask another administrator or an owner.","compute_admin.dialog.title.grant":"Grant compute access?","compute_admin.dialog.title.deny":"Deny this request?","compute_admin.dialog.title.suspend":"Suspend compute access?","compute_admin.dialog.title.revoke":"Revoke compute access?","compute_admin.dialog.consequence.grant":"Opens the owner\u2019s default allocation once for this account (a repeat grant adds nothing), unfreezes the account\u2019s pools, and allows the person to use compute when it is available. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.deny":"Closes this request. The person cannot ask again; only an administrator can grant later. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.suspend":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. A grant lifts the suspension. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.revoke":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. Only a new grant restores access. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.reason_label":"Reason (optional)","compute_admin.dialog.reason_hint":"Recorded in the audit log. The person is not sent it.","compute_admin.dialog.reason_count":"{count} of {max}","compute_admin.dialog.notice_label":"Notice to the person","compute_admin.dialog.notice_label_optional":"Notice to the person (optional)","compute_admin.dialog.notice_help":"Emailed to the person under a fixed heading, with how to ask for a review. Write it for them. It is not the reason, which stays in the audit log.","compute_admin.dialog.notice_required_hint":"A suspension or a revocation tells the person why. Write the notice to confirm.","compute_admin.dialog.ack_export_review":"Confirm that you have reviewed this person\u2019s name, affiliation and stated country against the export-control rules","compute_admin.dialog.type_word":"Type {word} to confirm","compute_admin.dialog.cancel":"Cancel","compute_admin.result.working":"Working","compute_admin.result.granted":"Granted.","compute_admin.result.granted_opened":"Granted. Opened {cpu} CPU SU and {gpu} GPU SU.","compute_admin.result.granted_zero_default":"Granted. The owner\u2019s default allocation is zero, so nothing was opened.","compute_admin.result.granted_already":"Granted. An earlier grant already opened the default allocation, so nothing more was opened.","compute_admin.result.granted_other":"Granted. The allocation answered: {reason}.","compute_admin.result.denied":"Denied.","compute_admin.result.suspended":"Suspended. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.revoked":"Revoked. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.email_not_sent":"The decision stands, but the person could not be emailed. Tell them.","compute_admin.result.state_changed":"Someone else may have decided this first. The row shows the current state.","compute_admin.result.unconfirmed":"The result is not confirmed. The row shows what the server says now.","compute_admin.result.check_email":"The decision is in place, but the answer was lost, so check that the person was emailed and tell them if not.","compute_admin.result.stale":"This account was not found. Reload the page.","compute_admin.result.reread_failed":"The current state could not be read. Reload the page before deciding again.","compute_admin.result.signed_out":"You are signed out. Sign in again, then retry.","compute_admin.error.malformed":"The server sent an answer this page could not read.","compute_admin.error.unreachable":"The server could not be reached. Check your connection and try again.","compute_admin.error.redirect":"The server answered in a way this page cannot follow. Try again later.","compute_admin.error.origin":"This page was not accepted as the source of the request. Reload and try again.","compute_admin.error.rate_limited":"Too many requests. Wait a moment, then try again.","compute_admin.error.timeout":"The server did not answer in time. Try again.","compute_admin.error.failed":"The request failed ({status}). Try again.","compute_admin.error.generic":"Something went wrong. Try again.","compute_admin.error.bad_id":"That is not an account id.","compute_admin.error.bad_decision":"That is not a decision.","compute_admin.error.reason_too_long":"A reason is at most {max} characters.","compute_admin.error.notice_required":"This decision needs a notice to the person.","compute_admin.error.notice_refused":"A grant does not take a notice to the person.","compute_admin.error.notice_too_long":"A notice is at most {max} characters.","compute_admin.error.notice_control_char":"A notice may not contain control characters other than newline and tab.","compute_admin.error.bad_quarter":"A quarter is written like 2026Q4.","compute_admin.section.failed":"Could not load {what}: {reason}","compute_admin.col.holder":"Holder","compute_admin.col.pool":"Pool","compute_admin.col.granted":"Granted (SU)","compute_admin.col.held":"Held (SU)","compute_admin.col.charged":"Charged (SU)","compute_admin.col.available":"Available (SU)","compute_admin.col.frozen":"Frozen","compute_admin.col.updated":"Updated","compute_admin.col.partition":"Partition","compute_admin.col.source":"Front door","compute_admin.col.users":"Distinct people","compute_admin.col.jobs":"Jobs","compute_admin.col.job":"Job","compute_admin.col.account":"Account","compute_admin.col.state":"State","compute_admin.col.flags":"Flags","compute_admin.col.failure":"Failure","compute_admin.col.created":"Created","compute_admin.col.ended":"Ended","compute_admin.col.slurm":"Scheduler job","compute_admin.col.elapsed":"Elapsed (s)","compute_admin.col.resources":"Nodes, CPUs, GPUs","compute_admin.col.ingested":"Ingested","compute_admin.ref.account":"account #{id}","compute_admin.ref.no_account":"no account","compute_admin.pools.platform":"Platform budgets","compute_admin.pools.partner":"Partner pools","compute_admin.pools.account":"Account pools","compute_admin.pools.none_platform":"No platform budgets are recorded.","compute_admin.pools.none":"No pools are recorded in this group.","compute_admin.pools.truncated":"Showing the first {shown} pools of this group; more exist.","compute_admin.pools.frozen":"Frozen","compute_admin.pools.open":"Open","compute_admin.usage.quarter":"Quarter","compute_admin.usage.counts_note":"These are counts of people and jobs, not service units. A person is counted once however many jobs they ran, and jobs that skipped the reservation or could not be attributed are left out.","compute_admin.usage.totals":"Total","compute_admin.usage.none":"No jobs were recorded in this quarter.","compute_admin.flag.nav":"Filter jobs by flag","compute_admin.flag.unreserved":"Unreserved","compute_admin.flag.unattributed":"Unattributed","compute_admin.flag.mismatch":"Mismatch","compute_admin.flag.overrun":"Overrun","compute_admin.flag.meaning.unreserved":"The job skipped the reservation. Its charge went to a partner pool and not to a person.","compute_admin.flag.meaning.unattributed":"The job skipped the reservation and its owner maps to no active account.","compute_admin.flag.meaning.mismatch":"NEMAR\u2019s record and the scheduler\u2019s accounting disagree for this job, or a partner\u2019s report for it was refused or could not be checked, or a partner job used more than its hold and was capped.","compute_admin.flag.meaning.overrun":"The job used more than its hold, and the excess is recorded as an overrun in the ledger.","compute_admin.flag.followup":"Moving the charge of an unreserved job to a person is an owner action in the command line.","compute_admin.flagged.none":"No jobs carry this flag. That is a fact about this read only.","compute_admin.flagged.platform_failure":"NEMAR\u2019s fault","compute_admin.flagged.partner":"Partner: {state}, {flag}","compute_admin.drift.paused":"Reconciliation is paused while compute is off. An empty list below does not mean nothing is unmatched.","compute_admin.drift.pause_unknown":"Whether reconciliation is running is not known, so an empty list does not mean nothing is unmatched.","compute_admin.drift.status":"Status","compute_admin.drift.compute_on":"Compute is on.","compute_admin.drift.compute_off":"Compute is off.","compute_admin.drift.tapis":"Scheduler gateway: token {token}, health {health}.","compute_admin.drift.attention":"Needs a person to look","compute_admin.drift.attention_none":"No attention count is positive.","compute_admin.drift.unmatched":"Accounting rows no job claims","compute_admin.drift.unmatched_shown":"Showing the newest {shown} of {total}.","compute_admin.drift.unmatched_none":"No accounting rows are waiting for a job.","compute_admin.drift.not_priced":"not priced","compute_admin.drift.mismatch":"Jobs flagged mismatch","compute_admin.drift.mismatch_more":"See the Flagged jobs view for the rest","compute_admin.unavailable.title":"Not available yet","compute_admin.unavailable.usage_by_day":"Service units charged by day, partition and front door across the platform are not served by any admin read yet.","compute_admin.unavailable.drift_difference":"The difference between NEMAR\u2019s ledger and the supercomputer\u2019s accounting, per job or per day, and the tolerance it is measured against are not served by any admin read yet. No row is marked over tolerance because this page has no tolerance to apply.","compute_admin.unavailable.link":"Tracking issue","compute_admin.badge.awaiting_decision":"awaiting decision","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.compute_access":"to request compute 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.compute_access":"compute 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.affiliation.label":"Affiliation","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.affiliation.set_on.web":"Settings","gap.field.affiliation.set_on.cli":"nemar auth profile set-affiliation","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.","mail.category.news.label":"News","mail.category.news.description":"New features, data and events.","mail.category.rfcs.label":"Requests for comments","mail.category.rfcs.description":"A new NEMAR request for comments is open for discussion.","mail.category.maintenance.label":"Maintenance","mail.category.maintenance.description":"Planned downtime and changes to the service.","mail.category.recall.label":"Recalls","mail.category.recall.description":"A dataset, release or credential NEMAR distributed has a problem you need to act on.","mail.recall.why":"Recalls cannot be turned off: they tell you to stop using, delete or replace something NEMAR distributed or issued, because continuing to use it can cause harm.","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.compute_access.cta":"Ask for it with `nemar compute request-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 tW(e){return typeof e==="string"&&p9.includes(e)}function rW(e){return typeof e==="string"&&BE.includes(e)}function nW(e){return Wo[`mail.category.${e}.label`]}function sW(e){return Wo[`mail.category.${e}.description`]}function oW(){return Wo["mail.recall.why"]}function h9(e){return e.replace(/\r\n?/g,`
|
|
33
|
+
`).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function g9(e){let t=/^(#{1,3})\s+(.+)$/.exec(e);if(!t)return null;return{level:t[1].length,text:t[2]}}function aW(e){let t=new Set(h9(e).map((r)=>g9(r)?.text.trim().toLowerCase()).filter((r)=>Boolean(r)));return m9.filter((r)=>!t.has(r.toLowerCase()))}function iW(e){let t=e.trim(),r=y9.exec(t);if(r)return{kind:"dataset",datasetId:r[1],version:r[2]??null,text:t};if(_9.test(t))return{kind:"github",url:t,text:t};return null}var BE,p9,eW="recall",WE,m9,y9,_9,cW="A recall needs a reference: a dataset id with an optional version (nm000104 or nm000104@v1.2.0), or a nemarOrg or nemarDatasets issue, pull request or security advisory URL.";var YE=L(()=>{HE();BE=["news","rfcs","maintenance"],p9=[...BE,"recall"];WE=["recall_cannot_be_turned_off","admin_alert_not_self_service","unknown_mail_preference","invalid_mail_preference"];m9=["What is affected","What to do"];y9=/^([a-z]{2}\d{6})(?:@v?(\d+\.\d+\.\d+))?$/,_9=/^https:\/\/github\.com\/(?:nemarOrg|nemarDatasets)\/[A-Za-z0-9._-]+\/(?:(?:issues|pull)\/\d{1,9}|security\/advisories\/GHSA(?:-[a-z0-9]{4}){3})$/});function mW(e){return typeof e==="string"&&b9.includes(e)}var v9,dW,fW,pW,b9,w9="ci_check_unavailable",XE,JE,QE,hW="X-Approval-Dispatch-Token",gW,yW="Search reflects this at once; the public dataset page and catalog list are cached at the edge and can keep showing the dataset for several minutes.";var ZE=L(()=>{_n();v9=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,dW=_().regex(v9,"ORCID must be in format 0000-0000-0000-000X"),fW=Fe(["found","no_public_name","lookup_failed"]),pW=Fe(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),b9=["bids_validation_pending","bids_validation_in_progress"];XE=[w9],JE=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],QE=["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"],gW=Fe(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});function tS(e){if(eS)return;eS=!0;let t=Pt.yellow("\u2500".repeat(60)),r=Pt.yellow.bold("[MAINTENANCE]"),n=Pt.dim(`mode: ${e.mode}`),s=e.eta?`
|
|
34
34
|
${Pt.dim(`eta: ${e.eta}`)}`:"";process.stderr.write(`${t}
|
|
35
35
|
${r} ${e.message}
|
|
36
36
|
${n}${s}
|
|
37
37
|
${t}
|
|
38
|
-
`)}var ZE=!1;var tS=L(()=>{Fl()});function rS(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(rd)return td;return vn().apiUrl||td}async function AW(e,t={},r=!1,n,s="json",o){let a=`${rS()}${e}`,i={"Content-Type":"application/json","X-CLI-Version":uc,...t.headers};if(r){let p=vn();if(!p.apiKey&&r===!0)throw new pr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)i.Authorization=`Bearer ${p.apiKey}`}let c=t.method||"GET",u=typeof t.body==="string"?t.body:void 0,l=Date.now(),d;try{let p=[...t.signal?[t.signal]:[],...o===void 0?[]:[AbortSignal.timeout(o)]];d=await fetch(a,{...t,headers:i,...p.length===0?{}:{signal:p.length===1?p[0]:AbortSignal.any(p)}})}catch(p){if(fc())pc({method:c,url:a,status:null,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,error:p instanceof Error?p.message:String(p)});throw new pr(0,`Network error: Could not connect to ${rS()}`,{originalError:p instanceof Error?p.message:String(p)})}let m;try{m=await d.text()}catch(p){if(fc())pc({method:c,url:a,status:d.status,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,error:p instanceof Error?p.message:String(p)});throw new pr(0,"Failed to read response body",{httpStatus:d.status,originalError:p instanceof Error?p.message:String(p)})}if(fc())pc({method:c,url:a,status:d.status,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,responseBody:m});if(s==="text"&&d.ok)return{text:m,headers:d.headers};let f;try{f=JSON.parse(m)}catch{throw new pr(d.status,`Invalid response from server (status ${d.status})`)}if(!d.ok){if(d.status===503&&(f.mode==="read-only"||f.mode==="full")){let hr=typeof f.message==="string"?f.message:"NEMAR is in maintenance mode. Please retry shortly.",wn=typeof f.eta==="string"?f.eta:null,Ln=new Cl(f.mode,hr,wn,f.details);throw eS(Ln),Ln}let p=typeof f.block_reason==="string",h=Array.isArray(f.missing)?f.missing.filter((hr)=>typeof hr==="string"):void 0,y=typeof f.error==="string"&&(tE.includes(f.error)||zE.includes(f.error)),v=typeof f.error==="string"&&(UE.options.includes(f.error)||FE.includes(f.error)),A=typeof f.error==="string"&&Q$.includes(f.error),k=typeof f.error==="string"&&CE.includes(f.error),M=typeof f.error==="string"&&XE.includes(f.error),S=typeof f.error==="string"&&YE.includes(f.error),$e=typeof f.error==="string"&&JE.includes(f.error),je=typeof f.error==="string"&&BE.includes(f.error),Ct=p||je||S||$e||y||v||A||k||M||h!==void 0&&typeof f.error==="string"&&eE.includes(f.error)||h!==void 0&&typeof f.error==="string"&&DE.includes(f.error)?f.message||f.error:f.error||f.message;if(d.status===404&&f.error==="Not Found"&&typeof f.message==="string")Ct=`${f.message}. This NEMAR backend does not support this command yet.`;let Ve=new pr(d.status,Ct||"Request failed",f.details,typeof f.step==="string"?f.step:void 0,p?f.block_reason:void 0,h);if(typeof f.error==="string")Ve.code=f.error;if(typeof f.reason==="string")Ve.reason=f.reason;Ve.rawBody=f;let xt=Number(d.headers.get("retry-after"));if(d.headers.get("retry-after")!==null&&Number.isFinite(xt)&&xt>=0)Ve.retryAfterSeconds=xt;throw Ve}if(n){let p=n.safeParse(f);if(!p.success)throw new pr(d.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return f}var td="https://nemar-api-dev.sccn-org.workers.dev",rd;var nS=L(()=>{qE();LE();VE();GE();WE();QE();oc();mc();Xl();tS();Kl();jl();rd=td.includes("workers.dev")});mc();import{open as x9,rm as R9}from"fs/promises";nS();var sS="NEMAR_DATA_HOSTS",_9="NEMAR_DATA_HOSTS_ONLY",v9="https://private.nemar.org",b9="https://private-test.nemar.org",w9=/^[a-z]{2,3}[0-9]{6}$/;function oS(e){return w9.test(e)}function $9(e){return e}function aS(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function iS(e){let t=e.trim();if(t===""||/[?#@]/.test(t))return null;let r;try{r=new URL(t)}catch{return null}if(r.username!==""||r.password!=="")return null;if(r.pathname!=="/")return null;if(r.protocol==="https:")return r.origin;if(r.protocol==="http:"&&aS(r.hostname))return r.origin;return null}function cS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=iS(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function uS(e){return e.env??process.env}function E9(e={}){let t=uS(e),r=e.isDevBuild??rd,n=t[_9]==="1"?[]:[r?b9:v9],{origins:s}=cS(t[sS]);return[...n,...s.filter((o)=>!n.includes(o))].map($9)}function PW(e={}){return cS(uS(e)[sS]).rejected}function gc(e,t={}){let r=iS(e);if(r===null)return null;return E9(t).find((n)=>n===r)??null}function lS(e,t={}){return gc(e,t)!==null}function IW(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return gc(r.origin,t)}function dS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&aS(e.hostname)&&new URL(t).protocol==="http:"}var S9="NEMAR_DATA_HOST_TIMEOUT_MS";function nd(e,t=process.env){let r=t[S9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function sd(e){if(!(e instanceof Error))return"error";let t=e.code;return typeof t==="string"&&/^[A-Z][A-Z0-9_]+$/.test(t)?`${e.name} ${t}`:e.name}var fS=3,mS=60000,k9=262144,hS=255,gS=/^[A-Z0-9][A-Z0-9_]*-s([0-9]{1,16})(?:-S([0-9]{1,16})-C([0-9]{1,16}))?--[A-Za-z0-9._-]+$/;function yS(e){return e.length<=hS&&gS.test(e)}function T9(e){if(e.length>hS)return null;let t=gS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function A9(e,t,r={}){if(!e)return{ok:!1,message:"The remote has no host setting."};if(!t)return{ok:!1,message:"The remote has no dataset setting."};if(!oS(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=gc(e,r);if(n===null)return{ok:!1,message:`The host setting ${It(e)} is not an https origin on this CLI's list of data hosts. The remote's host setting is part of the repository, so it cannot add one.`};return{ok:!0,settings:{origin:n,dataset:t,options:r}}}function It(e,t=200){let r=e.replace(/[^\x20-\x7e]/g,"?");return r.length>t?`${r.slice(0,t)}...`:r}function O9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function _S(e,t){if(t)return`The storage address was refused (status ${e}).`;if(e===401)return"The data host refused the API key. Run 'nemar auth login' to sign in again.";if(e===404)return"The data host has no such object, or this account has no access to the dataset.";if(e===429)return"The data host is limiting requests; try again shortly.";return`The data host answered status ${e}.`}async function vS(e,t,r,n,s,o){if(!lS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let a=O9(e,t),i=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(a.origin===e.origin)u.Authorization=`Bearer ${r}`;let l;try{l=await fetch(a,{method:n,headers:u,redirect:"manual",signal:o})}catch(f){if(o.aborted)return{kind:"failed",message:"The request timed out."};return{kind:"failed",message:`Could not reach the host (${sd(f)}).`}}if(l.status<300||l.status>=400)return{kind:"response",response:l,redirected:i};if(await l.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:l,redirected:i};if(c>=fS)return{kind:"failed",message:`More than ${fS} redirects.`};let d=l.headers.get("location");if(!d)return{kind:"failed",message:"A redirect named no address."};let m;try{m=new URL(d,a)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!dS(m,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};a=m,i=!0}}async function bS(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(),e),s=()=>{clearTimeout(n),n=setTimeout(()=>r.abort(),e)};try{return await t(r.signal,s)}finally{clearTimeout(n)}}async function N9(e,t,r,n,s){if(!yS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=T9(t);return bS(nd(mS,e.options?.env),async(a,i)=>{let c=await vS(e,t,r,"GET",!0,a);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:l}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:_S(u.status,l)};let d=u.headers.get("content-length");if(o!==null&&d!==null&&Number(d)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${It(d,20)} bytes but its key says ${o}.`};i();let m,f=0,p=0;try{m=await x9(n,"w");let h=u.body.getReader();while(!0){let{done:y,value:v}=await h.read();if(y)break;if(i(),f+=v.byteLength,o!==null&&f>o)throw await h.cancel().catch(()=>{}),new yc(`More bytes arrived than the key's ${o}.`);if(await m.write(v),f-p>=k9)p=f,s(f)}if(await m.close(),m=void 0,o!==null&&f!==o)throw new yc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==p)s(f);return{ok:!0,bytes:f}}catch(h){if(await m?.close().catch(()=>{}),await R9(n,{force:!0}).catch(()=>{}),h instanceof yc)return{ok:!1,message:h.message};if(a.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${sd(h)}).`}}})}class yc extends Error{constructor(e){super(e);this.name="SizeError"}}async function P9(e,t,r){if(!yS(t))return{state:"unknown",message:"The key is not one a data host serves."};return bS(nd(mS,e.options?.env),async(n)=>{let s=await vS(e,t,r,"HEAD",!1,n);if(s.kind==="failed")return{state:"unknown",message:s.message};let{status:o}=s.response;if(await s.response.body?.cancel().catch(()=>{}),o===200)return{state:"present"};if(o===404)return{state:"absent"};return{state:"unknown",message:_S(o,!1)}})}class _c extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function wS(e,t){let r=e.lines[Symbol.asyncIterator](),n=[],s=null,o=null,a=async()=>{let l=n.shift();if(l!==void 0)return l;let d=await r.next();return d.done?null:d.value},i=async(l)=>{await e.send(`GETCONFIG ${l}`);while(!0){let d=await r.next();if(d.done)throw new _c("git-annex closed the connection");let m=d.value;if(m==="VALUE"||m.startsWith("VALUE ")){let f=m.slice(5).trimStart();return f===""?void 0:f}if(m.startsWith("ERROR"))throw new _c(m);n.push(m)}},c=async()=>{let l=await i("host"),d=await i("dataset");return A9(l,d,t.options)},u=async(l,d)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${It(l)} The remote has not been prepared.`);return}let m=Promise.resolve(),f=await N9(s,l,o,d,(p)=>{m=m.then(()=>e.send(`PROGRESS ${p}`))});if(await m,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${l}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${It(l)} ${It(f.message)}`)};await e.send("VERSION 1");while(!0){let l=await a();if(l===null)return 0;if(l.trim()==="")continue;let[d,...m]=pS(l,1),f=m[0]??"";try{switch(d){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let p=await c();await e.send(p.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${It(p.message)}`);break}case"PREPARE":{let p=await c();if(!p.ok){s=null,await e.send(`PREPARE-FAILURE ${It(p.message)}`);break}let h=t.loadApiKey();if(!h){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=p.settings,o=h,await e.send("PREPARE-SUCCESS");break}case"LISTCONFIGS":await e.send("CONFIG host The https origin of the NEMAR data host"),await e.send("CONFIG dataset The dataset id on that host"),await e.send("CONFIGEND");break;case"GETCOST":await e.send("COST 200");break;case"GETAVAILABILITY":await e.send("AVAILABILITY GLOBAL");break;case"GETINFO":if(s)await e.send("INFOFIELD host"),await e.send(`INFOVALUE ${s.origin}`),await e.send("INFOFIELD dataset"),await e.send(`INFOVALUE ${s.dataset}`);await e.send("INFOEND");break;case"EXPORTSUPPORTED":await e.send("EXPORTSUPPORTED-FAILURE");break;case"IMPORTSUPPORTED":await e.send("IMPORTSUPPORTED-FAILURE");break;case"WHEREIS":await e.send("WHEREIS-FAILURE");break;case"CLAIMURL":await e.send("CLAIMURL-FAILURE");break;case"CHECKURL":await e.send("CHECKURL-FAILURE");break;case"TRANSFER":{let[p,h,...y]=pS(f,2);if(p==="STORE")await e.send(`TRANSFER-FAILURE STORE ${It(h??"")} This remote is read-only for now.`);else if(p==="RETRIEVE"&&h&&y[0])await u(h,y[0]);else await e.send("UNSUPPORTED-REQUEST");break}case"CHECKPRESENT":{if(!f){await e.send("UNSUPPORTED-REQUEST");break}if(!s||!o){await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} The remote has not been prepared.`);break}let p=await P9(s,f,o);if(p.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(p.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} ${p.message}`);break}case"REMOVE":await e.send(`REMOVE-FAILURE ${It(f)} This remote is read-only for now.`);break;case"ERROR":return 1;case"VALUE":break;default:await e.send("UNSUPPORTED-REQUEST")}}catch(p){if(p instanceof _c)return 1;throw p}}}function pS(e,t){let r=[],n=e;for(let s=0;s<t;s++){let o=n.indexOf(" ");if(o<0)break;r.push(n.slice(0,o)),n=n.slice(o+1)}return r.push(n),r}async function*I9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
|
|
38
|
+
`)}var eS=!1;var rS=L(()=>{Fl()});function nS(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(rd)return td;return vn().apiUrl||td}async function CW(e,t={},r=!1,n,s="json",o){let a=`${nS()}${e}`,i={"Content-Type":"application/json","X-CLI-Version":uc,...t.headers};if(r){let p=vn();if(!p.apiKey&&r===!0)throw new pr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)i.Authorization=`Bearer ${p.apiKey}`}let c=t.method||"GET",u=typeof t.body==="string"?t.body:void 0,l=Date.now(),d;try{let p=[...t.signal?[t.signal]:[],...o===void 0?[]:[AbortSignal.timeout(o)]];d=await fetch(a,{...t,headers:i,...p.length===0?{}:{signal:p.length===1?p[0]:AbortSignal.any(p)}})}catch(p){if(fc())pc({method:c,url:a,status:null,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,error:p instanceof Error?p.message:String(p)});throw new pr(0,`Network error: Could not connect to ${nS()}`,{originalError:p instanceof Error?p.message:String(p)})}let m;try{m=await d.text()}catch(p){if(fc())pc({method:c,url:a,status:d.status,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,error:p instanceof Error?p.message:String(p)});throw new pr(0,"Failed to read response body",{httpStatus:d.status,originalError:p instanceof Error?p.message:String(p)})}if(fc())pc({method:c,url:a,status:d.status,durationMs:Date.now()-l,requestHeaders:i,requestBody:u,responseBody:m});if(s==="text"&&d.ok)return{text:m,headers:d.headers};let f;try{f=JSON.parse(m)}catch{throw new pr(d.status,`Invalid response from server (status ${d.status})`)}if(!d.ok){if(d.status===503&&(f.mode==="read-only"||f.mode==="full")){let hr=typeof f.message==="string"?f.message:"NEMAR is in maintenance mode. Please retry shortly.",wn=typeof f.eta==="string"?f.eta:null,Ln=new Il(f.mode,hr,wn,f.details);throw tS(Ln),Ln}let p=typeof f.block_reason==="string",h=Array.isArray(f.missing)?f.missing.filter((hr)=>typeof hr==="string"):void 0,y=typeof f.error==="string"&&(tE.includes(f.error)||GE.includes(f.error)),v=typeof f.error==="string"&&(FE.options.includes(f.error)||VE.includes(f.error)),A=typeof f.error==="string"&&Q$.includes(f.error),k=typeof f.error==="string"&&IE.includes(f.error),M=typeof f.error==="string"&&JE.includes(f.error),S=typeof f.error==="string"&&XE.includes(f.error),$e=typeof f.error==="string"&&QE.includes(f.error),je=typeof f.error==="string"&&WE.includes(f.error),It=p||je||S||$e||y||v||A||k||M||h!==void 0&&typeof f.error==="string"&&eE.includes(f.error)||h!==void 0&&typeof f.error==="string"&&DE.includes(f.error)?f.message||f.error:f.error||f.message;if(d.status===404&&f.error==="Not Found"&&typeof f.message==="string")It=`${f.message}. This NEMAR backend does not support this command yet.`;let Ve=new pr(d.status,It||"Request failed",f.details,typeof f.step==="string"?f.step:void 0,p?f.block_reason:void 0,h);if(typeof f.error==="string")Ve.code=f.error;if(typeof f.reason==="string")Ve.reason=f.reason;Ve.rawBody=f;let xt=Number(d.headers.get("retry-after"));if(d.headers.get("retry-after")!==null&&Number.isFinite(xt)&&xt>=0)Ve.retryAfterSeconds=xt;throw Ve}if(n){let p=n.safeParse(f);if(!p.success)throw new pr(d.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return f}var td="https://nemar-api-dev.sccn-org.workers.dev",rd;var sS=L(()=>{qE();UE();zE();KE();YE();ZE();oc();mc();Xl();rS();Kl();jl();rd=td.includes("workers.dev")});mc();import{open as A9,rm as O9}from"fs/promises";sS();var oS="NEMAR_DATA_HOSTS",$9="NEMAR_DATA_HOSTS_ONLY",E9="https://private.nemar.org",S9="https://private-test.nemar.org",x9=/^[a-z]{2,3}[0-9]{6}$/;function aS(e){return x9.test(e)}function R9(e){return e}function iS(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function cS(e){let t=e.trim();if(t===""||/[?#@]/.test(t))return null;let r;try{r=new URL(t)}catch{return null}if(r.username!==""||r.password!=="")return null;if(r.pathname!=="/")return null;if(r.protocol==="https:")return r.origin;if(r.protocol==="http:"&&iS(r.hostname))return r.origin;return null}function uS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=cS(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function lS(e){return e.env??process.env}function k9(e={}){let t=lS(e),r=e.isDevBuild??rd,n=t[$9]==="1"?[]:[r?S9:E9],{origins:s}=uS(t[oS]);return[...n,...s.filter((o)=>!n.includes(o))].map(R9)}function qW(e={}){return uS(lS(e)[oS]).rejected}function gc(e,t={}){let r=cS(e);if(r===null)return null;return k9(t).find((n)=>n===r)??null}function dS(e,t={}){return gc(e,t)!==null}function DW(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return gc(r.origin,t)}function fS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&iS(e.hostname)&&new URL(t).protocol==="http:"}var T9="NEMAR_DATA_HOST_TIMEOUT_MS";function nd(e,t=process.env){let r=t[T9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function sd(e){if(!(e instanceof Error))return"error";let t=e.code;return typeof t==="string"&&/^[A-Z][A-Z0-9_]+$/.test(t)?`${e.name} ${t}`:e.name}var pS=3,hS=60000,N9=262144,gS=255,yS=/^[A-Z0-9][A-Z0-9_]*-s([0-9]{1,16})(?:-S([0-9]{1,16})-C([0-9]{1,16}))?--[A-Za-z0-9._-]+$/;function _S(e){return e.length<=gS&&yS.test(e)}function P9(e){if(e.length>gS)return null;let t=yS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function C9(e,t,r={}){if(!e)return{ok:!1,message:"The remote has no host setting."};if(!t)return{ok:!1,message:"The remote has no dataset setting."};if(!aS(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=gc(e,r);if(n===null)return{ok:!1,message:`The host setting ${Ct(e)} is not an https origin on this CLI's list of data hosts. The remote's host setting is part of the repository, so it cannot add one.`};return{ok:!0,settings:{origin:n,dataset:t,options:r}}}function Ct(e,t=200){let r=e.replace(/[^\x20-\x7e]/g,"?");return r.length>t?`${r.slice(0,t)}...`:r}function I9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function vS(e,t){if(t)return`The storage address was refused (status ${e}).`;if(e===401)return"The data host refused the API key. Run 'nemar auth login' to sign in again.";if(e===404)return"The data host has no such object, or this account has no access to the dataset.";if(e===429)return"The data host is limiting requests; try again shortly.";return`The data host answered status ${e}.`}async function bS(e,t,r,n,s,o){if(!dS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let a=I9(e,t),i=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(a.origin===e.origin)u.Authorization=`Bearer ${r}`;let l;try{l=await fetch(a,{method:n,headers:u,redirect:"manual",signal:o})}catch(f){if(o.aborted)return{kind:"failed",message:"The request timed out."};return{kind:"failed",message:`Could not reach the host (${sd(f)}).`}}if(l.status<300||l.status>=400)return{kind:"response",response:l,redirected:i};if(await l.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:l,redirected:i};if(c>=pS)return{kind:"failed",message:`More than ${pS} redirects.`};let d=l.headers.get("location");if(!d)return{kind:"failed",message:"A redirect named no address."};let m;try{m=new URL(d,a)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!fS(m,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};a=m,i=!0}}async function wS(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(),e),s=()=>{clearTimeout(n),n=setTimeout(()=>r.abort(),e)};try{return await t(r.signal,s)}finally{clearTimeout(n)}}async function j9(e,t,r,n,s){if(!_S(t))return{ok:!1,message:"The key is not one a data host serves."};let o=P9(t);return wS(nd(hS,e.options?.env),async(a,i)=>{let c=await bS(e,t,r,"GET",!0,a);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:l}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:vS(u.status,l)};let d=u.headers.get("content-length");if(o!==null&&d!==null&&Number(d)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${Ct(d,20)} bytes but its key says ${o}.`};i();let m,f=0,p=0;try{m=await A9(n,"w");let h=u.body.getReader();while(!0){let{done:y,value:v}=await h.read();if(y)break;if(i(),f+=v.byteLength,o!==null&&f>o)throw await h.cancel().catch(()=>{}),new yc(`More bytes arrived than the key's ${o}.`);if(await m.write(v),f-p>=N9)p=f,s(f)}if(await m.close(),m=void 0,o!==null&&f!==o)throw new yc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==p)s(f);return{ok:!0,bytes:f}}catch(h){if(await m?.close().catch(()=>{}),await O9(n,{force:!0}).catch(()=>{}),h instanceof yc)return{ok:!1,message:h.message};if(a.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${sd(h)}).`}}})}class yc extends Error{constructor(e){super(e);this.name="SizeError"}}async function q9(e,t,r){if(!_S(t))return{state:"unknown",message:"The key is not one a data host serves."};return wS(nd(hS,e.options?.env),async(n)=>{let s=await bS(e,t,r,"HEAD",!1,n);if(s.kind==="failed")return{state:"unknown",message:s.message};let{status:o}=s.response;if(await s.response.body?.cancel().catch(()=>{}),o===200)return{state:"present"};if(o===404)return{state:"absent"};return{state:"unknown",message:vS(o,!1)}})}class _c extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function $S(e,t){let r=e.lines[Symbol.asyncIterator](),n=[],s=null,o=null,a=async()=>{let l=n.shift();if(l!==void 0)return l;let d=await r.next();return d.done?null:d.value},i=async(l)=>{await e.send(`GETCONFIG ${l}`);while(!0){let d=await r.next();if(d.done)throw new _c("git-annex closed the connection");let m=d.value;if(m==="VALUE"||m.startsWith("VALUE ")){let f=m.slice(5).trimStart();return f===""?void 0:f}if(m.startsWith("ERROR"))throw new _c(m);n.push(m)}},c=async()=>{let l=await i("host"),d=await i("dataset");return C9(l,d,t.options)},u=async(l,d)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${Ct(l)} The remote has not been prepared.`);return}let m=Promise.resolve(),f=await j9(s,l,o,d,(p)=>{m=m.then(()=>e.send(`PROGRESS ${p}`))});if(await m,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${l}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${Ct(l)} ${Ct(f.message)}`)};await e.send("VERSION 1");while(!0){let l=await a();if(l===null)return 0;if(l.trim()==="")continue;let[d,...m]=mS(l,1),f=m[0]??"";try{switch(d){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let p=await c();await e.send(p.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${Ct(p.message)}`);break}case"PREPARE":{let p=await c();if(!p.ok){s=null,await e.send(`PREPARE-FAILURE ${Ct(p.message)}`);break}let h=t.loadApiKey();if(!h){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=p.settings,o=h,await e.send("PREPARE-SUCCESS");break}case"LISTCONFIGS":await e.send("CONFIG host The https origin of the NEMAR data host"),await e.send("CONFIG dataset The dataset id on that host"),await e.send("CONFIGEND");break;case"GETCOST":await e.send("COST 200");break;case"GETAVAILABILITY":await e.send("AVAILABILITY GLOBAL");break;case"GETINFO":if(s)await e.send("INFOFIELD host"),await e.send(`INFOVALUE ${s.origin}`),await e.send("INFOFIELD dataset"),await e.send(`INFOVALUE ${s.dataset}`);await e.send("INFOEND");break;case"EXPORTSUPPORTED":await e.send("EXPORTSUPPORTED-FAILURE");break;case"IMPORTSUPPORTED":await e.send("IMPORTSUPPORTED-FAILURE");break;case"WHEREIS":await e.send("WHEREIS-FAILURE");break;case"CLAIMURL":await e.send("CLAIMURL-FAILURE");break;case"CHECKURL":await e.send("CHECKURL-FAILURE");break;case"TRANSFER":{let[p,h,...y]=mS(f,2);if(p==="STORE")await e.send(`TRANSFER-FAILURE STORE ${Ct(h??"")} This remote is read-only for now.`);else if(p==="RETRIEVE"&&h&&y[0])await u(h,y[0]);else await e.send("UNSUPPORTED-REQUEST");break}case"CHECKPRESENT":{if(!f){await e.send("UNSUPPORTED-REQUEST");break}if(!s||!o){await e.send(`CHECKPRESENT-UNKNOWN ${Ct(f)} The remote has not been prepared.`);break}let p=await q9(s,f,o);if(p.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(p.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${Ct(f)} ${p.message}`);break}case"REMOVE":await e.send(`REMOVE-FAILURE ${Ct(f)} This remote is read-only for now.`);break;case"ERROR":return 1;case"VALUE":break;default:await e.send("UNSUPPORTED-REQUEST")}}catch(p){if(p instanceof _c)return 1;throw p}}}function mS(e,t){let r=[],n=e;for(let s=0;s<t;s++){let o=n.indexOf(" ");if(o<0)break;r.push(n.slice(0,o)),n=n.slice(o+1)}return r.push(n),r}async function*D9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
|
|
39
39
|
`);while(n>=0)yield t.slice(0,n).replace(/\r$/,""),t=t.slice(n+1),n=t.indexOf(`
|
|
40
|
-
`)}if(t+=e.decode(),t!=="")yield t}var od=Bun.stdout.writer(),
|
|
41
|
-
`),await od.flush()}},{loadApiKey:()=>vn().apiKey||void 0});await od.end();process.exit(
|
|
40
|
+
`)}if(t+=e.decode(),t!=="")yield t}var od=Bun.stdout.writer(),M9=await $S({lines:D9(),send:async(e)=>{od.write(`${e}
|
|
41
|
+
`),await od.flush()}},{loadApiKey:()=>vn().apiKey||void 0});await od.end();process.exit(M9);
|