nemar-cli 0.10.38-dev.4689 → 0.10.38-dev.4706
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/README.md +1 -0
- package/dist/git-annex-remote-nemar.js +22 -21
- package/dist/index.js +585 -566
- package/package.json +1 -1
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var hS=Object.create;var{getPrototypeOf:mS,defineProperty:Bo,getOwnPropertyNames:gS}=Object;var od=Object.prototype.hasOwnProperty;function yS(e){return this[e]}var _S,vS,_c=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?_S??=new WeakMap:vS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?hS(mS(e)):{};let i=t||!e||!e.__esModule||!od.call(e,"default")?Bo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of gS(e))if(!od.call(i,a))Bo(i,a,{get:yS.bind(e,a),enumerable:!0})}if(n)s.set(e,i);return i};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $S=(e)=>e;function ES(e,t){this[e]=$S.bind(null,t)}var _9=(e,t)=>{for(var r in t)Bo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:ES.bind(t,r)})};var F=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var v9=(e,t,r)=>{for(var n in t)Bo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},$9=import.meta.require;function Wo(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(vc.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(vc.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"&&!wS.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(vc.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function $c(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($c(e,t))throw Error("Cannot use string index")}function ad(e,t,r){if(!yn(e)||typeof t!=="string")return r===void 0?e:r;let n=Wo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if($c(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 Ec(e,t,r){if(!yn(e)||typeof t!=="string")return e;let n=e,s=Wo(t);for(let o=0;o<s.length;o++){let i=s[o];if(id(e,i),o===s.length-1)e[i]=r;else if(!yn(e[i]))e[i]=typeof s[o+1]==="number"?[]:{};e=e[i]}return n}function cd(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Wo(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],!yn(e))return!1}}function ud(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Wo(t);if(r.length===0)return!1;for(let n of r){if(!yn(e)||!(n in e)||$c(e,n))return!1;e=e[n]}return!0}var yn=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},vc,wS;var ld=F(()=>{vc=new Set(["__proto__","prototype","constructor"]),wS=new Set("0123456789")});import Se from"path";import dd from"os";import wc from"process";function Sc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(wc.platform==="darwin")return bS(e);if(wc.platform==="win32")return SS(e);return xS(e)}var Rr,bc,Dn,bS=(e)=>{let t=Se.join(Rr,"Library");return{data:Se.join(t,"Application Support",e),config:Se.join(t,"Preferences",e),cache:Se.join(t,"Caches",e),log:Se.join(t,"Logs",e),temp:Se.join(bc,e)}},SS=(e)=>{let t=Dn.APPDATA||Se.join(Rr,"AppData","Roaming"),r=Dn.LOCALAPPDATA||Se.join(Rr,"AppData","Local");return{data:Se.join(r,e,"Data"),config:Se.join(t,e,"Config"),cache:Se.join(r,e,"Cache"),log:Se.join(r,e,"Log"),temp:Se.join(bc,e)}},xS=(e)=>{let t=Se.basename(Rr);return{data:Se.join(Dn.XDG_DATA_HOME||Se.join(Rr,".local","share"),e),config:Se.join(Dn.XDG_CONFIG_HOME||Se.join(Rr,".config"),e),cache:Se.join(Dn.XDG_CACHE_HOME||Se.join(Rr,".cache"),e),log:Se.join(Dn.XDG_STATE_HOME||Se.join(Rr,".local","state"),e),temp:Se.join(bc,t,e)}};var fd=F(()=>{Rr=dd.homedir(),bc=dd.tmpdir(),{env:Dn}=wc});var RS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},Ct;var pd=F(()=>{Ct=RS});var TS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},Rt;var hd=F(()=>{Rt=TS});var md=250;var gd=()=>{};var kS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=s.interval??md,a=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let l=Math.round(i*Math.random());if(l>0)return new Promise((f)=>setTimeout(f,l)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},jt;var yd=F(()=>{gd();jt=kS});var OS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=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()>=i)throw u;continue}}}},qt;var _d=F(()=>{qt=OS});var xc=F(()=>{pd();hd();yd();_d()});var zs,Rc;var vd=F(()=>{Tc();zs={isChangeErrorOk:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!$d&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zs.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(!zs.isNodeError(e))throw e;if(zs.isChangeErrorOk(e))return;throw e}},Rc=zs});import Ed from"process";var Gs,tt,$d,Fe;var Tc=F(()=>{vd();Gs={onError:Rc.onChangeError},tt={onError:()=>{return}},$d=Ed.getuid?!Ed.getuid():!1,Fe={isRetriable:Rc.isRetriableError}});import ie from"fs";import{promisify as ze}from"util";var AS,De;var kc=F(()=>{xc();xc();Tc();AS={attempt:{chmod:Ct(ze(ie.chmod),Gs),chown:Ct(ze(ie.chown),Gs),close:Ct(ze(ie.close),tt),fsync:Ct(ze(ie.fsync),tt),mkdir:Ct(ze(ie.mkdir),tt),realpath:Ct(ze(ie.realpath),tt),stat:Ct(ze(ie.stat),tt),unlink:Ct(ze(ie.unlink),tt),chmodSync:Rt(ie.chmodSync,Gs),chownSync:Rt(ie.chownSync,Gs),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:jt(ze(ie.close),Fe),fsync:jt(ze(ie.fsync),Fe),open:jt(ze(ie.open),Fe),readFile:jt(ze(ie.readFile),Fe),rename:jt(ze(ie.rename),Fe),stat:jt(ze(ie.stat),Fe),write:jt(ze(ie.write),Fe),writeFile:jt(ze(ie.writeFile),Fe),closeSync:qt(ie.closeSync,Fe),fsyncSync:qt(ie.fsyncSync,Fe),openSync:qt(ie.openSync,Fe),readFileSync:qt(ie.readFileSync,Fe),renameSync:qt(ie.renameSync,Fe),statSync:qt(ie.statSync,Fe),writeSync:qt(ie.writeSync,Fe),writeFileSync:qt(ie.writeFileSync,Fe)}},De=AS});import _n from"process";var wd="utf8",Oc=438,bd=511,Sd,xd,Rd,Td=1000,kd,X9,Ac=128;var Pc=F(()=>{Sd={},xd=_n.geteuid?_n.geteuid():-1,Rd=_n.getegid?_n.getegid():-1,kd=!!_n.getuid,X9=_n.getuid?!_n.getuid():!1});var Od=(e)=>e instanceof Error&&("code"in e),Nc=(e)=>typeof e==="string",Yo=(e)=>e===void 0;var Ad=()=>{};var Pd=()=>{};import Nd from"process";var Id,Xo;var Ic=F(()=>{Id=Nd.platform==="linux",Xo=Nd.platform==="win32"});var Cc,Cd;var jd=F(()=>{Ic();Cc=["SIGHUP","SIGINT","SIGTERM"];if(!Xo)Cc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Id)Cc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Cd=Cc});import Mn from"process";class qd{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(Xo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Mn.kill(Mn.pid,"SIGTERM");else Mn.kill(Mn.pid,e)},this.hook=()=>{Mn.once("exit",()=>this.exit());for(let e of Cd)try{Mn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Dd;var Md=F(()=>{Ic();jd();Dd=new qd});var PS,Ld;var Ud=F(()=>{Md();PS=Dd.register,Ld=PS});import NS from"path";var dt,Ks;var Fd=F(()=>{kc();Ud();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],De.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],De.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=NS.basename(e);if(t.length<=Ac)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Ac;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ld(dt.purgeSyncAll);Ks=dt});import IS from"path";function jc(e,t,r=Sd){if(Nc(r))return jc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,i=null,a=null;try{let c=De.attempt.realpathSync(e),u=!!c;e=c||e,[i,o]=Ks.get(e,r.tmpCreate||Ks.create,r.tmpPurge!==!1);let d=kd&&Yo(r.chown),l=Yo(r.mode);if(u&&(d||l)){let p=De.attempt.statSync(e);if(p){if(r={...r},d)r.chown={uid:p.uid,gid:p.gid};if(l)r.mode=p.mode}}if(!u){let p=IS.dirname(e);De.attempt.mkdirSync(p,{mode:bd,recursive:!0})}if(a=De.retry.openSync(s)(i,"w",r.mode||Oc),r.tmpCreated)r.tmpCreated(i);if(Nc(t))De.retry.writeSync(s)(a,t,0,r.encoding||wd);else if(!Yo(t))De.retry.writeSync(s)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)De.retry.fsyncSync(s)(a);else De.attempt.fsync(a);if(De.retry.closeSync(s)(a),a=null,r.chown&&(r.chown.uid!==xd||r.chown.gid!==Rd))De.attempt.chownSync(i,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Oc)De.attempt.chmodSync(i,r.mode);try{De.retry.renameSync(s)(i,e)}catch(p){if(!Od(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;De.retry.renameSync(s)(i,Ks.truncate(e))}o(),i=null}finally{if(a)De.attempt.closeSync(a);if(i)Ks.purge(i)}}var Vd=F(()=>{kc();Pc();Ad();Pd();Fd()});var Bs=g(function(Kd){Object.defineProperty(Kd,"__esModule",{value:!0});Kd.regexpCode=Kd.getEsmExportName=Kd.getProperty=Kd.safeStringify=Kd.stringify=Kd.strConcat=Kd.addCodeArg=Kd.str=Kd._=Kd.nil=Kd._Code=Kd.Name=Kd.IDENTIFIER=Kd._CodeOrName=void 0;class Jo{}Kd._CodeOrName=Jo;Kd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Ln extends Jo{constructor(e){super();if(!Kd.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}}}Kd.Name=Ln;class Tt extends Jo{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 Ln)t[r.str]=(t[r.str]||0)+1;return t},{})}}Kd._Code=Tt;Kd.nil=new Tt("");function zd(e,...t){let r=[e[0]],n=0;while(n<t.length)Dc(r,t[n]),r.push(e[++n]);return new Tt(r)}Kd._=zd;var qc=new Tt("+");function Gd(e,...t){let r=[Hs(e[0])],n=0;while(n<t.length)r.push(qc),Dc(r,t[n]),r.push(qc,Hs(e[++n]));return CS(r),new Tt(r)}Kd.str=Gd;function Dc(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof Ln)e.push(t);else e.push(DS(t))}Kd.addCodeArg=Dc;function CS(e){let t=1;while(t<e.length-1){if(e[t]===qc){let r=jS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function jS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Ln||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 Ln))return`"${e}${t.slice(1)}`;return}function qS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Gd`${e}${t}`}Kd.strConcat=qS;function DS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Hs(Array.isArray(e)?e.join(","):e)}function MS(e){return new Tt(Hs(e))}Kd.stringify=MS;function Hs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Kd.safeStringify=Hs;function LS(e){return typeof e=="string"&&Kd.IDENTIFIER.test(e)?new Tt(`.${e}`):zd`[${e}]`}Kd.getProperty=LS;function US(e){if(typeof e=="string"&&Kd.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Kd.getEsmExportName=US;function FS(e){return new Tt(e.toString())}Kd.regexpCode=FS});var Fc=g(function(Yd){Object.defineProperty(Yd,"__esModule",{value:!0});Yd.ValueScope=Yd.ValueScopeName=Yd.Scope=Yd.varKinds=Yd.UsedValueState=void 0;var pe=Bs();class Bd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Zo;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Zo||(Yd.UsedValueState=Zo={}));Yd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Lc{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}}}Yd.Scope=Lc;class Uc 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}]`}}Yd.ValueScopeName=Uc;var ex=pe._`\n`;class Wd extends Lc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ex:pe.nil}}get(){return this._scope}name(e){return new Uc(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,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[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 i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Zo.Started);let u=t(c);if(u){let d=this.opts.es5?Yd.varKinds.var:Yd.varKinds.const;s=pe._`${s}${d} ${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 Bd(c);a.set(c,Zo.Completed)})}return s}}Yd.ValueScope=Wd});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 A=Bs(),xe=Fc(),Tr=Bs();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(rt,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(rt,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(rt,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Tr.Name}});var oi=Fc();Object.defineProperty(rt,"Scope",{enumerable:!0,get:function(){return oi.Scope}});Object.defineProperty(rt,"ValueScope",{enumerable:!0,get:function(){return oi.ValueScope}});Object.defineProperty(rt,"ValueScopeName",{enumerable:!0,get:function(){return oi.ValueScopeName}});Object.defineProperty(rt,"varKinds",{enumerable:!0,get:function(){return oi.varKinds}});rt.operators={GT:new A._Code(">"),GTE:new A._Code(">="),LT:new A._Code("<"),LTE:new A._Code("<="),EQ:new A._Code("==="),NEQ:new A._Code("!=="),NOT:new A._Code("!"),OR:new A._Code("||"),AND:new A._Code("&&"),ADD:new A._Code("+")};class kr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Jd extends kr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?xe.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=Fn(this.rhs,e,t);return this}get names(){return this.rhs instanceof A._CodeOrName?this.rhs.names:{}}}class Gc extends kr{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 A.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Fn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof A.Name?{}:{...this.lhs.names};return si(e,this.rhs)}}class Qd extends Gc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Zd extends kr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class ef extends kr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class tf extends kr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class rf extends kr{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=Fn(this.code,e,t),this}get names(){return this.code instanceof A._CodeOrName?this.code.names:{}}}class ii extends kr{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;sx(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>vn(e,t.names),{})}}class Or extends ii{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class nf extends ii{}class Ws extends Or{}Ws.kind="else";class mr extends Or{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 Ws(r):r}if(t){if(e===!1)return t instanceof mr?t:t.nodes;if(this.nodes.length)return this;return new mr(uf(e),t instanceof mr?[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=Fn(this.condition,e,t),this}get names(){let e=super.names;if(si(e,this.condition),this.else)vn(e,this.else.names);return e}}mr.kind="if";class Un extends Or{}Un.kind="for";class sf extends Un{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=Fn(this.iteration,e,t),this}get names(){return vn(super.names,this.iteration.names)}}class of extends Un{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?xe.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=si(super.names,this.from);return si(e,this.to)}}class Vc extends Un{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=Fn(this.iterable,e,t),this}get names(){return vn(super.names,this.iterable.names)}}class ei extends Or{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)}}ei.kind="func";class ti extends ii{render(e){return"return "+super.render(e)}}ti.kind="return";class af extends Or{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)vn(e,this.catch.names);if(this.finally)vn(e,this.finally.names);return e}}class ri extends Or{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ri.kind="catch";class ni extends Or{render(e){return"finally"+super.render(e)}}ni.kind="finally";class cf{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
4
|
-
`:""},this._extScope=e,this._scope=new xe.Scope({parent:e}),this._nodes=[new nf]}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 Jd(e,s,r)),s}const(e,t,r){return this._def(xe.varKinds.const,e,t,r)}let(e,t,r){return this._def(xe.varKinds.let,e,t,r)}var(e,t,r){return this._def(xe.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Gc(e,t,r))}add(e,t){return this._leafNode(new Qd(e,rt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==A.nil)this._leafNode(new rf(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(":"),A.addCodeArg(t,n)}return t.push("}"),new A._Code(t)}if(e,t,r){if(this._blockNode(new mr(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 mr(e))}else(){return this._elseNode(new Ws)}endIf(){return this._endBlockNode(mr,Ws)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new sf(e),t)}forRange(e,t,r,n,s=this.opts.es5?xe.varKinds.var:xe.varKinds.let){let o=this._scope.toName(e);return this._for(new of(s,o,t,r),()=>n(o))}forOf(e,t,r,n=xe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof A.Name?t:this.var("_arr",t);return this.forRange("_i",0,A._`${o}.length`,(i)=>{this.var(s,A._`${o}[${i}]`),r(s)})}return this._for(new Vc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?xe.varKinds.var:xe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,A._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Vc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(Un)}label(e){return this._leafNode(new Zd(e))}break(e){return this._leafNode(new ef(e))}return(e){let t=new ti;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ti)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new af;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new ri(s),t(s)}if(r)this._currNode=n.finally=new ni,this.code(r);return this._endBlockNode(ri,ni)}throw(e){return this._leafNode(new tf(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=A.nil,r,n){if(this._blockNode(new ei(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ei)}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 mr))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=cf;function vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function si(e,t){return t instanceof A._CodeOrName?vn(e,t.names):e}function Fn(e,t,r){if(e instanceof A.Name)return n(e);if(!s(e))return e;return new A._Code(e._items.reduce((o,i)=>{if(i instanceof A.Name)i=n(i);if(i instanceof A._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof A._Code&&o._items.some((i)=>i instanceof A.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function sx(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function uf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:A._`!${zc(e)}`}rt.not=uf;var ox=lf(rt.operators.AND);function ix(...e){return e.reduce(ox)}rt.and=ix;var ax=lf(rt.operators.OR);function cx(...e){return e.reduce(ax)}rt.or=cx;function lf(e){return(t,r)=>t===A.nil?r:r===A.nil?t:A._`${zc(t)} ${e} ${zc(r)}`}function zc(e){return e instanceof A.Name?e:A._`(${e})`}});var te=g(function($f){Object.defineProperty($f,"__esModule",{value:!0});$f.checkStrictMode=$f.getErrorPath=$f.Type=$f.useFunc=$f.setEvaluated=$f.evaluatedPropsToName=$f.mergeEvaluated=$f.eachItem=$f.unescapeJsonPointer=$f.escapeJsonPointer=$f.escapeFragment=$f.unescapeFragment=$f.schemaRefOrVal=$f.schemaHasRulesButRef=$f.schemaHasRules=$f.checkUnknownRules=$f.alwaysValidSchema=$f.toHash=void 0;var L=Y(),hf=Bs();function fx(e){let t={};for(let r of e)t[r]=!0;return t}$f.toHash=fx;function px(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return mf(e,t),!gf(t,e.self.RULES.all)}$f.alwaysValidSchema=px;function mf(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])vf(e,`unknown keyword: "${o}"`)}$f.checkUnknownRules=mf;function gf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}$f.schemaHasRules=gf;function hx(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}$f.schemaHasRulesButRef=hx;function mx({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return L._`${r}`}return L._`${e}${t}${L.getProperty(n)}`}$f.schemaRefOrVal=mx;function gx(e){return yf(decodeURIComponent(e))}$f.unescapeFragment=gx;function yx(e){return encodeURIComponent(Hc(e))}$f.escapeFragment=yx;function Hc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}$f.escapeJsonPointer=Hc;function yf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}$f.unescapeJsonPointer=yf;function _x(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}$f.eachItem=_x;function ff({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof L.Name?(o instanceof L.Name?e(s,o,i):t(s,o,i),i):o instanceof L.Name?(t(s,i,o),o):r(o,i);return a===L.Name&&!(c instanceof L.Name)?n(s,c):c}}$f.mergeEvaluated={props:ff({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>{e.if(L._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,L._`${r} || {}`).code(L._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,L._`${r} || {}`),Bc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_f}),items:ff({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,L._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>e.assign(r,t===!0?!0:L._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _f(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",L._`{}`);if(t!==void 0)Bc(e,r,t);return r}$f.evaluatedPropsToName=_f;function Bc(e,t,r){Object.keys(r).forEach((n)=>e.assign(L._`${t}${L.getProperty(n)}`,!0))}$f.setEvaluated=Bc;var pf={};function vx(e,t){return e.scopeValue("func",{ref:t,code:pf[t.code]||(pf[t.code]=new hf._Code(t.code))})}$f.useFunc=vx;var Kc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Kc||($f.Type=Kc={}));function $x(e,t,r){if(e instanceof L.Name){let n=t===Kc.Num;return r?n?L._`"[" + ${e} + "]"`:L._`"['" + ${e} + "']"`:n?L._`"/" + ${e}`:L._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?L.getProperty(e).toString():"/"+Hc(e)}$f.getErrorPath=$x;function vf(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}$f.checkStrictMode=vf});var pt=g(function(wf){Object.defineProperty(wf,"__esModule",{value:!0});var ce=Y(),Mx={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};wf.default=Mx});var Ys=g(function(Rf){Object.defineProperty(Rf,"__esModule",{value:!0});Rf.extendErrors=Rf.resetErrorsCount=Rf.reportExtraError=Rf.reportError=Rf.keyword$DataError=Rf.keywordError=void 0;var I=Y(),Ar=te(),We=pt();Rf.keywordError={message:({keyword:e})=>I.str`must pass "${e}" keyword validation`};Rf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?I.str`"${e}" keyword must be ${t} ($data)`:I.str`"${e}" keyword is invalid ($data)`};function Ux(e,t=Rf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=xf(e,t,r);if(n!==null&&n!==void 0?n:i||a)bf(o,c);else Sf(s,I._`[${c}]`)}Rf.reportError=Ux;function Fx(e,t=Rf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=xf(e,t,r);if(bf(s,a),!(o||i))Sf(n,We.default.vErrors)}Rf.reportExtraError=Fx;function Vx(e,t){e.assign(We.default.errors,t),e.if(I._`${We.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(I._`${We.default.vErrors}.length`,t),()=>e.assign(We.default.vErrors,null)))}Rf.resetErrorsCount=Vx;function zx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,We.default.errors,(a)=>{if(e.const(i,I._`${We.default.vErrors}[${a}]`),e.if(I._`${i}.instancePath === undefined`,()=>e.assign(I._`${i}.instancePath`,I.strConcat(We.default.instancePath,o.errorPath))),e.assign(I._`${i}.schemaPath`,I.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(I._`${i}.schema`,r),e.assign(I._`${i}.data`,n)})}Rf.extendErrors=zx;function bf(e,t){let r=e.const("err",t);e.if(I._`${We.default.vErrors} === null`,()=>e.assign(We.default.vErrors,I._`[${r}]`),I._`${We.default.vErrors}.push(${r})`),e.code(I._`${We.default.errors}++`)}function Sf(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 $n={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 xf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return I._`{}`;return Gx(e,t,r)}function Gx(e,t,r={}){let{gen:n,it:s}=e,o=[Kx(s,r),Hx(e,r)];return Bx(e,t,o),n.object(...o)}function Kx({errorPath:e},{instancePath:t}){let r=t?I.str`${e}${Ar.getErrorPath(t,Ar.Type.Str)}`:e;return[We.default.instancePath,I.strConcat(We.default.instancePath,r)]}function Hx({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:I.str`${t}/${e}`;if(r)s=I.str`${s}${Ar.getErrorPath(r,Ar.Type.Str)}`;return[$n.schemaPath,s]}function Bx(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([$n.keyword,s],[$n.params,typeof t=="function"?t(e):t||I._`{}`]),c.messages)n.push([$n.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([$n.schema,i],[$n.parentSchema,I._`${d}${l}`],[We.default.data,o]);if(u)n.push([$n.propertyName,u])}});var If=g(function(Pf){Object.defineProperty(Pf,"__esModule",{value:!0});Pf.boolOrEmptySchema=Pf.topBoolOrEmptySchema=void 0;var kf=Ys(),Of=Y(),Qx=pt(),Zx={message:"boolean schema is false"};function eR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Af(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(Qx.default.data);else t.assign(Of._`${n}.errors`,null),t.return(!0)}Pf.topBoolOrEmptySchema=eR;function tR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Af(e);else r.var(t,!0)}Pf.boolOrEmptySchema=tR;function Af(e,t){let{gen:r,data:n}=e;kf.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},Zx,void 0,t)}});var Yc=g(function(Cf){Object.defineProperty(Cf,"__esModule",{value:!0});Cf.getRules=Cf.isJSONType=void 0;var nR=["string","number","integer","boolean","null","object","array"],sR=new Set(nR);function oR(e){return typeof e=="string"&&sR.has(e)}Cf.isJSONType=oR;function iR(){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:{}}}Cf.getRules=iR});var Xc=g(function(Mf){Object.defineProperty(Mf,"__esModule",{value:!0});Mf.shouldUseRule=Mf.shouldUseGroup=Mf.schemaHasRulesForType=void 0;function cR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&qf(e,n)}Mf.schemaHasRulesForType=cR;function qf(e,t){return t.rules.some((r)=>Df(e,r))}Mf.shouldUseGroup=qf;function Df(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))}Mf.shouldUseRule=Df});var Xs=g(function(Kf){Object.defineProperty(Kf,"__esModule",{value:!0});Kf.reportTypeError=Kf.checkDataTypes=Kf.checkDataType=Kf.coerceAndCheckDataType=Kf.getJSONTypes=Kf.getSchemaTypes=Kf.DataType=void 0;var Uf=Yc(),Ff=Xc(),Vf=Ys(),x=Y(),ci=te(),Vn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Vn||(Kf.DataType=Vn={}));function dR(e){let t=zf(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}Kf.getSchemaTypes=dR;function zf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Uf.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Kf.getJSONTypes=zf;function fR(e,t){let{gen:r,data:n,opts:s}=e,o=pR(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&Ff.schemaHasRulesForType(e,t[0]));if(i){let a=Qc(t,n,s.strictNumbers,Vn.Wrong);r.if(a,()=>{if(o.length)hR(e,t,o);else Zc(e)})}return i}Kf.coerceAndCheckDataType=fR;var Gf=new Set(["string","number","integer","boolean","null"]);function pR(e,t){return t?e.filter((r)=>Gf.has(r)||t==="array"&&r==="array"):[]}function hR(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",x._`typeof ${s}`),a=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(i,x._`typeof ${s}`).if(Qc(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(x._`${a} !== undefined`);for(let u of r)if(Gf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Zc(e),n.endIf(),n.if(x._`${a} !== undefined`,()=>{n.assign(s,a),mR(e,a)});function c(u){switch(u){case"string":n.elseIf(x._`${i} == "number" || ${i} == "boolean"`).assign(a,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(a,x._`""`);return;case"number":n.elseIf(x._`${i} == "boolean" || ${s} === null
|
|
3
|
+
var vS=Object.create;var{getPrototypeOf:$S,defineProperty:Wo,getOwnPropertyNames:bS}=Object;var id=Object.prototype.hasOwnProperty;function wS(e){return this[e]}var ES,SS,vc=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?ES??=new WeakMap:SS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?vS($S(e)):{};let i=t||!e||!e.__esModule||!id.call(e,"default")?Wo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of bS(e))if(!id.call(i,a))Wo(i,a,{get:wS.bind(e,a),enumerable:!0})}if(n)s.set(e,i);return i};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var xS=(e)=>e;function RS(e,t){this[e]=xS.bind(null,t)}var O9=(e,t)=>{for(var r in t)Wo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:RS.bind(t,r)})};var F=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var A9=(e,t,r)=>{for(var n in t)Wo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},N9=import.meta.require;function Yo(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($c.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($c.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"&&!kS.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($c.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function bc(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 ad(e,t){if(bc(e,t))throw Error("Cannot use string index")}function cd(e,t,r){if(!yn(e)||typeof t!=="string")return r===void 0?e:r;let n=Yo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if(bc(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 wc(e,t,r){if(!yn(e)||typeof t!=="string")return e;let n=e,s=Yo(t);for(let o=0;o<s.length;o++){let i=s[o];if(ad(e,i),o===s.length-1)e[i]=r;else if(!yn(e[i]))e[i]=typeof s[o+1]==="number"?[]:{};e=e[i]}return n}function ud(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Yo(t);for(let n=0;n<r.length;n++){let s=r[n];if(ad(e,s),n===r.length-1)return delete e[s],!0;if(e=e[s],!yn(e))return!1}}function ld(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Yo(t);if(r.length===0)return!1;for(let n of r){if(!yn(e)||!(n in e)||bc(e,n))return!1;e=e[n]}return!0}var yn=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},$c,kS;var dd=F(()=>{$c=new Set(["__proto__","prototype","constructor"]),kS=new Set("0123456789")});import we 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 TS(e);if(Ec.platform==="win32")return OS(e);return AS(e)}var kr,Sc,Dn,TS=(e)=>{let t=we.join(kr,"Library");return{data:we.join(t,"Application Support",e),config:we.join(t,"Preferences",e),cache:we.join(t,"Caches",e),log:we.join(t,"Logs",e),temp:we.join(Sc,e)}},OS=(e)=>{let t=Dn.APPDATA||we.join(kr,"AppData","Roaming"),r=Dn.LOCALAPPDATA||we.join(kr,"AppData","Local");return{data:we.join(r,e,"Data"),config:we.join(t,e,"Config"),cache:we.join(r,e,"Cache"),log:we.join(r,e,"Log"),temp:we.join(Sc,e)}},AS=(e)=>{let t=we.basename(kr);return{data:we.join(Dn.XDG_DATA_HOME||we.join(kr,".local","share"),e),config:we.join(Dn.XDG_CONFIG_HOME||we.join(kr,".config"),e),cache:we.join(Dn.XDG_CACHE_HOME||we.join(kr,".cache"),e),log:we.join(Dn.XDG_STATE_HOME||we.join(kr,".local","state"),e),temp:we.join(Sc,t,e)}};var pd=F(()=>{kr=fd.homedir(),Sc=fd.tmpdir(),{env:Dn}=Ec});var NS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},qt;var hd=F(()=>{qt=NS});var IS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},kt;var md=F(()=>{kt=IS});var gd=250;var yd=()=>{};var PS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=s.interval??gd,a=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let l=Math.round(i*Math.random());if(l>0)return new Promise((f)=>setTimeout(f,l)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},Dt;var _d=F(()=>{yd();Dt=PS});var CS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=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()>=i)throw u;continue}}}},Mt;var vd=F(()=>{Mt=CS});var Rc=F(()=>{hd();md();_d();vd()});var zs,kc;var $d=F(()=>{Tc();zs={isChangeErrorOk:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!bd&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zs.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(!zs.isNodeError(e))throw e;if(zs.isChangeErrorOk(e))return;throw e}},kc=zs});import wd from"process";var Gs,et,bd,Fe;var Tc=F(()=>{$d();Gs={onError:kc.onChangeError},et={onError:()=>{return}},bd=wd.getuid?!wd.getuid():!1,Fe={isRetriable:kc.isRetriableError}});import ie from"fs";import{promisify as ze}from"util";var jS,De;var Oc=F(()=>{Rc();Rc();Tc();jS={attempt:{chmod:qt(ze(ie.chmod),Gs),chown:qt(ze(ie.chown),Gs),close:qt(ze(ie.close),et),fsync:qt(ze(ie.fsync),et),mkdir:qt(ze(ie.mkdir),et),realpath:qt(ze(ie.realpath),et),stat:qt(ze(ie.stat),et),unlink:qt(ze(ie.unlink),et),chmodSync:kt(ie.chmodSync,Gs),chownSync:kt(ie.chownSync,Gs),closeSync:kt(ie.closeSync,et),existsSync:kt(ie.existsSync,et),fsyncSync:kt(ie.fsync,et),mkdirSync:kt(ie.mkdirSync,et),realpathSync:kt(ie.realpathSync,et),statSync:kt(ie.statSync,et),unlinkSync:kt(ie.unlinkSync,et)},retry:{close:Dt(ze(ie.close),Fe),fsync:Dt(ze(ie.fsync),Fe),open:Dt(ze(ie.open),Fe),readFile:Dt(ze(ie.readFile),Fe),rename:Dt(ze(ie.rename),Fe),stat:Dt(ze(ie.stat),Fe),write:Dt(ze(ie.write),Fe),writeFile:Dt(ze(ie.writeFile),Fe),closeSync:Mt(ie.closeSync,Fe),fsyncSync:Mt(ie.fsyncSync,Fe),openSync:Mt(ie.openSync,Fe),readFileSync:Mt(ie.readFileSync,Fe),renameSync:Mt(ie.renameSync,Fe),statSync:Mt(ie.statSync,Fe),writeSync:Mt(ie.writeSync,Fe),writeFileSync:Mt(ie.writeFileSync,Fe)}},De=jS});import _n from"process";var Ed="utf8",Ac=438,Sd=511,xd,Rd,kd,Td=1000,Od,az,Nc=128;var Ic=F(()=>{xd={},Rd=_n.geteuid?_n.geteuid():-1,kd=_n.getegid?_n.getegid():-1,Od=!!_n.getuid,az=_n.getuid?!_n.getuid():!1});var Ad=(e)=>e instanceof Error&&("code"in e),Pc=(e)=>typeof e==="string",Xo=(e)=>e===void 0;var Nd=()=>{};var Id=()=>{};import Pd from"process";var Cd,Jo;var Cc=F(()=>{Cd=Pd.platform==="linux",Jo=Pd.platform==="win32"});var jc,jd;var qd=F(()=>{Cc();jc=["SIGHUP","SIGINT","SIGTERM"];if(!Jo)jc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Cd)jc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");jd=jc});import Mn 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(Jo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Mn.kill(Mn.pid,"SIGTERM");else Mn.kill(Mn.pid,e)},this.hook=()=>{Mn.once("exit",()=>this.exit());for(let e of jd)try{Mn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Md;var Ld=F(()=>{Cc();qd();Md=new Dd});var qS,Ud;var Fd=F(()=>{Ld();qS=Md.register,Ud=qS});import DS from"path";var dt,Ks;var Vd=F(()=>{Oc();Fd();Ic();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],De.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],De.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=DS.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);Ks=dt});import MS from"path";function qc(e,t,r=xd){if(Pc(r))return qc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,i=null,a=null;try{let c=De.attempt.realpathSync(e),u=!!c;e=c||e,[i,o]=Ks.get(e,r.tmpCreate||Ks.create,r.tmpPurge!==!1);let d=Od&&Xo(r.chown),l=Xo(r.mode);if(u&&(d||l)){let p=De.attempt.statSync(e);if(p){if(r={...r},d)r.chown={uid:p.uid,gid:p.gid};if(l)r.mode=p.mode}}if(!u){let p=MS.dirname(e);De.attempt.mkdirSync(p,{mode:Sd,recursive:!0})}if(a=De.retry.openSync(s)(i,"w",r.mode||Ac),r.tmpCreated)r.tmpCreated(i);if(Pc(t))De.retry.writeSync(s)(a,t,0,r.encoding||Ed);else if(!Xo(t))De.retry.writeSync(s)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)De.retry.fsyncSync(s)(a);else De.attempt.fsync(a);if(De.retry.closeSync(s)(a),a=null,r.chown&&(r.chown.uid!==Rd||r.chown.gid!==kd))De.attempt.chownSync(i,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Ac)De.attempt.chmodSync(i,r.mode);try{De.retry.renameSync(s)(i,e)}catch(p){if(!Ad(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;De.retry.renameSync(s)(i,Ks.truncate(e))}o(),i=null}finally{if(a)De.attempt.closeSync(a);if(i)Ks.purge(i)}}var zd=F(()=>{Oc();Ic();Nd();Id();Vd()});var Bs=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 Qo{}Hd._CodeOrName=Qo;Hd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Ln extends Qo{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=Ln;class Tt extends Qo{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 Ln)t[r.str]=(t[r.str]||0)+1;return t},{})}}Hd._Code=Tt;Hd.nil=new Tt("");function Gd(e,...t){let r=[e[0]],n=0;while(n<t.length)Mc(r,t[n]),r.push(e[++n]);return new Tt(r)}Hd._=Gd;var Dc=new Tt("+");function Kd(e,...t){let r=[Hs(e[0])],n=0;while(n<t.length)r.push(Dc),Mc(r,t[n]),r.push(Dc,Hs(e[++n]));return LS(r),new Tt(r)}Hd.str=Kd;function Mc(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof Ln)e.push(t);else e.push(VS(t))}Hd.addCodeArg=Mc;function LS(e){let t=1;while(t<e.length-1){if(e[t]===Dc){let r=US(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function US(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Ln||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 Ln))return`"${e}${t.slice(1)}`;return}function FS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Kd`${e}${t}`}Hd.strConcat=FS;function VS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Hs(Array.isArray(e)?e.join(","):e)}function zS(e){return new Tt(Hs(e))}Hd.stringify=zS;function Hs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Hd.safeStringify=Hs;function GS(e){return typeof e=="string"&&Hd.IDENTIFIER.test(e)?new Tt(`.${e}`):Gd`[${e}]`}Hd.getProperty=GS;function KS(e){if(typeof e=="string"&&Hd.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Hd.getEsmExportName=KS;function HS(e){return new Tt(e.toString())}Hd.regexpCode=HS});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=Bs();class Wd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ei;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ei||(Xd.UsedValueState=ei={}));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 ox=pe._`\n`;class Yd extends Uc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ox: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,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[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 i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,ei.Started);let u=t(c);if(u){let d=this.opts.es5?Xd.varKinds.var:Xd.varKinds.const;s=pe._`${s}${d} ${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);a.set(c,ei.Completed)})}return s}}Xd.ValueScope=Yd});var Y=g(function(tt){Object.defineProperty(tt,"__esModule",{value:!0});tt.or=tt.and=tt.not=tt.CodeGen=tt.operators=tt.varKinds=tt.ValueScopeName=tt.ValueScope=tt.Scope=tt.Name=tt.regexpCode=tt.stringify=tt.getProperty=tt.nil=tt.strConcat=tt.str=tt._=void 0;var A=Bs(),xe=Vc(),Tr=Bs();Object.defineProperty(tt,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(tt,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(tt,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(tt,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(tt,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(tt,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(tt,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(tt,"Name",{enumerable:!0,get:function(){return Tr.Name}});var ii=Vc();Object.defineProperty(tt,"Scope",{enumerable:!0,get:function(){return ii.Scope}});Object.defineProperty(tt,"ValueScope",{enumerable:!0,get:function(){return ii.ValueScope}});Object.defineProperty(tt,"ValueScopeName",{enumerable:!0,get:function(){return ii.ValueScopeName}});Object.defineProperty(tt,"varKinds",{enumerable:!0,get:function(){return ii.varKinds}});tt.operators={GT:new A._Code(">"),GTE:new A._Code(">="),LT:new A._Code("<"),LTE:new A._Code("<="),EQ:new A._Code("==="),NEQ:new A._Code("!=="),NOT:new A._Code("!"),OR:new A._Code("||"),AND:new A._Code("&&"),ADD:new A._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?xe.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=Fn(this.rhs,e,t);return this}get names(){return this.rhs instanceof A._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 A.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Fn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof A.Name?{}:{...this.lhs.names};return oi(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=Fn(this.code,e,t),this}get names(){return this.code instanceof A._CodeOrName?this.code.names:{}}}class ai 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;ux(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>vn(e,t.names),{})}}class Ar extends ai{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class sf extends ai{}class Ws extends Ar{}Ws.kind="else";class gr extends Ar{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 Ws(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=Fn(this.condition,e,t),this}get names(){let e=super.names;if(oi(e,this.condition),this.else)vn(e,this.else.names);return e}}gr.kind="if";class Un extends Ar{}Un.kind="for";class of extends Un{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=Fn(this.iteration,e,t),this}get names(){return vn(super.names,this.iteration.names)}}class af extends Un{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?xe.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=oi(super.names,this.from);return oi(e,this.to)}}class zc extends Un{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=Fn(this.iterable,e,t),this}get names(){return vn(super.names,this.iterable.names)}}class ti extends Ar{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)}}ti.kind="func";class ri extends ai{render(e){return"return "+super.render(e)}}ri.kind="return";class cf extends Ar{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)vn(e,this.catch.names);if(this.finally)vn(e,this.finally.names);return e}}class ni extends Ar{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ni.kind="catch";class si extends Ar{render(e){return"finally"+super.render(e)}}si.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 xe.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(xe.varKinds.const,e,t,r)}let(e,t,r){return this._def(xe.varKinds.let,e,t,r)}var(e,t,r){return this._def(xe.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,tt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==A.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(":"),A.addCodeArg(t,n)}return t.push("}"),new A._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 Ws)}endIf(){return this._endBlockNode(gr,Ws)}_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?xe.varKinds.var:xe.varKinds.let){let o=this._scope.toName(e);return this._for(new af(s,o,t,r),()=>n(o))}forOf(e,t,r,n=xe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof A.Name?t:this.var("_arr",t);return this.forRange("_i",0,A._`${o}.length`,(i)=>{this.var(s,A._`${o}[${i}]`),r(s)})}return this._for(new zc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?xe.varKinds.var:xe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,A._`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(Un)}label(e){return this._leafNode(new ef(e))}break(e){return this._leafNode(new tf(e))}return(e){let t=new ri;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ri)}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 ni(s),t(s)}if(r)this._currNode=n.finally=new si,this.code(r);return this._endBlockNode(ni,si)}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=A.nil,r,n){if(this._blockNode(new ti(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ti)}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}}tt.CodeGen=uf;function vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function oi(e,t){return t instanceof A._CodeOrName?vn(e,t.names):e}function Fn(e,t,r){if(e instanceof A.Name)return n(e);if(!s(e))return e;return new A._Code(e._items.reduce((o,i)=>{if(i instanceof A.Name)i=n(i);if(i instanceof A._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof A._Code&&o._items.some((i)=>i instanceof A.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function ux(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:A._`!${Gc(e)}`}tt.not=lf;var lx=df(tt.operators.AND);function dx(...e){return e.reduce(lx)}tt.and=dx;var fx=df(tt.operators.OR);function px(...e){return e.reduce(fx)}tt.or=px;function df(e){return(t,r)=>t===A.nil?r:r===A.nil?t:A._`${Gc(t)} ${e} ${Gc(r)}`}function Gc(e){return e instanceof A.Name?e:A._`(${e})`}});var te=g(function(bf){Object.defineProperty(bf,"__esModule",{value:!0});bf.checkStrictMode=bf.getErrorPath=bf.Type=bf.useFunc=bf.setEvaluated=bf.evaluatedPropsToName=bf.mergeEvaluated=bf.eachItem=bf.unescapeJsonPointer=bf.escapeJsonPointer=bf.escapeFragment=bf.unescapeFragment=bf.schemaRefOrVal=bf.schemaHasRulesButRef=bf.schemaHasRules=bf.checkUnknownRules=bf.alwaysValidSchema=bf.toHash=void 0;var L=Y(),mf=Bs();function yx(e){let t={};for(let r of e)t[r]=!0;return t}bf.toHash=yx;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)}bf.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])$f(e,`unknown keyword: "${o}"`)}bf.checkUnknownRules=gf;function yf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}bf.schemaHasRules=yf;function vx(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}bf.schemaHasRulesButRef=vx;function $x({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return L._`${r}`}return L._`${e}${t}${L.getProperty(n)}`}bf.schemaRefOrVal=$x;function bx(e){return _f(decodeURIComponent(e))}bf.unescapeFragment=bx;function wx(e){return encodeURIComponent(Bc(e))}bf.escapeFragment=wx;function Bc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}bf.escapeJsonPointer=Bc;function _f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}bf.unescapeJsonPointer=_f;function Ex(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}bf.eachItem=Ex;function pf({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof L.Name?(o instanceof L.Name?e(s,o,i):t(s,o,i),i):o instanceof L.Name?(t(s,i,o),o):r(o,i);return a===L.Name&&!(c instanceof L.Name)?n(s,c):c}}bf.mergeEvaluated={props:pf({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>{e.if(L._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,L._`${r} || {}`).code(L._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,L._`${r} || {}`),Wc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:vf}),items:pf({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,L._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>e.assign(r,t===!0?!0:L._`${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",L._`{}`);if(t!==void 0)Wc(e,r,t);return r}bf.evaluatedPropsToName=vf;function Wc(e,t,r){Object.keys(r).forEach((n)=>e.assign(L._`${t}${L.getProperty(n)}`,!0))}bf.setEvaluated=Wc;var hf={};function Sx(e,t){return e.scopeValue("func",{ref:t,code:hf[t.code]||(hf[t.code]=new mf._Code(t.code))})}bf.useFunc=Sx;var Hc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Hc||(bf.Type=Hc={}));function xx(e,t,r){if(e instanceof L.Name){let n=t===Hc.Num;return r?n?L._`"[" + ${e} + "]"`:L._`"['" + ${e} + "']"`:n?L._`"/" + ${e}`:L._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?L.getProperty(e).toString():"/"+Bc(e)}bf.getErrorPath=xx;function $f(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}bf.checkStrictMode=$f});var ht=g(function(Ef){Object.defineProperty(Ef,"__esModule",{value:!0});var ce=Y(),zx={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};Ef.default=zx});var Ys=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 P=Y(),Nr=te(),We=ht();kf.keywordError={message:({keyword:e})=>P.str`must pass "${e}" keyword validation`};kf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?P.str`"${e}" keyword must be ${t} ($data)`:P.str`"${e}" keyword is invalid ($data)`};function Kx(e,t=kf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Rf(e,t,r);if(n!==null&&n!==void 0?n:i||a)Sf(o,c);else xf(s,P._`[${c}]`)}kf.reportError=Kx;function Hx(e,t=kf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Rf(e,t,r);if(Sf(s,a),!(o||i))xf(n,We.default.vErrors)}kf.reportExtraError=Hx;function Bx(e,t){e.assign(We.default.errors,t),e.if(P._`${We.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(P._`${We.default.vErrors}.length`,t),()=>e.assign(We.default.vErrors,null)))}kf.resetErrorsCount=Bx;function Wx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,We.default.errors,(a)=>{if(e.const(i,P._`${We.default.vErrors}[${a}]`),e.if(P._`${i}.instancePath === undefined`,()=>e.assign(P._`${i}.instancePath`,P.strConcat(We.default.instancePath,o.errorPath))),e.assign(P._`${i}.schemaPath`,P.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(P._`${i}.schema`,r),e.assign(P._`${i}.data`,n)})}kf.extendErrors=Wx;function Sf(e,t){let r=e.const("err",t);e.if(P._`${We.default.vErrors} === null`,()=>e.assign(We.default.vErrors,P._`[${r}]`),P._`${We.default.vErrors}.push(${r})`),e.code(P._`${We.default.errors}++`)}function xf(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(P._`new ${e.ValidationError}(${t})`);else r.assign(P._`${n}.errors`,t),r.return(!1)}var $n={keyword:new P.Name("keyword"),schemaPath:new P.Name("schemaPath"),params:new P.Name("params"),propertyName:new P.Name("propertyName"),message:new P.Name("message"),schema:new P.Name("schema"),parentSchema:new P.Name("parentSchema")};function Rf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return P._`{}`;return Yx(e,t,r)}function Yx(e,t,r={}){let{gen:n,it:s}=e,o=[Xx(s,r),Jx(e,r)];return Qx(e,t,o),n.object(...o)}function Xx({errorPath:e},{instancePath:t}){let r=t?P.str`${e}${Nr.getErrorPath(t,Nr.Type.Str)}`:e;return[We.default.instancePath,P.strConcat(We.default.instancePath,r)]}function Jx({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:P.str`${t}/${e}`;if(r)s=P.str`${s}${Nr.getErrorPath(r,Nr.Type.Str)}`;return[$n.schemaPath,s]}function Qx(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([$n.keyword,s],[$n.params,typeof t=="function"?t(e):t||P._`{}`]),c.messages)n.push([$n.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([$n.schema,i],[$n.parentSchema,P._`${d}${l}`],[We.default.data,o]);if(u)n.push([$n.propertyName,u])}});var Cf=g(function(If){Object.defineProperty(If,"__esModule",{value:!0});If.boolOrEmptySchema=If.topBoolOrEmptySchema=void 0;var Of=Ys(),Af=Y(),nR=ht(),sR={message:"boolean schema is false"};function oR(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(nR.default.data);else t.assign(Af._`${n}.errors`,null),t.return(!0)}If.topBoolOrEmptySchema=oR;function iR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Nf(e);else r.var(t,!0)}If.boolOrEmptySchema=iR;function Nf(e,t){let{gen:r,data:n}=e;Of.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},sR,void 0,t)}});var Xc=g(function(jf){Object.defineProperty(jf,"__esModule",{value:!0});jf.getRules=jf.isJSONType=void 0;var cR=["string","number","integer","boolean","null","object","array"],uR=new Set(cR);function lR(e){return typeof e=="string"&&uR.has(e)}jf.isJSONType=lR;function dR(){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=dR});var Jc=g(function(Lf){Object.defineProperty(Lf,"__esModule",{value:!0});Lf.shouldUseRule=Lf.shouldUseGroup=Lf.schemaHasRulesForType=void 0;function pR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Df(e,n)}Lf.schemaHasRulesForType=pR;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 Xs=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=Ys(),x=Y(),ui=te(),Vn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Vn||(Hf.DataType=Vn={}));function gR(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=gR;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 yR(e,t){let{gen:r,data:n,opts:s}=e,o=_R(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&Vf.schemaHasRulesForType(e,t[0]));if(i){let a=Zc(t,n,s.strictNumbers,Vn.Wrong);r.if(a,()=>{if(o.length)vR(e,t,o);else eu(e)})}return i}Hf.coerceAndCheckDataType=yR;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 vR(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",x._`typeof ${s}`),a=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(i,x._`typeof ${s}`).if(Zc(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(x._`${a} !== 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._`${a} !== undefined`,()=>{n.assign(s,a),$R(e,a)});function c(u){switch(u){case"string":n.elseIf(x._`${i} == "number" || ${i} == "boolean"`).assign(a,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(a,x._`""`);return;case"number":n.elseIf(x._`${i} == "boolean" || ${s} === null
|
|
5
5
|
|| (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,x._`+${s}`);return;case"integer":n.elseIf(x._`${i} === "boolean" || ${s} === null
|
|
6
6
|
|| (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,x._`+${s}`);return;case"boolean":n.elseIf(x._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf(x._`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf(x._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf(x._`${i} === "string" || ${i} === "number"
|
|
7
|
-
|| ${i} === "boolean" || ${s} === null`).assign(a,x._`[${s}]`)}}}function mR({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Jc(e,t,r,n=Vn.Correct){let s=n===Vn.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=i(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Vn.Correct?o:x.not(o);function i(a=x.nil){return x.and(x._`typeof ${t} == "number"`,a,r?x._`isFinite(${t})`:x.nil)}}Kf.checkDataType=Jc;function Qc(e,t,r,n){if(e.length===1)return Jc(e[0],t,r,n);let s,o=ci.toHash(e);if(o.array&&o.object){let i=x._`typeof ${t} != "object"`;s=o.null?i:x._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let i in o)s=x.and(s,Jc(i,t,r,n));return s}Kf.checkDataTypes=Qc;var gR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function Zc(e){let t=yR(e);Vf.reportError(t,gR)}Kf.reportTypeError=Zc;function yR(e){let{gen:t,data:r,schema:n}=e,s=ci.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Jf=g(function(Yf){Object.defineProperty(Yf,"__esModule",{value:!0});Yf.assignDefaults=void 0;var ht=Y(),Wf=te();function SR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Bf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Bf(e,o,s.default))}Yf.assignDefaults=SR;function Bf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=ht._`${o}${ht.getProperty(t)}`;if(s){Wf.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=ht._`${a} === undefined`;if(i.useDefaults==="empty")c=ht._`${c} || ${a} === null || ${a} === ""`;n.if(c,ht._`${a} = ${ht.stringify(r)}`)}});var mt=g(function(tp){Object.defineProperty(tp,"__esModule",{value:!0});tp.validateUnion=tp.validateArray=tp.usePattern=tp.callValidateCode=tp.schemaProperties=tp.allSchemaProperties=tp.noPropertyInData=tp.propertyInData=tp.isOwnProperty=tp.hasPropFunc=tp.reportMissingProp=tp.checkMissingProp=tp.checkReportMissingProp=void 0;var V=Y(),zn=te(),Pr=pt(),Qf=te();function xR(e,t){let{gen:r,data:n,it:s}=e;r.if(tu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}tp.checkReportMissingProp=xR;function RR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(tu(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}tp.checkMissingProp=RR;function TR(e,t){e.setParams({missingProperty:t},!0),e.error()}tp.reportMissingProp=TR;function Zf(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}tp.hasPropFunc=Zf;function eu(e,t,r){return V._`${Zf(e)}.call(${t}, ${r})`}tp.isOwnProperty=eu;function kR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${eu(e,t,r)}`:s}tp.propertyInData=kR;function tu(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(eu(e,t,r))):s}tp.noPropertyInData=tu;function ep(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}tp.allSchemaProperties=ep;function OR(e,t){return ep(t).filter((r)=>!zn.alwaysValidSchema(e,t[r]))}tp.schemaProperties=OR;function AR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?V._`${e}, ${t}, ${n}${s}`:t,l=[[Pr.default.instancePath,V.strConcat(Pr.default.instancePath,o)],[Pr.default.parentData,i.parentData],[Pr.default.parentDataProperty,i.parentDataProperty],[Pr.default.rootData,Pr.default.rootData]];if(i.opts.dynamicRef)l.push([Pr.default.dynamicAnchors,Pr.default.dynamicAnchors]);let p=V._`${d}, ${r.object(...l)}`;return c!==V.nil?V._`${a}.call(${c}, ${p})`:V._`${a}(${p})`}tp.callValidateCode=AR;var PR=V._`new RegExp`;function NR({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"?PR:Qf.useFunc(e,s)}(${r}, ${n})`})}tp.usePattern=NR;function IR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:zn.Type.Num},o),t.if(V.not(o),a)})}}tp.validateArray=IR;function CR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>zn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,V._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(V.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}tp.validateUnion=CR});var up=g(function(ap){Object.defineProperty(ap,"__esModule",{value:!0});ap.validateKeywordUsage=ap.validSchemaType=ap.funcKeywordCode=ap.macroKeywordCode=void 0;var le=Y(),En=pt(),sp=mt(),op=Ys();function BR(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=ip(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:le.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}ap.macroKeywordCode=BR;function WR(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;XR(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=ip(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)np(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)np(e);y(()=>YR(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(le._`await `),(O)=>n.assign(l,!1).if(le._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,le._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=le._`${d}.errors`;return n.assign(_,null),m(le.nil),_}function m(_=t.async?le._`await `:le.nil){let O=c.opts.passContext?En.default.this:En.default.self,T=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,le._`${_}${sp.callValidateCode(e,d,O,T)}`,t.modifying)}function y(_){var O;n.if(le.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}ap.funcKeywordCode=WR;function np(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,le._`${n.parentData}[${n.parentDataProperty}]`))}function YR(e,t){let{gen:r}=e;r.if(le._`Array.isArray(${t})`,()=>{r.assign(En.default.vErrors,le._`${En.default.vErrors} === null ? ${t} : ${En.default.vErrors}.concat(${t})`).assign(En.default.errors,le._`${En.default.vErrors}.length`),op.extendErrors(e)},()=>e.error())}function XR({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:le.stringify(r)})}function JR(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")}ap.validSchemaType=JR;function QR({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 i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.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)}}}ap.validateKeywordUsage=QR});var fp=g(function(lp){Object.defineProperty(lp,"__esModule",{value:!0});lp.extendSubschemaMode=lp.extendSubschemaData=lp.getSubschema=void 0;var je=Y(),ui=te();function rT(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:je._`${e.schemaPath}${je.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:je._`${e.schemaPath}${je.getProperty(t)}${je.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ui.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}lp.getSubschema=rT;function nT(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",je._`${t.data}${je.getProperty(r)}`,!0);c(p),e.errorPath=je.str`${u}${ui.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=je._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof je.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}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]}}lp.extendSubschemaData=nT;function sT(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}lp.extendSubschemaMode=sT});var Js=g(function(Zz,pp){pp.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 i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var ru=g(function(e4,hp){var Nr=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(){};li(t,n,s,e,"",e)};Nr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Nr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Nr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Nr.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 li(e,t,r,n,s,o,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,i,a,c,u);for(var d in n){var l=n[d];if(Array.isArray(l)){if(d in Nr.arrayKeywords)for(var p=0;p<l.length;p++)li(e,t,r,l[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in Nr.propsKeywords){if(l&&typeof l=="object")for(var f in l)li(e,t,r,l[f],s+"/"+d+"/"+aT(f),o,s,d,n,f)}else if(d in Nr.keywords||e.allKeys&&!(d in Nr.skipKeywords))li(e,t,r,l,s+"/"+d,o,s,d,n)}r(n,s,o,i,a,c,u)}}function aT(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=g(function(vp){Object.defineProperty(vp,"__esModule",{value:!0});vp.getSchemaRefs=vp.resolveUrl=vp.normalizeId=vp._getFullPath=vp.getFullPath=vp.inlineRef=void 0;var mp=te(),cT=Js(),uT=ru(),lT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function dT(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!nu(e);if(!t)return!1;return gp(e)<=t}vp.inlineRef=dT;var fT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nu(e){for(let t in e){if(fT.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(nu))return!0;if(typeof r=="object"&&nu(r))return!0}return!1}function gp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,lT.has(r))continue;if(typeof e[r]=="object")mp.eachItem(e[r],(n)=>t+=gp(n));if(t===1/0)return 1/0}return t}function yp(e,t="",r){if(r!==!1)t=Gn(t);let n=e.parse(t);return _p(e,n)}vp.getFullPath=yp;function _p(e,t){return e.serialize(t).split("#")[0]+"#"}vp._getFullPath=_p;var pT=/#\/?$/;function Gn(e){return e?e.replace(pT,""):""}vp.normalizeId=Gn;function hT(e,t,r){return r=Gn(r),e.resolve(t,r)}vp.resolveUrl=hT;var mT=/^[a-z_][-a-z0-9._]*$/i;function gT(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Gn(e[r]||t),o={"":s},i=yp(n,s,!1),a={},c=new Set;return uT(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(T){let M=this.opts.uriResolver.resolve;if(T=Gn(y?M(y,T):T),c.has(T))throw d(T);c.add(T);let S=this.refs[T];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,T);else if(T!==Gn(m))if(T[0]==="#")u(l,a[T],T),a[T]=l;else this.refs[T]=m;return T}function O(T){if(typeof T=="string"){if(!mT.test(T))throw Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function u(l,p,f){if(p!==void 0&&!cT(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}vp.getSchemaRefs=gT});var Zs=g(function(jp){Object.defineProperty(jp,"__esModule",{value:!0});jp.getData=jp.KeywordCxt=jp.validateFunctionCode=void 0;var fi=If(),di=Xs(),Hn=Xc(),Ir=Xs(),Sp=Jf(),Mt=up(),Kn=fp(),E=Y(),H=pt(),xp=Qs(),Me=te(),Dt=Ys();function wT(e){if(kp(e)){if(Op(e),Tp(e)){xT(e);return}}Rp(e,()=>fi.topBoolOrEmptySchema(e))}jp.validateFunctionCode=wT;function Rp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,E._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(E._`"use strict"; ${Ep(r,s)}`),ST(e,s),e.code(o)});else e.func(t,E._`${H.default.data}, ${bT(s)}`,n.$async,()=>e.code(Ep(r,s)).code(o))}function bT(e){return E._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?E._`, ${H.default.dynamicAnchors}={}`:E.nil}}={}`}function ST(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,E._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,E._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,E._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,E._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,E._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,E._`""`),e.var(H.default.parentData,E._`undefined`),e.var(H.default.parentDataProperty,E._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,E._`{}`)})}function xT(e){let{schema:t,opts:r,gen:n}=e;Rp(e,()=>{if(r.$comment&&t.$comment)Pp(e);if(AT(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)RT(e);Ap(e),IT(e)});return}function RT(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",E._`${r}.evaluated`),t.if(E._`${e.evaluated}.dynamicProps`,()=>t.assign(E._`${e.evaluated}.props`,E._`undefined`)),t.if(E._`${e.evaluated}.dynamicItems`,()=>t.assign(E._`${e.evaluated}.items`,E._`undefined`))}function Ep(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?E._`/*# sourceURL=${r} */`:E.nil}function TT(e,t){if(kp(e)){if(Op(e),Tp(e)){kT(e,t);return}}fi.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 kp(e){return typeof e.schema!="boolean"}function kT(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Pp(e);PT(e),NT(e);let o=n.const("_errs",H.default.errors);Ap(e,o),n.var(t,E._`${o} === ${H.default.errors}`)}function Op(e){Me.checkUnknownRules(e),OT(e)}function Ap(e,t){if(e.opts.jtd)return wp(e,[],!1,t);let r=di.getSchemaTypes(e.schema),n=di.coerceAndCheckDataType(e,r);wp(e,r,!n,t)}function OT(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Me.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function AT(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Me.checkStrictMode(e,"default is ignored in the schema root")}function PT(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=xp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function NT(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(E._`${H.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=E.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(E._`${H.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function IT(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(E._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(E._`new ${s}(${H.default.vErrors})`));else{if(t.assign(E._`${n}.errors`,H.default.vErrors),o.unevaluated)CT(e);t.return(E._`${H.default.errors} === 0`)}}function CT({gen:e,evaluated:t,props:r,items:n}){if(r instanceof E.Name)e.assign(E._`${t}.props`,r);if(n instanceof E.Name)e.assign(E._`${t}.items`,n)}function wp(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Me.schemaHasRulesButRef(o,d))){s.block(()=>Ip(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)jT(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!Hn.shouldUseGroup(o,p))return;if(p.type){if(s.if(Ir.checkDataType(p.type,i,c.strictNumbers)),bp(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Ir.reportTypeError(e);s.endIf()}else bp(e,p);if(!a)s.if(E._`${H.default.errors} === ${n||0}`)}}function bp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Sp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Hn.shouldUseRule(n,o))Ip(e,o.keyword,o.definition,t.type)})}function jT(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(qT(e,t),!e.opts.allowUnionTypes)DT(e,t);MT(e,e.dataTypes)}function qT(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Np(e.dataTypes,r))su(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),UT(e,t)}function DT(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))su(e,"use allowUnionTypes to allow union type keyword")}function MT(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Hn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>LT(t,i)))su(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function LT(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Np(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function UT(e,t){let r=[];for(let n of e.dataTypes)if(Np(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function su(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Me.checkStrictMode(e,t,e.opts.strictTypes)}class ou{constructor(e,t,r){if(Mt.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=Me.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",Cp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Mt.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(E.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(E.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(E._`${t} !== undefined && (${E.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?Dt.reportExtraError:Dt.reportError)(this,this.def.error,t)}$dataError(){Dt.reportError(this,this.def.$dataError||Dt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Dt.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=E.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=E.nil,t=E.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(E.or(E._`${n} === undefined`,t)),e!==E.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==E.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return E.or(o(),i());function o(){if(r.length){if(!(t instanceof E.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return E._`${Ir.checkDataTypes(a,t,s.opts.strictNumbers,Ir.DataType.Wrong)}`}return E.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return E._`!${a}(${t})`}return E.nil}}subschema(e,t){let r=Kn.getSubschema(this.it,e);Kn.extendSubschemaData(r,this.it,e),Kn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return TT(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=Me.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Me.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,E.Name)),!0}}jp.KeywordCxt=ou;function Ip(e,t,r,n){let s=new ou(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Mt.funcKeywordCode(s,r);else if("macro"in r)Mt.macroKeywordCode(s,r);else if(r.compile||r.validate)Mt.funcKeywordCode(s,r)}var FT=/^\/(?:[^~]|~0|~1)*$/,VT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Cp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!FT.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=VT.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=E._`${o}${E.getProperty(Me.unescapeJsonPointer(u))}`,i=E._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}jp.getData=Cp});var pi=g(function(Mp){Object.defineProperty(Mp,"__esModule",{value:!0});class Dp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Mp.default=Dp});var eo=g(function(Up){Object.defineProperty(Up,"__esModule",{value:!0});var Bn=Qs();class Lp extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Bn.resolveUrl(e,t,r),this.missingSchema=Bn.normalizeId(Bn.getFullPath(e,this.missingRef))}}Up.default=Lp});var ro=g(function(zp){Object.defineProperty(zp,"__esModule",{value:!0});zp.resolveSchema=zp.getCompilingSchema=zp.resolveRef=zp.compileSchema=zp.SchemaEnv=void 0;var Re=Y(),BT=pi(),wn=pt(),Te=Qs(),hi=te(),Fp=Zs();class to{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:Te.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={}}}zp.SchemaEnv=to;function au(e){let t=Vp.call(this,e);if(t)return t;let r=Te.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Re.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:BT.default,code:Re._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:wn.default.data,parentData:wn.default.parentData,parentDataProperty:wn.default.parentDataProperty,dataNames:[wn.default.data],dataPathArr:[Re.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Re.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Re.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Re._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),Fp.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(wn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${wn.default.self}`,`${wn.default.scope}`,d)(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:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Re.Name?void 0:h,items:m instanceof Re.Name?void 0:m,dynamicProps:h instanceof Re.Name,dynamicItems:m instanceof Re.Name},f.source)f.source.evaluated=Re.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}zp.compileSchema=au;function WT(e,t,r){var n;r=Te.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=JT.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new to({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=YT.call(this,o)}zp.resolveRef=WT;function YT(e){if(Te.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:au.call(this,e)}function Vp(e){for(let t of this._compilations)if(XT(t,e))return t}zp.getCompilingSchema=Vp;function XT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function JT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||mi.call(this,e,t)}function mi(e,t){let r=this.opts.uriResolver.parse(t),n=Te._getFullPath(this.opts.uriResolver,r),s=Te.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=Te.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=mi.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return iu.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)au.call(this,i);if(o===Te.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Te.resolveUrl(this.opts.uriResolver,s,u);return new to({schema:a,schemaId:c,root:e,baseId:s})}return iu.call(this,r,i)}zp.resolveSchema=mi;var QT=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 a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[hi.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!QT.has(a)&&u)t=Te.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!hi.schemaHasRulesButRef(r,this.RULES)){let a=Te.resolveUrl(this.opts.uriResolver,t,r.$ref);o=mi.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new to({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Kp=g(function(i4,nk){nk.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 uu=g(function(a4,Yp){var sk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Bp=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 cu(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 ok=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Hp(e){return e.length=0,!0}function ik(e,t,r){if(e.length){let n=cu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function ak(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=ik;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)i=!0;if(!a(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(!a(s,n,r))break;a=Hp}else{s.push(u);continue}}if(s.length)if(a===Hp)r.zone=s.join("");else if(i)n.push(s.join(""));else n.push(cu(s));return r.address=n.join(""),r}function Wp(e){if(ck(e,":")<2)return{host:e,isIPV6:!1};let t=ak(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 ck(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function uk(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 lk(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 dk(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(!Bp(r)){let n=Wp(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}Yp.exports={nonSimpleDomain:ok,recomposeAuthority:dk,normalizeComponentEncoding:lk,removeDotSegments:uk,isIPv4:Bp,isUUID:sk,normalizeIPv6:Wp,stringArrayToHexStripped:cu}});var eh=g(function(c4,Zp){var{isUUID:fk}=uu(),pk=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hk=["http","https","ws","wss","urn","urn:uuid"];function mk(e){return hk.indexOf(e)!==-1}function lu(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 Xp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Jp(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 gk(e){return e.secure=lu(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function yk(e){if(e.port===(lu(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 _k(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(pk);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=du(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 vk(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=du(s);if(o)e=o.serialize(e,t);let i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function $k(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!fk(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function Ek(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Qp={scheme:"http",domainHost:!0,parse:Xp,serialize:Jp},wk={scheme:"https",domainHost:Qp.domainHost,parse:Xp,serialize:Jp},gi={scheme:"ws",domainHost:!0,parse:gk,serialize:yk},bk={scheme:"wss",domainHost:gi.domainHost,parse:gi.parse,serialize:gi.serialize},Sk={scheme:"urn",parse:_k,serialize:vk,skipNormalize:!0},xk={scheme:"urn:uuid",parse:$k,serialize:Ek,skipNormalize:!0},yi={http:Qp,https:wk,ws:gi,wss:bk,urn:Sk,"urn:uuid":xk};Object.setPrototypeOf(yi,null);function du(e){return e&&(yi[e]||yi[e.toLowerCase()])||void 0}Zp.exports={wsIsSecure:lu,SCHEMES:yi,isValidSchemeName:mk,getSchemeHandler:du}});var pu=g(function(u4,vi){var{normalizeIPv6:Rk,removeDotSegments:no,recomposeAuthority:Tk,normalizeComponentEncoding:_i,isIPv4:kk,nonSimpleDomain:Ok}=uu(),{SCHEMES:Ak,getSchemeHandler:th}=eh();function Pk(e,t){if(typeof e==="string")e=Lt(gr(e,t),t);else if(typeof e==="object")e=gr(Lt(e,t),t);return e}function Nk(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=rh(gr(e,n),gr(t,n),n,!0);return n.skipEscape=!0,Lt(s,n)}function rh(e,t,r,n){let s={};if(!n)e=gr(Lt(e,r),r),t=gr(Lt(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=no(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=no(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=no(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=no(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 Ik(e,t,r){if(typeof e==="string")e=unescape(e),e=Lt(_i(gr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Lt(_i(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Lt(_i(gr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Lt(_i(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Lt(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=th(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 i=Tk(r);if(i!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(i),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let a=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))a=no(a);if(i===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);s.push(a)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var Ck=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gr(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(Ck);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(kk(n.host)===!1){let c=Rk(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 i=th(r.scheme||n.scheme);if(!r.unicodeSupport&&(!i||!i.unicodeSupport)){if(n.host&&(r.domainHost||i&&i.domainHost)&&s===!1&&Ok(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}}if(!i||i&&!i.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(i&&i.parse)i.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var fu={SCHEMES:Ak,normalize:Pk,resolve:Nk,resolveComponent:rh,equal:Ik,serialize:Lt,parse:gr};vi.exports=fu;vi.exports.default=fu;vi.exports.fastUri=fu});var oh=g(function(sh){Object.defineProperty(sh,"__esModule",{value:!0});var nh=pu();nh.code='require("ajv/dist/runtime/uri").default';sh.default=nh});var mh=g(function(yr){Object.defineProperty(yr,"__esModule",{value:!0});yr.CodeGen=yr.Name=yr.nil=yr.stringify=yr.str=yr._=yr.KeywordCxt=void 0;var qk=Zs();Object.defineProperty(yr,"KeywordCxt",{enumerable:!0,get:function(){return qk.KeywordCxt}});var Yn=Y();Object.defineProperty(yr,"_",{enumerable:!0,get:function(){return Yn._}});Object.defineProperty(yr,"str",{enumerable:!0,get:function(){return Yn.str}});Object.defineProperty(yr,"stringify",{enumerable:!0,get:function(){return Yn.stringify}});Object.defineProperty(yr,"nil",{enumerable:!0,get:function(){return Yn.nil}});Object.defineProperty(yr,"Name",{enumerable:!0,get:function(){return Yn.Name}});Object.defineProperty(yr,"CodeGen",{enumerable:!0,get:function(){return Yn.CodeGen}});var Dk=pi(),lh=eo(),dh=Yc(),Ut=ro(),fh=Y(),Ft=Qs(),Cr=Xs(),Wn=te(),ih=Kp(),Mk=oh(),ph=(e,t)=>new RegExp(e,t);ph.code="new RegExp";var Lk=["removeAdditional","useDefaults","coerceTypes"],Uk=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Fk={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."},Vk={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ah=200;function zk(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,T,M,S,_e,ve,xt,hr;let et=e.strict,gn=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=gn===!0||gn===void 0?1:gn||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:ph,yc=(s=e.uriResolver)!==null&&s!==void 0?s:Mk.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:et)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:et)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:et)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:et)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:et)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:ah,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:ah,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(T=e.inlineRefs)!==null&&T!==void 0?T:!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:(ve=e.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(xt=e.unicodeRegExp)!==null&&xt!==void 0?xt:!0,int32range:(hr=e.int32range)!==null&&hr!==void 0?hr:!0,uriResolver:yc}}class $i{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...zk(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new fh.ValueScope({scope:{},prefixes:Uk,es5:t,lines:r}),this.logger=Yk(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=dh.getRules(),ch.call(this,Fk,e,"NOT SUPPORTED"),ch.call(this,Vk,e,"DEPRECATED","warn"),this._metaOpts=Bk.call(this),e.formats)Kk.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Hk.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Gk.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=ih;if(r==="id")n={...ih},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,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}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(d){if(!(d instanceof lh.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;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=Ft.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=uh.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ut.SchemaEnv({schema:{},schemaId:r});if(t=Ut.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=uh.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=Ft.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(Jk.call(this,r,t),!t)return Wn.eachItem(r,(s)=>hu.call(this,s)),this;Zk.call(this,t);let n={...t,type:Cr.getJSONTypes(t.type),schemaType:Cr.getJSONTypes(t.schemaType)};return Wn.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 i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=hh(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:i}=this.opts;if(typeof e=="object")o=e[i];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 a=this._cache.get(e);if(a!==void 0)return a;r=Ft.normalizeId(o||r);let c=Ft.getSchemaRefs.call(this,e,r);if(a=new Ut.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_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 Ut.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{Ut.compileSchema.call(this,e)}finally{this.opts=t}}}$i.ValidationError=Dk.default;$i.MissingRefError=lh.default;yr.default=$i;function ch(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 uh(e){return e=Ft.normalizeId(e),this.schemas[e]||this.refs[e]}function Gk(){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 Kk(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Hk(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 Bk(){let e={...this.opts};for(let t of Lk)delete e[t];return e}var Wk={log(){},warn(){},error(){}};function Yk(e){if(e===!1)return Wk;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 Xk=/^[a-z_$][a-z0-9_$:-]*$/i;function Jk(e,t){let{RULES:r}=this;if(Wn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Xk.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,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Cr.getJSONTypes(t.type),schemaType:Cr.getJSONTypes(t.schemaType)}};if(t.before)Qk.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Qk(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 Zk(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hh(t);e.validateSchema=this.compile(t,!0)}var eO={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hh(e){return{anyOf:[e,eO]}}});var yh=g(function(gh){Object.defineProperty(gh,"__esModule",{value:!0});var nO={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};gh.default=nO});var Si=g(function(vh){Object.defineProperty(vh,"__esModule",{value:!0});vh.callRef=vh.getValidate=void 0;var oO=eo(),wi=mt(),he=Y(),Xn=pt(),bi=ro(),jr=te(),iO={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=bi.resolveRef.call(c,u,s,r);if(d===void 0)throw new oO.default(n.opts.uriResolver,s,r);if(d instanceof bi.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return Ei(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return Ei(e,he._`${h}.validate`,u,u.$async)}function p(h){let m=_h(e,h);Ei(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:he.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:he.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function _h(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):he._`${r.scopeValue("wrapper",{ref:t})}.validate`}vh.getValidate=_h;function Ei(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?Xn.default.this:he.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(he._`await ${wi.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(he._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(wi.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=he._`${h}.errors`;s.assign(Xn.default.vErrors,he._`${Xn.default.vErrors} === null ? ${m} : ${Xn.default.vErrors}.concat(${m})`),s.assign(Xn.default.errors,he._`${Xn.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=jr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",he._`${h}.evaluated.props`);o.props=jr.mergeEvaluated.props(s,_,o.props,he.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=jr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",he._`${h}.evaluated.items`);o.items=jr.mergeEvaluated.items(s,_,o.items,he.Name)}}}vh.callRef=Ei;vh.default=iO});var wh=g(function(Eh){Object.defineProperty(Eh,"__esModule",{value:!0});var uO=yh(),lO=Si(),dO=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",uO.default,lO.default];Eh.default=dO});var Sh=g(function(bh){Object.defineProperty(bh,"__esModule",{value:!0});var Dr=Y(),qr=Dr.operators,xi={maximum:{okStr:"<=",ok:qr.LTE,fail:qr.GT},minimum:{okStr:">=",ok:qr.GTE,fail:qr.LT},exclusiveMaximum:{okStr:"<",ok:qr.LT,fail:qr.GTE},exclusiveMinimum:{okStr:">",ok:qr.GT,fail:qr.LTE}},pO={message:({keyword:e,schemaCode:t})=>Dr.str`must be ${xi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Dr._`{comparison: ${xi[e].okStr}, limit: ${t}}`},hO={keyword:Object.keys(xi),type:"number",schemaType:"number",$data:!0,error:pO,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Dr._`${r} ${xi[t].fail} ${n} || isNaN(${r})`)}};bh.default=hO});var Rh=g(function(xh){Object.defineProperty(xh,"__esModule",{value:!0});var Vt=Y(),gO={message:({schemaCode:e})=>Vt.str`must be multiple of ${e}`,params:({schemaCode:e})=>Vt._`{multipleOf: ${e}}`},yO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gO,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?Vt._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:Vt._`${i} !== parseInt(${i})`;e.fail$data(Vt._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};xh.default=yO});var Oh=g(function(kh){Object.defineProperty(kh,"__esModule",{value:!0});function Th(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}kh.default=Th;Th.code='require("ajv/dist/runtime/ucs2length").default'});var Nh=g(function(Ph){Object.defineProperty(Ph,"__esModule",{value:!0});var nt=Y(),Ah=te(),$O=Oh(),EO={message({keyword:e,schemaCode:t}){return nt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>nt._`{limit: ${e}}`},wO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:EO,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?nt.operators.GT:nt.operators.LT,i=s.opts.unicode===!1?nt._`${r}.length`:nt._`${Ah.useFunc(e.gen,$O.default)}(${r})`;e.fail$data(nt._`${i} ${o} ${n}`)}};Ph.default=wO});var jh=g(function(Ch){Object.defineProperty(Ch,"__esModule",{value:!0});var Ih=mt(),Mr=Y(),SO={message:({schemaCode:e})=>Mr.str`must match pattern "${e}"`,params:({schemaCode:e})=>Mr._`{pattern: ${e}}`},xO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SO,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?Mr._`(new RegExp(${s}, ${i}))`:Ih.usePattern(e,n);e.fail$data(Mr._`!${a}.test(${t})`)}};Ch.default=xO});var Dh=g(function(qh){Object.defineProperty(qh,"__esModule",{value:!0});var zt=Y(),TO={message({keyword:e,schemaCode:t}){return zt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>zt._`{limit: ${e}}`},kO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:TO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?zt.operators.GT:zt.operators.LT;e.fail$data(zt._`Object.keys(${r}).length ${s} ${n}`)}};qh.default=kO});var Uh=g(function(Lh){Object.defineProperty(Lh,"__esModule",{value:!0});var Gt=mt(),Kt=Y(),Mh=te(),AO={message:({params:{missingProperty:e}})=>Kt.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Kt._`{missingProperty: ${e}}`},PO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:AO,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Mh.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(Kt.nil,l);else for(let f of r)Gt.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(Gt.checkMissingProp(e,r,f)),Gt.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Gt.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,Gt.propertyInData(t,s,f,a.ownProperties)),t.if(Kt.not(h),()=>{e.error(),t.break()})},Kt.nil)}}};Lh.default=PO});var Vh=g(function(Fh){Object.defineProperty(Fh,"__esModule",{value:!0});var Ht=Y(),IO={message({keyword:e,schemaCode:t}){return Ht.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Ht._`{limit: ${e}}`},CO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Ht.operators.GT:Ht.operators.LT;e.fail$data(Ht._`${r}.length ${s} ${n}`)}};Fh.default=CO});var Ri=g(function(Gh){Object.defineProperty(Gh,"__esModule",{value:!0});var zh=Js();zh.code='require("ajv/dist/runtime/equal").default';Gh.default=zh});var Bh=g(function(Hh){Object.defineProperty(Hh,"__esModule",{value:!0});var Jn=Xs(),se=Y(),Kh=te(),DO=Ri(),MO={message:({params:{i:e,j:t}})=>se.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>se._`{i: ${e}, j: ${t}}`},LO={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:MO,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?Jn.getSchemaTypes(o.items):[];e.block$data(c,d,se._`${i} === false`),e.ok(c);function d(){let h=t.let("i",se._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(se._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=Jn.checkDataTypes(u,y,a.opts.strictNumbers,Jn.DataType.Wrong),O=t.const("indices",se._`{}`);t.for(se._`;${h}--;`,()=>{if(t.let(y,se._`${r}[${h}]`),t.if(_,se._`continue`),u.length>1)t.if(se._`typeof ${y} == "string"`,se._`${y} += "_"`);t.if(se._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,se._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(se._`${O}[${y}] = ${h}`)})}function f(h,m){let y=Kh.useFunc(t,DO.default),_=t.name("outer");t.label(_).for(se._`;${h}--;`,()=>t.for(se._`${m} = ${h}; ${m}--;`,()=>t.if(se._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};Hh.default=LO});var Xh=g(function(Yh){Object.defineProperty(Yh,"__esModule",{value:!0});var Qn=Y(),Wh=te(),FO=Ri(),VO={message:"must be equal to constant",params:({schemaCode:e})=>Qn._`{allowedValue: ${e}}`},zO={keyword:"const",$data:!0,error:VO,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(Qn._`!${Wh.useFunc(t,FO.default)}(${r}, ${s})`);else e.fail(Qn._`${o} !== ${r}`)}};Yh.default=zO});var Zh=g(function(Qh){Object.defineProperty(Qh,"__esModule",{value:!0});var Bt=Y(),Jh=te(),KO=Ri(),HO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Bt._`{allowedValues: ${e}}`},BO={keyword:"enum",schemaType:"array",$data:!0,error:HO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Jh.useFunc(t,KO.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=Bt.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(Bt._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?Bt._`${u()}(${r}, ${f}[${h}])`:Bt._`${r} === ${m}`}}};Qh.default=BO});var tm=g(function(em){Object.defineProperty(em,"__esModule",{value:!0});var YO=Sh(),XO=Rh(),JO=Nh(),QO=jh(),ZO=Dh(),eA=Uh(),tA=Vh(),rA=Bh(),nA=Xh(),sA=Zh(),oA=[YO.default,XO.default,JO.default,QO.default,ZO.default,eA.default,tA.default,rA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nA.default,sA.default];em.default=oA});var mu=g(function(nm){Object.defineProperty(nm,"__esModule",{value:!0});nm.validateAdditionalItems=void 0;var st=Y(),Zn=te(),aA={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},cA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aA,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Zn.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rm(e,n)}};function rm(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",st._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(st._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Zn.alwaysValidSchema(i,n)){let u=r.var("valid",st._`${a} <= ${t.length}`);r.if(st.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:Zn.Type.Num},u),!i.allErrors)r.if(st.not(u),()=>r.break())})}}nm.validateAdditionalItems=rm;nm.default=cA});var gu=g(function(am){Object.defineProperty(am,"__esModule",{value:!0});am.validateTuple=void 0;var Ti=Y(),Lr=te(),om=mt(),lA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return im(e,"additionalItems",t);if(r.items=!0,Lr.alwaysValidSchema(r,t))return;e.ok(om.validateArray(e))}};function im(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Lr.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",Ti._`${o}.length`);r.forEach((l,p)=>{if(Lr.alwaysValidSchema(a,l))return;n.if(Ti._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Lr.checkStrictMode(a,y,p.strictTuples)}}}am.validateTuple=im;am.default=lA});var dm=g(function(lm){Object.defineProperty(lm,"__esModule",{value:!0});var um=gu(),fA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>um.validateTuple(e,"items")};lm.default=fA});var gm=g(function(mm){Object.defineProperty(mm,"__esModule",{value:!0});var ki=Y(),fm=te(),pm=mt(),hm=mu(),hA={message:({params:{len:e}})=>ki.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ki._`{limit: ${e}}`},mA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:hA,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,fm.alwaysValidSchema(n,t))return;if(s)hm.validateAdditionalItems(e,s);else e.ok(pm.validateArray(e))}};mm.default=mA});var _m=g(function(ym){Object.defineProperty(ym,"__esModule",{value:!0});var $e=Y(),Ur=te(),yA={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}}`},_A={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",$e._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){Ur.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){Ur.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Ur.alwaysValidSchema(o,r)){let m=$e._`${d} >= ${i}`;if(a!==void 0)m=$e._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if($e._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:Ur.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code($e._`${m}++`),a===void 0)t.if($e._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if($e._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if($e._`${m} >= ${i}`,()=>t.assign(l,!0))}}};ym.default=_A});var Oi=g(function(wm){Object.defineProperty(wm,"__esModule",{value:!0});wm.validateSchemaDeps=wm.validatePropertyDeps=wm.error=void 0;var es=Y(),vm=te(),Wt=mt();wm.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},
|
|
7
|
+
|| ${i} === "boolean" || ${s} === null`).assign(a,x._`[${s}]`)}}}function $R({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Qc(e,t,r,n=Vn.Correct){let s=n===Vn.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=i(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Vn.Correct?o:x.not(o);function i(a=x.nil){return x.and(x._`typeof ${t} == "number"`,a,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=ui.toHash(e);if(o.array&&o.object){let i=x._`typeof ${t} != "object"`;s=o.null?i:x._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let i in o)s=x.and(s,Qc(i,t,r,n));return s}Hf.checkDataTypes=Zc;var bR={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=wR(e);zf.reportError(t,bR)}Hf.reportTypeError=eu;function wR(e){let{gen:t,data:r,schema:n}=e,s=ui.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=te();function OR(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=OR;function Wf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=mt._`${o}${mt.getProperty(t)}`;if(s){Yf.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=mt._`${a} === undefined`;if(i.useDefaults==="empty")c=mt._`${c} || ${a} === null || ${a} === ""`;n.if(c,mt._`${a} = ${mt.stringify(r)}`)}});var gt=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(),zn=te(),Ir=ht(),Zf=te();function AR(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=AR;function NR({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=NR;function IR(e,t){e.setParams({missingProperty:t},!0),e.error()}rp.reportMissingProp=IR;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 PR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${tu(e,t,r)}`:s}rp.propertyInData=PR;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 CR(e,t){return tp(t).filter((r)=>!zn.alwaysValidSchema(e,t[r]))}rp.schemaProperties=CR;function jR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?V._`${e}, ${t}, ${n}${s}`:t,l=[[Ir.default.instancePath,V.strConcat(Ir.default.instancePath,o)],[Ir.default.parentData,i.parentData],[Ir.default.parentDataProperty,i.parentDataProperty],[Ir.default.rootData,Ir.default.rootData]];if(i.opts.dynamicRef)l.push([Ir.default.dynamicAnchors,Ir.default.dynamicAnchors]);let p=V._`${d}, ${r.object(...l)}`;return c!==V.nil?V._`${a}.call(${c}, ${p})`:V._`${a}(${p})`}rp.callValidateCode=jR;var qR=V._`new RegExp`;function DR({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"?qR:Zf.useFunc(e,s)}(${r}, ${n})`})}rp.usePattern=DR;function MR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:zn.Type.Num},o),t.if(V.not(o),a)})}}rp.validateArray=MR;function LR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>zn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,V._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(V.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}rp.validateUnion=LR});var lp=g(function(cp){Object.defineProperty(cp,"__esModule",{value:!0});cp.validateKeywordUsage=cp.validSchemaType=cp.funcKeywordCode=cp.macroKeywordCode=void 0;var le=Y(),bn=ht(),op=gt(),ip=Ys();function QR(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=ap(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:le.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}cp.macroKeywordCode=QR;function ZR(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;tk(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=ap(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)sp(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)sp(e);y(()=>ek(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(le._`await `),(O)=>n.assign(l,!1).if(le._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,le._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=le._`${d}.errors`;return n.assign(_,null),m(le.nil),_}function m(_=t.async?le._`await `:le.nil){let O=c.opts.passContext?bn.default.this:bn.default.self,k=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,le._`${_}${op.callValidateCode(e,d,O,k)}`,t.modifying)}function y(_){var O;n.if(le.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}cp.funcKeywordCode=ZR;function sp(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,le._`${n.parentData}[${n.parentDataProperty}]`))}function ek(e,t){let{gen:r}=e;r.if(le._`Array.isArray(${t})`,()=>{r.assign(bn.default.vErrors,le._`${bn.default.vErrors} === null ? ${t} : ${bn.default.vErrors}.concat(${t})`).assign(bn.default.errors,le._`${bn.default.vErrors}.length`),ip.extendErrors(e)},()=>e.error())}function tk({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ap(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:le.stringify(r)})}function rk(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=rk;function nk({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 i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.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=nk});var pp=g(function(dp){Object.defineProperty(dp,"__esModule",{value:!0});dp.extendSubschemaMode=dp.extendSubschemaData=dp.getSubschema=void 0;var je=Y(),li=te();function ak(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:je._`${e.schemaPath}${je.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:je._`${e.schemaPath}${je.getProperty(t)}${je.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${li.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}dp.getSubschema=ak;function ck(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",je._`${t.data}${je.getProperty(r)}`,!0);c(p),e.errorPath=je.str`${u}${li.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=je._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof je.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}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=ck;function uk(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=uk});var Js=g(function(lG,hp){hp.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 i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var nu=g(function(dG,mp){var Pr=mp.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(){};di(t,n,s,e,"",e)};Pr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Pr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pr.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 di(e,t,r,n,s,o,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,i,a,c,u);for(var d in n){var l=n[d];if(Array.isArray(l)){if(d in Pr.arrayKeywords)for(var p=0;p<l.length;p++)di(e,t,r,l[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in Pr.propsKeywords){if(l&&typeof l=="object")for(var f in l)di(e,t,r,l[f],s+"/"+d+"/"+fk(f),o,s,d,n,f)}else if(d in Pr.keywords||e.allKeys&&!(d in Pr.skipKeywords))di(e,t,r,l,s+"/"+d,o,s,d,n)}r(n,s,o,i,a,c,u)}}function fk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=g(function($p){Object.defineProperty($p,"__esModule",{value:!0});$p.getSchemaRefs=$p.resolveUrl=$p.normalizeId=$p._getFullPath=$p.getFullPath=$p.inlineRef=void 0;var gp=te(),pk=Js(),hk=nu(),mk=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function gk(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!su(e);if(!t)return!1;return yp(e)<=t}$p.inlineRef=gk;var yk=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function su(e){for(let t in e){if(yk.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++,mk.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=Gn(t);let n=e.parse(t);return vp(e,n)}$p.getFullPath=_p;function vp(e,t){return e.serialize(t).split("#")[0]+"#"}$p._getFullPath=vp;var _k=/#\/?$/;function Gn(e){return e?e.replace(_k,""):""}$p.normalizeId=Gn;function vk(e,t,r){return r=Gn(r),e.resolve(t,r)}$p.resolveUrl=vk;var $k=/^[a-z_][-a-z0-9._]*$/i;function bk(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Gn(e[r]||t),o={"":s},i=_p(n,s,!1),a={},c=new Set;return hk(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(k){let M=this.opts.uriResolver.resolve;if(k=Gn(y?M(y,k):k),c.has(k))throw d(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,k);else if(k!==Gn(m))if(k[0]==="#")u(l,a[k],k),a[k]=l;else this.refs[k]=m;return k}function O(k){if(typeof k=="string"){if(!$k.test(k))throw Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),a;function u(l,p,f){if(p!==void 0&&!pk(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}$p.getSchemaRefs=bk});var Zs=g(function(qp){Object.defineProperty(qp,"__esModule",{value:!0});qp.getData=qp.KeywordCxt=qp.validateFunctionCode=void 0;var pi=Cf(),fi=Xs(),Hn=Jc(),Cr=Xs(),xp=Qf(),Ut=lp(),Kn=pp(),b=Y(),H=ht(),Rp=Qs(),Me=te(),Lt=Ys();function kk(e){if(Op(e)){if(Ap(e),Tp(e)){Ak(e);return}}kp(e,()=>pi.topBoolOrEmptySchema(e))}qp.validateFunctionCode=kk;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"; ${wp(r,s)}`),Ok(e,s),e.code(o)});else e.func(t,b._`${H.default.data}, ${Tk(s)}`,n.$async,()=>e.code(wp(r,s)).code(o))}function Tk(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 Ok(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 Ak(e){let{schema:t,opts:r,gen:n}=e;kp(e,()=>{if(r.$comment&&t.$comment)Ip(e);if(jk(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)Nk(e);Np(e),Mk(e)});return}function Nk(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 wp(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?b._`/*# sourceURL=${r} */`:b.nil}function Ik(e,t){if(Op(e)){if(Ap(e),Tp(e)){Pk(e,t);return}}pi.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 Op(e){return typeof e.schema!="boolean"}function Pk(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Ip(e);qk(e),Dk(e);let o=n.const("_errs",H.default.errors);Np(e,o),n.var(t,b._`${o} === ${H.default.errors}`)}function Ap(e){Me.checkUnknownRules(e),Ck(e)}function Np(e,t){if(e.opts.jtd)return Ep(e,[],!1,t);let r=fi.getSchemaTypes(e.schema),n=fi.coerceAndCheckDataType(e,r);Ep(e,r,!n,t)}function Ck(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Me.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function jk(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Me.checkStrictMode(e,"default is ignored in the schema root")}function qk(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Rp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function Dk(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Ip({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 i=b.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(b._`${H.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function Mk(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)Lk(e);t.return(b._`${H.default.errors} === 0`)}}function Lk({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:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Me.schemaHasRulesButRef(o,d))){s.block(()=>Cp(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)Uk(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!Hn.shouldUseGroup(o,p))return;if(p.type){if(s.if(Cr.checkDataType(p.type,i,c.strictNumbers)),Sp(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Cr.reportTypeError(e);s.endIf()}else Sp(e,p);if(!a)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(Hn.shouldUseRule(n,o))Cp(e,o.keyword,o.definition,t.type)})}function Uk(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Fk(e,t),!e.opts.allowUnionTypes)Vk(e,t);zk(e,e.dataTypes)}function Fk(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Pp(e.dataTypes,r))ou(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Kk(e,t)}function Vk(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))ou(e,"use allowUnionTypes to allow union type keyword")}function zk(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Hn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>Gk(t,i)))ou(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Gk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Pp(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Kk(e,t){let r=[];for(let n of e.dataTypes)if(Pp(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)`,Me.checkStrictMode(e,t,e.opts.strictTypes)}class iu{constructor(e,t,r){if(Ut.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=Me.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,!Ut.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?Lt.reportExtraError:Lt.reportError)(this,this.def.error,t)}$dataError(){Lt.reportError(this,this.def.$dataError||Lt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Lt.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(),i());function o(){if(r.length){if(!(t instanceof b.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return b._`${Cr.checkDataTypes(a,t,s.opts.strictNumbers,Cr.DataType.Wrong)}`}return b.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return b._`!${a}(${t})`}return b.nil}}subschema(e,t){let r=Kn.getSubschema(this.it,e);Kn.extendSubschemaData(r,this.it,e),Kn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return Ik(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=Me.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Me.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=iu;function Cp(e,t,r,n){let s=new iu(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Ut.funcKeywordCode(s,r);else if("macro"in r)Ut.macroKeywordCode(s,r);else if(r.compile||r.validate)Ut.funcKeywordCode(s,r)}var Hk=/^\/(?:[^~]|~0|~1)*$/,Bk=/^([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(!Hk.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=Bk.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=b._`${o}${b.getProperty(Me.unescapeJsonPointer(u))}`,i=b._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}qp.getData=jp});var hi=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 eo=g(function(Fp){Object.defineProperty(Fp,"__esModule",{value:!0});var Bn=Qs();class Up extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Bn.resolveUrl(e,t,r),this.missingSchema=Bn.normalizeId(Bn.getFullPath(e,this.missingRef))}}Fp.default=Up});var ro=g(function(Gp){Object.defineProperty(Gp,"__esModule",{value:!0});Gp.resolveSchema=Gp.getCompilingSchema=Gp.resolveRef=Gp.compileSchema=Gp.SchemaEnv=void 0;var Re=Y(),Qk=hi(),wn=ht(),ke=Qs(),mi=te(),Vp=Zs();class to{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:ke.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=to;function cu(e){let t=zp.call(this,e);if(t)return t;let r=ke.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Re.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:Qk.default,code:Re._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:wn.default.data,parentData:wn.default.parentData,parentDataProperty:wn.default.parentDataProperty,dataNames:[wn.default.data],dataPathArr:[Re.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Re.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Re.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Re._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),Vp.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(wn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${wn.default.self}`,`${wn.default.scope}`,d)(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:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Re.Name?void 0:h,items:m instanceof Re.Name?void 0:m,dynamicProps:h instanceof Re.Name,dynamicItems:m instanceof Re.Name},f.source)f.source.evaluated=Re.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}Gp.compileSchema=cu;function Zk(e,t,r){var n;r=ke.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=rT.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new to({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=eT.call(this,o)}Gp.resolveRef=Zk;function eT(e){if(ke.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(tT(t,e))return t}Gp.getCompilingSchema=zp;function tT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function rT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||gi.call(this,e,t)}function gi(e,t){let r=this.opts.uriResolver.parse(t),n=ke._getFullPath(this.opts.uriResolver,r),s=ke.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return au.call(this,r,e);let o=ke.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=gi.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return au.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)cu.call(this,i);if(o===ke.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=ke.resolveUrl(this.opts.uriResolver,s,u);return new to({schema:a,schemaId:c,root:e,baseId:s})}return au.call(this,r,i)}Gp.resolveSchema=gi;var nT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function au(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[mi.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!nT.has(a)&&u)t=ke.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!mi.schemaHasRulesButRef(r,this.RULES)){let a=ke.resolveUrl(this.opts.uriResolver,t,r.$ref);o=gi.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new to({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Hp=g(function(yG,cT){cT.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(_G,Xp){var uT=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 lT=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Bp(e){return e.length=0,!0}function dT(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 fT(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=dT;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)i=!0;if(!a(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(!a(s,n,r))break;a=Bp}else{s.push(u);continue}}if(s.length)if(a===Bp)r.zone=s.join("");else if(i)n.push(s.join(""));else n.push(uu(s));return r.address=n.join(""),r}function Yp(e){if(pT(e,":")<2)return{host:e,isIPV6:!1};let t=fT(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 pT(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function hT(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 mT(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 gT(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:lT,recomposeAuthority:gT,normalizeComponentEncoding:mT,removeDotSegments:hT,isIPv4:Wp,isUUID:uT,normalizeIPv6:Yp,stringArrayToHexStripped:uu}});var th=g(function(vG,eh){var{isUUID:yT}=lu(),_T=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,vT=["http","https","ws","wss","urn","urn:uuid"];function $T(e){return vT.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 bT(e){return e.secure=du(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function wT(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 ET(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 ST(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 i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function xT(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!yT(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function RT(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Zp={scheme:"http",domainHost:!0,parse:Jp,serialize:Qp},kT={scheme:"https",domainHost:Zp.domainHost,parse:Jp,serialize:Qp},yi={scheme:"ws",domainHost:!0,parse:bT,serialize:wT},TT={scheme:"wss",domainHost:yi.domainHost,parse:yi.parse,serialize:yi.serialize},OT={scheme:"urn",parse:ET,serialize:ST,skipNormalize:!0},AT={scheme:"urn:uuid",parse:xT,serialize:RT,skipNormalize:!0},_i={http:Zp,https:kT,ws:yi,wss:TT,urn:OT,"urn:uuid":AT};Object.setPrototypeOf(_i,null);function fu(e){return e&&(_i[e]||_i[e.toLowerCase()])||void 0}eh.exports={wsIsSecure:du,SCHEMES:_i,isValidSchemeName:$T,getSchemeHandler:fu}});var hu=g(function($G,$i){var{normalizeIPv6:NT,removeDotSegments:no,recomposeAuthority:IT,normalizeComponentEncoding:vi,isIPv4:PT,nonSimpleDomain:CT}=lu(),{SCHEMES:jT,getSchemeHandler:rh}=th();function qT(e,t){if(typeof e==="string")e=Ft(yr(e,t),t);else if(typeof e==="object")e=yr(Ft(e,t),t);return e}function DT(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=nh(yr(e,n),yr(t,n),n,!0);return n.skipEscape=!0,Ft(s,n)}function nh(e,t,r,n){let s={};if(!n)e=yr(Ft(e,r),r),t=yr(Ft(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=no(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=no(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=no(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=no(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 MT(e,t,r){if(typeof e==="string")e=unescape(e),e=Ft(vi(yr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Ft(vi(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Ft(vi(yr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Ft(vi(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Ft(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=rh(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 i=IT(r);if(i!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(i),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let a=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))a=no(a);if(i===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);s.push(a)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var LT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\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(LT);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(PT(n.host)===!1){let c=NT(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 i=rh(r.scheme||n.scheme);if(!r.unicodeSupport&&(!i||!i.unicodeSupport)){if(n.host&&(r.domainHost||i&&i.domainHost)&&s===!1&&CT(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}}if(!i||i&&!i.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(i&&i.parse)i.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var pu={SCHEMES:jT,normalize:qT,resolve:DT,resolveComponent:nh,equal:MT,serialize:Ft,parse:yr};$i.exports=pu;$i.exports.default=pu;$i.exports.fastUri=pu});var ih=g(function(oh){Object.defineProperty(oh,"__esModule",{value:!0});var sh=hu();sh.code='require("ajv/dist/runtime/uri").default';oh.default=sh});var gh=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 FT=Zs();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return FT.KeywordCxt}});var Yn=Y();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Yn._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Yn.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Yn.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Yn.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Yn.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Yn.CodeGen}});var VT=hi(),dh=eo(),fh=Xc(),Vt=ro(),ph=Y(),zt=Qs(),jr=Xs(),Wn=te(),ah=Hp(),zT=ih(),hh=(e,t)=>new RegExp(e,t);hh.code="new RegExp";var GT=["removeAdditional","useDefaults","coerceTypes"],KT=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),HT={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."},BT={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ch=200;function WT(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,k,M,S,Ee,Se,pt,Rt;let lt=e.strict,jt=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=jt===!0||jt===void 0?1:jt||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:hh,_c=(s=e.uriResolver)!==null&&s!==void 0?s:zT.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:lt)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:lt)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:lt)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:lt)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:lt)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:ch,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:ch,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!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:(Ee=e.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Se=e.validateFormats)!==null&&Se!==void 0?Se:!0,unicodeRegExp:(pt=e.unicodeRegExp)!==null&&pt!==void 0?pt:!0,int32range:(Rt=e.int32range)!==null&&Rt!==void 0?Rt:!0,uriResolver:_c}}class bi{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...WT(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new ph.ValueScope({scope:{},prefixes:KT,es5:t,lines:r}),this.logger=eO(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=fh.getRules(),uh.call(this,HT,e,"NOT SUPPORTED"),uh.call(this,BT,e,"DEPRECATED","warn"),this._metaOpts=QT.call(this),e.formats)XT.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)JT.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);YT.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=ah;if(r==="id")n={...ah},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,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}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(d){if(!(d instanceof dh.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;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=zt.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=lh.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Vt.SchemaEnv({schema:{},schemaId:r});if(t=Vt.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=lh.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=zt.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(rO.call(this,r,t),!t)return Wn.eachItem(r,(s)=>mu.call(this,s)),this;sO.call(this,t);let n={...t,type:jr.getJSONTypes(t.type),schemaType:jr.getJSONTypes(t.schemaType)};return Wn.eachItem(r,n.type.length===0?(s)=>mu.call(this,s,n):(s)=>n.type.forEach((o)=>mu.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 i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=mh(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:i}=this.opts;if(typeof e=="object")o=e[i];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 a=this._cache.get(e);if(a!==void 0)return a;r=zt.normalizeId(o||r);let c=zt.getSchemaRefs.call(this,e,r);if(a=new Vt.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_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 Vt.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{Vt.compileSchema.call(this,e)}finally{this.opts=t}}}bi.ValidationError=VT.default;bi.MissingRefError=dh.default;_r.default=bi;function uh(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 lh(e){return e=zt.normalizeId(e),this.schemas[e]||this.refs[e]}function YT(){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 XT(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function JT(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 QT(){let e={...this.opts};for(let t of GT)delete e[t];return e}var ZT={log(){},warn(){},error(){}};function eO(e){if(e===!1)return ZT;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 tO=/^[a-z_$][a-z0-9_$:-]*$/i;function rO(e,t){let{RULES:r}=this;if(Wn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!tO.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 mu(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,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:jr.getJSONTypes(t.type),schemaType:jr.getJSONTypes(t.schemaType)}};if(t.before)nO.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function nO(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 sO(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=mh(t);e.validateSchema=this.compile(t,!0)}var oO={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mh(e){return{anyOf:[e,oO]}}});var _h=g(function(yh){Object.defineProperty(yh,"__esModule",{value:!0});var cO={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yh.default=cO});var xi=g(function($h){Object.defineProperty($h,"__esModule",{value:!0});$h.callRef=$h.getValidate=void 0;var lO=eo(),Ei=gt(),he=Y(),Xn=ht(),Si=ro(),qr=te(),dO={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=Si.resolveRef.call(c,u,s,r);if(d===void 0)throw new lO.default(n.opts.uriResolver,s,r);if(d instanceof Si.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return wi(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return wi(e,he._`${h}.validate`,u,u.$async)}function p(h){let m=vh(e,h);wi(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:he.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:he.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function vh(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):he._`${r.scopeValue("wrapper",{ref:t})}.validate`}$h.getValidate=vh;function wi(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?Xn.default.this:he.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(he._`await ${Ei.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(he._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(Ei.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=he._`${h}.errors`;s.assign(Xn.default.vErrors,he._`${Xn.default.vErrors} === null ? ${m} : ${Xn.default.vErrors}.concat(${m})`),s.assign(Xn.default.errors,he._`${Xn.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=qr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",he._`${h}.evaluated.props`);o.props=qr.mergeEvaluated.props(s,_,o.props,he.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=qr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",he._`${h}.evaluated.items`);o.items=qr.mergeEvaluated.items(s,_,o.items,he.Name)}}}$h.callRef=wi;$h.default=dO});var Eh=g(function(wh){Object.defineProperty(wh,"__esModule",{value:!0});var hO=_h(),mO=xi(),gO=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",hO.default,mO.default];wh.default=gO});var xh=g(function(Sh){Object.defineProperty(Sh,"__esModule",{value:!0});var Mr=Y(),Dr=Mr.operators,Ri={maximum:{okStr:"<=",ok:Dr.LTE,fail:Dr.GT},minimum:{okStr:">=",ok:Dr.GTE,fail:Dr.LT},exclusiveMaximum:{okStr:"<",ok:Dr.LT,fail:Dr.GTE},exclusiveMinimum:{okStr:">",ok:Dr.GT,fail:Dr.LTE}},_O={message:({keyword:e,schemaCode:t})=>Mr.str`must be ${Ri[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Mr._`{comparison: ${Ri[e].okStr}, limit: ${t}}`},vO={keyword:Object.keys(Ri),type:"number",schemaType:"number",$data:!0,error:_O,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Mr._`${r} ${Ri[t].fail} ${n} || isNaN(${r})`)}};Sh.default=vO});var kh=g(function(Rh){Object.defineProperty(Rh,"__esModule",{value:!0});var Gt=Y(),bO={message:({schemaCode:e})=>Gt.str`must be multiple of ${e}`,params:({schemaCode:e})=>Gt._`{multipleOf: ${e}}`},wO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:bO,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?Gt._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:Gt._`${i} !== parseInt(${i})`;e.fail$data(Gt._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Rh.default=wO});var Ah=g(function(Oh){Object.defineProperty(Oh,"__esModule",{value:!0});function Th(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}Oh.default=Th;Th.code='require("ajv/dist/runtime/ucs2length").default'});var Ph=g(function(Ih){Object.defineProperty(Ih,"__esModule",{value:!0});var rt=Y(),Nh=te(),xO=Ah(),RO={message({keyword:e,schemaCode:t}){return rt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>rt._`{limit: ${e}}`},kO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:RO,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?rt.operators.GT:rt.operators.LT,i=s.opts.unicode===!1?rt._`${r}.length`:rt._`${Nh.useFunc(e.gen,xO.default)}(${r})`;e.fail$data(rt._`${i} ${o} ${n}`)}};Ih.default=kO});var qh=g(function(jh){Object.defineProperty(jh,"__esModule",{value:!0});var Ch=gt(),Lr=Y(),OO={message:({schemaCode:e})=>Lr.str`must match pattern "${e}"`,params:({schemaCode:e})=>Lr._`{pattern: ${e}}`},AO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:OO,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?Lr._`(new RegExp(${s}, ${i}))`:Ch.usePattern(e,n);e.fail$data(Lr._`!${a}.test(${t})`)}};jh.default=AO});var Mh=g(function(Dh){Object.defineProperty(Dh,"__esModule",{value:!0});var Kt=Y(),IO={message({keyword:e,schemaCode:t}){return Kt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Kt._`{limit: ${e}}`},PO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:IO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Kt.operators.GT:Kt.operators.LT;e.fail$data(Kt._`Object.keys(${r}).length ${s} ${n}`)}};Dh.default=PO});var Fh=g(function(Uh){Object.defineProperty(Uh,"__esModule",{value:!0});var Ht=gt(),Bt=Y(),Lh=te(),jO={message:({params:{missingProperty:e}})=>Bt.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Bt._`{missingProperty: ${e}}`},qO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:jO,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Lh.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(Bt.nil,l);else for(let f of r)Ht.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(Ht.checkMissingProp(e,r,f)),Ht.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Ht.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,Ht.propertyInData(t,s,f,a.ownProperties)),t.if(Bt.not(h),()=>{e.error(),t.break()})},Bt.nil)}}};Uh.default=qO});var zh=g(function(Vh){Object.defineProperty(Vh,"__esModule",{value:!0});var Wt=Y(),MO={message({keyword:e,schemaCode:t}){return Wt.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Wt._`{limit: ${e}}`},LO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Wt.operators.GT:Wt.operators.LT;e.fail$data(Wt._`${r}.length ${s} ${n}`)}};Vh.default=LO});var ki=g(function(Kh){Object.defineProperty(Kh,"__esModule",{value:!0});var Gh=Js();Gh.code='require("ajv/dist/runtime/equal").default';Kh.default=Gh});var Wh=g(function(Bh){Object.defineProperty(Bh,"__esModule",{value:!0});var Jn=Xs(),se=Y(),Hh=te(),VO=ki(),zO={message:({params:{i:e,j:t}})=>se.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>se._`{i: ${e}, j: ${t}}`},GO={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:zO,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?Jn.getSchemaTypes(o.items):[];e.block$data(c,d,se._`${i} === false`),e.ok(c);function d(){let h=t.let("i",se._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(se._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=Jn.checkDataTypes(u,y,a.opts.strictNumbers,Jn.DataType.Wrong),O=t.const("indices",se._`{}`);t.for(se._`;${h}--;`,()=>{if(t.let(y,se._`${r}[${h}]`),t.if(_,se._`continue`),u.length>1)t.if(se._`typeof ${y} == "string"`,se._`${y} += "_"`);t.if(se._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,se._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(se._`${O}[${y}] = ${h}`)})}function f(h,m){let y=Hh.useFunc(t,VO.default),_=t.name("outer");t.label(_).for(se._`;${h}--;`,()=>t.for(se._`${m} = ${h}; ${m}--;`,()=>t.if(se._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};Bh.default=GO});var Jh=g(function(Xh){Object.defineProperty(Xh,"__esModule",{value:!0});var Qn=Y(),Yh=te(),HO=ki(),BO={message:"must be equal to constant",params:({schemaCode:e})=>Qn._`{allowedValue: ${e}}`},WO={keyword:"const",$data:!0,error:BO,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(Qn._`!${Yh.useFunc(t,HO.default)}(${r}, ${s})`);else e.fail(Qn._`${o} !== ${r}`)}};Xh.default=WO});var em=g(function(Zh){Object.defineProperty(Zh,"__esModule",{value:!0});var Yt=Y(),Qh=te(),XO=ki(),JO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Yt._`{allowedValues: ${e}}`},QO={keyword:"enum",schemaType:"array",$data:!0,error:JO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Qh.useFunc(t,XO.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=Yt.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(Yt._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?Yt._`${u()}(${r}, ${f}[${h}])`:Yt._`${r} === ${m}`}}};Zh.default=QO});var rm=g(function(tm){Object.defineProperty(tm,"__esModule",{value:!0});var eA=xh(),tA=kh(),rA=Ph(),nA=qh(),sA=Mh(),oA=Fh(),iA=zh(),aA=Wh(),cA=Jh(),uA=em(),lA=[eA.default,tA.default,rA.default,nA.default,sA.default,oA.default,iA.default,aA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},cA.default,uA.default];tm.default=lA});var gu=g(function(sm){Object.defineProperty(sm,"__esModule",{value:!0});sm.validateAdditionalItems=void 0;var nt=Y(),Zn=te(),fA={message:({params:{len:e}})=>nt.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>nt._`{limit: ${e}}`},pA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:fA,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Zn.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}nm(e,n)}};function nm(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",nt._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(nt._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Zn.alwaysValidSchema(i,n)){let u=r.var("valid",nt._`${a} <= ${t.length}`);r.if(nt.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:Zn.Type.Num},u),!i.allErrors)r.if(nt.not(u),()=>r.break())})}}sm.validateAdditionalItems=nm;sm.default=pA});var yu=g(function(cm){Object.defineProperty(cm,"__esModule",{value:!0});cm.validateTuple=void 0;var Ti=Y(),Ur=te(),im=gt(),mA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return am(e,"additionalItems",t);if(r.items=!0,Ur.alwaysValidSchema(r,t))return;e.ok(im.validateArray(e))}};function am(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Ur.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",Ti._`${o}.length`);r.forEach((l,p)=>{if(Ur.alwaysValidSchema(a,l))return;n.if(Ti._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Ur.checkStrictMode(a,y,p.strictTuples)}}}cm.validateTuple=am;cm.default=mA});var fm=g(function(dm){Object.defineProperty(dm,"__esModule",{value:!0});var lm=yu(),yA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>lm.validateTuple(e,"items")};dm.default=yA});var ym=g(function(gm){Object.defineProperty(gm,"__esModule",{value:!0});var Oi=Y(),pm=te(),hm=gt(),mm=gu(),vA={message:({params:{len:e}})=>Oi.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Oi._`{limit: ${e}}`},$A={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:vA,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,pm.alwaysValidSchema(n,t))return;if(s)mm.validateAdditionalItems(e,s);else e.ok(hm.validateArray(e))}};gm.default=$A});var vm=g(function(_m){Object.defineProperty(_m,"__esModule",{value:!0});var _e=Y(),Fr=te(),wA={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}}`},EA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:wA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",_e._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){Fr.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){Fr.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Fr.alwaysValidSchema(o,r)){let m=_e._`${d} >= ${i}`;if(a!==void 0)m=_e._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if(_e._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:Fr.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code(_e._`${m}++`),a===void 0)t.if(_e._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(_e._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(_e._`${m} >= ${i}`,()=>t.assign(l,!0))}}};_m.default=EA});var Ai=g(function(Em){Object.defineProperty(Em,"__esModule",{value:!0});Em.validateSchemaDeps=Em.validatePropertyDeps=Em.error=void 0;var es=Y(),$m=te(),Xt=gt();Em.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},
|
|
8
8
|
missingProperty: ${n},
|
|
9
9
|
depsCount: ${t},
|
|
10
|
-
deps: ${r}}`};var $A={keyword:"dependencies",type:"object",schemaType:"object",error:wm.error,code(e){let[t,r]=EA(e);$m(e,t),Em(e,r)}};function EA({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 $m(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 i in t){let a=t[i];if(a.length===0)continue;let c=Wt.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)Wt.checkReportMissingProp(e,u)});else r.if(es._`${c} && (${Wt.checkMissingProp(e,a,o)})`),Wt.reportMissingProp(e,o),r.else()}}wm.validatePropertyDeps=$m;function Em(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(vm.alwaysValidSchema(o,t[a]))continue;r.if(Wt.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}wm.validateSchemaDeps=Em;wm.default=$A});var Tm=g(function(Rm){Object.defineProperty(Rm,"__esModule",{value:!0});var Ai=Y(),xm=te(),SA={message:"property name must be valid",params:({params:e})=>Ai._`{propertyName: ${e.propertyName}}`},xA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:SA,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(xm.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(Ai.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};Rm.default=xA});var yu=g(function(km){Object.defineProperty(km,"__esModule",{value:!0});var Fr=mt(),ke=Y(),TA=pt(),Vr=te(),kA={message:"must NOT have additional properties",params:({params:e})=>ke._`{additionalProperty: ${e.additionalProperty}}`},OA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:kA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&Vr.alwaysValidSchema(i,r))return;let u=Fr.allSchemaProperties(n.properties),d=Fr.allSchemaProperties(n.patternProperties);l(),e.ok(ke._`${o} === ${TA.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=Vr.schemaRefOrVal(i,n.properties,"properties");_=Fr.isOwnProperty(t,O,y)}else if(u.length)_=ke.or(...u.map((O)=>ke._`${y} === ${O}`));else _=ke.nil;if(d.length)_=ke.or(_,...d.map((O)=>ke._`${Fr.usePattern(e,O)}.test(${y})`));return ke.not(_)}function f(y){t.code(ke._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Vr.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(ke.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(ke.not(_),()=>t.break())}}function m(y,_,O){let T={keyword:"additionalProperties",dataProp:y,dataPropType:Vr.Type.Str};if(O===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(T,_)}}};km.default=OA});var Nm=g(function(Pm){Object.defineProperty(Pm,"__esModule",{value:!0});var Am=Zs(),Pi=mt(),ts=te(),Om=yu(),PA={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)Om.default.code(new Am.KeywordCxt(o,Om.default,"additionalProperties"));let i=Pi.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=ts.mergeEvaluated.props(t,ts.toHash(i),o.props);let a=i.filter((l)=>!ts.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(Pi.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Pm.default=PA});var Cm=g(function(Im){Object.defineProperty(Im,"__esModule",{value:!0});var Ni=mt(),zr=Y(),Ii=te(),Ci=te(),IA={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=Ni.allSchemaProperties(r),c=a.filter((m)=>Ii.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof zr.Name))o.props=Ci.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))Ii.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(zr._`${Ni.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:Ci.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(zr._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(zr.not(d),()=>t.break())})})}}};Im.default=IA});var Dm=g(function(qm){Object.defineProperty(qm,"__esModule",{value:!0});var jm=te(),jA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(jm.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"}};qm.default=jA});var Um=g(function(Lm){Object.defineProperty(Lm,"__esModule",{value:!0});var Mm=mt(),DA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Mm.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=DA});var zm=g(function(Vm){Object.defineProperty(Vm,"__esModule",{value:!0});var Gr=Y(),Fm=te(),LA={message:"must match exactly one schema in oneOf",params:({params:e})=>Gr._`{passingSchemas: ${e.passing}}`},UA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:LA,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,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(Fm.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(Gr._`${c} && ${i}`).assign(i,!1).assign(a,Gr._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,Gr.Name)})})}}};Vm.default=UA});var Hm=g(function(Km){Object.defineProperty(Km,"__esModule",{value:!0});var Gm=te(),VA={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,i)=>{if(Gm.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};Km.default=VA});var Ym=g(function(Wm){Object.defineProperty(Wm,"__esModule",{value:!0});var Kr=Y(),ji=te(),GA={message:({params:e})=>Kr.str`must match "${e.ifClause}" schema`,params:({params:e})=>Kr._`{failingKeyword: ${e.ifClause}}`},KA={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:GA,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)ji.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Bm(n,"then"),o=Bm(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(Kr.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,Kr._`${d}`);else e.setParams({ifClause:d})}}}};function Bm(e,t){let r=e.schema[t];return r!==void 0&&!ji.alwaysValidSchema(e,r)}Wm.default=KA});var Qm=g(function(Jm){Object.defineProperty(Jm,"__esModule",{value:!0});var Xm=te(),BA={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Xm.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Jm.default=BA});var eg=g(function(Zm){Object.defineProperty(Zm,"__esModule",{value:!0});var YA=mu(),XA=dm(),JA=gu(),QA=gm(),ZA=_m(),eP=Oi(),tP=Tm(),rP=yu(),nP=Nm(),sP=Cm(),oP=Dm(),iP=Um(),aP=zm(),cP=Hm(),uP=Ym(),lP=Qm();function dP(e=!1){let t=[oP.default,iP.default,aP.default,cP.default,uP.default,lP.default,tP.default,rP.default,eP.default,nP.default,sP.default];if(e)t.push(XA.default,QA.default);else t.push(YA.default,JA.default);return t.push(ZA.default),t}Zm.default=dP});var _u=g(function(ng){Object.defineProperty(ng,"__esModule",{value:!0});ng.dynamicAnchor=void 0;var rs=Y(),pP=pt(),qi=ro(),tg=Si(),hP={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>rg(e,e.schema)};function rg(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=rs._`${pP.default.dynamicAnchors}${rs.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:mP(e);r.if(rs._`!${s}`,()=>r.assign(s,o))}ng.dynamicAnchor=rg;function mP(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:i,meta:a}=t.root,{schemaId:c}=n.opts,u=new qi.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:i,meta:a});return qi.compileSchema.call(n,u),tg.getValidate(e,u)}ng.default=hP});var vu=g(function(ig){Object.defineProperty(ig,"__esModule",{value:!0});ig.dynamicRef=void 0;var Di=Y(),yP=pt(),Mi=Si(),_P={keyword:"$dynamicRef",schemaType:"string",code:(e)=>og(e,e.schema)};function og(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)i();else{let c=r.let("valid",!1);i(c),e.ok(c)}function i(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",Di._`${yP.default.dynamicAnchors}${Di.getProperty(o)}`);r.if(u,a(u,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,u){return u?()=>r.block(()=>{Mi.callRef(e,c),r.let(u,!0)}):()=>Mi.callRef(e,c)}}ig.dynamicRef=og;ig.default=_P});var dg=g(function(lg){Object.defineProperty(lg,"__esModule",{value:!0});var cg=_u(),ug=te(),$P={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)cg.dynamicAnchor(e,"");else ug.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};lg.default=$P});var hg=g(function(pg){Object.defineProperty(pg,"__esModule",{value:!0});var fg=vu(),wP={keyword:"$recursiveRef",schemaType:"string",code:(e)=>fg.dynamicRef(e,e.schema)};pg.default=wP});var gg=g(function(mg){Object.defineProperty(mg,"__esModule",{value:!0});var SP=_u(),xP=vu(),RP=dg(),TP=hg(),kP=[SP.default,xP.default,RP.default,TP.default];mg.default=kP});var _g=g(function(yg){Object.defineProperty(yg,"__esModule",{value:!0});var Li=Oi(),AP={keyword:"dependentRequired",type:"object",schemaType:"object",error:Li.error,code:(e)=>Li.validatePropertyDeps(e)};yg.default=AP});var Eg=g(function($g){Object.defineProperty($g,"__esModule",{value:!0});var vg=Oi(),NP={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>vg.validateSchemaDeps(e)};$g.default=NP});var Sg=g(function(bg){Object.defineProperty(bg,"__esModule",{value:!0});var wg=te(),CP={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)wg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};bg.default=CP});var Rg=g(function(xg){Object.defineProperty(xg,"__esModule",{value:!0});var qP=_g(),DP=Eg(),MP=Sg(),LP=[qP.default,DP.default,MP.default];xg.default=LP});var kg=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ge=Y(),Ui=te(),FP=pt(),VP={message:"must NOT have unevaluated properties",params:({params:e})=>Ge._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},zP={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:VP,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:i,props:a}=o;if(a instanceof Ge.Name)t.if(Ge._`${a} !== true`,()=>t.forIn("key",n,(l)=>t.if(u(a,l),()=>c(l))));else if(a!==!0)t.forIn("key",n,(l)=>a===void 0?c(l):t.if(d(a,l),()=>c(l)));o.props=!0,e.ok(Ge._`${s} === ${FP.default.errors}`);function c(l){if(r===!1){if(e.setParams({unevaluatedProperty:l}),e.error(),!i)t.break();return}if(!Ui.alwaysValidSchema(o,r)){let p=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:l,dataPropType:Ui.Type.Str},p),!i)t.if(Ge.not(p),()=>t.break())}}function u(l,p){return Ge._`!${l} || !${l}[${p}]`}function d(l,p){let f=[];for(let h in l)if(l[h]===!0)f.push(Ge._`${p} !== ${h}`);return Ge.and(...f)}}};Tg.default=zP});var Ag=g(function(Og){Object.defineProperty(Og,"__esModule",{value:!0});var ot=Y(),Fi=te(),KP={message:({params:{len:e}})=>ot.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ot._`{limit: ${e}}`},HP={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:KP,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let i=t.const("len",ot._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(ot._`${i} > ${o}`);else if(typeof r=="object"&&!Fi.alwaysValidSchema(s,r)){let c=t.var("valid",ot._`${i} <= ${o}`);t.if(ot.not(c),()=>a(c,o)),e.ok(c)}s.items=!0;function a(c,u){t.forRange("i",u,i,(d)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Fi.Type.Num},c),!s.allErrors)t.if(ot.not(c),()=>t.break())})}}};Og.default=HP});var Ng=g(function(Pg){Object.defineProperty(Pg,"__esModule",{value:!0});var WP=kg(),YP=Ag(),XP=[WP.default,YP.default];Pg.default=XP});var Cg=g(function(Ig){Object.defineProperty(Ig,"__esModule",{value:!0});var X=Y(),QP={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},ZP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:QP,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",X._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(X._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,X._`${m}.type || "string"`).assign(_,X._`${m}.validate`),()=>r.assign(y,X._`"string"`).assign(_,m)),e.fail$data(X.or(O(),T()));function O(){if(c.strictSchema===!1)return X.nil;return X._`${i} && !${_}`}function T(){let M=d.$async?X._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:X._`${_}(${n})`,S=X._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return X._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=T(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function T(S){let _e=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,ve=r.scopeValue("formats",{key:o,ref:S,code:_e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${ve}.validate`];return["string",S,ve]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return X._`await ${_}(${n})`}return typeof y=="function"?X._`${_}(${n})`:X._`${_}.test(${n})`}}}};Ig.default=ZP});var qg=g(function(jg){Object.defineProperty(jg,"__esModule",{value:!0});var tN=Cg(),rN=[tN.default];jg.default=rN});var Lg=g(function(Dg){Object.defineProperty(Dg,"__esModule",{value:!0});Dg.contentVocabulary=Dg.metadataVocabulary=void 0;Dg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Dg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Fg=g(function(Ug){Object.defineProperty(Ug,"__esModule",{value:!0});var oN=wh(),iN=tm(),aN=eg(),cN=gg(),uN=Rg(),lN=Ng(),dN=qg(),Vi=Lg(),fN=[cN.default,oN.default,iN.default,(0,aN.default)(!0),dN.default,Vi.metadataVocabulary,Vi.contentVocabulary,uN.default,lN.default];Ug.default=fN});var Kg=g(function(zg){Object.defineProperty(zg,"__esModule",{value:!0});zg.DiscrError=void 0;var Vg;(function(e){e.Tag="tag",e.Mapping="mapping"})(Vg||(zg.DiscrError=Vg={}))});var Wg=g(function(Bg){Object.defineProperty(Bg,"__esModule",{value:!0});var gt=Y(),ns=Kg(),zi=ro(),hN=eo(),Hg=te(),mN={message:({params:{discrError:e,tagName:t}})=>e===ns.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}}`},gN={keyword:"discriminator",type:"object",schemaType:"object",error:mN,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",gt._`${r}${gt.getProperty(a)}`);t.if(gt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ns.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(gt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ns.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,gt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!Hg.schemaHasRulesButRef(S,o.self.RULES)){let ve=S.$ref;if(S=zi.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ve),S instanceof zi.SchemaEnv)S=S.schema;if(S===void 0)throw new hN.default(o.opts.uriResolver,o.baseId,ve)}let _e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof _e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(_e,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)T(M.const,S);else if(M.enum)for(let _e of M.enum)T(_e,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};Bg.default=gN});var Yg=g(function(mG,_N){_N.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 Xg=g(function(gG,vN){vN.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 Jg=g(function(yG,$N){$N.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 Qg=g(function(_G,EN){EN.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 Zg=g(function(vG,wN){wN.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 ey=g(function($G,bN){bN.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 ty=g(function(EG,SN){SN.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 ry=g(function(wG,xN){xN.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 sy=g(function(ny){Object.defineProperty(ny,"__esModule",{value:!0});var RN=Yg(),TN=Xg(),kN=Jg(),ON=Qg(),AN=Zg(),PN=ey(),NN=ty(),IN=ry(),CN=["/properties"];function jN(e){return[RN,TN,kN,ON,AN,t(this,PN),NN,t(this,IN)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,CN):n}}ny.default=jN});var oy=g(function(it,Eu){Object.defineProperty(it,"__esModule",{value:!0});it.MissingRefError=it.ValidationError=it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=it.Ajv2020=void 0;var DN=mh(),MN=Fg(),LN=Wg(),UN=sy(),$u="https://json-schema.org/draft/2020-12/schema";class so extends DN.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),MN.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(LN.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;UN.default.call(this,e),this.refs["http://json-schema.org/schema"]=$u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema($u)?$u:void 0)}}it.Ajv2020=so;Eu.exports=it=so;Eu.exports.Ajv2020=so;Object.defineProperty(it,"__esModule",{value:!0});it.default=so;var FN=Zs();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return FN.KeywordCxt}});var ss=Y();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return ss._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return ss.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return ss.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return ss.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return ss.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return ss.CodeGen}});var VN=pi();Object.defineProperty(it,"ValidationError",{enumerable:!0,get:function(){return VN.default}});var zN=eo();Object.defineProperty(it,"MissingRefError",{enumerable:!0,get:function(){return zN.default}})});var my=g(function(py){Object.defineProperty(py,"__esModule",{value:!0});py.formatNames=py.fastFormats=py.fullFormats=void 0;function Yt(e,t){return{validate:e,compare:t}}py.fullFormats={date:Yt(uy,xu),time:Yt(bu(!0),Ru),"date-time":Yt(iy(!0),dy),"iso-time":Yt(bu(),ly),"iso-date-time":Yt(iy(),fy),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:JN,"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:sI,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:QN,int32:{type:"number",validate:tI},int64:{type:"number",validate:rI},float:{type:"number",validate:cy},double:{type:"number",validate:cy},password:!0,binary:!0};py.fastFormats={...py.fullFormats,date:Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xu),time:Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ru),"date-time":Yt(/^\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,dy),"iso-time":Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ly),"iso-date-time":Yt(/^\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,fy),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};py.formatNames=Object.keys(py.fullFormats);function HN(e){return e%4===0&&(e%100!==0||e%400===0)}var BN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,WN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function uy(e){let t=BN.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&&HN(r)?29:WN[n])}function xu(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var wu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function bu(e){return function(r){let n=wu.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!a)return!1;if(s<=23&&o<=59&&i<60)return!0;let l=o-d*c,p=s-u*c-(l<0?1:0);return(p===23||p===-1)&&(l===59||l===-1)&&i<61}}function Ru(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 ly(e,t){if(!(e&&t))return;let r=wu.exec(e),n=wu.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 Su=/t|\s/i;function iy(e){let t=bu(e);return function(n){let s=n.split(Su);return s.length===2&&uy(s[0])&&t(s[1])}}function dy(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 fy(e,t){if(!(e&&t))return;let[r,n]=e.split(Su),[s,o]=t.split(Su),i=xu(r,s);if(i===void 0)return;return i||Ru(n,o)}var YN=/\/|:/,XN=/^(?:[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 JN(e){return YN.test(e)&&XN.test(e)}var ay=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function QN(e){return ay.lastIndex=0,ay.test(e)}var ZN=-2147483648,eI=2147483647;function tI(e){return Number.isInteger(e)&&e<=eI&&e>=ZN}function rI(e){return Number.isInteger(e)}function cy(){return!0}var nI=/[^\\]\\Z/;function sI(e){if(nI.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(_y){Object.defineProperty(_y,"__esModule",{value:!0});_y.regexpCode=_y.getEsmExportName=_y.getProperty=_y.safeStringify=_y.stringify=_y.strConcat=_y.addCodeArg=_y.str=_y._=_y.nil=_y._Code=_y.Name=_y.IDENTIFIER=_y._CodeOrName=void 0;class Gi{}_y._CodeOrName=Gi;_y.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class os extends Gi{constructor(e){super();if(!_y.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}}}_y.Name=os;class kt extends Gi{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 os)t[r.str]=(t[r.str]||0)+1;return t},{})}}_y._Code=kt;_y.nil=new kt("");function gy(e,...t){let r=[e[0]],n=0;while(n<t.length)Ou(r,t[n]),r.push(e[++n]);return new kt(r)}_y._=gy;var ku=new kt("+");function yy(e,...t){let r=[oo(e[0])],n=0;while(n<t.length)r.push(ku),Ou(r,t[n]),r.push(ku,oo(e[++n]));return iI(r),new kt(r)}_y.str=yy;function Ou(e,t){if(t instanceof kt)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(uI(t))}_y.addCodeArg=Ou;function iI(e){let t=1;while(t<e.length-1){if(e[t]===ku){let r=aI(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function aI(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof os||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 os))return`"${e}${t.slice(1)}`;return}function cI(e,t){return t.emptyStr()?e:e.emptyStr()?t:yy`${e}${t}`}_y.strConcat=cI;function uI(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:oo(Array.isArray(e)?e.join(","):e)}function lI(e){return new kt(oo(e))}_y.stringify=lI;function oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}_y.safeStringify=oo;function dI(e){return typeof e=="string"&&_y.IDENTIFIER.test(e)?new kt(`.${e}`):gy`[${e}]`}_y.getProperty=dI;function fI(e){if(typeof e=="string"&&_y.IDENTIFIER.test(e))return new kt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}_y.getEsmExportName=fI;function pI(e){return new kt(e.toString())}_y.regexpCode=pI});var Iu=g(function(wy){Object.defineProperty(wy,"__esModule",{value:!0});wy.ValueScope=wy.ValueScopeName=wy.Scope=wy.varKinds=wy.UsedValueState=void 0;var me=io();class $y extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Hi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Hi||(wy.UsedValueState=Hi={}));wy.varKinds={const:new me.Name("const"),let:new me.Name("let"),var:new me.Name("var")};class Pu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof me.Name?e:this.name(e)}name(e){return new me.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}}}wy.Scope=Pu;class Nu extends me.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=me._`.${new me.Name(t)}[${r}]`}}wy.ValueScopeName=Nu;var RI=me._`\n`;class Ey extends Pu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?RI:me.nil}}get(){return this._scope}name(e){return new Nu(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,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[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 me._`${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=me.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Hi.Started);let u=t(c);if(u){let d=this.opts.es5?wy.varKinds.var:wy.varKinds.const;s=me._`${s}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=me._`${s}${u}${this.opts._n}`;else throw new $y(c);a.set(c,Hi.Completed)})}return s}}wy.ValueScope=Ey});var Z=g(function(at){Object.defineProperty(at,"__esModule",{value:!0});at.or=at.and=at.not=at.CodeGen=at.operators=at.varKinds=at.ValueScopeName=at.ValueScope=at.Scope=at.Name=at.regexpCode=at.stringify=at.getProperty=at.nil=at.strConcat=at.str=at._=void 0;var P=io(),Oe=Iu(),Hr=io();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return Hr._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return Hr.str}});Object.defineProperty(at,"strConcat",{enumerable:!0,get:function(){return Hr.strConcat}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return Hr.nil}});Object.defineProperty(at,"getProperty",{enumerable:!0,get:function(){return Hr.getProperty}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return Hr.stringify}});Object.defineProperty(at,"regexpCode",{enumerable:!0,get:function(){return Hr.regexpCode}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return Hr.Name}});var Qi=Iu();Object.defineProperty(at,"Scope",{enumerable:!0,get:function(){return Qi.Scope}});Object.defineProperty(at,"ValueScope",{enumerable:!0,get:function(){return Qi.ValueScope}});Object.defineProperty(at,"ValueScopeName",{enumerable:!0,get:function(){return Qi.ValueScopeName}});Object.defineProperty(at,"varKinds",{enumerable:!0,get:function(){return Qi.varKinds}});at.operators={GT:new P._Code(">"),GTE:new P._Code(">="),LT:new P._Code("<"),LTE:new P._Code("<="),EQ:new P._Code("==="),NEQ:new P._Code("!=="),NOT:new P._Code("!"),OR:new P._Code("||"),AND:new P._Code("&&"),ADD:new P._Code("+")};class Br{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Sy extends Br{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Oe.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=as(this.rhs,e,t);return this}get names(){return this.rhs instanceof P._CodeOrName?this.rhs.names:{}}}class qu extends Br{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 P.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=as(this.rhs,e,t),this}get names(){let e=this.lhs instanceof P.Name?{}:{...this.lhs.names};return Ji(e,this.rhs)}}class xy extends qu{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Ry extends Br{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Br{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class ky extends Br{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Oy extends Br{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=as(this.code,e,t),this}get names(){return this.code instanceof P._CodeOrName?this.code.names:{}}}class Zi extends Br{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;AI(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>bn(e,t.names),{})}}class Wr extends Zi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ay extends Zi{}class ao extends Wr{}ao.kind="else";class _r extends Wr{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 ao(r):r}if(t){if(e===!1)return t instanceof _r?t:t.nodes;if(this.nodes.length)return this;return new _r(jy(e),t instanceof _r?[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=as(this.condition,e,t),this}get names(){let e=super.names;if(Ji(e,this.condition),this.else)bn(e,this.else.names);return e}}_r.kind="if";class is extends Wr{}is.kind="for";class Py extends is{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=as(this.iteration,e,t),this}get names(){return bn(super.names,this.iteration.names)}}class Ny extends is{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Oe.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=Ji(super.names,this.from);return Ji(e,this.to)}}class Cu extends is{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=as(this.iterable,e,t),this}get names(){return bn(super.names,this.iterable.names)}}class Bi extends Wr{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)}}Bi.kind="func";class Wi extends Zi{render(e){return"return "+super.render(e)}}Wi.kind="return";class Iy extends Wr{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)bn(e,this.catch.names);if(this.finally)bn(e,this.finally.names);return e}}class Yi extends Wr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Yi.kind="catch";class Xi extends Wr{render(e){return"finally"+super.render(e)}}Xi.kind="finally";class Cy{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
11
|
-
`:""},this._extScope=e,this._scope=new Oe.Scope({parent:e}),this._nodes=[new Ay]}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 Sy(e,s,r)),s}const(e,t,r){return this._def(Oe.varKinds.const,e,t,r)}let(e,t,r){return this._def(Oe.varKinds.let,e,t,r)}var(e,t,r){return this._def(Oe.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new qu(e,t,r))}add(e,t){return this._leafNode(new xy(e,at.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==P.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(":"),P.addCodeArg(t,n)}return t.push("}"),new P._Code(t)}if(e,t,r){if(this._blockNode(new _r(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 _r(e))}else(){return this._elseNode(new ao)}endIf(){return this._endBlockNode(_r,ao)}_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?Oe.varKinds.var:Oe.varKinds.let){let o=this._scope.toName(e);return this._for(new Ny(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Oe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof P.Name?t:this.var("_arr",t);return this.forRange("_i",0,P._`${o}.length`,(i)=>{this.var(s,P._`${o}[${i}]`),r(s)})}return this._for(new Cu("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Oe.varKinds.var:Oe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,P._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Cu("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(is)}label(e){return this._leafNode(new Ry(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Wi;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Wi)}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 Yi(s),t(s)}if(r)this._currNode=n.finally=new Xi,this.code(r);return this._endBlockNode(Yi,Xi)}throw(e){return this._leafNode(new ky(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=P.nil,r,n){if(this._blockNode(new Bi(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Bi)}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 _r))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}}at.CodeGen=Cy;function bn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ji(e,t){return t instanceof P._CodeOrName?bn(e,t.names):e}function as(e,t,r){if(e instanceof P.Name)return n(e);if(!s(e))return e;return new P._Code(e._items.reduce((o,i)=>{if(i instanceof P.Name)i=n(i);if(i instanceof P._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof P._Code&&o._items.some((i)=>i instanceof P.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function AI(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function jy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:P._`!${ju(e)}`}at.not=jy;var PI=qy(at.operators.AND);function NI(...e){return e.reduce(PI)}at.and=NI;var II=qy(at.operators.OR);function CI(...e){return e.reduce(II)}at.or=CI;function qy(e){return(t,r)=>t===P.nil?r:r===P.nil?t:P._`${ju(t)} ${e} ${ju(r)}`}function ju(e){return e instanceof P.Name?e:P._`(${e})`}});var ae=g(function(Hy){Object.defineProperty(Hy,"__esModule",{value:!0});Hy.checkStrictMode=Hy.getErrorPath=Hy.Type=Hy.useFunc=Hy.setEvaluated=Hy.evaluatedPropsToName=Hy.mergeEvaluated=Hy.eachItem=Hy.unescapeJsonPointer=Hy.escapeJsonPointer=Hy.escapeFragment=Hy.unescapeFragment=Hy.schemaRefOrVal=Hy.schemaHasRulesButRef=Hy.schemaHasRules=Hy.checkUnknownRules=Hy.alwaysValidSchema=Hy.toHash=void 0;var U=Z(),Uy=io();function MI(e){let t={};for(let r of e)t[r]=!0;return t}Hy.toHash=MI;function LI(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Fy(e,t),!Vy(t,e.self.RULES.all)}Hy.alwaysValidSchema=LI;function Fy(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])Ky(e,`unknown keyword: "${o}"`)}Hy.checkUnknownRules=Fy;function Vy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Hy.schemaHasRules=Vy;function UI(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Hy.schemaHasRulesButRef=UI;function FI({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)}`}Hy.schemaRefOrVal=FI;function VI(e){return zy(decodeURIComponent(e))}Hy.unescapeFragment=VI;function zI(e){return encodeURIComponent(Mu(e))}Hy.escapeFragment=zI;function Mu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Hy.escapeJsonPointer=Mu;function zy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Hy.unescapeJsonPointer=zy;function GI(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Hy.eachItem=GI;function My({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof U.Name?(o instanceof U.Name?e(s,o,i):t(s,o,i),i):o instanceof U.Name?(t(s,i,o),o):r(o,i);return a===U.Name&&!(c instanceof U.Name)?n(s,c):c}}Hy.mergeEvaluated={props:My({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} || {}`),Lu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Gy}),items:My({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 Gy(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Lu(e,r,t);return r}Hy.evaluatedPropsToName=Gy;function Lu(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}Hy.setEvaluated=Lu;var Ly={};function KI(e,t){return e.scopeValue("func",{ref:t,code:Ly[t.code]||(Ly[t.code]=new Uy._Code(t.code))})}Hy.useFunc=KI;var Du;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Du||(Hy.Type=Du={}));function HI(e,t,r){if(e instanceof U.Name){let n=t===Du.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():"/"+Mu(e)}Hy.getErrorPath=HI;function Ky(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}Hy.checkStrictMode=Ky});var vr=g(function(Wy){Object.defineProperty(Wy,"__esModule",{value:!0});var ue=Z(),l1={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")};Wy.default=l1});var co=g(function(Qy){Object.defineProperty(Qy,"__esModule",{value:!0});Qy.extendErrors=Qy.resetErrorsCount=Qy.reportExtraError=Qy.reportError=Qy.keyword$DataError=Qy.keywordError=void 0;var C=Z(),Yr=ae(),Ye=vr();Qy.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};Qy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function f1(e,t=Qy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Jy(e,t,r);if(n!==null&&n!==void 0?n:i||a)Yy(o,c);else Xy(s,C._`[${c}]`)}Qy.reportError=f1;function p1(e,t=Qy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Jy(e,t,r);if(Yy(s,a),!(o||i))Xy(n,Ye.default.vErrors)}Qy.reportExtraError=p1;function h1(e,t){e.assign(Ye.default.errors,t),e.if(C._`${Ye.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Ye.default.vErrors}.length`,t),()=>e.assign(Ye.default.vErrors,null)))}Qy.resetErrorsCount=h1;function m1({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,Ye.default.errors,(a)=>{if(e.const(i,C._`${Ye.default.vErrors}[${a}]`),e.if(C._`${i}.instancePath === undefined`,()=>e.assign(C._`${i}.instancePath`,C.strConcat(Ye.default.instancePath,o.errorPath))),e.assign(C._`${i}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${i}.schema`,r),e.assign(C._`${i}.data`,n)})}Qy.extendErrors=m1;function Yy(e,t){let r=e.const("err",t);e.if(C._`${Ye.default.vErrors} === null`,()=>e.assign(Ye.default.vErrors,C._`[${r}]`),C._`${Ye.default.vErrors}.push(${r})`),e.code(C._`${Ye.default.errors}++`)}function Xy(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 Sn={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 Jy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return g1(e,t,r)}function g1(e,t,r={}){let{gen:n,it:s}=e,o=[y1(s,r),_1(e,r)];return v1(e,t,o),n.object(...o)}function y1({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Yr.getErrorPath(t,Yr.Type.Str)}`:e;return[Ye.default.instancePath,C.strConcat(Ye.default.instancePath,r)]}function _1({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Yr.getErrorPath(r,Yr.Type.Str)}`;return[Sn.schemaPath,s]}function v1(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([Sn.keyword,s],[Sn.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([Sn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([Sn.schema,i],[Sn.parentSchema,C._`${d}${l}`],[Ye.default.data,o]);if(u)n.push([Sn.propertyName,u])}});var o_=g(function(n_){Object.defineProperty(n_,"__esModule",{value:!0});n_.boolOrEmptySchema=n_.topBoolOrEmptySchema=void 0;var e_=co(),t_=Z(),S1=vr(),x1={message:"boolean schema is false"};function R1(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)r_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(S1.default.data);else t.assign(t_._`${n}.errors`,null),t.return(!0)}n_.topBoolOrEmptySchema=R1;function T1(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),r_(e);else r.var(t,!0)}n_.boolOrEmptySchema=T1;function r_(e,t){let{gen:r,data:n}=e;e_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},x1,void 0,t)}});var Fu=g(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});i_.getRules=i_.isJSONType=void 0;var O1=["string","number","integer","boolean","null","object","array"],A1=new Set(O1);function P1(e){return typeof e=="string"&&A1.has(e)}i_.isJSONType=P1;function N1(){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=N1});var Vu=g(function(l_){Object.defineProperty(l_,"__esModule",{value:!0});l_.shouldUseRule=l_.shouldUseGroup=l_.schemaHasRulesForType=void 0;function C1({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&c_(e,n)}l_.schemaHasRulesForType=C1;function c_(e,t){return t.rules.some((r)=>u_(e,r))}l_.shouldUseGroup=c_;function u_(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))}l_.shouldUseRule=u_});var uo=g(function(y_){Object.defineProperty(y_,"__esModule",{value:!0});y_.reportTypeError=y_.checkDataTypes=y_.checkDataType=y_.coerceAndCheckDataType=y_.getJSONTypes=y_.getSchemaTypes=y_.DataType=void 0;var f_=Fu(),p_=Vu(),h_=co(),R=Z(),ta=ae(),cs;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(cs||(y_.DataType=cs={}));function D1(e){let t=m_(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}y_.getSchemaTypes=D1;function m_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(f_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}y_.getJSONTypes=m_;function M1(e,t){let{gen:r,data:n,opts:s}=e,o=L1(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&p_.schemaHasRulesForType(e,t[0]));if(i){let a=Gu(t,n,s.strictNumbers,cs.Wrong);r.if(a,()=>{if(o.length)U1(e,t,o);else Ku(e)})}return i}y_.coerceAndCheckDataType=M1;var g_=new Set(["string","number","integer","boolean","null"]);function L1(e,t){return t?e.filter((r)=>g_.has(r)||t==="array"&&r==="array"):[]}function U1(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",R._`typeof ${s}`),a=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(i,R._`typeof ${s}`).if(Gu(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(R._`${a} !== undefined`);for(let u of r)if(g_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Ku(e),n.endIf(),n.if(R._`${a} !== undefined`,()=>{n.assign(s,a),F1(e,a)});function c(u){switch(u){case"string":n.elseIf(R._`${i} == "number" || ${i} == "boolean"`).assign(a,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(a,R._`""`);return;case"number":n.elseIf(R._`${i} == "boolean" || ${s} === null
|
|
10
|
+
deps: ${r}}`};var xA={keyword:"dependencies",type:"object",schemaType:"object",error:Em.error,code(e){let[t,r]=RA(e);bm(e,t),wm(e,r)}};function RA({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 bm(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 i in t){let a=t[i];if(a.length===0)continue;let c=Xt.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)Xt.checkReportMissingProp(e,u)});else r.if(es._`${c} && (${Xt.checkMissingProp(e,a,o)})`),Xt.reportMissingProp(e,o),r.else()}}Em.validatePropertyDeps=bm;function wm(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if($m.alwaysValidSchema(o,t[a]))continue;r.if(Xt.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}Em.validateSchemaDeps=wm;Em.default=xA});var Tm=g(function(km){Object.defineProperty(km,"__esModule",{value:!0});var Ni=Y(),Rm=te(),OA={message:"property name must be valid",params:({params:e})=>Ni._`{propertyName: ${e.propertyName}}`},AA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:OA,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(Rm.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(Ni.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};km.default=AA});var _u=g(function(Om){Object.defineProperty(Om,"__esModule",{value:!0});var Vr=gt(),Te=Y(),IA=ht(),zr=te(),PA={message:"must NOT have additional properties",params:({params:e})=>Te._`{additionalProperty: ${e.additionalProperty}}`},CA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:PA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&zr.alwaysValidSchema(i,r))return;let u=Vr.allSchemaProperties(n.properties),d=Vr.allSchemaProperties(n.patternProperties);l(),e.ok(Te._`${o} === ${IA.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=zr.schemaRefOrVal(i,n.properties,"properties");_=Vr.isOwnProperty(t,O,y)}else if(u.length)_=Te.or(...u.map((O)=>Te._`${y} === ${O}`));else _=Te.nil;if(d.length)_=Te.or(_,...d.map((O)=>Te._`${Vr.usePattern(e,O)}.test(${y})`));return Te.not(_)}function f(y){t.code(Te._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!zr.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Te.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Te.not(_),()=>t.break())}}function m(y,_,O){let k={keyword:"additionalProperties",dataProp:y,dataPropType:zr.Type.Str};if(O===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,_)}}};Om.default=CA});var Pm=g(function(Im){Object.defineProperty(Im,"__esModule",{value:!0});var Nm=Zs(),Ii=gt(),ts=te(),Am=_u(),qA={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)Am.default.code(new Nm.KeywordCxt(o,Am.default,"additionalProperties"));let i=Ii.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=ts.mergeEvaluated.props(t,ts.toHash(i),o.props);let a=i.filter((l)=>!ts.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(Ii.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Im.default=qA});var jm=g(function(Cm){Object.defineProperty(Cm,"__esModule",{value:!0});var Pi=gt(),Gr=Y(),Ci=te(),ji=te(),MA={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=Pi.allSchemaProperties(r),c=a.filter((m)=>Ci.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof Gr.Name))o.props=ji.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))Ci.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(Gr._`${Pi.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:ji.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(Gr._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(Gr.not(d),()=>t.break())})})}}};Cm.default=MA});var Mm=g(function(Dm){Object.defineProperty(Dm,"__esModule",{value:!0});var qm=te(),UA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(qm.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"}};Dm.default=UA});var Fm=g(function(Um){Object.defineProperty(Um,"__esModule",{value:!0});var Lm=gt(),VA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Lm.validateUnion,error:{message:"must match a schema in anyOf"}};Um.default=VA});var Gm=g(function(zm){Object.defineProperty(zm,"__esModule",{value:!0});var Kr=Y(),Vm=te(),GA={message:"must match exactly one schema in oneOf",params:({params:e})=>Kr._`{passingSchemas: ${e.passing}}`},KA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:GA,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,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(Vm.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(Kr._`${c} && ${i}`).assign(i,!1).assign(a,Kr._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,Kr.Name)})})}}};zm.default=KA});var Bm=g(function(Hm){Object.defineProperty(Hm,"__esModule",{value:!0});var Km=te(),BA={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,i)=>{if(Km.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};Hm.default=BA});var Xm=g(function(Ym){Object.defineProperty(Ym,"__esModule",{value:!0});var Hr=Y(),qi=te(),YA={message:({params:e})=>Hr.str`must match "${e.ifClause}" schema`,params:({params:e})=>Hr._`{failingKeyword: ${e.ifClause}}`},XA={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:YA,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)qi.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Wm(n,"then"),o=Wm(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(Hr.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,Hr._`${d}`);else e.setParams({ifClause:d})}}}};function Wm(e,t){let r=e.schema[t];return r!==void 0&&!qi.alwaysValidSchema(e,r)}Ym.default=XA});var Zm=g(function(Qm){Object.defineProperty(Qm,"__esModule",{value:!0});var Jm=te(),QA={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Jm.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Qm.default=QA});var tg=g(function(eg){Object.defineProperty(eg,"__esModule",{value:!0});var eN=gu(),tN=fm(),rN=yu(),nN=ym(),sN=vm(),oN=Ai(),iN=Tm(),aN=_u(),cN=Pm(),uN=jm(),lN=Mm(),dN=Fm(),fN=Gm(),pN=Bm(),hN=Xm(),mN=Zm();function gN(e=!1){let t=[lN.default,dN.default,fN.default,pN.default,hN.default,mN.default,iN.default,aN.default,oN.default,cN.default,uN.default];if(e)t.push(tN.default,nN.default);else t.push(eN.default,rN.default);return t.push(sN.default),t}eg.default=gN});var vu=g(function(sg){Object.defineProperty(sg,"__esModule",{value:!0});sg.dynamicAnchor=void 0;var rs=Y(),_N=ht(),Di=ro(),rg=xi(),vN={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=rs._`${_N.default.dynamicAnchors}${rs.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:$N(e);r.if(rs._`!${s}`,()=>r.assign(s,o))}sg.dynamicAnchor=ng;function $N(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:i,meta:a}=t.root,{schemaId:c}=n.opts,u=new Di.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:i,meta:a});return Di.compileSchema.call(n,u),rg.getValidate(e,u)}sg.default=vN});var $u=g(function(ag){Object.defineProperty(ag,"__esModule",{value:!0});ag.dynamicRef=void 0;var Mi=Y(),wN=ht(),Li=xi(),EN={keyword:"$dynamicRef",schemaType:"string",code:(e)=>ig(e,e.schema)};function ig(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)i();else{let c=r.let("valid",!1);i(c),e.ok(c)}function i(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",Mi._`${wN.default.dynamicAnchors}${Mi.getProperty(o)}`);r.if(u,a(u,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,u){return u?()=>r.block(()=>{Li.callRef(e,c),r.let(u,!0)}):()=>Li.callRef(e,c)}}ag.dynamicRef=ig;ag.default=EN});var fg=g(function(dg){Object.defineProperty(dg,"__esModule",{value:!0});var ug=vu(),lg=te(),xN={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)ug.dynamicAnchor(e,"");else lg.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};dg.default=xN});var mg=g(function(hg){Object.defineProperty(hg,"__esModule",{value:!0});var pg=$u(),kN={keyword:"$recursiveRef",schemaType:"string",code:(e)=>pg.dynamicRef(e,e.schema)};hg.default=kN});var yg=g(function(gg){Object.defineProperty(gg,"__esModule",{value:!0});var ON=vu(),AN=$u(),NN=fg(),IN=mg(),PN=[ON.default,AN.default,NN.default,IN.default];gg.default=PN});var vg=g(function(_g){Object.defineProperty(_g,"__esModule",{value:!0});var Ui=Ai(),jN={keyword:"dependentRequired",type:"object",schemaType:"object",error:Ui.error,code:(e)=>Ui.validatePropertyDeps(e)};_g.default=jN});var wg=g(function(bg){Object.defineProperty(bg,"__esModule",{value:!0});var $g=Ai(),DN={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>$g.validateSchemaDeps(e)};bg.default=DN});var xg=g(function(Sg){Object.defineProperty(Sg,"__esModule",{value:!0});var Eg=te(),LN={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=LN});var kg=g(function(Rg){Object.defineProperty(Rg,"__esModule",{value:!0});var FN=vg(),VN=wg(),zN=xg(),GN=[FN.default,VN.default,zN.default];Rg.default=GN});var Og=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ge=Y(),Fi=te(),HN=ht(),BN={message:"must NOT have unevaluated properties",params:({params:e})=>Ge._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},WN={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:BN,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:i,props:a}=o;if(a instanceof Ge.Name)t.if(Ge._`${a} !== true`,()=>t.forIn("key",n,(l)=>t.if(u(a,l),()=>c(l))));else if(a!==!0)t.forIn("key",n,(l)=>a===void 0?c(l):t.if(d(a,l),()=>c(l)));o.props=!0,e.ok(Ge._`${s} === ${HN.default.errors}`);function c(l){if(r===!1){if(e.setParams({unevaluatedProperty:l}),e.error(),!i)t.break();return}if(!Fi.alwaysValidSchema(o,r)){let p=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:l,dataPropType:Fi.Type.Str},p),!i)t.if(Ge.not(p),()=>t.break())}}function u(l,p){return Ge._`!${l} || !${l}[${p}]`}function d(l,p){let f=[];for(let h in l)if(l[h]===!0)f.push(Ge._`${p} !== ${h}`);return Ge.and(...f)}}};Tg.default=WN});var Ng=g(function(Ag){Object.defineProperty(Ag,"__esModule",{value:!0});var st=Y(),Vi=te(),XN={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},JN={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:XN,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let i=t.const("len",st._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(st._`${i} > ${o}`);else if(typeof r=="object"&&!Vi.alwaysValidSchema(s,r)){let c=t.var("valid",st._`${i} <= ${o}`);t.if(st.not(c),()=>a(c,o)),e.ok(c)}s.items=!0;function a(c,u){t.forRange("i",u,i,(d)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Vi.Type.Num},c),!s.allErrors)t.if(st.not(c),()=>t.break())})}}};Ag.default=JN});var Pg=g(function(Ig){Object.defineProperty(Ig,"__esModule",{value:!0});var ZN=Og(),eI=Ng(),tI=[ZN.default,eI.default];Ig.default=tI});var jg=g(function(Cg){Object.defineProperty(Cg,"__esModule",{value:!0});var X=Y(),nI={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},sI={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:nI,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",X._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(X._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,X._`${m}.type || "string"`).assign(_,X._`${m}.validate`),()=>r.assign(y,X._`"string"`).assign(_,m)),e.fail$data(X.or(O(),k()));function O(){if(c.strictSchema===!1)return X.nil;return X._`${i} && !${_}`}function k(){let M=d.$async?X._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:X._`${_}(${n})`,S=X._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return X._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=k(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let Ee=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,Se=r.scopeValue("formats",{key:o,ref:S,code:Ee});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${Se}.validate`];return["string",S,Se]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return X._`await ${_}(${n})`}return typeof y=="function"?X._`${_}(${n})`:X._`${_}.test(${n})`}}}};Cg.default=sI});var Dg=g(function(qg){Object.defineProperty(qg,"__esModule",{value:!0});var iI=jg(),aI=[iI.default];qg.default=aI});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 lI=Eh(),dI=rm(),fI=tg(),pI=yg(),hI=kg(),mI=Pg(),gI=Dg(),zi=Ug(),yI=[pI.default,lI.default,dI.default,(0,fI.default)(!0),gI.default,zi.metadataVocabulary,zi.contentVocabulary,hI.default,mI.default];Fg.default=yI});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 yt=Y(),ns=Hg(),Gi=ro(),vI=eo(),Bg=te(),$I={message:({params:{discrError:e,tagName:t}})=>e===ns.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>yt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},bI={keyword:"discriminator",type:"object",schemaType:"object",error:$I,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",yt._`${r}${yt.getProperty(a)}`);t.if(yt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ns.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(yt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ns.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,yt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!Bg.schemaHasRulesButRef(S,o.self.RULES)){let Se=S.$ref;if(S=Gi.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Se),S instanceof Gi.SchemaEnv)S=S.schema;if(S===void 0)throw new vI.default(o.opts.uriResolver,o.baseId,Se)}let Ee=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof Ee!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(Ee,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let Ee of M.enum)k(Ee,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};Wg.default=bI});var Xg=g(function(R4,EI){EI.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(k4,SI){SI.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(T4,xI){xI.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(O4,RI){RI.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(A4,kI){kI.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(N4,TI){TI.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(I4,OI){OI.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(P4,AI){AI.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 NI=Xg(),II=Jg(),PI=Qg(),CI=Zg(),jI=ey(),qI=ty(),DI=ry(),MI=ny(),LI=["/properties"];function UI(e){return[NI,II,PI,CI,jI,t(this,qI),DI,t(this,MI)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,LI):n}}sy.default=UI});var iy=g(function(ot,wu){Object.defineProperty(ot,"__esModule",{value:!0});ot.MissingRefError=ot.ValidationError=ot.CodeGen=ot.Name=ot.nil=ot.stringify=ot.str=ot._=ot.KeywordCxt=ot.Ajv2020=void 0;var VI=gh(),zI=Vg(),GI=Yg(),KI=oy(),bu="https://json-schema.org/draft/2020-12/schema";class so extends VI.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),zI.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(GI.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;KI.default.call(this,e),this.refs["http://json-schema.org/schema"]=bu}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(bu)?bu:void 0)}}ot.Ajv2020=so;wu.exports=ot=so;wu.exports.Ajv2020=so;Object.defineProperty(ot,"__esModule",{value:!0});ot.default=so;var HI=Zs();Object.defineProperty(ot,"KeywordCxt",{enumerable:!0,get:function(){return HI.KeywordCxt}});var ss=Y();Object.defineProperty(ot,"_",{enumerable:!0,get:function(){return ss._}});Object.defineProperty(ot,"str",{enumerable:!0,get:function(){return ss.str}});Object.defineProperty(ot,"stringify",{enumerable:!0,get:function(){return ss.stringify}});Object.defineProperty(ot,"nil",{enumerable:!0,get:function(){return ss.nil}});Object.defineProperty(ot,"Name",{enumerable:!0,get:function(){return ss.Name}});Object.defineProperty(ot,"CodeGen",{enumerable:!0,get:function(){return ss.CodeGen}});var BI=hi();Object.defineProperty(ot,"ValidationError",{enumerable:!0,get:function(){return BI.default}});var WI=eo();Object.defineProperty(ot,"MissingRefError",{enumerable:!0,get:function(){return WI.default}})});var gy=g(function(hy){Object.defineProperty(hy,"__esModule",{value:!0});hy.formatNames=hy.fastFormats=hy.fullFormats=void 0;function Jt(e,t){return{validate:e,compare:t}}hy.fullFormats={date:Jt(ly,Ru),time:Jt(Su(!0),ku),"date-time":Jt(ay(!0),fy),"iso-time":Jt(Su(),dy),"iso-date-time":Jt(ay(),py),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rP,"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:uP,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:nP,int32:{type:"number",validate:iP},int64:{type:"number",validate:aP},float:{type:"number",validate:uy},double:{type:"number",validate:uy},password:!0,binary:!0};hy.fastFormats={...hy.fullFormats,date:Jt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ru),time:Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ku),"date-time":Jt(/^\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":Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dy),"iso-date-time":Jt(/^\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};hy.formatNames=Object.keys(hy.fullFormats);function JI(e){return e%4===0&&(e%100!==0||e%400===0)}var QI=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ZI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ly(e){let t=QI.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&&JI(r)?29:ZI[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],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!a)return!1;if(s<=23&&o<=59&&i<60)return!0;let l=o-d*c,p=s-u*c-(l<0?1:0);return(p===23||p===-1)&&(l===59||l===-1)&&i<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 ay(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),i=Ru(r,s);if(i===void 0)return;return i||ku(n,o)}var eP=/\/|:/,tP=/^(?:[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 rP(e){return eP.test(e)&&tP.test(e)}var cy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function nP(e){return cy.lastIndex=0,cy.test(e)}var sP=-2147483648,oP=2147483647;function iP(e){return Number.isInteger(e)&&e<=oP&&e>=sP}function aP(e){return Number.isInteger(e)}function uy(){return!0}var cP=/[^\\]\\Z/;function uP(e){if(cP.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 Ki{}vy._CodeOrName=Ki;vy.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class os extends Ki{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=os;class Ot extends Ki{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 os)t[r.str]=(t[r.str]||0)+1;return t},{})}}vy._Code=Ot;vy.nil=new Ot("");function yy(e,...t){let r=[e[0]],n=0;while(n<t.length)Au(r,t[n]),r.push(e[++n]);return new Ot(r)}vy._=yy;var Ou=new Ot("+");function _y(e,...t){let r=[oo(e[0])],n=0;while(n<t.length)r.push(Ou),Au(r,t[n]),r.push(Ou,oo(e[++n]));return dP(r),new Ot(r)}vy.str=_y;function Au(e,t){if(t instanceof Ot)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(hP(t))}vy.addCodeArg=Au;function dP(e){let t=1;while(t<e.length-1){if(e[t]===Ou){let r=fP(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function fP(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof os||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 os))return`"${e}${t.slice(1)}`;return}function pP(e,t){return t.emptyStr()?e:e.emptyStr()?t:_y`${e}${t}`}vy.strConcat=pP;function hP(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:oo(Array.isArray(e)?e.join(","):e)}function mP(e){return new Ot(oo(e))}vy.stringify=mP;function oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}vy.safeStringify=oo;function gP(e){return typeof e=="string"&&vy.IDENTIFIER.test(e)?new Ot(`.${e}`):yy`[${e}]`}vy.getProperty=gP;function yP(e){if(typeof e=="string"&&vy.IDENTIFIER.test(e))return new Ot(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}vy.getEsmExportName=yP;function _P(e){return new Ot(e.toString())}vy.regexpCode=_P});var Cu=g(function(Ey){Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueScope=Ey.ValueScopeName=Ey.Scope=Ey.varKinds=Ey.UsedValueState=void 0;var me=io();class by extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Bi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Bi||(Ey.UsedValueState=Bi={}));Ey.varKinds={const:new me.Name("const"),let:new me.Name("let"),var:new me.Name("var")};class Iu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof me.Name?e:this.name(e)}name(e){return new me.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=Iu;class Pu extends me.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=me._`.${new me.Name(t)}[${r}]`}}Ey.ValueScopeName=Pu;var NP=me._`\n`;class wy extends Iu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?NP:me.nil}}get(){return this._scope}name(e){return new Pu(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,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[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 me._`${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=me.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Bi.Started);let u=t(c);if(u){let d=this.opts.es5?Ey.varKinds.var:Ey.varKinds.const;s=me._`${s}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=me._`${s}${u}${this.opts._n}`;else throw new by(c);a.set(c,Bi.Completed)})}return s}}Ey.ValueScope=wy});var Z=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(),Oe=Cu(),Br=io();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return Br._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return Br.str}});Object.defineProperty(it,"strConcat",{enumerable:!0,get:function(){return Br.strConcat}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return Br.nil}});Object.defineProperty(it,"getProperty",{enumerable:!0,get:function(){return Br.getProperty}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return Br.stringify}});Object.defineProperty(it,"regexpCode",{enumerable:!0,get:function(){return Br.regexpCode}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return Br.Name}});var Zi=Cu();Object.defineProperty(it,"Scope",{enumerable:!0,get:function(){return Zi.Scope}});Object.defineProperty(it,"ValueScope",{enumerable:!0,get:function(){return Zi.ValueScope}});Object.defineProperty(it,"ValueScopeName",{enumerable:!0,get:function(){return Zi.ValueScopeName}});Object.defineProperty(it,"varKinds",{enumerable:!0,get:function(){return Zi.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 Wr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xy extends Wr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Oe.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=as(this.rhs,e,t);return this}get names(){return this.rhs instanceof N._CodeOrName?this.rhs.names:{}}}class Du extends Wr{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=as(this.rhs,e,t),this}get names(){let e=this.lhs instanceof N.Name?{}:{...this.lhs.names};return Qi(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 Wr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Wr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Oy extends Wr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Ay extends Wr{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=as(this.code,e,t),this}get names(){return this.code instanceof N._CodeOrName?this.code.names:{}}}class ea extends Wr{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;jP(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>En(e,t.names),{})}}class Yr extends ea{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ny extends ea{}class ao extends Yr{}ao.kind="else";class vr extends Yr{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 ao(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=as(this.condition,e,t),this}get names(){let e=super.names;if(Qi(e,this.condition),this.else)En(e,this.else.names);return e}}vr.kind="if";class is extends Yr{}is.kind="for";class Iy extends is{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=as(this.iteration,e,t),this}get names(){return En(super.names,this.iteration.names)}}class Py extends is{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Oe.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=Qi(super.names,this.from);return Qi(e,this.to)}}class ju extends is{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=as(this.iterable,e,t),this}get names(){return En(super.names,this.iterable.names)}}class Wi extends Yr{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)}}Wi.kind="func";class Yi extends ea{render(e){return"return "+super.render(e)}}Yi.kind="return";class Cy extends Yr{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)En(e,this.catch.names);if(this.finally)En(e,this.finally.names);return e}}class Xi extends Yr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Xi.kind="catch";class Ji extends Yr{render(e){return"finally"+super.render(e)}}Ji.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 Oe.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(Oe.varKinds.const,e,t,r)}let(e,t,r){return this._def(Oe.varKinds.let,e,t,r)}var(e,t,r){return this._def(Oe.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 Ay(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 ao)}endIf(){return this._endBlockNode(vr,ao)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Iy(e),t)}forRange(e,t,r,n,s=this.opts.es5?Oe.varKinds.var:Oe.varKinds.let){let o=this._scope.toName(e);return this._for(new Py(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Oe.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`,(i)=>{this.var(s,N._`${o}[${i}]`),r(s)})}return this._for(new ju("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Oe.varKinds.var:Oe.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(is)}label(e){return this._leafNode(new ky(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Yi;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Yi)}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 Xi(s),t(s)}if(r)this._currNode=n.finally=new Ji,this.code(r);return this._endBlockNode(Xi,Ji)}throw(e){return this._leafNode(new Oy(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 Wi(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Wi)}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 En(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Qi(e,t){return t instanceof N._CodeOrName?En(e,t.names):e}function as(e,t,r){if(e instanceof N.Name)return n(e);if(!s(e))return e;return new N._Code(e._items.reduce((o,i)=>{if(i instanceof N.Name)i=n(i);if(i instanceof N._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof N._Code&&o._items.some((i)=>i instanceof N.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function jP(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 qP=Dy(it.operators.AND);function DP(...e){return e.reduce(qP)}it.and=DP;var MP=Dy(it.operators.OR);function LP(...e){return e.reduce(MP)}it.or=LP;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 ae=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 U=Z(),Fy=io();function zP(e){let t={};for(let r of e)t[r]=!0;return t}By.toHash=zP;function GP(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=GP;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 KP(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=KP;function HP({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)}`}By.schemaRefOrVal=HP;function BP(e){return Gy(decodeURIComponent(e))}By.unescapeFragment=BP;function WP(e){return encodeURIComponent(Lu(e))}By.escapeFragment=WP;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 YP(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}By.eachItem=YP;function Ly({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof U.Name?(o instanceof U.Name?e(s,o,i):t(s,o,i),i):o instanceof U.Name?(t(s,i,o),o):r(o,i);return a===U.Name&&!(c instanceof U.Name)?n(s,c):c}}By.mergeEvaluated={props:Ly({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} || {}`),Uu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ky}),items:Ly({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 Ky(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);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(U._`${t}${U.getProperty(n)}`,!0))}By.setEvaluated=Uu;var Uy={};function XP(e,t){return e.scopeValue("func",{ref:t,code:Uy[t.code]||(Uy[t.code]=new Fy._Code(t.code))})}By.useFunc=XP;var Mu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mu||(By.Type=Mu={}));function JP(e,t,r){if(e instanceof U.Name){let n=t===Mu.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():"/"+Lu(e)}By.getErrorPath=JP;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 $r=g(function(Yy){Object.defineProperty(Yy,"__esModule",{value:!0});var ue=Z(),m1={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")};Yy.default=m1});var co=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=Z(),Xr=ae(),Ye=$r();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 y1(e,t=Zy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Qy(e,t,r);if(n!==null&&n!==void 0?n:i||a)Xy(o,c);else Jy(s,C._`[${c}]`)}Zy.reportError=y1;function _1(e,t=Zy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Qy(e,t,r);if(Xy(s,a),!(o||i))Jy(n,Ye.default.vErrors)}Zy.reportExtraError=_1;function v1(e,t){e.assign(Ye.default.errors,t),e.if(C._`${Ye.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Ye.default.vErrors}.length`,t),()=>e.assign(Ye.default.vErrors,null)))}Zy.resetErrorsCount=v1;function $1({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,Ye.default.errors,(a)=>{if(e.const(i,C._`${Ye.default.vErrors}[${a}]`),e.if(C._`${i}.instancePath === undefined`,()=>e.assign(C._`${i}.instancePath`,C.strConcat(Ye.default.instancePath,o.errorPath))),e.assign(C._`${i}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${i}.schema`,r),e.assign(C._`${i}.data`,n)})}Zy.extendErrors=$1;function Xy(e,t){let r=e.const("err",t);e.if(C._`${Ye.default.vErrors} === null`,()=>e.assign(Ye.default.vErrors,C._`[${r}]`),C._`${Ye.default.vErrors}.push(${r})`),e.code(C._`${Ye.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 Sn={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 b1(e,t,r)}function b1(e,t,r={}){let{gen:n,it:s}=e,o=[w1(s,r),E1(e,r)];return S1(e,t,o),n.object(...o)}function w1({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Xr.getErrorPath(t,Xr.Type.Str)}`:e;return[Ye.default.instancePath,C.strConcat(Ye.default.instancePath,r)]}function E1({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Xr.getErrorPath(r,Xr.Type.Str)}`;return[Sn.schemaPath,s]}function S1(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([Sn.keyword,s],[Sn.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([Sn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([Sn.schema,i],[Sn.parentSchema,C._`${d}${l}`],[Ye.default.data,o]);if(u)n.push([Sn.propertyName,u])}});var i_=g(function(s_){Object.defineProperty(s_,"__esModule",{value:!0});s_.boolOrEmptySchema=s_.topBoolOrEmptySchema=void 0;var t_=co(),r_=Z(),O1=$r(),A1={message:"boolean schema is false"};function N1(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(O1.default.data);else t.assign(r_._`${n}.errors`,null),t.return(!0)}s_.topBoolOrEmptySchema=N1;function I1(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),n_(e);else r.var(t,!0)}s_.boolOrEmptySchema=I1;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},A1,void 0,t)}});var Vu=g(function(a_){Object.defineProperty(a_,"__esModule",{value:!0});a_.getRules=a_.isJSONType=void 0;var C1=["string","number","integer","boolean","null","object","array"],j1=new Set(C1);function q1(e){return typeof e=="string"&&j1.has(e)}a_.isJSONType=q1;function D1(){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:{}}}a_.getRules=D1});var zu=g(function(d_){Object.defineProperty(d_,"__esModule",{value:!0});d_.shouldUseRule=d_.shouldUseGroup=d_.schemaHasRulesForType=void 0;function L1({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&u_(e,n)}d_.schemaHasRulesForType=L1;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 uo=g(function(__){Object.defineProperty(__,"__esModule",{value:!0});__.reportTypeError=__.checkDataTypes=__.checkDataType=__.coerceAndCheckDataType=__.getJSONTypes=__.getSchemaTypes=__.DataType=void 0;var p_=Vu(),h_=zu(),m_=co(),R=Z(),ra=ae(),cs;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(cs||(__.DataType=cs={}));function V1(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=V1;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 z1(e,t){let{gen:r,data:n,opts:s}=e,o=G1(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&h_.schemaHasRulesForType(e,t[0]));if(i){let a=Ku(t,n,s.strictNumbers,cs.Wrong);r.if(a,()=>{if(o.length)K1(e,t,o);else Hu(e)})}return i}__.coerceAndCheckDataType=z1;var y_=new Set(["string","number","integer","boolean","null"]);function G1(e,t){return t?e.filter((r)=>y_.has(r)||t==="array"&&r==="array"):[]}function K1(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",R._`typeof ${s}`),a=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(i,R._`typeof ${s}`).if(Ku(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(R._`${a} !== 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._`${a} !== undefined`,()=>{n.assign(s,a),H1(e,a)});function c(u){switch(u){case"string":n.elseIf(R._`${i} == "number" || ${i} == "boolean"`).assign(a,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(a,R._`""`);return;case"number":n.elseIf(R._`${i} == "boolean" || ${s} === null
|
|
12
12
|
|| (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,R._`+${s}`);return;case"integer":n.elseIf(R._`${i} === "boolean" || ${s} === null
|
|
13
13
|
|| (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,R._`+${s}`);return;case"boolean":n.elseIf(R._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf(R._`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf(R._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf(R._`${i} === "string" || ${i} === "number"
|
|
14
|
-
|| ${i} === "boolean" || ${s} === null`).assign(a,R._`[${s}]`)}}}function F1({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function zu(e,t,r,n=cs.Correct){let s=n===cs.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=i(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return R._`typeof ${t} ${s} ${e}`}return n===cs.Correct?o:R.not(o);function i(a=R.nil){return R.and(R._`typeof ${t} == "number"`,a,r?R._`isFinite(${t})`:R.nil)}}y_.checkDataType=zu;function Gu(e,t,r,n){if(e.length===1)return zu(e[0],t,r,n);let s,o=ta.toHash(e);if(o.array&&o.object){let i=R._`typeof ${t} != "object"`;s=o.null?i:R._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let i in o)s=R.and(s,zu(i,t,r,n));return s}y_.checkDataTypes=Gu;var V1={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Ku(e){let t=z1(e);h_.reportError(t,V1)}y_.reportTypeError=Ku;function z1(e){let{gen:t,data:r,schema:n}=e,s=ta.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var b_=g(function(E_){Object.defineProperty(E_,"__esModule",{value:!0});E_.assignDefaults=void 0;var yt=Z(),$_=ae();function X1(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)v_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>v_(e,o,s.default))}E_.assignDefaults=X1;function v_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=yt._`${o}${yt.getProperty(t)}`;if(s){$_.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=yt._`${a} === undefined`;if(i.useDefaults==="empty")c=yt._`${c} || ${a} === null || ${a} === ""`;n.if(c,yt._`${a} = ${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=Z(),us=ae(),Xr=vr(),S_=ae();function J1(e,t){let{gen:r,data:n,it:s}=e;r.if(Bu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=J1;function Q1({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Bu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=Q1;function Z1(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=Z1;function x_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=x_;function Hu(e,t,r){return z._`${x_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Hu;function eC(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Hu(e,t,r)}`:s}T_.propertyInData=eC;function Bu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Hu(e,t,r))):s}T_.noPropertyInData=Bu;function R_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=R_;function tC(e,t){return R_(t).filter((r)=>!us.alwaysValidSchema(e,t[r]))}T_.schemaProperties=tC;function rC({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?z._`${e}, ${t}, ${n}${s}`:t,l=[[Xr.default.instancePath,z.strConcat(Xr.default.instancePath,o)],[Xr.default.parentData,i.parentData],[Xr.default.parentDataProperty,i.parentDataProperty],[Xr.default.rootData,Xr.default.rootData]];if(i.opts.dynamicRef)l.push([Xr.default.dynamicAnchors,Xr.default.dynamicAnchors]);let p=z._`${d}, ${r.object(...l)}`;return c!==z.nil?z._`${a}.call(${c}, ${p})`:z._`${a}(${p})`}T_.callValidateCode=rC;var nC=z._`new RegExp`;function sC({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"?nC:S_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=sC;function oC(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:us.Type.Num},o),t.if(z.not(o),a)})}}T_.validateArray=oC;function iC(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>us.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,z._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(z.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=iC});var j_=g(function(I_){Object.defineProperty(I_,"__esModule",{value:!0});I_.validateKeywordUsage=I_.validSchemaType=I_.funcKeywordCode=I_.macroKeywordCode=void 0;var de=Z(),xn=vr(),A_=_t(),P_=co();function vC(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=N_(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:de.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}I_.macroKeywordCode=vC;function $C(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;wC(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=N_(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)O_(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)O_(e);y(()=>EC(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(de._`await `),(O)=>n.assign(l,!1).if(de._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,de._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=de._`${d}.errors`;return n.assign(_,null),m(de.nil),_}function m(_=t.async?de._`await `:de.nil){let O=c.opts.passContext?xn.default.this:xn.default.self,T=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,de._`${_}${A_.callValidateCode(e,d,O,T)}`,t.modifying)}function y(_){var O;n.if(de.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}I_.funcKeywordCode=$C;function O_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function EC(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(xn.default.vErrors,de._`${xn.default.vErrors} === null ? ${t} : ${xn.default.vErrors}.concat(${t})`).assign(xn.default.errors,de._`${xn.default.vErrors}.length`),P_.extendErrors(e)},()=>e.error())}function wC({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function N_(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 bC(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=bC;function SC({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 i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.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=SC});var M_=g(function(q_){Object.defineProperty(q_,"__esModule",{value:!0});q_.extendSubschemaMode=q_.extendSubschemaData=q_.getSubschema=void 0;var qe=Z(),ra=ae();function kC(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ra.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}q_.getSubschema=kC;function OC(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(p),e.errorPath=qe.str`${u}${ra.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}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]}}q_.extendSubschemaData=OC;function AC(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}q_.extendSubschemaMode=AC});var lo=g(function(z_){Object.defineProperty(z_,"__esModule",{value:!0});z_.getSchemaRefs=z_.resolveUrl=z_.normalizeId=z_._getFullPath=z_.getFullPath=z_.inlineRef=void 0;var L_=ae(),IC=Js(),CC=ru(),jC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function qC(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Wu(e);if(!t)return!1;return U_(e)<=t}z_.inlineRef=qC;var DC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wu(e){for(let t in e){if(DC.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Wu))return!0;if(typeof r=="object"&&Wu(r))return!0}return!1}function U_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,jC.has(r))continue;if(typeof e[r]=="object")L_.eachItem(e[r],(n)=>t+=U_(n));if(t===1/0)return 1/0}return t}function F_(e,t="",r){if(r!==!1)t=ls(t);let n=e.parse(t);return V_(e,n)}z_.getFullPath=F_;function V_(e,t){return e.serialize(t).split("#")[0]+"#"}z_._getFullPath=V_;var MC=/#\/?$/;function ls(e){return e?e.replace(MC,""):""}z_.normalizeId=ls;function LC(e,t,r){return r=ls(r),e.resolve(t,r)}z_.resolveUrl=LC;var UC=/^[a-z_][-a-z0-9._]*$/i;function FC(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ls(e[r]||t),o={"":s},i=F_(n,s,!1),a={},c=new Set;return CC(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(T){let M=this.opts.uriResolver.resolve;if(T=ls(y?M(y,T):T),c.has(T))throw d(T);c.add(T);let S=this.refs[T];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,T);else if(T!==ls(m))if(T[0]==="#")u(l,a[T],T),a[T]=l;else this.refs[T]=m;return T}function O(T){if(typeof T=="string"){if(!UC.test(T))throw Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function u(l,p,f){if(p!==void 0&&!IC(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}z_.getSchemaRefs=FC});var fo=g(function(ov){Object.defineProperty(ov,"__esModule",{value:!0});ov.getData=ov.KeywordCxt=ov.validateFunctionCode=void 0;var sa=o_(),na=uo(),fs=Vu(),Jr=uo(),W_=b_(),Jt=j_(),ds=M_(),w=Z(),B=vr(),Y_=lo(),Le=ae(),Xt=co();function BC(e){if(Q_(e)){if(Z_(e),J_(e)){XC(e);return}}X_(e,()=>sa.topBoolOrEmptySchema(e))}ov.validateFunctionCode=BC;function X_({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"; ${K_(r,s)}`),YC(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${WC(s)}`,n.$async,()=>e.code(K_(r,s)).code(o))}function WC(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 YC(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 XC(e){let{schema:t,opts:r,gen:n}=e;X_(e,()=>{if(r.$comment&&t.$comment)tv(e);if(tj(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)JC(e);ev(e),sj(e)});return}function JC(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 K_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?w._`/*# sourceURL=${r} */`:w.nil}function QC(e,t){if(Q_(e)){if(Z_(e),J_(e)){ZC(e,t);return}}sa.boolOrEmptySchema(e,t)}function J_({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 Q_(e){return typeof e.schema!="boolean"}function ZC(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)tv(e);rj(e),nj(e);let o=n.const("_errs",B.default.errors);ev(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function Z_(e){Le.checkUnknownRules(e),ej(e)}function ev(e,t){if(e.opts.jtd)return H_(e,[],!1,t);let r=na.getSchemaTypes(e.schema),n=na.coerceAndCheckDataType(e,r);H_(e,r,!n,t)}function ej(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 tj(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 rj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Y_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function nj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function tv({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 i=w.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(w._`${B.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function sj(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)oj(e);t.return(w._`${B.default.errors} === 0`)}}function oj({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 H_(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,d))){s.block(()=>nv(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)ij(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!fs.shouldUseGroup(o,p))return;if(p.type){if(s.if(Jr.checkDataType(p.type,i,c.strictNumbers)),B_(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Jr.reportTypeError(e);s.endIf()}else B_(e,p);if(!a)s.if(w._`${B.default.errors} === ${n||0}`)}}function B_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)W_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(fs.shouldUseRule(n,o))nv(e,o.keyword,o.definition,t.type)})}function ij(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(aj(e,t),!e.opts.allowUnionTypes)cj(e,t);uj(e,e.dataTypes)}function aj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!rv(e.dataTypes,r))Yu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),dj(e,t)}function cj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Yu(e,"use allowUnionTypes to allow union type keyword")}function uj(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&fs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>lj(t,i)))Yu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function lj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function rv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function dj(e,t){let r=[];for(let n of e.dataTypes)if(rv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Yu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class Xu{constructor(e,t,r){if(Jt.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",sv(this.$data,e));else if(this.schemaCode=this.schemaValue,!Jt.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?Xt.reportExtraError:Xt.reportError)(this,this.def.error,t)}$dataError(){Xt.reportError(this,this.def.$dataError||Xt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Xt.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(),i());function o(){if(r.length){if(!(t instanceof w.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return w._`${Jr.checkDataTypes(a,t,s.opts.strictNumbers,Jr.DataType.Wrong)}`}return w.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return w._`!${a}(${t})`}return w.nil}}subschema(e,t){let r=ds.getSubschema(this.it,e);ds.extendSubschemaData(r,this.it,e),ds.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return QC(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,w.Name)),!0}}ov.KeywordCxt=Xu;function nv(e,t,r,n){let s=new Xu(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Jt.funcKeywordCode(s,r);else if("macro"in r)Jt.macroKeywordCode(s,r);else if(r.compile||r.validate)Jt.funcKeywordCode(s,r)}var fj=/^\/(?:[^~]|~0|~1)*$/,pj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function sv(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!fj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=pj.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=w._`${o}${w.getProperty(Le.unescapeJsonPointer(u))}`,i=w._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}ov.getData=sv});var oa=g(function(cv){Object.defineProperty(cv,"__esModule",{value:!0});class av extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}cv.default=av});var po=g(function(lv){Object.defineProperty(lv,"__esModule",{value:!0});var ps=lo();class uv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=ps.resolveUrl(e,t,r),this.missingSchema=ps.normalizeId(ps.getFullPath(e,this.missingRef))}}lv.default=uv});var ca=g(function(pv){Object.defineProperty(pv,"__esModule",{value:!0});pv.resolveSchema=pv.getCompilingSchema=pv.resolveRef=pv.compileSchema=pv.SchemaEnv=void 0;var Ae=Z(),_j=oa(),Rn=vr(),Pe=lo(),ia=ae(),dv=fo();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:Pe.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={}}}pv.SchemaEnv=ho;function Qu(e){let t=fv.call(this,e);if(t)return t;let r=Pe.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:_j.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Rn.default.data,parentData:Rn.default.parentData,parentDataProperty:Rn.default.parentDataProperty,dataNames:[Rn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,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},d;try{this._compilations.add(e),dv.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(Rn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${Rn.default.self}`,`${Rn.default.scope}`,d)(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:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Ae.Name?void 0:h,items:m instanceof Ae.Name?void 0:m,dynamicProps:h instanceof Ae.Name,dynamicItems:m instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}pv.compileSchema=Qu;function vj(e,t,r){var n;r=Pe.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=wj.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new ho({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=$j.call(this,o)}pv.resolveRef=vj;function $j(e){if(Pe.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Qu.call(this,e)}function fv(e){for(let t of this._compilations)if(Ej(t,e))return t}pv.getCompilingSchema=fv;function Ej(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function wj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||aa.call(this,e,t)}function aa(e,t){let r=this.opts.uriResolver.parse(t),n=Pe._getFullPath(this.opts.uriResolver,r),s=Pe.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Ju.call(this,r,e);let o=Pe.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=aa.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Ju.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)Qu.call(this,i);if(o===Pe.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Pe.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:a,schemaId:c,root:e,baseId:s})}return Ju.call(this,r,i)}pv.resolveSchema=aa;var bj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ju(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ia.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!bj.has(a)&&u)t=Pe.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ia.schemaHasRulesButRef(r,this.RULES)){let a=Pe.resolveUrl(this.opts.uriResolver,t,r.$ref);o=aa.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new ho({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var mv=g(function(lK,kj){kj.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 _v=g(function(yv){Object.defineProperty(yv,"__esModule",{value:!0});var gv=pu();gv.code='require("ajv/dist/runtime/uri").default';yv.default=gv});var kv=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 Aj=fo();Object.defineProperty($r,"KeywordCxt",{enumerable:!0,get:function(){return Aj.KeywordCxt}});var ms=Z();Object.defineProperty($r,"_",{enumerable:!0,get:function(){return ms._}});Object.defineProperty($r,"str",{enumerable:!0,get:function(){return ms.str}});Object.defineProperty($r,"stringify",{enumerable:!0,get:function(){return ms.stringify}});Object.defineProperty($r,"nil",{enumerable:!0,get:function(){return ms.nil}});Object.defineProperty($r,"Name",{enumerable:!0,get:function(){return ms.Name}});Object.defineProperty($r,"CodeGen",{enumerable:!0,get:function(){return ms.CodeGen}});var Pj=oa(),bv=po(),Sv=Fu(),Qt=ca(),xv=Z(),Zt=lo(),Qr=uo(),hs=ae(),vv=mv(),Nj=_v(),Rv=(e,t)=>new RegExp(e,t);Rv.code="new RegExp";var Ij=["removeAdditional","useDefaults","coerceTypes"],Cj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jj={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."},qj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},$v=200;function Dj(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,T,M,S,_e,ve,xt,hr;let et=e.strict,gn=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=gn===!0||gn===void 0?1:gn||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Rv,yc=(s=e.uriResolver)!==null&&s!==void 0?s:Nj.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:et)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:et)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:et)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:et)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:et)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:$v,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:$v,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(T=e.inlineRefs)!==null&&T!==void 0?T:!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:(ve=e.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(xt=e.unicodeRegExp)!==null&&xt!==void 0?xt:!0,int32range:(hr=e.int32range)!==null&&hr!==void 0?hr:!0,uriResolver:yc}}class ua{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Dj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new xv.ValueScope({scope:{},prefixes:Cj,es5:t,lines:r}),this.logger=zj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=Sv.getRules(),Ev.call(this,jj,e,"NOT SUPPORTED"),Ev.call(this,qj,e,"DEPRECATED","warn"),this._metaOpts=Fj.call(this),e.formats)Lj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Uj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Mj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=vv;if(r==="id")n={...vv},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,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}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(d){if(!(d instanceof bv.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;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=Zt.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=wv.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Qt.SchemaEnv({schema:{},schemaId:r});if(t=Qt.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=wv.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=Zt.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(Kj.call(this,r,t),!t)return hs.eachItem(r,(s)=>Zu.call(this,s)),this;Bj.call(this,t);let n={...t,type:Qr.getJSONTypes(t.type),schemaType:Qr.getJSONTypes(t.schemaType)};return hs.eachItem(r,n.type.length===0?(s)=>Zu.call(this,s,n):(s)=>n.type.forEach((o)=>Zu.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 i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=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:i}=this.opts;if(typeof e=="object")o=e[i];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 a=this._cache.get(e);if(a!==void 0)return a;r=Zt.normalizeId(o||r);let c=Zt.getSchemaRefs.call(this,e,r);if(a=new Qt.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_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 Qt.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{Qt.compileSchema.call(this,e)}finally{this.opts=t}}}ua.ValidationError=Pj.default;ua.MissingRefError=bv.default;$r.default=ua;function Ev(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 wv(e){return e=Zt.normalizeId(e),this.schemas[e]||this.refs[e]}function Mj(){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 Lj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Uj(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 Fj(){let e={...this.opts};for(let t of Ij)delete e[t];return e}var Vj={log(){},warn(){},error(){}};function zj(e){if(e===!1)return Vj;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 Gj=/^[a-z_$][a-z0-9_$:-]*$/i;function Kj(e,t){let{RULES:r}=this;if(hs.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Gj.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 Zu(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,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Qr.getJSONTypes(t.type),schemaType:Qr.getJSONTypes(t.schemaType)}};if(t.before)Hj.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Hj(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 Bj(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 Wj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,Wj]}}});var Av=g(function(Ov){Object.defineProperty(Ov,"__esModule",{value:!0});var Jj={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ov.default=Jj});var Cv=g(function(Nv){Object.defineProperty(Nv,"__esModule",{value:!0});Nv.callRef=Nv.getValidate=void 0;var Zj=po(),da=_t(),ge=Z(),gs=vr(),fa=ca(),Zr=ae(),eq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=fa.resolveRef.call(c,u,s,r);if(d===void 0)throw new Zj.default(n.opts.uriResolver,s,r);if(d instanceof fa.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return la(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return la(e,ge._`${h}.validate`,u,u.$async)}function p(h){let m=Pv(e,h);la(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:ge.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:ge.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),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`}Nv.getValidate=Pv;function la(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?gs.default.this:ge.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(ge._`await ${da.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(ge._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(da.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=ge._`${h}.errors`;s.assign(gs.default.vErrors,ge._`${gs.default.vErrors} === null ? ${m} : ${gs.default.vErrors}.concat(${m})`),s.assign(gs.default.errors,ge._`${gs.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=Zr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",ge._`${h}.evaluated.props`);o.props=Zr.mergeEvaluated.props(s,_,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=Zr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",ge._`${h}.evaluated.items`);o.items=Zr.mergeEvaluated.items(s,_,o.items,ge.Name)}}}Nv.callRef=la;Nv.default=eq});var qv=g(function(jv){Object.defineProperty(jv,"__esModule",{value:!0});var nq=Av(),sq=Cv(),oq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",nq.default,sq.default];jv.default=oq});var Mv=g(function(Dv){Object.defineProperty(Dv,"__esModule",{value:!0});var tn=Z(),en=tn.operators,pa={maximum:{okStr:"<=",ok:en.LTE,fail:en.GT},minimum:{okStr:">=",ok:en.GTE,fail:en.LT},exclusiveMaximum:{okStr:"<",ok:en.LT,fail:en.GTE},exclusiveMinimum:{okStr:">",ok:en.GT,fail:en.LTE}},aq={message:({keyword:e,schemaCode:t})=>tn.str`must be ${pa[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>tn._`{comparison: ${pa[e].okStr}, limit: ${t}}`},cq={keyword:Object.keys(pa),type:"number",schemaType:"number",$data:!0,error:aq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(tn._`${r} ${pa[t].fail} ${n} || isNaN(${r})`)}};Dv.default=cq});var Uv=g(function(Lv){Object.defineProperty(Lv,"__esModule",{value:!0});var er=Z(),lq={message:({schemaCode:e})=>er.str`must be multiple of ${e}`,params:({schemaCode:e})=>er._`{multipleOf: ${e}}`},dq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:lq,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?er._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:er._`${i} !== parseInt(${i})`;e.fail$data(er._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Lv.default=dq});var zv=g(function(Vv){Object.defineProperty(Vv,"__esModule",{value:!0});function Fv(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}Vv.default=Fv;Fv.code='require("ajv/dist/runtime/ucs2length").default'});var Hv=g(function(Kv){Object.defineProperty(Kv,"__esModule",{value:!0});var ct=Z(),Gv=ae(),hq=zv(),mq={message({keyword:e,schemaCode:t}){return ct.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>ct._`{limit: ${e}}`},gq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:mq,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?ct.operators.GT:ct.operators.LT,i=s.opts.unicode===!1?ct._`${r}.length`:ct._`${Gv.useFunc(e.gen,hq.default)}(${r})`;e.fail$data(ct._`${i} ${o} ${n}`)}};Kv.default=gq});var Yv=g(function(Wv){Object.defineProperty(Wv,"__esModule",{value:!0});var Bv=_t(),rn=Z(),_q={message:({schemaCode:e})=>rn.str`must match pattern "${e}"`,params:({schemaCode:e})=>rn._`{pattern: ${e}}`},vq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:_q,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?rn._`(new RegExp(${s}, ${i}))`:Bv.usePattern(e,n);e.fail$data(rn._`!${a}.test(${t})`)}};Wv.default=vq});var Jv=g(function(Xv){Object.defineProperty(Xv,"__esModule",{value:!0});var tr=Z(),Eq={message({keyword:e,schemaCode:t}){return tr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>tr._`{limit: ${e}}`},wq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Eq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?tr.operators.GT:tr.operators.LT;e.fail$data(tr._`Object.keys(${r}).length ${s} ${n}`)}};Xv.default=wq});var e0=g(function(Zv){Object.defineProperty(Zv,"__esModule",{value:!0});var rr=_t(),nr=Z(),Qv=ae(),Sq={message:({params:{missingProperty:e}})=>nr.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>nr._`{missingProperty: ${e}}`},xq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Sq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Qv.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(nr.nil,l);else for(let f of r)rr.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(rr.checkMissingProp(e,r,f)),rr.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(rr.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,rr.propertyInData(t,s,f,a.ownProperties)),t.if(nr.not(h),()=>{e.error(),t.break()})},nr.nil)}}};Zv.default=xq});var r0=g(function(t0){Object.defineProperty(t0,"__esModule",{value:!0});var sr=Z(),Tq={message({keyword:e,schemaCode:t}){return sr.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>sr._`{limit: ${e}}`},kq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?sr.operators.GT:sr.operators.LT;e.fail$data(sr._`${r}.length ${s} ${n}`)}};t0.default=kq});var ha=g(function(s0){Object.defineProperty(s0,"__esModule",{value:!0});var n0=Js();n0.code='require("ajv/dist/runtime/equal").default';s0.default=n0});var a0=g(function(i0){Object.defineProperty(i0,"__esModule",{value:!0});var ys=uo(),oe=Z(),o0=ae(),Pq=ha(),Nq={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}}`},Iq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?ys.getSchemaTypes(o.items):[];e.block$data(c,d,oe._`${i} === false`),e.ok(c);function d(){let h=t.let("i",oe._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(oe._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=ys.checkDataTypes(u,y,a.opts.strictNumbers,ys.DataType.Wrong),O=t.const("indices",oe._`{}`);t.for(oe._`;${h}--;`,()=>{if(t.let(y,oe._`${r}[${h}]`),t.if(_,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,oe._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${O}[${y}] = ${h}`)})}function f(h,m){let y=o0.useFunc(t,Pq.default),_=t.name("outer");t.label(_).for(oe._`;${h}--;`,()=>t.for(oe._`${m} = ${h}; ${m}--;`,()=>t.if(oe._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};i0.default=Iq});var l0=g(function(u0){Object.defineProperty(u0,"__esModule",{value:!0});var _s=Z(),c0=ae(),jq=ha(),qq={message:"must be equal to constant",params:({schemaCode:e})=>_s._`{allowedValue: ${e}}`},Dq={keyword:"const",$data:!0,error:qq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(_s._`!${c0.useFunc(t,jq.default)}(${r}, ${s})`);else e.fail(_s._`${o} !== ${r}`)}};u0.default=Dq});var p0=g(function(f0){Object.defineProperty(f0,"__esModule",{value:!0});var or=Z(),d0=ae(),Lq=ha(),Uq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>or._`{allowedValues: ${e}}`},Fq={keyword:"enum",schemaType:"array",$data:!0,error:Uq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=d0.useFunc(t,Lq.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=or.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(or._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?or._`${u()}(${r}, ${f}[${h}])`:or._`${r} === ${m}`}}};f0.default=Fq});var m0=g(function(h0){Object.defineProperty(h0,"__esModule",{value:!0});var zq=Mv(),Gq=Uv(),Kq=Hv(),Hq=Yv(),Bq=Jv(),Wq=e0(),Yq=r0(),Xq=a0(),Jq=l0(),Qq=p0(),Zq=[zq.default,Gq.default,Kq.default,Hq.default,Bq.default,Wq.default,Yq.default,Xq.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Jq.default,Qq.default];h0.default=Zq});var el=g(function(y0){Object.defineProperty(y0,"__esModule",{value:!0});y0.validateAdditionalItems=void 0;var ut=Z(),vs=ae(),tD={message:({params:{len:e}})=>ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ut._`{limit: ${e}}`},rD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:tD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){vs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}g0(e,n)}};function g0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",ut._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ut._`${a} <= ${t.length}`);else if(typeof n=="object"&&!vs.alwaysValidSchema(i,n)){let u=r.var("valid",ut._`${a} <= ${t.length}`);r.if(ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:vs.Type.Num},u),!i.allErrors)r.if(ut.not(u),()=>r.break())})}}y0.validateAdditionalItems=g0;y0.default=rD});var tl=g(function(E0){Object.defineProperty(E0,"__esModule",{value:!0});E0.validateTuple=void 0;var ma=Z(),nn=ae(),v0=_t(),sD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return $0(e,"additionalItems",t);if(r.items=!0,nn.alwaysValidSchema(r,t))return;e.ok(v0.validateArray(e))}};function $0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=nn.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",ma._`${o}.length`);r.forEach((l,p)=>{if(nn.alwaysValidSchema(a,l))return;n.if(ma._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;nn.checkStrictMode(a,y,p.strictTuples)}}}E0.validateTuple=$0;E0.default=sD});var x0=g(function(S0){Object.defineProperty(S0,"__esModule",{value:!0});var b0=tl(),iD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>b0.validateTuple(e,"items")};S0.default=iD});var A0=g(function(O0){Object.defineProperty(O0,"__esModule",{value:!0});var ga=Z(),R0=ae(),T0=_t(),k0=el(),cD={message:({params:{len:e}})=>ga.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ga._`{limit: ${e}}`},uD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,R0.alwaysValidSchema(n,t))return;if(s)k0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};O0.default=uD});var N0=g(function(P0){Object.defineProperty(P0,"__esModule",{value:!0});var Ee=Z(),sn=ae(),dD={message:({params:{min:e,max:t}})=>t===void 0?Ee.str`must contain at least ${e} valid item(s)`:Ee.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Ee._`{minContains: ${e}}`:Ee._`{minContains: ${e}, maxContains: ${t}}`},fD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:dD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",Ee._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){sn.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){sn.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(sn.alwaysValidSchema(o,r)){let m=Ee._`${d} >= ${i}`;if(a!==void 0)m=Ee._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if(Ee._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:sn.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code(Ee._`${m}++`),a===void 0)t.if(Ee._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(Ee._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(Ee._`${m} >= ${i}`,()=>t.assign(l,!0))}}};P0.default=fD});var L0=g(function(q0){Object.defineProperty(q0,"__esModule",{value:!0});q0.validateSchemaDeps=q0.validatePropertyDeps=q0.error=void 0;var $s=Z(),I0=ae(),ir=_t();q0.error={message:({params:{property:e,depsCount:t,deps:r}})=>$s.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>$s._`{property: ${e},
|
|
14
|
+
|| ${i} === "boolean" || ${s} === null`).assign(a,R._`[${s}]`)}}}function H1({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function Gu(e,t,r,n=cs.Correct){let s=n===cs.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=i(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return R._`typeof ${t} ${s} ${e}`}return n===cs.Correct?o:R.not(o);function i(a=R.nil){return R.and(R._`typeof ${t} == "number"`,a,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=ra.toHash(e);if(o.array&&o.object){let i=R._`typeof ${t} != "object"`;s=o.null?i:R._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let i in o)s=R.and(s,Gu(i,t,r,n));return s}__.checkDataTypes=Ku;var B1={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=W1(e);m_.reportError(t,B1)}__.reportTypeError=Hu;function W1(e){let{gen:t,data:r,schema:n}=e,s=ra.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(w_){Object.defineProperty(w_,"__esModule",{value:!0});w_.assignDefaults=void 0;var _t=Z(),b_=ae();function tC(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)$_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>$_(e,o,s.default))}w_.assignDefaults=tC;function $_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=_t._`${o}${_t.getProperty(t)}`;if(s){b_.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=_t._`${a} === undefined`;if(i.useDefaults==="empty")c=_t._`${c} || ${a} === null || ${a} === ""`;n.if(c,_t._`${a} = ${_t.stringify(r)}`)}});var vt=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=Z(),us=ae(),Jr=$r(),x_=ae();function rC(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=rC;function nC({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=nC;function sC(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=sC;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 oC(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Bu(e,t,r)}`:s}T_.propertyInData=oC;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 iC(e,t){return k_(t).filter((r)=>!us.alwaysValidSchema(e,t[r]))}T_.schemaProperties=iC;function aC({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?z._`${e}, ${t}, ${n}${s}`:t,l=[[Jr.default.instancePath,z.strConcat(Jr.default.instancePath,o)],[Jr.default.parentData,i.parentData],[Jr.default.parentDataProperty,i.parentDataProperty],[Jr.default.rootData,Jr.default.rootData]];if(i.opts.dynamicRef)l.push([Jr.default.dynamicAnchors,Jr.default.dynamicAnchors]);let p=z._`${d}, ${r.object(...l)}`;return c!==z.nil?z._`${a}.call(${c}, ${p})`:z._`${a}(${p})`}T_.callValidateCode=aC;var cC=z._`new RegExp`;function uC({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"?cC:x_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=uC;function lC(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:us.Type.Num},o),t.if(z.not(o),a)})}}T_.validateArray=lC;function dC(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>us.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,z._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(z.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=dC});var q_=g(function(C_){Object.defineProperty(C_,"__esModule",{value:!0});C_.validateKeywordUsage=C_.validSchemaType=C_.funcKeywordCode=C_.macroKeywordCode=void 0;var de=Z(),xn=$r(),N_=vt(),I_=co();function SC(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=P_(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:de.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}C_.macroKeywordCode=SC;function xC(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;kC(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=P_(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)A_(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)A_(e);y(()=>RC(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(de._`await `),(O)=>n.assign(l,!1).if(de._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,de._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=de._`${d}.errors`;return n.assign(_,null),m(de.nil),_}function m(_=t.async?de._`await `:de.nil){let O=c.opts.passContext?xn.default.this:xn.default.self,k=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,de._`${_}${N_.callValidateCode(e,d,O,k)}`,t.modifying)}function y(_){var O;n.if(de.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}C_.funcKeywordCode=xC;function A_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function RC(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(xn.default.vErrors,de._`${xn.default.vErrors} === null ? ${t} : ${xn.default.vErrors}.concat(${t})`).assign(xn.default.errors,de._`${xn.default.vErrors}.length`),I_.extendErrors(e)},()=>e.error())}function kC({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function P_(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 TC(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=TC;function OC({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 i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.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=OC});var L_=g(function(D_){Object.defineProperty(D_,"__esModule",{value:!0});D_.extendSubschemaMode=D_.extendSubschemaData=D_.getSubschema=void 0;var qe=Z(),na=ae();function PC(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${na.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}D_.getSubschema=PC;function CC(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(p),e.errorPath=qe.str`${u}${na.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}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=CC;function jC(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=jC});var lo=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_=ae(),MC=Js(),LC=nu(),UC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function FC(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=FC;var VC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Yu(e){for(let t in e){if(VC.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++,UC.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=ls(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 zC=/#\/?$/;function ls(e){return e?e.replace(zC,""):""}G_.normalizeId=ls;function GC(e,t,r){return r=ls(r),e.resolve(t,r)}G_.resolveUrl=GC;var KC=/^[a-z_][-a-z0-9._]*$/i;function HC(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ls(e[r]||t),o={"":s},i=V_(n,s,!1),a={},c=new Set;return LC(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(k){let M=this.opts.uriResolver.resolve;if(k=ls(y?M(y,k):k),c.has(k))throw d(k);c.add(k);let S=this.refs[k];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,k);else if(k!==ls(m))if(k[0]==="#")u(l,a[k],k),a[k]=l;else this.refs[k]=m;return k}function O(k){if(typeof k=="string"){if(!KC.test(k))throw Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),a;function u(l,p,f){if(p!==void 0&&!MC(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}G_.getSchemaRefs=HC});var fo=g(function(iv){Object.defineProperty(iv,"__esModule",{value:!0});iv.getData=iv.KeywordCxt=iv.validateFunctionCode=void 0;var oa=i_(),sa=uo(),fs=zu(),Qr=uo(),Y_=S_(),Zt=q_(),ds=L_(),w=Z(),B=$r(),X_=lo(),Le=ae(),Qt=co();function QC(e){if(Z_(e)){if(ev(e),Q_(e)){tj(e);return}}J_(e,()=>oa.topBoolOrEmptySchema(e))}iv.validateFunctionCode=QC;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)}`),ej(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${ZC(s)}`,n.$async,()=>e.code(H_(r,s)).code(o))}function ZC(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 ej(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 tj(e){let{schema:t,opts:r,gen:n}=e;J_(e,()=>{if(r.$comment&&t.$comment)rv(e);if(ij(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)rj(e);tv(e),uj(e)});return}function rj(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 nj(e,t){if(Z_(e)){if(ev(e),Q_(e)){sj(e,t);return}}oa.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 sj(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)rv(e);aj(e),cj(e);let o=n.const("_errs",B.default.errors);tv(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function ev(e){Le.checkUnknownRules(e),oj(e)}function tv(e,t){if(e.opts.jtd)return B_(e,[],!1,t);let r=sa.getSchemaTypes(e.schema),n=sa.coerceAndCheckDataType(e,r);B_(e,r,!n,t)}function oj(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 ij(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 aj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=X_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function cj(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 i=w.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(w._`${B.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function uj(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)lj(e);t.return(w._`${B.default.errors} === 0`)}}function lj({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:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,d))){s.block(()=>sv(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)dj(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!fs.shouldUseGroup(o,p))return;if(p.type){if(s.if(Qr.checkDataType(p.type,i,c.strictNumbers)),W_(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Qr.reportTypeError(e);s.endIf()}else W_(e,p);if(!a)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(fs.shouldUseRule(n,o))sv(e,o.keyword,o.definition,t.type)})}function dj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(fj(e,t),!e.opts.allowUnionTypes)pj(e,t);hj(e,e.dataTypes)}function fj(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(",")}"`)}),gj(e,t)}function pj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Xu(e,"use allowUnionTypes to allow union type keyword")}function hj(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&fs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>mj(t,i)))Xu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function mj(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 gj(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)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class Ju{constructor(e,t,r){if(Zt.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",ov(this.$data,e));else if(this.schemaCode=this.schemaValue,!Zt.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?Qt.reportExtraError:Qt.reportError)(this,this.def.error,t)}$dataError(){Qt.reportError(this,this.def.$dataError||Qt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Qt.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(),i());function o(){if(r.length){if(!(t instanceof w.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return w._`${Qr.checkDataTypes(a,t,s.opts.strictNumbers,Qr.DataType.Wrong)}`}return w.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return w._`!${a}(${t})`}return w.nil}}subschema(e,t){let r=ds.getSubschema(this.it,e);ds.extendSubschemaData(r,this.it,e),ds.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return nj(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,w.Name)),!0}}iv.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)Zt.funcKeywordCode(s,r);else if("macro"in r)Zt.macroKeywordCode(s,r);else if(r.compile||r.validate)Zt.funcKeywordCode(s,r)}var yj=/^\/(?:[^~]|~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(!yj.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 d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=w._`${o}${w.getProperty(Le.unescapeJsonPointer(u))}`,i=w._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}iv.getData=ov});var ia=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 po=g(function(dv){Object.defineProperty(dv,"__esModule",{value:!0});var ps=lo();class lv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=ps.resolveUrl(e,t,r),this.missingSchema=ps.normalizeId(ps.getFullPath(e,this.missingRef))}}dv.default=lv});var ua=g(function(hv){Object.defineProperty(hv,"__esModule",{value:!0});hv.resolveSchema=hv.getCompilingSchema=hv.resolveRef=hv.compileSchema=hv.SchemaEnv=void 0;var Ae=Z(),Ej=ia(),Rn=$r(),Ne=lo(),aa=ae(),fv=fo();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:Ne.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={}}}hv.SchemaEnv=ho;function Zu(e){let t=pv.call(this,e);if(t)return t;let r=Ne.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:Ej.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Rn.default.data,parentData:Rn.default.parentData,parentDataProperty:Rn.default.parentDataProperty,dataNames:[Rn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,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},d;try{this._compilations.add(e),fv.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(Rn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${Rn.default.self}`,`${Rn.default.scope}`,d)(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:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Ae.Name?void 0:h,items:m instanceof Ae.Name?void 0:m,dynamicProps:h instanceof Ae.Name,dynamicItems:m instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}hv.compileSchema=Zu;function Sj(e,t,r){var n;r=Ne.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=kj.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new ho({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=xj.call(this,o)}hv.resolveRef=Sj;function xj(e){if(Ne.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(Rj(t,e))return t}hv.getCompilingSchema=pv;function Rj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function kj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ca.call(this,e,t)}function ca(e,t){let r=this.opts.uriResolver.parse(t),n=Ne._getFullPath(this.opts.uriResolver,r),s=Ne.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=Ne.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=ca.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Qu.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)Zu.call(this,i);if(o===Ne.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Ne.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:a,schemaId:c,root:e,baseId:s})}return Qu.call(this,r,i)}hv.resolveSchema=ca;var Tj=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 a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[aa.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!Tj.has(a)&&u)t=Ne.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!aa.schemaHasRulesButRef(r,this.RULES)){let a=Ne.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ca.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new ho({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var gv=g(function(bK,Pj){Pj.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=hu();yv.code='require("ajv/dist/runtime/uri").default';_v.default=yv});var Ov=g(function(br){Object.defineProperty(br,"__esModule",{value:!0});br.CodeGen=br.Name=br.nil=br.stringify=br.str=br._=br.KeywordCxt=void 0;var jj=fo();Object.defineProperty(br,"KeywordCxt",{enumerable:!0,get:function(){return jj.KeywordCxt}});var ms=Z();Object.defineProperty(br,"_",{enumerable:!0,get:function(){return ms._}});Object.defineProperty(br,"str",{enumerable:!0,get:function(){return ms.str}});Object.defineProperty(br,"stringify",{enumerable:!0,get:function(){return ms.stringify}});Object.defineProperty(br,"nil",{enumerable:!0,get:function(){return ms.nil}});Object.defineProperty(br,"Name",{enumerable:!0,get:function(){return ms.Name}});Object.defineProperty(br,"CodeGen",{enumerable:!0,get:function(){return ms.CodeGen}});var qj=ia(),Sv=po(),xv=Vu(),er=ua(),Rv=Z(),tr=lo(),Zr=uo(),hs=ae(),$v=gv(),Dj=vv(),kv=(e,t)=>new RegExp(e,t);kv.code="new RegExp";var Mj=["removeAdditional","useDefaults","coerceTypes"],Lj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Uj={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."},Fj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},bv=200;function Vj(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,k,M,S,Ee,Se,pt,Rt;let lt=e.strict,jt=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=jt===!0||jt===void 0?1:jt||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:kv,_c=(s=e.uriResolver)!==null&&s!==void 0?s:Dj.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:lt)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:lt)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:lt)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:lt)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:lt)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:bv,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:bv,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!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:(Ee=e.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Se=e.validateFormats)!==null&&Se!==void 0?Se:!0,unicodeRegExp:(pt=e.unicodeRegExp)!==null&&pt!==void 0?pt:!0,int32range:(Rt=e.int32range)!==null&&Rt!==void 0?Rt:!0,uriResolver:_c}}class la{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Vj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new Rv.ValueScope({scope:{},prefixes:Lj,es5:t,lines:r}),this.logger=Wj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=xv.getRules(),wv.call(this,Uj,e,"NOT SUPPORTED"),wv.call(this,Fj,e,"DEPRECATED","warn"),this._metaOpts=Hj.call(this),e.formats)Gj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Kj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);zj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=$v;if(r==="id")n={...$v},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,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}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(d){if(!(d instanceof Sv.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;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=tr.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 er.SchemaEnv({schema:{},schemaId:r});if(t=er.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=tr.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(Xj.call(this,r,t),!t)return hs.eachItem(r,(s)=>el.call(this,s)),this;Qj.call(this,t);let n={...t,type:Zr.getJSONTypes(t.type),schemaType:Zr.getJSONTypes(t.schemaType)};return hs.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 i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=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:i}=this.opts;if(typeof e=="object")o=e[i];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 a=this._cache.get(e);if(a!==void 0)return a;r=tr.normalizeId(o||r);let c=tr.getSchemaRefs.call(this,e,r);if(a=new er.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_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 er.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{er.compileSchema.call(this,e)}finally{this.opts=t}}}la.ValidationError=qj.default;la.MissingRefError=Sv.default;br.default=la;function wv(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=tr.normalizeId(e),this.schemas[e]||this.refs[e]}function zj(){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 Gj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Kj(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 Hj(){let e={...this.opts};for(let t of Mj)delete e[t];return e}var Bj={log(){},warn(){},error(){}};function Wj(e){if(e===!1)return Bj;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 Yj=/^[a-z_$][a-z0-9_$:-]*$/i;function Xj(e,t){let{RULES:r}=this;if(hs.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Yj.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,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Zr.getJSONTypes(t.type),schemaType:Zr.getJSONTypes(t.schemaType)}};if(t.before)Jj.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Jj(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 Qj(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 Zj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,Zj]}}});var Nv=g(function(Av){Object.defineProperty(Av,"__esModule",{value:!0});var rq={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Av.default=rq});var jv=g(function(Pv){Object.defineProperty(Pv,"__esModule",{value:!0});Pv.callRef=Pv.getValidate=void 0;var sq=po(),fa=vt(),ge=Z(),gs=$r(),pa=ua(),en=ae(),oq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=pa.resolveRef.call(c,u,s,r);if(d===void 0)throw new sq.default(n.opts.uriResolver,s,r);if(d instanceof pa.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return da(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return da(e,ge._`${h}.validate`,u,u.$async)}function p(h){let m=Iv(e,h);da(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:ge.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:ge.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function Iv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ge._`${r.scopeValue("wrapper",{ref:t})}.validate`}Pv.getValidate=Iv;function da(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?gs.default.this:ge.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(ge._`await ${fa.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(ge._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(fa.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=ge._`${h}.errors`;s.assign(gs.default.vErrors,ge._`${gs.default.vErrors} === null ? ${m} : ${gs.default.vErrors}.concat(${m})`),s.assign(gs.default.errors,ge._`${gs.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=en.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",ge._`${h}.evaluated.props`);o.props=en.mergeEvaluated.props(s,_,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=en.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",ge._`${h}.evaluated.items`);o.items=en.mergeEvaluated.items(s,_,o.items,ge.Name)}}}Pv.callRef=da;Pv.default=oq});var Dv=g(function(qv){Object.defineProperty(qv,"__esModule",{value:!0});var cq=Nv(),uq=jv(),lq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cq.default,uq.default];qv.default=lq});var Lv=g(function(Mv){Object.defineProperty(Mv,"__esModule",{value:!0});var rn=Z(),tn=rn.operators,ha={maximum:{okStr:"<=",ok:tn.LTE,fail:tn.GT},minimum:{okStr:">=",ok:tn.GTE,fail:tn.LT},exclusiveMaximum:{okStr:"<",ok:tn.LT,fail:tn.GTE},exclusiveMinimum:{okStr:">",ok:tn.GT,fail:tn.LTE}},fq={message:({keyword:e,schemaCode:t})=>rn.str`must be ${ha[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>rn._`{comparison: ${ha[e].okStr}, limit: ${t}}`},pq={keyword:Object.keys(ha),type:"number",schemaType:"number",$data:!0,error:fq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(rn._`${r} ${ha[t].fail} ${n} || isNaN(${r})`)}};Mv.default=pq});var Fv=g(function(Uv){Object.defineProperty(Uv,"__esModule",{value:!0});var rr=Z(),mq={message:({schemaCode:e})=>rr.str`must be multiple of ${e}`,params:({schemaCode:e})=>rr._`{multipleOf: ${e}}`},gq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:mq,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?rr._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:rr._`${i} !== parseInt(${i})`;e.fail$data(rr._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Uv.default=gq});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 at=Z(),Kv=ae(),vq=Gv(),$q={message({keyword:e,schemaCode:t}){return at.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>at._`{limit: ${e}}`},bq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:$q,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?at.operators.GT:at.operators.LT,i=s.opts.unicode===!1?at._`${r}.length`:at._`${Kv.useFunc(e.gen,vq.default)}(${r})`;e.fail$data(at._`${i} ${o} ${n}`)}};Hv.default=bq});var Xv=g(function(Yv){Object.defineProperty(Yv,"__esModule",{value:!0});var Wv=vt(),nn=Z(),Eq={message:({schemaCode:e})=>nn.str`must match pattern "${e}"`,params:({schemaCode:e})=>nn._`{pattern: ${e}}`},Sq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Eq,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?nn._`(new RegExp(${s}, ${i}))`:Wv.usePattern(e,n);e.fail$data(nn._`!${a}.test(${t})`)}};Yv.default=Sq});var Qv=g(function(Jv){Object.defineProperty(Jv,"__esModule",{value:!0});var nr=Z(),Rq={message({keyword:e,schemaCode:t}){return nr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>nr._`{limit: ${e}}`},kq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Rq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?nr.operators.GT:nr.operators.LT;e.fail$data(nr._`Object.keys(${r}).length ${s} ${n}`)}};Jv.default=kq});var t0=g(function(e0){Object.defineProperty(e0,"__esModule",{value:!0});var sr=vt(),or=Z(),Zv=ae(),Oq={message:({params:{missingProperty:e}})=>or.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>or._`{missingProperty: ${e}}`},Aq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Oq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Zv.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(or.nil,l);else for(let f of r)sr.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(sr.checkMissingProp(e,r,f)),sr.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(sr.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,sr.propertyInData(t,s,f,a.ownProperties)),t.if(or.not(h),()=>{e.error(),t.break()})},or.nil)}}};e0.default=Aq});var n0=g(function(r0){Object.defineProperty(r0,"__esModule",{value:!0});var ir=Z(),Iq={message({keyword:e,schemaCode:t}){return ir.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>ir._`{limit: ${e}}`},Pq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Iq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?ir.operators.GT:ir.operators.LT;e.fail$data(ir._`${r}.length ${s} ${n}`)}};r0.default=Pq});var ma=g(function(o0){Object.defineProperty(o0,"__esModule",{value:!0});var s0=Js();s0.code='require("ajv/dist/runtime/equal").default';o0.default=s0});var c0=g(function(a0){Object.defineProperty(a0,"__esModule",{value:!0});var ys=uo(),oe=Z(),i0=ae(),qq=ma(),Dq={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}}`},Mq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Dq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?ys.getSchemaTypes(o.items):[];e.block$data(c,d,oe._`${i} === false`),e.ok(c);function d(){let h=t.let("i",oe._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(oe._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=ys.checkDataTypes(u,y,a.opts.strictNumbers,ys.DataType.Wrong),O=t.const("indices",oe._`{}`);t.for(oe._`;${h}--;`,()=>{if(t.let(y,oe._`${r}[${h}]`),t.if(_,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,oe._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${O}[${y}] = ${h}`)})}function f(h,m){let y=i0.useFunc(t,qq.default),_=t.name("outer");t.label(_).for(oe._`;${h}--;`,()=>t.for(oe._`${m} = ${h}; ${m}--;`,()=>t.if(oe._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};a0.default=Mq});var d0=g(function(l0){Object.defineProperty(l0,"__esModule",{value:!0});var _s=Z(),u0=ae(),Uq=ma(),Fq={message:"must be equal to constant",params:({schemaCode:e})=>_s._`{allowedValue: ${e}}`},Vq={keyword:"const",$data:!0,error:Fq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(_s._`!${u0.useFunc(t,Uq.default)}(${r}, ${s})`);else e.fail(_s._`${o} !== ${r}`)}};l0.default=Vq});var h0=g(function(p0){Object.defineProperty(p0,"__esModule",{value:!0});var ar=Z(),f0=ae(),Gq=ma(),Kq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ar._`{allowedValues: ${e}}`},Hq={keyword:"enum",schemaType:"array",$data:!0,error:Kq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=f0.useFunc(t,Gq.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=ar.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(ar._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?ar._`${u()}(${r}, ${f}[${h}])`:ar._`${r} === ${m}`}}};p0.default=Hq});var g0=g(function(m0){Object.defineProperty(m0,"__esModule",{value:!0});var Wq=Lv(),Yq=Fv(),Xq=Bv(),Jq=Xv(),Qq=Qv(),Zq=t0(),eD=n0(),tD=c0(),rD=d0(),nD=h0(),sD=[Wq.default,Yq.default,Xq.default,Jq.default,Qq.default,Zq.default,eD.default,tD.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},rD.default,nD.default];m0.default=sD});var tl=g(function(_0){Object.defineProperty(_0,"__esModule",{value:!0});_0.validateAdditionalItems=void 0;var ct=Z(),vs=ae(),iD={message:({params:{len:e}})=>ct.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ct._`{limit: ${e}}`},aD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:iD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){vs.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:i}=e;i.items=!0;let a=r.const("len",ct._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ct._`${a} <= ${t.length}`);else if(typeof n=="object"&&!vs.alwaysValidSchema(i,n)){let u=r.var("valid",ct._`${a} <= ${t.length}`);r.if(ct.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:vs.Type.Num},u),!i.allErrors)r.if(ct.not(u),()=>r.break())})}}_0.validateAdditionalItems=y0;_0.default=aD});var rl=g(function(w0){Object.defineProperty(w0,"__esModule",{value:!0});w0.validateTuple=void 0;var ga=Z(),sn=ae(),$0=vt(),uD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return b0(e,"additionalItems",t);if(r.items=!0,sn.alwaysValidSchema(r,t))return;e.ok($0.validateArray(e))}};function b0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=sn.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",ga._`${o}.length`);r.forEach((l,p)=>{if(sn.alwaysValidSchema(a,l))return;n.if(ga._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;sn.checkStrictMode(a,y,p.strictTuples)}}}w0.validateTuple=b0;w0.default=uD});var R0=g(function(x0){Object.defineProperty(x0,"__esModule",{value:!0});var S0=rl(),dD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>S0.validateTuple(e,"items")};x0.default=dD});var N0=g(function(A0){Object.defineProperty(A0,"__esModule",{value:!0});var ya=Z(),k0=ae(),T0=vt(),O0=tl(),pD={message:({params:{len:e}})=>ya.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ya._`{limit: ${e}}`},hD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:pD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,k0.alwaysValidSchema(n,t))return;if(s)O0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};A0.default=hD});var P0=g(function(I0){Object.defineProperty(I0,"__esModule",{value:!0});var ve=Z(),on=ae(),gD={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}}`},yD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:gD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",ve._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){on.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){on.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(on.alwaysValidSchema(o,r)){let m=ve._`${d} >= ${i}`;if(a!==void 0)m=ve._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if(ve._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:on.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code(ve._`${m}++`),a===void 0)t.if(ve._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(ve._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(ve._`${m} >= ${i}`,()=>t.assign(l,!0))}}};I0.default=yD});var U0=g(function(D0){Object.defineProperty(D0,"__esModule",{value:!0});D0.validateSchemaDeps=D0.validatePropertyDeps=D0.error=void 0;var $s=Z(),C0=ae(),cr=vt();D0.error={message:({params:{property:e,depsCount:t,deps:r}})=>$s.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>$s._`{property: ${e},
|
|
15
15
|
missingProperty: ${n},
|
|
16
16
|
depsCount: ${t},
|
|
17
|
-
deps: ${r}}`};var hD={keyword:"dependencies",type:"object",schemaType:"object",error:q0.error,code(e){let[t,r]=mD(e);C0(e,t),j0(e,r)}};function mD({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 C0(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 i in t){let a=t[i];if(a.length===0)continue;let c=ir.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)ir.checkReportMissingProp(e,u)});else r.if($s._`${c} && (${ir.checkMissingProp(e,a,o)})`),ir.reportMissingProp(e,o),r.else()}}q0.validatePropertyDeps=C0;function j0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(I0.alwaysValidSchema(o,t[a]))continue;r.if(ir.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}q0.validateSchemaDeps=j0;q0.default=hD});var V0=g(function(F0){Object.defineProperty(F0,"__esModule",{value:!0});var ya=Z(),U0=ae(),_D={message:"property name must be valid",params:({params:e})=>ya._`{propertyName: ${e.propertyName}}`},vD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_D,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(U0.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(ya.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};F0.default=vD});var rl=g(function(z0){Object.defineProperty(z0,"__esModule",{value:!0});var on=_t(),Ne=Z(),ED=vr(),an=ae(),wD={message:"must NOT have additional properties",params:({params:e})=>Ne._`{additionalProperty: ${e.additionalProperty}}`},bD={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&an.alwaysValidSchema(i,r))return;let u=on.allSchemaProperties(n.properties),d=on.allSchemaProperties(n.patternProperties);l(),e.ok(Ne._`${o} === ${ED.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=an.schemaRefOrVal(i,n.properties,"properties");_=on.isOwnProperty(t,O,y)}else if(u.length)_=Ne.or(...u.map((O)=>Ne._`${y} === ${O}`));else _=Ne.nil;if(d.length)_=Ne.or(_,...d.map((O)=>Ne._`${on.usePattern(e,O)}.test(${y})`));return Ne.not(_)}function f(y){t.code(Ne._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!an.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Ne.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Ne.not(_),()=>t.break())}}function m(y,_,O){let T={keyword:"additionalProperties",dataProp:y,dataPropType:an.Type.Str};if(O===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(T,_)}}};z0.default=bD});var B0=g(function(H0){Object.defineProperty(H0,"__esModule",{value:!0});var K0=fo(),_a=_t(),Es=ae(),G0=rl(),xD={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)G0.default.code(new K0.KeywordCxt(o,G0.default,"additionalProperties"));let i=_a.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=Es.mergeEvaluated.props(t,Es.toHash(i),o.props);let a=i.filter((l)=>!Es.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(_a.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};H0.default=xD});var Y0=g(function(W0){Object.defineProperty(W0,"__esModule",{value:!0});var va=_t(),cn=Z(),$a=ae(),Ea=ae(),TD={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=va.allSchemaProperties(r),c=a.filter((m)=>$a.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof cn.Name))o.props=Ea.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))$a.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(cn._`${va.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:Ea.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(cn._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(cn.not(d),()=>t.break())})})}}};W0.default=TD});var Q0=g(function(J0){Object.defineProperty(J0,"__esModule",{value:!0});var X0=ae(),OD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(X0.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"}};J0.default=OD});var t$=g(function(e$){Object.defineProperty(e$,"__esModule",{value:!0});var Z0=_t(),PD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Z0.validateUnion,error:{message:"must match a schema in anyOf"}};e$.default=PD});var s$=g(function(n$){Object.defineProperty(n$,"__esModule",{value:!0});var un=Z(),r$=ae(),ID={message:"must match exactly one schema in oneOf",params:({params:e})=>un._`{passingSchemas: ${e.passing}}`},CD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ID,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,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(r$.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(un._`${c} && ${i}`).assign(i,!1).assign(a,un._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,un.Name)})})}}};n$.default=CD});var a$=g(function(i$){Object.defineProperty(i$,"__esModule",{value:!0});var o$=ae(),qD={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,i)=>{if(o$.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};i$.default=qD});var l$=g(function(u$){Object.defineProperty(u$,"__esModule",{value:!0});var ln=Z(),wa=ae(),MD={message:({params:e})=>ln.str`must match "${e.ifClause}" schema`,params:({params:e})=>ln._`{failingKeyword: ${e.ifClause}}`},LD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:MD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)wa.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=c$(n,"then"),o=c$(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(ln.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,ln._`${d}`);else e.setParams({ifClause:d})}}}};function c$(e,t){let r=e.schema[t];return r!==void 0&&!wa.alwaysValidSchema(e,r)}u$.default=LD});var p$=g(function(f$){Object.defineProperty(f$,"__esModule",{value:!0});var d$=ae(),FD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)d$.checkStrictMode(r,`"${e}" without "if" is ignored`)}};f$.default=FD});var m$=g(function(h$){Object.defineProperty(h$,"__esModule",{value:!0});var zD=el(),GD=x0(),KD=tl(),HD=A0(),BD=N0(),WD=L0(),YD=V0(),XD=rl(),JD=B0(),QD=Y0(),ZD=Q0(),eM=t$(),tM=s$(),rM=a$(),nM=l$(),sM=p$();function oM(e=!1){let t=[ZD.default,eM.default,tM.default,rM.default,nM.default,sM.default,YD.default,XD.default,WD.default,JD.default,QD.default];if(e)t.push(GD.default,HD.default);else t.push(zD.default,KD.default);return t.push(BD.default),t}h$.default=oM});var y$=g(function(g$){Object.defineProperty(g$,"__esModule",{value:!0});var J=Z(),aM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},cM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",J._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(J._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,J._`${m}.type || "string"`).assign(_,J._`${m}.validate`),()=>r.assign(y,J._`"string"`).assign(_,m)),e.fail$data(J.or(O(),T()));function O(){if(c.strictSchema===!1)return J.nil;return J._`${i} && !${_}`}function T(){let M=d.$async?J._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:J._`${_}(${n})`,S=J._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return J._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=T(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function T(S){let _e=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,ve=r.scopeValue("formats",{key:o,ref:S,code:_e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${ve}.validate`];return["string",S,ve]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return J._`await ${_}(${n})`}return typeof y=="function"?J._`${_}(${n})`:J._`${_}.test(${n})`}}}};g$.default=cM});var v$=g(function(_$){Object.defineProperty(_$,"__esModule",{value:!0});var lM=y$(),dM=[lM.default];_$.default=dM});var w$=g(function($$){Object.defineProperty($$,"__esModule",{value:!0});$$.contentVocabulary=$$.metadataVocabulary=void 0;$$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];$$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var S$=g(function(b$){Object.defineProperty(b$,"__esModule",{value:!0});var hM=qv(),mM=m0(),gM=m$(),yM=v$(),ba=w$(),_M=[hM.default,mM.default,(0,gM.default)(),yM.default,ba.metadataVocabulary,ba.contentVocabulary];b$.default=_M});var k$=g(function(R$){Object.defineProperty(R$,"__esModule",{value:!0});R$.DiscrError=void 0;var x$;(function(e){e.Tag="tag",e.Mapping="mapping"})(x$||(R$.DiscrError=x$={}))});var P$=g(function(A$){Object.defineProperty(A$,"__esModule",{value:!0});var vt=Z(),ws=k$(),Sa=ca(),$M=po(),O$=ae(),EM={message:({params:{discrError:e,tagName:t}})=>e===ws.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}}`},wM={keyword:"discriminator",type:"object",schemaType:"object",error:EM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",vt._`${r}${vt.getProperty(a)}`);t.if(vt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ws.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(vt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ws.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,vt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!O$.schemaHasRulesButRef(S,o.self.RULES)){let ve=S.$ref;if(S=Sa.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ve),S instanceof Sa.SchemaEnv)S=S.schema;if(S===void 0)throw new $M.default(o.opts.uriResolver,o.baseId,ve)}let _e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof _e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(_e,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)T(M.const,S);else if(M.enum)for(let _e of M.enum)T(_e,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};A$.default=wM});var N$=g(function(sH,SM){SM.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 C$=g(function(lt,nl){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 xM=kv(),RM=S$(),TM=P$(),I$=N$(),kM=["/properties"],xa="http://json-schema.org/draft-07/schema";class mo extends xM.default{_addVocabularies(){if(super._addVocabularies(),RM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(TM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(I$,kM):I$;this.addMetaSchema(e,xa,!1),this.refs["http://json-schema.org/schema"]=xa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(xa)?xa:void 0)}}lt.Ajv=mo;nl.exports=lt=mo;nl.exports.Ajv=mo;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=mo;var OM=fo();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return OM.KeywordCxt}});var bs=Z();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return bs._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return bs.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return bs.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return bs.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return bs.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return bs.CodeGen}});var AM=oa();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return AM.default}});var PM=po();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return PM.default}})});var D$=g(function(q$){Object.defineProperty(q$,"__esModule",{value:!0});q$.formatLimitDefinition=void 0;var j$=C$(),Ie=Z(),dn=Ie.operators,Ra={formatMaximum:{okStr:"<=",ok:dn.LTE,fail:dn.GT},formatMinimum:{okStr:">=",ok:dn.GTE,fail:dn.LT},formatExclusiveMaximum:{okStr:"<",ok:dn.LT,fail:dn.GTE},formatExclusiveMinimum:{okStr:">",ok:dn.GT,fail:dn.LTE}},CM={message:({keyword:e,schemaCode:t})=>Ie.str`should be ${Ra[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ie._`{comparison: ${Ra[e].okStr}, limit: ${t}}`};q$.formatLimitDefinition={keyword:Object.keys(Ra),type:"string",schemaType:"string",$data:!0,error:CM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:i,self:a}=o;if(!i.validateFormats)return;let c=new j$.KeywordCxt(o,a.RULES.all.format.definition,"format");if(c.$data)u();else d();function u(){let p=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),f=t.const("fmt",Ie._`${p}[${c.schemaCode}]`);e.fail$data(Ie.or(Ie._`typeof ${f} != "object"`,Ie._`${f} instanceof RegExp`,Ie._`typeof ${f}.compare != "function"`,l(f)))}function d(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${p}" does not define "compare" function`);let h=t.scopeValue("formats",{key:p,ref:f,code:i.code.formats?Ie._`${i.code.formats}${Ie.getProperty(p)}`:void 0});e.fail$data(l(h))}function l(p){return Ie._`${p}.compare(${r}, ${n}) ${Ra[s].fail} 0`}},dependencies:["format"]};var jM=(e)=>(e.addKeyword(q$.formatLimitDefinition),e);q$.default=jM});var F$=g(function(go,U$){Object.defineProperty(go,"__esModule",{value:!0});var $t=my(),DM=D$(),Ss=Z(),M$=new Ss.Name("fullFormats"),MM=new Ss.Name("fastFormats"),ol=(e,t={keywords:!0})=>{if(Array.isArray(t))return L$(e,t,$t.fullFormats,M$),e;let[r,n]=t.mode==="fast"?[$t.fastFormats,MM]:[$t.fullFormats,M$],s=t.formats||$t.formatNames;if(L$(e,s,r,n),t.keywords)(0,DM.default)(e);return e};ol.get=(e,t="full")=>{let n=(t==="fast"?$t.fastFormats:$t.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function L$(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=Ss._`require("ajv-formats/dist/formats").${n}`);for(let i of t)e.addFormat(i,r[i])}U$.exports=go=ol;Object.defineProperty(go,"__esModule",{value:!0});go.default=ol});function il(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))LM(e,t,s,r);return FM(e,t),KM(e,t,n),e}var LM=(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(!UM(s,o)&&n)return;Object.defineProperty(e,r,o)},UM=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)},FM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},VM=(e,t)=>`/* Wrapped ${e}*/
|
|
18
|
-
${t}`,zM,GM,KM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=VM.bind(null,n,t.toString());Object.defineProperty(s,"name",GM);let{writable:o,enumerable:i,configurable:a}=zM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:i,configurable:a})};var V$=F(()=>{zM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),GM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var HM=(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 i,a,c,u=function(...d){let l=this,p=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(l,d)},f=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(l,d)},h=s&&!i;if(clearTimeout(i),i=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a)a=setTimeout(f,n);if(h)c=e.apply(l,d);return c};return il(u,e),u.cancel=()=>{if(i)clearTimeout(i),i=void 0;if(a)clearTimeout(a),a=void 0},u},al;var z$=F(()=>{V$();al=HM});var yo=g(function(yH,G$){var BM=Number.MAX_SAFE_INTEGER||9007199254740991,WM=["major","premajor","minor","preminor","patch","prepatch","prerelease"];G$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:BM,RELEASE_TYPES:WM,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _o=g(function(_H,K$){var YM=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};K$.exports=YM});var xs=g(function(ar,H$){var{MAX_SAFE_COMPONENT_LENGTH:cl,MAX_SAFE_BUILD_LENGTH:XM,MAX_LENGTH:JM}=yo(),QM=_o();ar=H$.exports={};var ZM=ar.re=[],eL=ar.safeRe=[],j=ar.src=[],tL=ar.safeSrc=[],q=ar.t={},rL=0,ul="[a-zA-Z0-9-]",nL=[["\\s",1],["\\d",JM],[ul,XM]],sL=(e)=>{for(let[t,r]of nL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=sL(t),s=rL++;QM(e,s,t),q[e]=s,j[s]=t,tL[s]=n,ZM[s]=new RegExp(t,r?"g":void 0),eL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ul}*`);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",`${ul}+`);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,${cl}})(?:\\.(\\d{1,${cl}}))?(?:\\.(\\d{1,${cl}}))?`);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);ar.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);ar.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);ar.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 Ta=g(function(vH,B$){var oL=Object.freeze({loose:!0}),iL=Object.freeze({}),aL=(e)=>{if(!e)return iL;if(typeof e!=="object")return oL;return e};B$.exports=aL});var ll=g(function($H,X$){var W$=/^[0-9]+$/,Y$=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=W$.test(e),n=W$.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},cL=(e,t)=>Y$(t,e);X$.exports={compareIdentifiers:Y$,rcompareIdentifiers:cL}});var Ke=g(function(EH,Q$){var ka=_o(),{MAX_LENGTH:J$,MAX_SAFE_INTEGER:Oa}=yo(),{safeRe:Aa,t:Pa}=xs(),uL=Ta(),{compareIdentifiers:dl}=ll();class Ot{constructor(e,t){if(t=uL(t),e instanceof Ot)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>J$)throw TypeError(`version is longer than ${J$} characters`);ka("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Aa[Pa.LOOSE]:Aa[Pa.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>Oa||this.major<0)throw TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Oa||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<Oa)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(ka("SemVer.compare",this.version,this.options,e),!(e instanceof Ot)){if(typeof e==="string"&&e===this.version)return 0;e=new Ot(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Ot))e=new Ot(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 Ot))e=new Ot(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(ka("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 dl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Ot))e=new Ot(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(ka("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 dl(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?Aa[Pa.PRERELEASELOOSE]:Aa[Pa.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(dl(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}}Q$.exports=Ot});var Tn=g(function(wH,eE){var Z$=Ke(),lL=(e,t,r=!1)=>{if(e instanceof Z$)return e;try{return new Z$(e,t)}catch(n){if(!r)return null;throw n}};eE.exports=lL});var rE=g(function(bH,tE){var dL=Tn(),fL=(e,t)=>{let r=dL(e,t);return r?r.version:null};tE.exports=fL});var sE=g(function(SH,nE){var pL=Tn(),hL=(e,t)=>{let r=pL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};nE.exports=hL});var aE=g(function(xH,iE){var oE=Ke(),mL=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new oE(e instanceof oE?e.version:e,r).inc(t,n,s).version}catch(o){return null}};iE.exports=mL});var lE=g(function(RH,uE){var cE=Tn(),gL=(e,t)=>{let r=cE(e,null,!0),n=cE(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};uE.exports=gL});var fE=g(function(TH,dE){var yL=Ke(),_L=(e,t)=>new yL(e,t).major;dE.exports=_L});var hE=g(function(kH,pE){var vL=Ke(),$L=(e,t)=>new vL(e,t).minor;pE.exports=$L});var gE=g(function(OH,mE){var EL=Ke(),wL=(e,t)=>new EL(e,t).patch;mE.exports=wL});var _E=g(function(AH,yE){var bL=Tn(),SL=(e,t)=>{let r=bL(e,t);return r&&r.prerelease.length?r.prerelease:null};yE.exports=SL});var Et=g(function(PH,$E){var vE=Ke(),xL=(e,t,r)=>new vE(e,r).compare(new vE(t,r));$E.exports=xL});var wE=g(function(NH,EE){var RL=Et(),TL=(e,t,r)=>RL(t,e,r);EE.exports=TL});var SE=g(function(IH,bE){var kL=Et(),OL=(e,t)=>kL(e,t,!0);bE.exports=OL});var Na=g(function(CH,RE){var xE=Ke(),AL=(e,t,r)=>{let n=new xE(e,r),s=new xE(t,r);return n.compare(s)||n.compareBuild(s)};RE.exports=AL});var kE=g(function(jH,TE){var PL=Na(),NL=(e,t)=>e.sort((r,n)=>PL(r,n,t));TE.exports=NL});var AE=g(function(qH,OE){var IL=Na(),CL=(e,t)=>e.sort((r,n)=>IL(n,r,t));OE.exports=CL});var vo=g(function(DH,PE){var jL=Et(),qL=(e,t,r)=>jL(e,t,r)>0;PE.exports=qL});var Ia=g(function(MH,NE){var DL=Et(),ML=(e,t,r)=>DL(e,t,r)<0;NE.exports=ML});var fl=g(function(LH,IE){var LL=Et(),UL=(e,t,r)=>LL(e,t,r)===0;IE.exports=UL});var pl=g(function(UH,CE){var FL=Et(),VL=(e,t,r)=>FL(e,t,r)!==0;CE.exports=VL});var Ca=g(function(FH,jE){var zL=Et(),GL=(e,t,r)=>zL(e,t,r)>=0;jE.exports=GL});var ja=g(function(VH,qE){var KL=Et(),HL=(e,t,r)=>KL(e,t,r)<=0;qE.exports=HL});var hl=g(function(zH,DE){var BL=fl(),WL=pl(),YL=vo(),XL=Ca(),JL=Ia(),QL=ja(),ZL=(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 BL(e,r,n);case"!=":return WL(e,r,n);case">":return YL(e,r,n);case">=":return XL(e,r,n);case"<":return JL(e,r,n);case"<=":return QL(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};DE.exports=ZL});var LE=g(function(GH,ME){var eU=Ke(),tU=Tn(),{safeRe:qa,t:Da}=xs(),rU=(e,t)=>{if(e instanceof eU)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?qa[Da.COERCEFULL]:qa[Da.COERCE]);else{let c=t.includePrerelease?qa[Da.COERCERTLFULL]:qa[Da.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",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return tU(`${n}.${s}.${o}${i}${a}`,t)};ME.exports=rU});var VE=g(function(KH,FE){class UE{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}}FE.exports=UE});var wt=g(function(HH,HE){var nU=/\s+/g;class $o{constructor(e,t){if(t=oU(t),e instanceof $o)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new $o(e.raw,t);if(e instanceof Ma)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(nU," "),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)=>!GE(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&&fU(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&&lU)|(this.options.loose&&dU))+":"+e,n=zE.get(r);if(n)return n;let s=this.options.loose,o=s?Xe[He.HYPHENRANGELOOSE]:Xe[He.HYPHENRANGE];e=e.replace(o,wU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Xe[He.COMPARATORTRIM],aU),ye("comparator trim",e),e=e.replace(Xe[He.TILDETRIM],cU),ye("tilde trim",e),e=e.replace(Xe[He.CARETTRIM],uU),ye("caret trim",e);let i=e.split(" ").map((d)=>pU(d,this.options)).join(" ").split(/\s+/).map((d)=>EU(d,this.options));if(s)i=i.filter((d)=>(ye("loose invalid filter",d,this.options),!!d.match(Xe[He.COMPARATORLOOSE])));ye("range list",i);let a=new Map,c=i.map((d)=>new Ma(d,this.options));for(let d of c){if(GE(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return zE.set(r,u),u}intersects(e,t){if(!(e instanceof $o))throw TypeError("a Range is required");return this.set.some((r)=>KE(r,t)&&e.set.some((n)=>KE(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 iU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(bU(this.set[t],e,this.options))return!0;return!1}}HE.exports=$o;var sU=VE(),zE=new sU,oU=Ta(),Ma=Eo(),ye=_o(),iU=Ke(),{safeRe:Xe,t:He,comparatorTrimReplace:aU,tildeTrimReplace:cU,caretTrimReplace:uU}=xs(),{FLAG_INCLUDE_PRERELEASE:lU,FLAG_LOOSE:dU}=yo(),GE=(e)=>e.value==="<0.0.0-0",fU=(e)=>e.value==="",KE=(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},pU=(e,t)=>(e=e.replace(Xe[He.BUILD],""),ye("comp",e,t),e=gU(e,t),ye("caret",e),e=hU(e,t),ye("tildes",e),e=_U(e,t),ye("xrange",e),e=$U(e,t),ye("stars",e),e),Je=(e)=>!e||e.toLowerCase()==="x"||e==="*",hU=(e,t)=>e.trim().split(/\s+/).map((r)=>mU(r,t)).join(" "),mU=(e,t)=>{let r=t.loose?Xe[He.TILDELOOSE]:Xe[He.TILDE];return e.replace(r,(n,s,o,i,a)=>{ye("tilde",e,n,s,o,i,a);let c;if(Je(s))c="";else if(Je(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Je(i))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(a)ye("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},gU=(e,t)=>e.trim().split(/\s+/).map((r)=>yU(r,t)).join(" "),yU=(e,t)=>{ye("caret",e,t);let r=t.loose?Xe[He.CARETLOOSE]:Xe[He.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{ye("caret",e,s,o,i,a,c);let u;if(Je(o))u="";else if(Je(i))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Je(a))if(o==="0")u=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(i==="0")u=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(i==="0")u=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return ye("caret return",u),u})},_U=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>vU(r,t)).join(" ")),vU=(e,t)=>{e=e.trim();let r=t.loose?Xe[He.XRANGELOOSE]:Xe[He.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{ye("xRange",e,n,s,o,i,a,c);let u=Je(o),d=u||Je(i),l=d||Je(a),p=l;if(s==="="&&p)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&p){if(d)i=0;if(a=0,s===">")if(s=">=",d)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",d)o=+o+1;else i=+i+1;if(s==="<")c="-0";n=`${s+o}.${i}.${a}${c}`}else if(d)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(l)n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`;return ye("xRange return",n),n})},$U=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Xe[He.STAR],"")),EU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Xe[t.includePrerelease?He.GTE0PRE:He.GTE0],"")),wU=(e)=>(t,r,n,s,o,i,a,c,u,d,l,p)=>{if(Je(n))r="";else if(Je(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Je(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(i)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Je(u))c="";else if(Je(d))c=`<${+u+1}.0.0-0`;else if(Je(l))c=`<${u}.${+d+1}.0-0`;else if(p)c=`<=${u}.${d}.${l}-${p}`;else if(e)c=`<${u}.${d}.${+l+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},bU=(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===Ma.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 Eo=g(function(BH,QE){var wo=Symbol("SemVer ANY");class La{static get ANY(){return wo}constructor(e,t){if(t=BE(t),e instanceof La)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),gl("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===wo)this.value="";else this.value=this.operator+this.semver.version;gl("comp",this)}parse(e){let t=this.options.loose?WE[YE.COMPARATORLOOSE]:WE[YE.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=wo;else this.semver=new XE(r[2],this.options.loose)}toString(){return this.value}test(e){if(gl("Comparator.test",e,this.options.loose),this.semver===wo||e===wo)return!0;if(typeof e==="string")try{e=new XE(e,this.options)}catch(t){return!1}return ml(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof La))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new JE(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new JE(this.value,t).test(e.semver)}if(t=BE(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(ml(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(ml(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}QE.exports=La;var BE=Ta(),{safeRe:WE,t:YE}=xs(),ml=hl(),gl=_o(),XE=Ke(),JE=wt()});var bo=g(function(WH,ZE){var SU=wt(),xU=(e,t,r)=>{try{t=new SU(t,r)}catch(n){return!1}return t.test(e)};ZE.exports=xU});var tw=g(function(YH,ew){var RU=wt(),TU=(e,t)=>new RU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));ew.exports=TU});var nw=g(function(XH,rw){var kU=Ke(),OU=wt(),AU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new OU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===-1)n=i,s=new kU(n,r)}}),n};rw.exports=AU});var ow=g(function(JH,sw){var PU=Ke(),NU=wt(),IU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new NU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===1)n=i,s=new PU(n,r)}}),n};sw.exports=IU});var cw=g(function(QH,aw){var yl=Ke(),CU=wt(),iw=vo(),jU=(e,t)=>{e=new CU(e,t);let r=new yl("0.0.0");if(e.test(r))return r;if(r=new yl("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((i)=>{let a=new yl(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||iw(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||iw(r,o)))r=o}if(r&&e.test(r))return r;return null};aw.exports=jU});var lw=g(function(ZH,uw){var qU=wt(),DU=(e,t)=>{try{return new qU(e,t).range||"*"}catch(r){return null}};uw.exports=DU});var Ua=g(function(e5,hw){var MU=Ke(),pw=Eo(),{ANY:LU}=pw,UU=wt(),FU=bo(),dw=vo(),fw=Ia(),VU=ja(),zU=Ca(),GU=(e,t,r,n)=>{e=new MU(e,n),t=new UU(t,n);let s,o,i,a,c;switch(r){case">":s=dw,o=VU,i=fw,a=">",c=">=";break;case"<":s=fw,o=zU,i=dw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(FU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let d=t.set[u],l=null,p=null;if(d.forEach((f)=>{if(f.semver===LU)f=new pw(">=0.0.0");if(l=l||f,p=p||f,s(f.semver,l.semver,n))l=f;else if(i(f.semver,p.semver,n))p=f}),l.operator===a||l.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;else if(p.operator===c&&i(e,p.semver))return!1}return!0};hw.exports=GU});var gw=g(function(t5,mw){var KU=Ua(),HU=(e,t,r)=>KU(e,t,">",r);mw.exports=HU});var _w=g(function(r5,yw){var BU=Ua(),WU=(e,t,r)=>BU(e,t,"<",r);yw.exports=WU});var Ew=g(function(n5,$w){var vw=wt(),YU=(e,t,r)=>(e=new vw(e,r),t=new vw(t,r),e.intersects(t,r));$w.exports=YU});var bw=g(function(s5,ww){var XU=bo(),JU=Et();ww.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((d,l)=>JU(d,l,r));for(let d of i)if(XU(d,t,r)){if(o=d,!s)s=d}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let a=[];for(let[d,l]of n)if(d===l)a.push(d);else if(!l&&d===i[0])a.push("*");else if(!l)a.push(`>=${d}`);else if(d===i[0])a.push(`<=${l}`);else a.push(`${d} - ${l}`);let c=a.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var Ow=g(function(o5,kw){var Sw=wt(),vl=Eo(),{ANY:_l}=vl,So=bo(),$l=Et(),QU=(e,t,r={})=>{if(e===t)return!0;e=new Sw(e,r),t=new Sw(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=e2(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ZU=[new vl(">=0.0.0-0")],xw=[new vl(">=0.0.0")],e2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===_l)if(t.length===1&&t[0].semver===_l)return!0;else if(r.includePrerelease)e=ZU;else e=xw;if(t.length===1&&t[0].semver===_l)if(r.includePrerelease)return!0;else t=xw;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=Rw(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=Tw(o,f,r);else n.add(f.semver);if(n.size>1)return null;let i;if(s&&o){if(i=$l(s.semver,o.semver,r),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!So(f,String(s),r))return null;if(o&&!So(f,String(o),r))return null;for(let h of t)if(!So(f,String(h),r))return!1;return!0}let a,c,u,d,l=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(l&&l.prerelease.length===1&&o.operator==="<"&&l.prerelease[0]===0)l=!1;for(let f of t){if(d=d||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(p){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch)p=!1}if(f.operator===">"||f.operator===">="){if(a=Rw(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!So(s.semver,String(f),r))return!1}if(o){if(l){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===l.major&&f.semver.minor===l.minor&&f.semver.patch===l.patch)l=!1}if(f.operator==="<"||f.operator==="<="){if(c=Tw(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!So(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&i!==0)return!1}if(s&&u&&!o&&i!==0)return!1;if(o&&d&&!s&&i!==0)return!1;if(p||l)return!1;return!0},Rw=(e,t,r)=>{if(!e)return t;let n=$l(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Tw=(e,t,r)=>{if(!e)return t;let n=$l(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};kw.exports=QU});var Pw=g(function(i5,Aw){var Rs=xs(),Fa=yo(),t2=Ke(),Va=ll(),r2=Tn(),n2=rE(),s2=sE(),o2=aE(),i2=lE(),a2=fE(),c2=hE(),u2=gE(),l2=_E(),d2=Et(),f2=wE(),p2=SE(),h2=Na(),m2=kE(),g2=AE(),y2=vo(),_2=Ia(),v2=fl(),$2=pl(),E2=Ca(),w2=ja(),b2=hl(),S2=LE(),x2=Eo(),R2=wt(),T2=bo(),k2=tw(),O2=nw(),A2=ow(),P2=cw(),N2=lw(),I2=Ua(),C2=gw(),j2=_w(),q2=Ew(),D2=bw(),M2=Ow();Aw.exports={parse:r2,valid:n2,clean:s2,inc:o2,diff:i2,major:a2,minor:c2,patch:u2,prerelease:l2,compare:d2,rcompare:f2,compareLoose:p2,compareBuild:h2,sort:m2,rsort:g2,gt:y2,lt:_2,eq:v2,neq:$2,gte:E2,lte:w2,cmp:b2,coerce:S2,Comparator:x2,Range:R2,satisfies:T2,toComparators:k2,maxSatisfying:O2,minSatisfying:A2,minVersion:P2,validRange:N2,outside:I2,gtr:C2,ltr:j2,intersects:q2,simplifyRange:D2,subset:M2,SemVer:t2,re:Rs.re,src:Rs.src,tokens:Rs.t,SEMVER_SPEC_VERSION:Fa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Fa.RELEASE_TYPES,compareIdentifiers:Va.compareIdentifiers,rcompareIdentifiers:Va.rcompareIdentifiers}});function Iw(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return L2.call(e)===r}function Cw(e){return Iw(e,Uint8Array,"[object Uint8Array]")}function U2(e){return Iw(e,ArrayBuffer,"[object ArrayBuffer]")}function F2(e){return Cw(e)||U2(e)}function V2(e){if(!Cw(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function z2(e){if(!F2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function El(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)V2(s),r.set(s,n),n+=s.length;return r}function wl(e,t="utf8"){return z2(e),Nw[t]??=new globalThis.TextDecoder(t),Nw[t].decode(e)}function G2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function za(e){return G2(e),K2.encode(e)}var L2,Nw,K2,a5;var jw=F(()=>{L2=Object.prototype.toString;Nw={utf8:new globalThis.TextDecoder("utf8")};K2=new globalThis.TextEncoder;a5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as H2}from"util";import qw from"process";import kn from"fs";import Dw from"path";import xo from"crypto";import B2 from"assert";var Lw,Uw,On,W2,Mw="aes-256-cbc",Ts=()=>Object.create(null),Y2=(e)=>e!==void 0&&e!==null,X2=(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`)},Ga="__internal__",bl,Ka;var Fw=F(()=>{ld();fd();Vd();z$();jw();Lw=_c(oy(),1),Uw=_c(F$(),1),On=_c(Pw(),1),W2=Uw.default.default,bl=`${Ga}.migrations.version`;Ka=class Ka{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=Sc(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 Lw.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});W2(o);let i={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(i);for(let[a,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[a]=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=Dw.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(Ts(),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{B2.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 ${Ga} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(X2(s,o),this.#e.accessPropertiesByDotNotation)Ec(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,i]of Object.entries(s))n(o,i)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return ud(this.store,e);return e in this.store}reset(...e){for(let t of e)if(Y2(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)cd(t,e);else delete t[e];this.store=t}clear(){this.store=Ts();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=kn.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Ts(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Ts();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Ts();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:wl(e);try{let t=e.slice(0,16),r=xo.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=xo.createDecipheriv(Mw,r,t),s=e.slice(17),o=typeof s==="string"?za(s):s;return wl(El([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(H2(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(){kn.mkdirSync(Dw.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=xo.randomBytes(16),n=xo.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=xo.createCipheriv(Mw,n,r);t=El([r,za(":"),s.update(za(t)),s.final()])}if(qw.env.SNAP)kn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{jc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){kn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!kn.existsSync(this.path))this._write(Ts());if(qw.platform==="win32")kn.watch(this.path,{persistent:!1},al(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else kn.watchFile(this.path,{persistent:!1},al(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(bl,"0.0.0"),s=Object.keys(e).filter((i)=>this._shouldPerformMigration(i,n,t)),o={...this.store};for(let i of s)try{if(r)r(this,{fromVersion:n,toVersion:i,finalVersion:t,versions:s});let a=e[i];a?.(this),this._set(bl,i),n=i,o={...this.store}}catch(a){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${a}`)}if(this._isVersionInRangeFormat(n)||!On.default.eq(n,t))this._set(bl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Ga)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Ga}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return On.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&On.default.satisfies(t,e))return!1;return On.default.satisfies(r,e)}if(On.default.lte(e,t))return!1;if(On.default.gt(e,r))return!1;return!0}_get(e,t){return ad(this.store,e,t)}_set(e,t){let{store:r}=this;Ec(r,e,t),this.store=r}}});var re,Vw,N,Er=(e)=>{switch(typeof e){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(e)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(e))return N.array;if(e===null)return N.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return N.promise;if(typeof Map<"u"&&e instanceof Map)return N.map;if(typeof Set<"u"&&e instanceof Set)return N.set;if(typeof Date<"u"&&e instanceof Date)return N.date;return N.object;default:return N.unknown}};var Ro=F(()=>{(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 i of s)o[i]=i;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((a)=>typeof s[s[a]]!=="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},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 i in s)if(Object.prototype.hasOwnProperty.call(s,i))o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i;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((i)=>typeof i==="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(re||(re={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Vw||(Vw={}));N=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var b,ft;var Ha=F(()=>{Ro();b=re.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 i=r,a=0;while(a<o.path.length){let c=o.path[a];if(a!==o.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o));i=i[c],a++}}};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,re.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 J2=(e,t)=>{let r;switch(e.code){case b.invalid_type:if(e.received===N.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case b.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case b.invalid_union:r="Invalid input";break;case b.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case b.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case b.invalid_arguments:r="Invalid function arguments";break;case b.invalid_return_type:r="Invalid function return type";break;case b.invalid_date:r="Invalid date";break;case b.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 re.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case b.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 b.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 b.custom:r="Invalid input";break;case b.invalid_intersection_types:r="Intersection results could not be merged";break;case b.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case b.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},fn;var Sl=F(()=>{Ha();Ro();fn=J2});function To(){return Q2}var Q2;var Ba=F(()=>{Sl();Q2=fn});function k(e,t){let r=To(),n=Wa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===fn?void 0:fn].filter((s)=>!!s)});e.common.issues.push(n)}class Be{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 Be.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 Wa=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},G,ks=(e)=>({status:"dirty",value:e}),Qe=(e)=>({status:"valid",value:e}),xl=(e)=>e.status==="aborted",Rl=(e)=>e.status==="dirty",An=(e)=>e.status==="valid",ko=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=F(()=>{Ba();Sl();G=Object.freeze({status:"aborted"})});var zw=()=>{};var D;var Gw=F(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class At{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:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:s}}class ee{get description(){return this._def.description}_getType(e){return Er(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Be,ctx:{common:e.parent.common,data:e.data,parsedType:Er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ko(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:Er(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Kw(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return An(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)=>An(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:Er(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(ko(n)?n:Promise.resolve(n));return Kw(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),i=()=>s.addIssue({code:b.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((a)=>{if(!a)return i(),!1;else return!0});if(!o)return i(),!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 lr({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 ur.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this)}promise(){return Is.create(this,this._def)}or(e){return Io.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new lr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Mo({...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 Lo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return rc.create(this,e)}readonly(){return Uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Bw(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 mF(e){return new RegExp(`^${Bw(e)}$`)}function gF(e){let t=`${Hw}T${Bw(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 yF(e,t){if((t==="v4"||!t)&&cF.test(e))return!0;if((t==="v6"||!t)&&lF.test(e))return!0;return!1}function _F(e,t){if(!sF.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 vF(e,t){if((t==="v4"||!t)&&uF.test(e))return!0;if((t==="v6"||!t)&&dF.test(e))return!0;return!1}function $F(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(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}function Os(e){if(e instanceof Ce){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ur.create(Os(n))}return new Ce({...e._def,shape:()=>t})}else if(e instanceof cr)return new cr({...e._def,type:Os(e.element)});else if(e instanceof ur)return ur.create(Os(e.unwrap()));else if(e instanceof pn)return pn.create(Os(e.unwrap()));else if(e instanceof xr)return xr.create(e.items.map((t)=>Os(t)));else return e}function Ol(e,t){let r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};else if(r===N.object&&n===N.object){let s=re.objectKeys(t),o=re.objectKeys(e).filter((a)=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Ol(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===N.array&&n===N.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Ol(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===N.date&&n===N.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Ww(e,t){return new Nn({values:e,typeName:K.ZodEnum,...Q(t)})}var Kw=(e,t)=>{if(An(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}}}},Z2,eF,tF,rF,nF,sF,oF,iF,aF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kl,cF,uF,lF,dF,fF,pF,Hw="((\\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])))",hF,br,As,Ps,Ya,Ao,Xa,Po,No,Ja,Pn,Sr,Qa,cr,Ce,Io,wr=(e)=>{if(e instanceof jo)return wr(e.schema);else if(e instanceof lr)return wr(e.innerType());else if(e instanceof qo)return[e.value];else if(e instanceof Nn)return e.options;else if(e instanceof Do)return re.objectValues(e.enum);else if(e instanceof Mo)return wr(e._def.innerType);else if(e instanceof Po)return[void 0];else if(e instanceof No)return[null];else if(e instanceof ur)return[void 0,...wr(e.unwrap())];else if(e instanceof pn)return[null,...wr(e.unwrap())];else if(e instanceof Pl)return wr(e.unwrap());else if(e instanceof Uo)return wr(e.unwrap());else if(e instanceof Lo)return wr(e._def.innerType);else return[]},Al,Co,xr,Za,ec,Ns,Oo,jo,qo,Nn,Do,Is,lr,ur,pn,Mo,Lo,tc,M5,Pl,rc,Uo,L5,K,v,fe,U5,F5,Ue,V5,z5,G5,K5,H5,B5,W5,Y5,Ze,ne,X5,EF,Yw,J5,Q5,wF,Z5,e3,t3,r3,In,Ve,n3,s3,o3,i3,a3,c3,u3;var Xw=F(()=>{Ha();Ba();Gw();Tl();Ro();Z2=/^c[^\s-]{8,}$/i,eF=/^[0-9a-z]+$/,tF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rF=/^[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,nF=/^[a-z0-9_-]{21}$/i,sF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oF=/^[-+]?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)?)??$/,iF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cF=/^(?:(?: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])$/,uF=/^(?:(?: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])$/,lF=/^(([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]))$/,dF=/^(([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])$/,fF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hF=new RegExp(`^${Hw}$`);br=class br extends ee{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==N.string){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:N.string,received:s.parsedType}),G}let r=new Be,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),k(n,{code:b.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),k(n,{code:b.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,i=e.data.length<s.value;if(o||i){if(n=this._getOrReturnCtx(e,n),o)k(n,{code:b.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(i)k(n,{code:b.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!iF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"email",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!kl)kl=new RegExp(aF,"u");if(!kl.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"emoji",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!rF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"uuid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!nF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"nanoid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!Z2.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!eF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid2",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!tF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"ulid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),k(n,{validation:"url",code:b.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),k(n,{validation:"regex",code:b.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),k(n,{code:b.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),k(n,{code:b.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),k(n,{code:b.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!gF(s).test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!hF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!mF(s).test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!oF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"duration",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!yF(e.data,s.version))n=this._getOrReturnCtx(e,n),k(n,{validation:"ip",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!_F(e.data,s.alg))n=this._getOrReturnCtx(e,n),k(n,{validation:"jwt",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!vF(e.data,s.version))n=this._getOrReturnCtx(e,n),k(n,{validation:"cidr",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!fF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"base64",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!pF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"base64url",code:b.invalid_string,message:s.message}),r.dirty()}else re.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:b.invalid_string,...D.errToObj(r)})}_addCheck(e){return new br({...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 br({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new br({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new br({...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}};br.create=(e)=>new br({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Q(e)});As=class As extends ee{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)!==N.number){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:N.number,received:s.parsedType}),G}let r=void 0,n=new Be;for(let s of this._def.checks)if(s.kind==="int"){if(!re.isInteger(e.data))r=this._getOrReturnCtx(e,r),k(r,{code:b.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),k(r,{code:b.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),k(r,{code:b.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if($F(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),k(r,{code:b.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),k(r,{code:b.not_finite,message:s.message}),n.dirty()}else re.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 As({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new As({...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"&&re.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)}};As.create=(e)=>new As({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Ps=class Ps extends ee{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)!==N.bigint)return this._getInvalidInput(e);let r=void 0,n=new Be;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),k(r,{code:b.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),k(r,{code:b.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),k(r,{code:b.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else re.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return k(t,{code:b.invalid_type,expected:N.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 Ps({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Ps({...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}};Ps.create=(e)=>new Ps({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Ya=class Ya extends ee{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==N.boolean){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.boolean,received:r.parsedType}),G}return Qe(e.data)}};Ya.create=(e)=>new Ya({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});Ao=class Ao extends ee{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==N.date){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:N.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_date}),G}let r=new Be,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),k(n,{code:b.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),k(n,{code:b.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()}else re.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ao({...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}};Ao.create=(e)=>new Ao({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Xa=class Xa extends ee{_parse(e){if(this._getType(e)!==N.symbol){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.symbol,received:r.parsedType}),G}return Qe(e.data)}};Xa.create=(e)=>new Xa({typeName:K.ZodSymbol,...Q(e)});Po=class Po extends ee{_parse(e){if(this._getType(e)!==N.undefined){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.undefined,received:r.parsedType}),G}return Qe(e.data)}};Po.create=(e)=>new Po({typeName:K.ZodUndefined,...Q(e)});No=class No extends ee{_parse(e){if(this._getType(e)!==N.null){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.null,received:r.parsedType}),G}return Qe(e.data)}};No.create=(e)=>new No({typeName:K.ZodNull,...Q(e)});Ja=class Ja extends ee{constructor(){super(...arguments);this._any=!0}_parse(e){return Qe(e.data)}};Ja.create=(e)=>new Ja({typeName:K.ZodAny,...Q(e)});Pn=class Pn extends ee{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Qe(e.data)}};Pn.create=(e)=>new Pn({typeName:K.ZodUnknown,...Q(e)});Sr=class Sr extends ee{_parse(e){let t=this._getOrReturnCtx(e);return k(t,{code:b.invalid_type,expected:N.never,received:t.parsedType}),G}};Sr.create=(e)=>new Sr({typeName:K.ZodNever,...Q(e)});Qa=class Qa extends ee{_parse(e){if(this._getType(e)!==N.undefined){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.void,received:r.parsedType}),G}return Qe(e.data)}};Qa.create=(e)=>new Qa({typeName:K.ZodVoid,...Q(e)});cr=class cr extends ee{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==N.array)return k(t,{code:b.invalid_type,expected:N.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;if(o||i)k(t,{code:o?b.too_big:b.too_small,minimum:i?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)k(t,{code:b.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)k(t,{code:b.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,i)=>n.type._parseAsync(new At(t,o,t.path,i)))).then((o)=>Be.mergeArray(r,o));let s=[...t.data].map((o,i)=>n.type._parseSync(new At(t,o,t.path,i)));return Be.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new cr({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new cr({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new cr({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};cr.create=(e,t)=>new cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ce=class Ce extends ee{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=re.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==N.object){let c=this._getOrReturnCtx(e);return k(c,{code:b.invalid_type,expected:N.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Sr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))i.push(c)}let a=[];for(let c of o){let u=s[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new At(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Sr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of i)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(i.length>0)k(n,{code:b.unrecognized_keys,keys:i}),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 i){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new At(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,l=await u.value;c.push({key:d,value:l,alwaysSet:u.alwaysSet})}return c}).then((c)=>Be.mergeObjectSync(r,c));else return Be.mergeObjectSync(r,a)}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 re.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 re.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}deepPartial(){return Os(this)}partial(e){let t={};for(let r of re.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 re.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof ur)s=s._def.innerType;t[r]=s}return new Ce({...this._def,shape:()=>t})}keyof(){return Ww(re.objectKeys(this.shape))}};Ce.create=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strip",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Ce.strictCreate=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strict",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Ce.lazycreate=(e,t)=>new Ce({shape:e,unknownKeys:"strip",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Io=class Io extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let i of s)if(i.result.status==="valid")return i.result;for(let i of s)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map((i)=>new ft(i.ctx.common.issues));return k(t,{code:b.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 a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!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 i=o.map((a)=>new ft(a));return k(t,{code:b.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};Io.create=(e,t)=>new Io({options:e,typeName:K.ZodUnion,...Q(t)});Al=class Al extends ee{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.object)return k(t,{code:b.invalid_type,expected:N.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return k(t,{code:b.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=wr(s.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,s)}}return new Al({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};Co=class Co extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(xl(s)||xl(o))return G;let i=Ol(s.value,o.value);if(!i.valid)return k(r,{code:b.invalid_intersection_types}),G;if(Rl(s)||Rl(o))t.dirty();return{status:t.value,value:i.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}))}};Co.create=(e,t,r)=>new Co({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});xr=class xr extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.array)return k(r,{code:b.invalid_type,expected:N.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return k(r,{code:b.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)k(r,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let s=[...r.data].map((o,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new At(r,o,r.path,i))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>Be.mergeArray(t,o));else return Be.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new xr({...this._def,rest:e})}};xr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xr({items:e,typeName:K.ZodTuple,rest:null,...Q(t)})};Za=class Za extends ee{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!==N.object)return k(r,{code:b.invalid_type,expected:N.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let i in r.data)n.push({key:s._parse(new At(r,i,r.path,i)),value:o._parse(new At(r,r.data[i],r.path,i)),alwaysSet:i in r.data});if(r.common.async)return Be.mergeObjectAsync(t,n);else return Be.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof ee)return new Za({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new Za({keyType:br.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};ec=class ec extends ee{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!==N.map)return k(r,{code:b.invalid_type,expected:N.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([i,a],c)=>({key:n._parse(new At(r,i,r.path,[c,"key"])),value:s._parse(new At(r,a,r.path,[c,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of o){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of o){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}}}};ec.create=(e,t,r)=>new ec({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});Ns=class Ns extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.set)return k(r,{code:b.invalid_type,expected:N.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)k(r,{code:b.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)k(r,{code:b.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(a){let c=new Set;for(let u of a){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let i=[...r.data.values()].map((a,c)=>s._parse(new At(r,a,r.path,c)));if(r.common.async)return Promise.all(i).then((a)=>o(a));else return o(i)}min(e,t){return new Ns({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new Ns({...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)}};Ns.create=(e,t)=>new Ns({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends ee{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.function)return k(t,{code:b.invalid_type,expected:N.function,received:t.parsedType}),G;function r(i,a){return Wa({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),fn].filter((c)=>!!c),issueData:{code:b.invalid_arguments,argumentsError:a}})}function n(i,a){return Wa({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),fn].filter((c)=>!!c),issueData:{code:b.invalid_return_type,returnTypeError:a}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Is){let i=this;return Qe(async function(...a){let c=new ft([]),u=await i._def.args.parseAsync(a,s).catch((p)=>{throw c.addIssue(r(a,p)),c}),d=await Reflect.apply(o,this,u);return await i._def.returns._def.type.parseAsync(d,s).catch((p)=>{throw c.addIssue(n(d,p)),c})})}else{let i=this;return Qe(function(...a){let c=i._def.args.safeParse(a,s);if(!c.success)throw new ft([r(a,c.error)]);let u=Reflect.apply(o,this,c.data),d=i._def.returns.safeParse(u,s);if(!d.success)throw new ft([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:xr.create(e).rest(Pn.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:xr.create([]).rest(Pn.create()),returns:t||Pn.create(),typeName:K.ZodFunction,...Q(r)})}};jo=class jo extends ee{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})}};jo.create=(e,t)=>new jo({getter:e,typeName:K.ZodLazy,...Q(t)});qo=class qo extends ee{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:b.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};qo.create=(e,t)=>new qo({value:e,typeName:K.ZodLiteral,...Q(t)});Nn=class Nn extends ee{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return k(t,{expected:re.joinValues(r),received:t.parsedType,code:b.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 k(t,{received:t.data,code:b.invalid_enum_value,options:r}),G}return Qe(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 Nn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Nn.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};Nn.create=Ww;Do=class Do extends ee{_parse(e){let t=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==N.string&&r.parsedType!==N.number){let n=re.objectValues(t);return k(r,{expected:re.joinValues(n),received:r.parsedType,code:b.invalid_type}),G}if(!this._cache)this._cache=new Set(re.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=re.objectValues(t);return k(r,{received:r.data,code:b.invalid_enum_value,options:n}),G}return Qe(e.data)}get enum(){return this._def.values}};Do.create=(e,t)=>new Do({values:e,typeName:K.ZodNativeEnum,...Q(t)});Is=class Is extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.promise&&t.common.async===!1)return k(t,{code:b.invalid_type,expected:N.promise,received:t.parsedType}),G;let r=t.parsedType===N.promise?t.data:Promise.resolve(t.data);return Qe(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Is.create=(e,t)=>new Is({type:e,typeName:K.ZodPromise,...Q(t)});lr=class lr extends ee{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(k(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(i)=>{if(t.value==="aborted")return G;let a=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return ks(a.value);if(t.value==="dirty")return ks(a.value);return a});else{if(t.value==="aborted")return G;let i=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return ks(i.value);if(t.value==="dirty")return ks(i.value);return i}}if(n.type==="refinement"){let o=(i)=>{let a=n.refinement(i,s);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((i)=>{if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value).then(()=>({status:t.value,value:i.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(!An(o))return G;let i=n.transform(o.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!An(o))return G;return Promise.resolve(n.transform(o.value,s)).then((i)=>({status:t.value,value:i}))});re.assertNever(n)}};lr.create=(e,t,r)=>new lr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});lr.createWithPreprocess=(e,t,r)=>new lr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});ur=class ur extends ee{_parse(e){if(this._getType(e)===N.undefined)return Qe(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ur.create=(e,t)=>new ur({innerType:e,typeName:K.ZodOptional,...Q(t)});pn=class pn extends ee{_parse(e){if(this._getType(e)===N.null)return Qe(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:K.ZodNullable,...Q(t)});Mo=class Mo extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===N.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Mo.create=(e,t)=>new Mo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Lo=class Lo extends ee{_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(ko(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}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});tc=class tc extends ee{_parse(e){if(this._getType(e)!==N.nan){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};tc.create=(e)=>new tc({typeName:K.ZodNaN,...Q(e)});M5=Symbol("zod_brand");Pl=class Pl extends ee{_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}};rc=class rc extends ee{_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(),ks(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 rc({in:e,out:t,typeName:K.ZodPipeline})}};Uo=class Uo extends ee{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(An(n))n.value=Object.freeze(n.value);return n};return ko(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodReadonly,...Q(t)});L5={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={}));v=br.create,fe=As.create,U5=tc.create,F5=Ps.create,Ue=Ya.create,V5=Ao.create,z5=Xa.create,G5=Po.create,K5=No.create,H5=Ja.create,B5=Pn.create,W5=Sr.create,Y5=Qa.create,Ze=cr.create,ne=Ce.create,X5=Ce.strictCreate,EF=Io.create,Yw=Al.create,J5=Co.create,Q5=xr.create,wF=Za.create,Z5=ec.create,e3=Ns.create,t3=Oo.create,r3=jo.create,In=qo.create,Ve=Nn.create,n3=Do.create,s3=Is.create,o3=lr.create,i3=ur.create,a3=pn.create,c3=lr.createWithPreprocess,u3=rc.create});var Nl=F(()=>{Ba();Tl();zw();Ro();Xw();Ha()});var jn=F(()=>{Nl();Nl()});function $3(e){return SF.includes(e)}var bF,qn,SF,E3,xF,Jw,RF,Qw,TF,kF,w3,OF,b3,S3,x3,R3,AF,Zw,PF,eb,T3=20,k3=500,NF,O3;var nc=F(()=>{jn();bF=Ve(["pending","verified","approved","revoked"]),qn=Ve(["person","service","test"]),SF=qn.options;E3={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"},xF=Ve(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Jw=xF.options,RF=Ve(["active","pending","revoked"]),Qw=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),TF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),orcid:v().nullable().optional(),created_at:v().optional(),approved_at:v().nullable().optional(),dataset_count:fe().int().optional(),sandbox_completed:Ue().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),service_access:Ue().optional(),status:bF.optional(),email_verified:Ue().optional(),orcid_verified:Ue().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:Ze(Qw).optional(),username_auto_assigned:Ue().optional(),account_kind:qn.optional()}).passthrough(),kF=ne({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),w3=ne({user:TF,token:kF.optional()}).passthrough(),OF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),email_verified:fe().int().nullable().optional(),role:v().nullable(),created_at:v(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),signup_source:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),orcid:v().nullable().optional(),upload_access_requested_at:v().nullable().optional(),account_kind:qn.optional(),matched_in:Ze(v()).optional(),match_kind:v().optional()}).passthrough(),b3=ne({users:Ze(OF),count:fe().int()}).passthrough(),S3=Ve(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),x3=Ve(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),R3=ne({suggestion:v().nullable(),based_on:Ve(["name","unavailable","exhausted"])}).passthrough(),AF=Ve(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),Zw=AF.options,PF=Ve(["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"]),eb=PF.options,NF=ne({id:fe().int(),email:v(),username:v().nullable(),role:v(),status:RF,email_verified:Ue(),given_name:v().nullable(),family_name:v().nullable(),orcid:v().nullable(),orcid_verified:Ue(),github_username:v().nullable(),city:v().nullable(),country:v().nullable(),affiliation:v().nullable(),service_access:Ue(),service_access_granted_at:v().nullable(),upload_access_requested_at:v().nullable(),profile_gaps:Ze(Qw),username_auto_assigned:Ue()}).passthrough(),O3=ne({user:NF.nullable()}).passthrough()});function dr(e){if(e instanceof Error)return e.message;return String(e)}function P3(e){if(!(e instanceof fr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var fr,Il;var Cl=F(()=>{fr=class fr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;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 fr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function jF(){let e=new Map;for(let[t,r]of Object.entries(we)){for(let[n,s]of Object.entries(r))we[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=we[n],e.set(s[0],s[1]);Object.defineProperty(we,t,{value:r,enumerable:!1})}return Object.defineProperty(we,"codes",{value:e,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=tb(),we.color.ansi256=rb(),we.color.ansi16m=nb(),we.bgColor.ansi=tb(10),we.bgColor.ansi256=rb(10),we.bgColor.ansi16m=nb(10),Object.defineProperties(we,{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)=>we.rgbToAnsi256(...we.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 a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let i=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)i+=60;return i},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>we.ansi256ToAnsi(we.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>we.ansi256ToAnsi(we.hexToAnsi256(t)),enumerable:!1}}),we}var tb=(e=0)=>(t)=>`\x1B[${t+e}m`,rb=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,nb=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,we,I3,IF,CF,C3,qF,Pt;var sb=F(()=>{we={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]}},I3=Object.keys(we.modifier),IF=Object.keys(we.color),CF=Object.keys(we.bgColor),C3=[...IF,...CF];qF=jF(),Pt=qF});import jl from"process";import DF from"os";import ob from"tty";function bt(e,t=globalThis.Deno?globalThis.Deno.args:jl.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function MF(){if("FORCE_COLOR"in be){if(be.FORCE_COLOR==="true")return 1;if(be.FORCE_COLOR==="false")return 0;return be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}}function LF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function UF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=MF();if(n!==void 0)sc=n;let s=r?sc:n;if(s===0)return 0;if(r){if(bt("color=16m")||bt("color=full")||bt("color=truecolor"))return 3;if(bt("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(e&&!t&&s===void 0)return 0;let o=s||0;if(be.TERM==="dumb")return o;if(jl.platform==="win32"){let i=DF.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in be){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((i)=>(i in be)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((i)=>(i in be))||be.CI_NAME==="codeship")return 1;return o}if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor")return 3;if(be.TERM==="xterm-kitty")return 3;if(be.TERM==="xterm-ghostty")return 3;if(be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let i=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(be.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM))return 1;if("COLORTERM"in be)return 1;return o}function ib(e,t={}){let r=UF(e,{streamIsTTY:e&&e.isTTY,...t});return LF(r)}var be,sc,FF,ab;var cb=F(()=>{({env:be}=jl);if(bt("no-color")||bt("no-colors")||bt("color=false")||bt("color=never"))sc=0;else if(bt("color")||bt("colors")||bt("color=true")||bt("color=always"))sc=1;FF={stdout:ib({isTTY:ob.isatty(1)}),stderr:ib({isTTY:ob.isatty(2)})},ab=FF});function ub(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,i="";do i+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return i+=e.slice(o),i}function lb(e,t,r,n){let s=0,o="";do{let i=e[n-1]==="\r";o+=e.slice(s,i?n-1:n)+t+(i?`\r
|
|
17
|
+
deps: ${r}}`};var vD={keyword:"dependencies",type:"object",schemaType:"object",error:D0.error,code(e){let[t,r]=$D(e);j0(e,t),q0(e,r)}};function $D({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 i in t){let a=t[i];if(a.length===0)continue;let c=cr.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)cr.checkReportMissingProp(e,u)});else r.if($s._`${c} && (${cr.checkMissingProp(e,a,o)})`),cr.reportMissingProp(e,o),r.else()}}D0.validatePropertyDeps=j0;function q0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(C0.alwaysValidSchema(o,t[a]))continue;r.if(cr.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}D0.validateSchemaDeps=q0;D0.default=vD});var z0=g(function(V0){Object.defineProperty(V0,"__esModule",{value:!0});var _a=Z(),F0=ae(),ED={message:"property name must be valid",params:({params:e})=>_a._`{propertyName: ${e.propertyName}}`},SD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ED,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,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(_a.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};V0.default=SD});var nl=g(function(G0){Object.defineProperty(G0,"__esModule",{value:!0});var an=vt(),Ie=Z(),RD=$r(),cn=ae(),kD={message:"must NOT have additional properties",params:({params:e})=>Ie._`{additionalProperty: ${e.additionalProperty}}`},TD={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:kD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&cn.alwaysValidSchema(i,r))return;let u=an.allSchemaProperties(n.properties),d=an.allSchemaProperties(n.patternProperties);l(),e.ok(Ie._`${o} === ${RD.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=cn.schemaRefOrVal(i,n.properties,"properties");_=an.isOwnProperty(t,O,y)}else if(u.length)_=Ie.or(...u.map((O)=>Ie._`${y} === ${O}`));else _=Ie.nil;if(d.length)_=Ie.or(_,...d.map((O)=>Ie._`${an.usePattern(e,O)}.test(${y})`));return Ie.not(_)}function f(y){t.code(Ie._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!cn.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Ie.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Ie.not(_),()=>t.break())}}function m(y,_,O){let k={keyword:"additionalProperties",dataProp:y,dataPropType:cn.Type.Str};if(O===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(k,_)}}};G0.default=TD});var W0=g(function(B0){Object.defineProperty(B0,"__esModule",{value:!0});var H0=fo(),va=vt(),bs=ae(),K0=nl(),AD={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 i=va.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=bs.mergeEvaluated.props(t,bs.toHash(i),o.props);let a=i.filter((l)=>!bs.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(va.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};B0.default=AD});var X0=g(function(Y0){Object.defineProperty(Y0,"__esModule",{value:!0});var $a=vt(),un=Z(),ba=ae(),wa=ae(),ID={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=$a.allSchemaProperties(r),c=a.filter((m)=>ba.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof un.Name))o.props=wa.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))ba.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(un._`${$a.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:wa.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(un._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(un.not(d),()=>t.break())})})}}};Y0.default=ID});var Z0=g(function(Q0){Object.defineProperty(Q0,"__esModule",{value:!0});var J0=ae(),CD={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=CD});var r$=g(function(t$){Object.defineProperty(t$,"__esModule",{value:!0});var e$=vt(),qD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e$.validateUnion,error:{message:"must match a schema in anyOf"}};t$.default=qD});var o$=g(function(s$){Object.defineProperty(s$,"__esModule",{value:!0});var ln=Z(),n$=ae(),MD={message:"must match exactly one schema in oneOf",params:({params:e})=>ln._`{passingSchemas: ${e.passing}}`},LD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:MD,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,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(n$.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(ln._`${c} && ${i}`).assign(i,!1).assign(a,ln._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,ln.Name)})})}}};s$.default=LD});var c$=g(function(a$){Object.defineProperty(a$,"__esModule",{value:!0});var i$=ae(),FD={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,i)=>{if(i$.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};a$.default=FD});var d$=g(function(l$){Object.defineProperty(l$,"__esModule",{value:!0});var dn=Z(),Ea=ae(),zD={message:({params:e})=>dn.str`must match "${e.ifClause}" schema`,params:({params:e})=>dn._`{failingKeyword: ${e.ifClause}}`},GD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:zD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Ea.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=u$(n,"then"),o=u$(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(dn.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,dn._`${d}`);else e.setParams({ifClause:d})}}}};function u$(e,t){let r=e.schema[t];return r!==void 0&&!Ea.alwaysValidSchema(e,r)}l$.default=GD});var h$=g(function(p$){Object.defineProperty(p$,"__esModule",{value:!0});var f$=ae(),HD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)f$.checkStrictMode(r,`"${e}" without "if" is ignored`)}};p$.default=HD});var g$=g(function(m$){Object.defineProperty(m$,"__esModule",{value:!0});var WD=tl(),YD=R0(),XD=rl(),JD=N0(),QD=P0(),ZD=U0(),eM=z0(),tM=nl(),rM=W0(),nM=X0(),sM=Z0(),oM=r$(),iM=o$(),aM=c$(),cM=d$(),uM=h$();function lM(e=!1){let t=[sM.default,oM.default,iM.default,aM.default,cM.default,uM.default,eM.default,tM.default,ZD.default,rM.default,nM.default];if(e)t.push(YD.default,JD.default);else t.push(WD.default,XD.default);return t.push(QD.default),t}m$.default=lM});var _$=g(function(y$){Object.defineProperty(y$,"__esModule",{value:!0});var J=Z(),fM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},pM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",J._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(J._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,J._`${m}.type || "string"`).assign(_,J._`${m}.validate`),()=>r.assign(y,J._`"string"`).assign(_,m)),e.fail$data(J.or(O(),k()));function O(){if(c.strictSchema===!1)return J.nil;return J._`${i} && !${_}`}function k(){let M=d.$async?J._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:J._`${_}(${n})`,S=J._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return J._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=k(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(S){let Ee=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,Se=r.scopeValue("formats",{key:o,ref:S,code:Ee});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${Se}.validate`];return["string",S,Se]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return J._`await ${_}(${n})`}return typeof y=="function"?J._`${_}(${n})`:J._`${_}.test(${n})`}}}};y$.default=pM});var $$=g(function(v$){Object.defineProperty(v$,"__esModule",{value:!0});var mM=_$(),gM=[mM.default];v$.default=gM});var E$=g(function(b$){Object.defineProperty(b$,"__esModule",{value:!0});b$.contentVocabulary=b$.metadataVocabulary=void 0;b$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];b$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var x$=g(function(S$){Object.defineProperty(S$,"__esModule",{value:!0});var vM=Dv(),$M=g0(),bM=g$(),wM=$$(),Sa=E$(),EM=[vM.default,$M.default,(0,bM.default)(),wM.default,Sa.metadataVocabulary,Sa.contentVocabulary];S$.default=EM});var O$=g(function(k$){Object.defineProperty(k$,"__esModule",{value:!0});k$.DiscrError=void 0;var R$;(function(e){e.Tag="tag",e.Mapping="mapping"})(R$||(k$.DiscrError=R$={}))});var I$=g(function(N$){Object.defineProperty(N$,"__esModule",{value:!0});var $t=Z(),ws=O$(),xa=ua(),xM=po(),A$=ae(),RM={message:({params:{discrError:e,tagName:t}})=>e===ws.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>$t._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},kM={keyword:"discriminator",type:"object",schemaType:"object",error:RM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",$t._`${r}${$t.getProperty(a)}`);t.if($t._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ws.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf($t._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ws.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,$t.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!A$.schemaHasRulesButRef(S,o.self.RULES)){let Se=S.$ref;if(S=xa.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Se),S instanceof xa.SchemaEnv)S=S.schema;if(S===void 0)throw new xM.default(o.opts.uriResolver,o.baseId,Se)}let Ee=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof Ee!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(Ee,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)k(M.const,S);else if(M.enum)for(let Ee of M.enum)k(Ee,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};N$.default=kM});var P$=g(function(mH,OM){OM.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 j$=g(function(ut,sl){Object.defineProperty(ut,"__esModule",{value:!0});ut.MissingRefError=ut.ValidationError=ut.CodeGen=ut.Name=ut.nil=ut.stringify=ut.str=ut._=ut.KeywordCxt=ut.Ajv=void 0;var AM=Ov(),NM=x$(),IM=I$(),C$=P$(),PM=["/properties"],Ra="http://json-schema.org/draft-07/schema";class mo extends AM.default{_addVocabularies(){if(super._addVocabularies(),NM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(IM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(C$,PM):C$;this.addMetaSchema(e,Ra,!1),this.refs["http://json-schema.org/schema"]=Ra}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ra)?Ra:void 0)}}ut.Ajv=mo;sl.exports=ut=mo;sl.exports.Ajv=mo;Object.defineProperty(ut,"__esModule",{value:!0});ut.default=mo;var CM=fo();Object.defineProperty(ut,"KeywordCxt",{enumerable:!0,get:function(){return CM.KeywordCxt}});var Es=Z();Object.defineProperty(ut,"_",{enumerable:!0,get:function(){return Es._}});Object.defineProperty(ut,"str",{enumerable:!0,get:function(){return Es.str}});Object.defineProperty(ut,"stringify",{enumerable:!0,get:function(){return Es.stringify}});Object.defineProperty(ut,"nil",{enumerable:!0,get:function(){return Es.nil}});Object.defineProperty(ut,"Name",{enumerable:!0,get:function(){return Es.Name}});Object.defineProperty(ut,"CodeGen",{enumerable:!0,get:function(){return Es.CodeGen}});var jM=ia();Object.defineProperty(ut,"ValidationError",{enumerable:!0,get:function(){return jM.default}});var qM=po();Object.defineProperty(ut,"MissingRefError",{enumerable:!0,get:function(){return qM.default}})});var M$=g(function(D$){Object.defineProperty(D$,"__esModule",{value:!0});D$.formatLimitDefinition=void 0;var q$=j$(),Pe=Z(),fn=Pe.operators,ka={formatMaximum:{okStr:"<=",ok:fn.LTE,fail:fn.GT},formatMinimum:{okStr:">=",ok:fn.GTE,fail:fn.LT},formatExclusiveMaximum:{okStr:"<",ok:fn.LT,fail:fn.GTE},formatExclusiveMinimum:{okStr:">",ok:fn.GT,fail:fn.LTE}},LM={message:({keyword:e,schemaCode:t})=>Pe.str`should be ${ka[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pe._`{comparison: ${ka[e].okStr}, limit: ${t}}`};D$.formatLimitDefinition={keyword:Object.keys(ka),type:"string",schemaType:"string",$data:!0,error:LM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:i,self:a}=o;if(!i.validateFormats)return;let c=new q$.KeywordCxt(o,a.RULES.all.format.definition,"format");if(c.$data)u();else d();function u(){let p=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),f=t.const("fmt",Pe._`${p}[${c.schemaCode}]`);e.fail$data(Pe.or(Pe._`typeof ${f} != "object"`,Pe._`${f} instanceof RegExp`,Pe._`typeof ${f}.compare != "function"`,l(f)))}function d(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${p}" does not define "compare" function`);let h=t.scopeValue("formats",{key:p,ref:f,code:i.code.formats?Pe._`${i.code.formats}${Pe.getProperty(p)}`:void 0});e.fail$data(l(h))}function l(p){return Pe._`${p}.compare(${r}, ${n}) ${ka[s].fail} 0`}},dependencies:["format"]};var UM=(e)=>(e.addKeyword(D$.formatLimitDefinition),e);D$.default=UM});var V$=g(function(go,F$){Object.defineProperty(go,"__esModule",{value:!0});var bt=gy(),VM=M$(),Ss=Z(),L$=new Ss.Name("fullFormats"),zM=new Ss.Name("fastFormats"),il=(e,t={keywords:!0})=>{if(Array.isArray(t))return U$(e,t,bt.fullFormats,L$),e;let[r,n]=t.mode==="fast"?[bt.fastFormats,zM]:[bt.fullFormats,L$],s=t.formats||bt.formatNames;if(U$(e,s,r,n),t.keywords)(0,VM.default)(e);return e};il.get=(e,t="full")=>{let n=(t==="fast"?bt.fastFormats:bt.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function U$(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=Ss._`require("ajv-formats/dist/formats").${n}`);for(let i of t)e.addFormat(i,r[i])}F$.exports=go=il;Object.defineProperty(go,"__esModule",{value:!0});go.default=il});function al(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))GM(e,t,s,r);return HM(e,t),XM(e,t,n),e}var GM=(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(!KM(s,o)&&n)return;Object.defineProperty(e,r,o)},KM=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)},HM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},BM=(e,t)=>`/* Wrapped ${e}*/
|
|
18
|
+
${t}`,WM,YM,XM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=BM.bind(null,n,t.toString());Object.defineProperty(s,"name",YM);let{writable:o,enumerable:i,configurable:a}=WM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:i,configurable:a})};var z$=F(()=>{WM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),YM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var JM=(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 i,a,c,u=function(...d){let l=this,p=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(l,d)},f=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(l,d)},h=s&&!i;if(clearTimeout(i),i=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a)a=setTimeout(f,n);if(h)c=e.apply(l,d);return c};return al(u,e),u.cancel=()=>{if(i)clearTimeout(i),i=void 0;if(a)clearTimeout(a),a=void 0},u},cl;var G$=F(()=>{z$();cl=JM});var yo=g(function(TH,K$){var QM=Number.MAX_SAFE_INTEGER||9007199254740991,ZM=["major","premajor","minor","preminor","patch","prepatch","prerelease"];K$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:QM,RELEASE_TYPES:ZM,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _o=g(function(OH,H$){var eL=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};H$.exports=eL});var xs=g(function(ur,B$){var{MAX_SAFE_COMPONENT_LENGTH:ul,MAX_SAFE_BUILD_LENGTH:tL,MAX_LENGTH:rL}=yo(),nL=_o();ur=B$.exports={};var sL=ur.re=[],oL=ur.safeRe=[],j=ur.src=[],iL=ur.safeSrc=[],q=ur.t={},aL=0,ll="[a-zA-Z0-9-]",cL=[["\\s",1],["\\d",rL],[ll,tL]],uL=(e)=>{for(let[t,r]of cL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=uL(t),s=aL++;nL(e,s,t),q[e]=s,j[s]=t,iL[s]=n,sL[s]=new RegExp(t,r?"g":void 0),oL[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);ur.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);ur.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);ur.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 Ta=g(function(AH,W$){var lL=Object.freeze({loose:!0}),dL=Object.freeze({}),fL=(e)=>{if(!e)return dL;if(typeof e!=="object")return lL;return e};W$.exports=fL});var dl=g(function(NH,J$){var Y$=/^[0-9]+$/,X$=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Y$.test(e),n=Y$.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},pL=(e,t)=>X$(t,e);J$.exports={compareIdentifiers:X$,rcompareIdentifiers:pL}});var Ke=g(function(IH,Z$){var Oa=_o(),{MAX_LENGTH:Q$,MAX_SAFE_INTEGER:Aa}=yo(),{safeRe:Na,t:Ia}=xs(),hL=Ta(),{compareIdentifiers:fl}=dl();class At{constructor(e,t){if(t=hL(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>Q$)throw TypeError(`version is longer than ${Q$} characters`);Oa("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Na[Ia.LOOSE]:Na[Ia.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>Aa||this.major<0)throw TypeError("Invalid major version");if(this.minor>Aa||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Aa||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<Aa)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(Oa("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(Oa("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(Oa("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?Na[Ia.PRERELEASELOOSE]:Na[Ia.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}}Z$.exports=At});var kn=g(function(PH,tb){var eb=Ke(),mL=(e,t,r=!1)=>{if(e instanceof eb)return e;try{return new eb(e,t)}catch(n){if(!r)return null;throw n}};tb.exports=mL});var nb=g(function(CH,rb){var gL=kn(),yL=(e,t)=>{let r=gL(e,t);return r?r.version:null};rb.exports=yL});var ob=g(function(jH,sb){var _L=kn(),vL=(e,t)=>{let r=_L(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};sb.exports=vL});var cb=g(function(qH,ab){var ib=Ke(),$L=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new ib(e instanceof ib?e.version:e,r).inc(t,n,s).version}catch(o){return null}};ab.exports=$L});var db=g(function(DH,lb){var ub=kn(),bL=(e,t)=>{let r=ub(e,null,!0),n=ub(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};lb.exports=bL});var pb=g(function(MH,fb){var wL=Ke(),EL=(e,t)=>new wL(e,t).major;fb.exports=EL});var mb=g(function(LH,hb){var SL=Ke(),xL=(e,t)=>new SL(e,t).minor;hb.exports=xL});var yb=g(function(UH,gb){var RL=Ke(),kL=(e,t)=>new RL(e,t).patch;gb.exports=kL});var vb=g(function(FH,_b){var TL=kn(),OL=(e,t)=>{let r=TL(e,t);return r&&r.prerelease.length?r.prerelease:null};_b.exports=OL});var wt=g(function(VH,bb){var $b=Ke(),AL=(e,t,r)=>new $b(e,r).compare(new $b(t,r));bb.exports=AL});var Eb=g(function(zH,wb){var NL=wt(),IL=(e,t,r)=>NL(t,e,r);wb.exports=IL});var xb=g(function(GH,Sb){var PL=wt(),CL=(e,t)=>PL(e,t,!0);Sb.exports=CL});var Pa=g(function(KH,kb){var Rb=Ke(),jL=(e,t,r)=>{let n=new Rb(e,r),s=new Rb(t,r);return n.compare(s)||n.compareBuild(s)};kb.exports=jL});var Ob=g(function(HH,Tb){var qL=Pa(),DL=(e,t)=>e.sort((r,n)=>qL(r,n,t));Tb.exports=DL});var Nb=g(function(BH,Ab){var ML=Pa(),LL=(e,t)=>e.sort((r,n)=>ML(n,r,t));Ab.exports=LL});var vo=g(function(WH,Ib){var UL=wt(),FL=(e,t,r)=>UL(e,t,r)>0;Ib.exports=FL});var Ca=g(function(YH,Pb){var VL=wt(),zL=(e,t,r)=>VL(e,t,r)<0;Pb.exports=zL});var pl=g(function(XH,Cb){var GL=wt(),KL=(e,t,r)=>GL(e,t,r)===0;Cb.exports=KL});var hl=g(function(JH,jb){var HL=wt(),BL=(e,t,r)=>HL(e,t,r)!==0;jb.exports=BL});var ja=g(function(QH,qb){var WL=wt(),YL=(e,t,r)=>WL(e,t,r)>=0;qb.exports=YL});var qa=g(function(ZH,Db){var XL=wt(),JL=(e,t,r)=>XL(e,t,r)<=0;Db.exports=JL});var ml=g(function(e5,Mb){var QL=pl(),ZL=hl(),eU=vo(),tU=ja(),rU=Ca(),nU=qa(),sU=(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 QL(e,r,n);case"!=":return ZL(e,r,n);case">":return eU(e,r,n);case">=":return tU(e,r,n);case"<":return rU(e,r,n);case"<=":return nU(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Mb.exports=sU});var Ub=g(function(t5,Lb){var oU=Ke(),iU=kn(),{safeRe:Da,t:Ma}=xs(),aU=(e,t)=>{if(e instanceof oU)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?Da[Ma.COERCEFULL]:Da[Ma.COERCE]);else{let c=t.includePrerelease?Da[Ma.COERCERTLFULL]:Da[Ma.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",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return iU(`${n}.${s}.${o}${i}${a}`,t)};Lb.exports=aU});var zb=g(function(r5,Vb){class Fb{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}}Vb.exports=Fb});var Et=g(function(n5,Bb){var cU=/\s+/g;class $o{constructor(e,t){if(t=lU(t),e instanceof $o)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new $o(e.raw,t);if(e instanceof La)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(cU," "),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)=>!Kb(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&&yU(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&&mU)|(this.options.loose&&gU))+":"+e,n=Gb.get(r);if(n)return n;let s=this.options.loose,o=s?Xe[He.HYPHENRANGELOOSE]:Xe[He.HYPHENRANGE];e=e.replace(o,kU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Xe[He.COMPARATORTRIM],fU),ye("comparator trim",e),e=e.replace(Xe[He.TILDETRIM],pU),ye("tilde trim",e),e=e.replace(Xe[He.CARETTRIM],hU),ye("caret trim",e);let i=e.split(" ").map((d)=>_U(d,this.options)).join(" ").split(/\s+/).map((d)=>RU(d,this.options));if(s)i=i.filter((d)=>(ye("loose invalid filter",d,this.options),!!d.match(Xe[He.COMPARATORLOOSE])));ye("range list",i);let a=new Map,c=i.map((d)=>new La(d,this.options));for(let d of c){if(Kb(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return Gb.set(r,u),u}intersects(e,t){if(!(e instanceof $o))throw TypeError("a Range is required");return this.set.some((r)=>Hb(r,t)&&e.set.some((n)=>Hb(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 dU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(TU(this.set[t],e,this.options))return!0;return!1}}Bb.exports=$o;var uU=zb(),Gb=new uU,lU=Ta(),La=bo(),ye=_o(),dU=Ke(),{safeRe:Xe,t:He,comparatorTrimReplace:fU,tildeTrimReplace:pU,caretTrimReplace:hU}=xs(),{FLAG_INCLUDE_PRERELEASE:mU,FLAG_LOOSE:gU}=yo(),Kb=(e)=>e.value==="<0.0.0-0",yU=(e)=>e.value==="",Hb=(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(Xe[He.BUILD],""),ye("comp",e,t),e=bU(e,t),ye("caret",e),e=vU(e,t),ye("tildes",e),e=EU(e,t),ye("xrange",e),e=xU(e,t),ye("stars",e),e),Je=(e)=>!e||e.toLowerCase()==="x"||e==="*",vU=(e,t)=>e.trim().split(/\s+/).map((r)=>$U(r,t)).join(" "),$U=(e,t)=>{let r=t.loose?Xe[He.TILDELOOSE]:Xe[He.TILDE];return e.replace(r,(n,s,o,i,a)=>{ye("tilde",e,n,s,o,i,a);let c;if(Je(s))c="";else if(Je(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Je(i))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(a)ye("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},bU=(e,t)=>e.trim().split(/\s+/).map((r)=>wU(r,t)).join(" "),wU=(e,t)=>{ye("caret",e,t);let r=t.loose?Xe[He.CARETLOOSE]:Xe[He.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{ye("caret",e,s,o,i,a,c);let u;if(Je(o))u="";else if(Je(i))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Je(a))if(o==="0")u=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(i==="0")u=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(i==="0")u=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return ye("caret return",u),u})},EU=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>SU(r,t)).join(" ")),SU=(e,t)=>{e=e.trim();let r=t.loose?Xe[He.XRANGELOOSE]:Xe[He.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{ye("xRange",e,n,s,o,i,a,c);let u=Je(o),d=u||Je(i),l=d||Je(a),p=l;if(s==="="&&p)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&p){if(d)i=0;if(a=0,s===">")if(s=">=",d)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",d)o=+o+1;else i=+i+1;if(s==="<")c="-0";n=`${s+o}.${i}.${a}${c}`}else if(d)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(l)n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`;return ye("xRange return",n),n})},xU=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Xe[He.STAR],"")),RU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Xe[t.includePrerelease?He.GTE0PRE:He.GTE0],"")),kU=(e)=>(t,r,n,s,o,i,a,c,u,d,l,p)=>{if(Je(n))r="";else if(Je(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Je(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(i)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Je(u))c="";else if(Je(d))c=`<${+u+1}.0.0-0`;else if(Je(l))c=`<${u}.${+d+1}.0-0`;else if(p)c=`<=${u}.${d}.${l}-${p}`;else if(e)c=`<${u}.${d}.${+l+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},TU=(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===La.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 bo=g(function(s5,Zb){var wo=Symbol("SemVer ANY");class Ua{static get ANY(){return wo}constructor(e,t){if(t=Wb(t),e instanceof Ua)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===wo)this.value="";else this.value=this.operator+this.semver.version;yl("comp",this)}parse(e){let t=this.options.loose?Yb[Xb.COMPARATORLOOSE]:Yb[Xb.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=wo;else this.semver=new Jb(r[2],this.options.loose)}toString(){return this.value}test(e){if(yl("Comparator.test",e,this.options.loose),this.semver===wo||e===wo)return!0;if(typeof e==="string")try{e=new Jb(e,this.options)}catch(t){return!1}return gl(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ua))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Qb(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Qb(this.value,t).test(e.semver)}if(t=Wb(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}}Zb.exports=Ua;var Wb=Ta(),{safeRe:Yb,t:Xb}=xs(),gl=ml(),yl=_o(),Jb=Ke(),Qb=Et()});var Eo=g(function(o5,ew){var OU=Et(),AU=(e,t,r)=>{try{t=new OU(t,r)}catch(n){return!1}return t.test(e)};ew.exports=AU});var rw=g(function(i5,tw){var NU=Et(),IU=(e,t)=>new NU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));tw.exports=IU});var sw=g(function(a5,nw){var PU=Ke(),CU=Et(),jU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new CU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===-1)n=i,s=new PU(n,r)}}),n};nw.exports=jU});var iw=g(function(c5,ow){var qU=Ke(),DU=Et(),MU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new DU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===1)n=i,s=new qU(n,r)}}),n};ow.exports=MU});var uw=g(function(u5,cw){var _l=Ke(),LU=Et(),aw=vo(),UU=(e,t)=>{e=new LU(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((i)=>{let a=new _l(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||aw(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||aw(r,o)))r=o}if(r&&e.test(r))return r;return null};cw.exports=UU});var dw=g(function(l5,lw){var FU=Et(),VU=(e,t)=>{try{return new FU(e,t).range||"*"}catch(r){return null}};lw.exports=VU});var Fa=g(function(d5,mw){var zU=Ke(),hw=bo(),{ANY:GU}=hw,KU=Et(),HU=Eo(),fw=vo(),pw=Ca(),BU=qa(),WU=ja(),YU=(e,t,r,n)=>{e=new zU(e,n),t=new KU(t,n);let s,o,i,a,c;switch(r){case">":s=fw,o=BU,i=pw,a=">",c=">=";break;case"<":s=pw,o=WU,i=fw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(HU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let d=t.set[u],l=null,p=null;if(d.forEach((f)=>{if(f.semver===GU)f=new hw(">=0.0.0");if(l=l||f,p=p||f,s(f.semver,l.semver,n))l=f;else if(i(f.semver,p.semver,n))p=f}),l.operator===a||l.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;else if(p.operator===c&&i(e,p.semver))return!1}return!0};mw.exports=YU});var yw=g(function(f5,gw){var XU=Fa(),JU=(e,t,r)=>XU(e,t,">",r);gw.exports=JU});var vw=g(function(p5,_w){var QU=Fa(),ZU=(e,t,r)=>QU(e,t,"<",r);_w.exports=ZU});var ww=g(function(h5,bw){var $w=Et(),e2=(e,t,r)=>(e=new $w(e,r),t=new $w(t,r),e.intersects(t,r));bw.exports=e2});var Sw=g(function(m5,Ew){var t2=Eo(),r2=wt();Ew.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((d,l)=>r2(d,l,r));for(let d of i)if(t2(d,t,r)){if(o=d,!s)s=d}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let a=[];for(let[d,l]of n)if(d===l)a.push(d);else if(!l&&d===i[0])a.push("*");else if(!l)a.push(`>=${d}`);else if(d===i[0])a.push(`<=${l}`);else a.push(`${d} - ${l}`);let c=a.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var Aw=g(function(g5,Ow){var xw=Et(),$l=bo(),{ANY:vl}=$l,So=Eo(),bl=wt(),n2=(e,t,r={})=>{if(e===t)return!0;e=new xw(e,r),t=new xw(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=o2(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},s2=[new $l(">=0.0.0-0")],Rw=[new $l(">=0.0.0")],o2=(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=s2;else e=Rw;if(t.length===1&&t[0].semver===vl)if(r.includePrerelease)return!0;else t=Rw;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=kw(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=Tw(o,f,r);else n.add(f.semver);if(n.size>1)return null;let i;if(s&&o){if(i=bl(s.semver,o.semver,r),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!So(f,String(s),r))return null;if(o&&!So(f,String(o),r))return null;for(let h of t)if(!So(f,String(h),r))return!1;return!0}let a,c,u,d,l=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(l&&l.prerelease.length===1&&o.operator==="<"&&l.prerelease[0]===0)l=!1;for(let f of t){if(d=d||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(p){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch)p=!1}if(f.operator===">"||f.operator===">="){if(a=kw(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!So(s.semver,String(f),r))return!1}if(o){if(l){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===l.major&&f.semver.minor===l.minor&&f.semver.patch===l.patch)l=!1}if(f.operator==="<"||f.operator==="<="){if(c=Tw(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!So(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&i!==0)return!1}if(s&&u&&!o&&i!==0)return!1;if(o&&d&&!s&&i!==0)return!1;if(p||l)return!1;return!0},kw=(e,t,r)=>{if(!e)return t;let n=bl(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Tw=(e,t,r)=>{if(!e)return t;let n=bl(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Ow.exports=n2});var Iw=g(function(y5,Nw){var Rs=xs(),Va=yo(),i2=Ke(),za=dl(),a2=kn(),c2=nb(),u2=ob(),l2=cb(),d2=db(),f2=pb(),p2=mb(),h2=yb(),m2=vb(),g2=wt(),y2=Eb(),_2=xb(),v2=Pa(),$2=Ob(),b2=Nb(),w2=vo(),E2=Ca(),S2=pl(),x2=hl(),R2=ja(),k2=qa(),T2=ml(),O2=Ub(),A2=bo(),N2=Et(),I2=Eo(),P2=rw(),C2=sw(),j2=iw(),q2=uw(),D2=dw(),M2=Fa(),L2=yw(),U2=vw(),F2=ww(),V2=Sw(),z2=Aw();Nw.exports={parse:a2,valid:c2,clean:u2,inc:l2,diff:d2,major:f2,minor:p2,patch:h2,prerelease:m2,compare:g2,rcompare:y2,compareLoose:_2,compareBuild:v2,sort:$2,rsort:b2,gt:w2,lt:E2,eq:S2,neq:x2,gte:R2,lte:k2,cmp:T2,coerce:O2,Comparator:A2,Range:N2,satisfies:I2,toComparators:P2,maxSatisfying:C2,minSatisfying:j2,minVersion:q2,validRange:D2,outside:M2,gtr:L2,ltr:U2,intersects:F2,simplifyRange:V2,subset:z2,SemVer:i2,re:Rs.re,src:Rs.src,tokens:Rs.t,SEMVER_SPEC_VERSION:Va.SEMVER_SPEC_VERSION,RELEASE_TYPES:Va.RELEASE_TYPES,compareIdentifiers:za.compareIdentifiers,rcompareIdentifiers:za.rcompareIdentifiers}});function Cw(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return G2.call(e)===r}function jw(e){return Cw(e,Uint8Array,"[object Uint8Array]")}function K2(e){return Cw(e,ArrayBuffer,"[object ArrayBuffer]")}function H2(e){return jw(e)||K2(e)}function B2(e){if(!jw(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function W2(e){if(!H2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function wl(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)B2(s),r.set(s,n),n+=s.length;return r}function El(e,t="utf8"){return W2(e),Pw[t]??=new globalThis.TextDecoder(t),Pw[t].decode(e)}function Y2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function Ga(e){return Y2(e),X2.encode(e)}var G2,Pw,X2,_5;var qw=F(()=>{G2=Object.prototype.toString;Pw={utf8:new globalThis.TextDecoder("utf8")};X2=new globalThis.TextEncoder;_5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as J2}from"util";import Dw from"process";import Tn from"fs";import Mw from"path";import xo from"crypto";import Q2 from"assert";var Uw,Fw,On,Z2,Lw="aes-256-cbc",ks=()=>Object.create(null),eF=(e)=>e!==void 0&&e!==null,tF=(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`)},Ka="__internal__",Sl,Ha;var Vw=F(()=>{dd();pd();zd();G$();qw();Uw=vc(iy(),1),Fw=vc(V$(),1),On=vc(Iw(),1),Z2=Fw.default.default,Sl=`${Ka}.migrations.version`;Ha=class Ha{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 Uw.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});Z2(o);let i={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(i);for(let[a,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[a]=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=Mw.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(ks(),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{Q2.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 ${Ka} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(tF(s,o),this.#e.accessPropertiesByDotNotation)wc(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,i]of Object.entries(s))n(o,i)}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(eF(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=ks();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=Tn.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(ks(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),ks();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return ks();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=xo.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=xo.createDecipheriv(Lw,r,t),s=e.slice(17),o=typeof s==="string"?Ga(s):s;return El(wl([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(J2(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(){Tn.mkdirSync(Mw.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=xo.randomBytes(16),n=xo.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=xo.createCipheriv(Lw,n,r);t=wl([r,Ga(":"),s.update(Ga(t)),s.final()])}if(Dw.env.SNAP)Tn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{qc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){Tn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!Tn.existsSync(this.path))this._write(ks());if(Dw.platform==="win32")Tn.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else Tn.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((i)=>this._shouldPerformMigration(i,n,t)),o={...this.store};for(let i of s)try{if(r)r(this,{fromVersion:n,toVersion:i,finalVersion:t,versions:s});let a=e[i];a?.(this),this._set(Sl,i),n=i,o={...this.store}}catch(a){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${a}`)}if(this._isVersionInRangeFormat(n)||!On.default.eq(n,t))this._set(Sl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Ka)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Ka}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return On.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&On.default.satisfies(t,e))return!1;return On.default.satisfies(r,e)}if(On.default.lte(e,t))return!1;if(On.default.gt(e,r))return!1;return!0}_get(e,t){return cd(this.store,e,t)}_set(e,t){let{store:r}=this;wc(r,e,t),this.store=r}}});var re,zw,I,wr=(e)=>{switch(typeof e){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(e)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":if(Array.isArray(e))return I.array;if(e===null)return I.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return I.promise;if(typeof Map<"u"&&e instanceof Map)return I.map;if(typeof Set<"u"&&e instanceof Set)return I.set;if(typeof Date<"u"&&e instanceof Date)return I.date;return I.object;default:return I.unknown}};var Ro=F(()=>{(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 i of s)o[i]=i;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((a)=>typeof s[s[a]]!=="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},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 i in s)if(Object.prototype.hasOwnProperty.call(s,i))o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i;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((i)=>typeof i==="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(re||(re={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(zw||(zw={}));I=re.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 Ba=F(()=>{Ro();E=re.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 i=r,a=0;while(a<o.path.length){let c=o.path[a];if(a!==o.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o));i=i[c],a++}}};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,re.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 rF=(e,t)=>{let r;switch(e.code){case E.invalid_type:if(e.received===I.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,re.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${re.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 re.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,re.assertNever(e)}return{message:r}},pn;var xl=F(()=>{Ba();Ro();pn=rF});function ko(){return nF}var nF;var Wa=F(()=>{xl();nF=pn});function T(e,t){let r=ko(),n=Ya({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===pn?void 0:pn].filter((s)=>!!s)});e.common.issues.push(n)}class Be{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 Be.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 Ya=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},G,Ts=(e)=>({status:"dirty",value:e}),Qe=(e)=>({status:"valid",value:e}),Rl=(e)=>e.status==="aborted",kl=(e)=>e.status==="dirty",An=(e)=>e.status==="valid",To=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=F(()=>{Wa();xl();G=Object.freeze({status:"aborted"})});var Gw=()=>{};var D;var Kw=F(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class Nt{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:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:s}}class ee{get description(){return this._def.description}_getType(e){return wr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Be,ctx:{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(To(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:wr(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Hw(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return An(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)=>An(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:wr(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(To(n)?n:Promise.resolve(n));return Hw(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),i=()=>s.addIssue({code:E.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((a)=>{if(!a)return i(),!1;else return!0});if(!o)return i(),!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 fr({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 dr.create(this,this._def)}nullable(){return hn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lr.create(this)}promise(){return Ps.create(this,this._def)}or(e){return Po.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new fr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Mo({...Q(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new Il({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Lo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return nc.create(this,e)}readonly(){return Uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Ww(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 $F(e){return new RegExp(`^${Ww(e)}$`)}function bF(e){let t=`${Bw}T${Ww(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 wF(e,t){if((t==="v4"||!t)&&pF.test(e))return!0;if((t==="v6"||!t)&&mF.test(e))return!0;return!1}function EF(e,t){if(!uF.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 SF(e,t){if((t==="v4"||!t)&&hF.test(e))return!0;if((t==="v6"||!t)&&gF.test(e))return!0;return!1}function xF(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(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}function Os(e){if(e instanceof Ce){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=dr.create(Os(n))}return new Ce({...e._def,shape:()=>t})}else if(e instanceof lr)return new lr({...e._def,type:Os(e.element)});else if(e instanceof dr)return dr.create(Os(e.unwrap()));else if(e instanceof hn)return hn.create(Os(e.unwrap()));else if(e instanceof Rr)return Rr.create(e.items.map((t)=>Os(t)));else return e}function Al(e,t){let r=wr(e),n=wr(t);if(e===t)return{valid:!0,data:e};else if(r===I.object&&n===I.object){let s=re.objectKeys(t),o=re.objectKeys(e).filter((a)=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Al(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===I.array&&n===I.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Al(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===I.date&&n===I.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Yw(e,t){return new In({values:e,typeName:K.ZodEnum,...Q(t)})}var Hw=(e,t)=>{if(An(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}}}},sF,oF,iF,aF,cF,uF,lF,dF,fF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ol,pF,hF,mF,gF,yF,_F,Bw="((\\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])))",vF,Sr,As,Ns,Xa,Ao,Ja,No,Io,Qa,Nn,xr,Za,lr,Ce,Po,Er=(e)=>{if(e instanceof jo)return Er(e.schema);else if(e instanceof fr)return Er(e.innerType());else if(e instanceof qo)return[e.value];else if(e instanceof In)return e.options;else if(e instanceof Do)return re.objectValues(e.enum);else if(e instanceof Mo)return Er(e._def.innerType);else if(e instanceof No)return[void 0];else if(e instanceof Io)return[null];else if(e instanceof dr)return[void 0,...Er(e.unwrap())];else if(e instanceof hn)return[null,...Er(e.unwrap())];else if(e instanceof Il)return Er(e.unwrap());else if(e instanceof Uo)return Er(e.unwrap());else if(e instanceof Lo)return Er(e._def.innerType);else return[]},Nl,Co,Rr,ec,tc,Is,Oo,jo,qo,In,Do,Ps,fr,dr,hn,Mo,Lo,rc,Y5,Il,nc,Uo,X5,K,v,fe,J5,Q5,Ue,Z5,e3,t3,r3,n3,s3,o3,i3,Ze,ne,a3,RF,Xw,c3,u3,kF,l3,d3,f3,p3,Pn,Ve,h3,m3,g3,y3,_3,v3,$3;var Jw=F(()=>{Ba();Wa();Kw();Tl();Ro();sF=/^c[^\s-]{8,}$/i,oF=/^[0-9a-z]+$/,iF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,aF=/^[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,cF=/^[a-z0-9_-]{21}$/i,uF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lF=/^[-+]?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)?)??$/,dF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pF=/^(?:(?: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])$/,hF=/^(?:(?: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])$/,mF=/^(([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]))$/,gF=/^(([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])$/,yF=/^([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}(=)?))?$/,vF=new RegExp(`^${Bw}$`);Sr=class Sr extends ee{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==I.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:I.string,received:s.parsedType}),G}let r=new Be,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,i=e.data.length<s.value;if(o||i){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(i)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(!dF.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(!Ol)Ol=new RegExp(fF,"u");if(!Ol.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(!aF.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(!cF.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(!sF.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(!oF.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(!iF.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(!bF(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(!vF.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(!$F(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(!lF.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(!wF(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(!EF(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(!SF(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(!yF.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 re.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)});As=class As extends ee{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)!==I.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:I.number,received:s.parsedType}),G}let r=void 0,n=new Be;for(let s of this._def.checks)if(s.kind==="int"){if(!re.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(xF(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 re.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 As({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new As({...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"&&re.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)}};As.create=(e)=>new As({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Ns=class Ns extends ee{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)!==I.bigint)return this._getInvalidInput(e);let r=void 0,n=new Be;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 re.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:I.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 Ns({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Ns({...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}};Ns.create=(e)=>new Ns({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Xa=class Xa extends ee{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==I.boolean){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.boolean,received:r.parsedType}),G}return Qe(e.data)}};Xa.create=(e)=>new Xa({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});Ao=class Ao extends ee{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==I.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:I.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 Be,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 re.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ao({...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}};Ao.create=(e)=>new Ao({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Ja=class Ja extends ee{_parse(e){if(this._getType(e)!==I.symbol){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.symbol,received:r.parsedType}),G}return Qe(e.data)}};Ja.create=(e)=>new Ja({typeName:K.ZodSymbol,...Q(e)});No=class No extends ee{_parse(e){if(this._getType(e)!==I.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.undefined,received:r.parsedType}),G}return Qe(e.data)}};No.create=(e)=>new No({typeName:K.ZodUndefined,...Q(e)});Io=class Io extends ee{_parse(e){if(this._getType(e)!==I.null){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.null,received:r.parsedType}),G}return Qe(e.data)}};Io.create=(e)=>new Io({typeName:K.ZodNull,...Q(e)});Qa=class Qa extends ee{constructor(){super(...arguments);this._any=!0}_parse(e){return Qe(e.data)}};Qa.create=(e)=>new Qa({typeName:K.ZodAny,...Q(e)});Nn=class Nn extends ee{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Qe(e.data)}};Nn.create=(e)=>new Nn({typeName:K.ZodUnknown,...Q(e)});xr=class xr extends ee{_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:E.invalid_type,expected:I.never,received:t.parsedType}),G}};xr.create=(e)=>new xr({typeName:K.ZodNever,...Q(e)});Za=class Za extends ee{_parse(e){if(this._getType(e)!==I.undefined){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.void,received:r.parsedType}),G}return Qe(e.data)}};Za.create=(e)=>new Za({typeName:K.ZodVoid,...Q(e)});lr=class lr extends ee{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==I.array)return T(t,{code:E.invalid_type,expected:I.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;if(o||i)T(t,{code:o?E.too_big:E.too_small,minimum:i?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,i)=>n.type._parseAsync(new Nt(t,o,t.path,i)))).then((o)=>Be.mergeArray(r,o));let s=[...t.data].map((o,i)=>n.type._parseSync(new Nt(t,o,t.path,i)));return Be.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new lr({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new lr({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new lr({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};lr.create=(e,t)=>new lr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ce=class Ce extends ee{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=re.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==I.object){let c=this._getOrReturnCtx(e);return T(c,{code:E.invalid_type,expected:I.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))i.push(c)}let a=[];for(let c of o){let u=s[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Nt(n,d,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 i)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(i.length>0)T(n,{code:E.unrecognized_keys,keys:i}),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 i){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Nt(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,l=await u.value;c.push({key:d,value:l,alwaysSet:u.alwaysSet})}return c}).then((c)=>Be.mergeObjectSync(r,c));else return Be.mergeObjectSync(r,a)}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 re.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 re.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}deepPartial(){return Os(this)}partial(e){let t={};for(let r of re.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 re.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof dr)s=s._def.innerType;t[r]=s}return new Ce({...this._def,shape:()=>t})}keyof(){return Yw(re.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)});Po=class Po extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let i of s)if(i.result.status==="valid")return i.result;for(let i of s)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map((i)=>new ft(i.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 a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!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 i=o.map((a)=>new ft(a));return T(t,{code:E.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};Po.create=(e,t)=>new Po({options:e,typeName:K.ZodUnion,...Q(t)});Nl=class Nl extends ee{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return T(t,{code:E.invalid_type,expected:I.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 i of o){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,s)}}return new Nl({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};Co=class Co extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(Rl(s)||Rl(o))return G;let i=Al(s.value,o.value);if(!i.valid)return T(r,{code:E.invalid_intersection_types}),G;if(kl(s)||kl(o))t.dirty();return{status:t.value,value:i.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}))}};Co.create=(e,t,r)=>new Co({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});Rr=class Rr extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.array)return T(r,{code:E.invalid_type,expected:I.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,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new Nt(r,o,r.path,i))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>Be.mergeArray(t,o));else return Be.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)})};ec=class ec extends ee{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!==I.object)return T(r,{code:E.invalid_type,expected:I.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let i in r.data)n.push({key:s._parse(new Nt(r,i,r.path,i)),value:o._parse(new Nt(r,r.data[i],r.path,i)),alwaysSet:i in r.data});if(r.common.async)return Be.mergeObjectAsync(t,n);else return Be.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof ee)return new ec({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new ec({keyType:Sr.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};tc=class tc extends ee{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!==I.map)return T(r,{code:E.invalid_type,expected:I.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([i,a],c)=>({key:n._parse(new Nt(r,i,r.path,[c,"key"])),value:s._parse(new Nt(r,a,r.path,[c,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of o){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of o){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}}}};tc.create=(e,t,r)=>new tc({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});Is=class Is extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.set)return T(r,{code:E.invalid_type,expected:I.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(a){let c=new Set;for(let u of a){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let i=[...r.data.values()].map((a,c)=>s._parse(new Nt(r,a,r.path,c)));if(r.common.async)return Promise.all(i).then((a)=>o(a));else return o(i)}min(e,t){return new Is({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new Is({...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)}};Is.create=(e,t)=>new Is({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends ee{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.function)return T(t,{code:E.invalid_type,expected:I.function,received:t.parsedType}),G;function r(i,a){return Ya({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ko(),pn].filter((c)=>!!c),issueData:{code:E.invalid_arguments,argumentsError:a}})}function n(i,a){return Ya({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ko(),pn].filter((c)=>!!c),issueData:{code:E.invalid_return_type,returnTypeError:a}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Ps){let i=this;return Qe(async function(...a){let c=new ft([]),u=await i._def.args.parseAsync(a,s).catch((p)=>{throw c.addIssue(r(a,p)),c}),d=await Reflect.apply(o,this,u);return await i._def.returns._def.type.parseAsync(d,s).catch((p)=>{throw c.addIssue(n(d,p)),c})})}else{let i=this;return Qe(function(...a){let c=i._def.args.safeParse(a,s);if(!c.success)throw new ft([r(a,c.error)]);let u=Reflect.apply(o,this,c.data),d=i._def.returns.safeParse(u,s);if(!d.success)throw new ft([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:Rr.create(e).rest(Nn.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(Nn.create()),returns:t||Nn.create(),typeName:K.ZodFunction,...Q(r)})}};jo=class jo extends ee{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})}};jo.create=(e,t)=>new jo({getter:e,typeName:K.ZodLazy,...Q(t)});qo=class qo extends ee{_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}};qo.create=(e,t)=>new qo({value:e,typeName:K.ZodLiteral,...Q(t)});In=class In extends ee{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return T(t,{expected:re.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 Qe(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 In.create(e,{...this._def,...t})}exclude(e,t=this._def){return In.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};In.create=Yw;Do=class Do extends ee{_parse(e){let t=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==I.string&&r.parsedType!==I.number){let n=re.objectValues(t);return T(r,{expected:re.joinValues(n),received:r.parsedType,code:E.invalid_type}),G}if(!this._cache)this._cache=new Set(re.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=re.objectValues(t);return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),G}return Qe(e.data)}get enum(){return this._def.values}};Do.create=(e,t)=>new Do({values:e,typeName:K.ZodNativeEnum,...Q(t)});Ps=class Ps extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return T(t,{code:E.invalid_type,expected:I.promise,received:t.parsedType}),G;let r=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return Qe(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ps.create=(e,t)=>new Ps({type:e,typeName:K.ZodPromise,...Q(t)});fr=class fr extends ee{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(i)=>{if(t.value==="aborted")return G;let a=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return Ts(a.value);if(t.value==="dirty")return Ts(a.value);return a});else{if(t.value==="aborted")return G;let i=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return Ts(i.value);if(t.value==="dirty")return Ts(i.value);return i}}if(n.type==="refinement"){let o=(i)=>{let a=n.refinement(i,s);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((i)=>{if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value).then(()=>({status:t.value,value:i.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(!An(o))return G;let i=n.transform(o.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!An(o))return G;return Promise.resolve(n.transform(o.value,s)).then((i)=>({status:t.value,value:i}))});re.assertNever(n)}};fr.create=(e,t,r)=>new fr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});fr.createWithPreprocess=(e,t,r)=>new fr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});dr=class dr extends ee{_parse(e){if(this._getType(e)===I.undefined)return Qe(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dr.create=(e,t)=>new dr({innerType:e,typeName:K.ZodOptional,...Q(t)});hn=class hn extends ee{_parse(e){if(this._getType(e)===I.null)return Qe(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)});Mo=class Mo extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===I.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Mo.create=(e,t)=>new Mo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Lo=class Lo extends ee{_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(To(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}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});rc=class rc extends ee{_parse(e){if(this._getType(e)!==I.nan){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:I.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};rc.create=(e)=>new rc({typeName:K.ZodNaN,...Q(e)});Y5=Symbol("zod_brand");Il=class Il extends ee{_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}};nc=class nc extends ee{_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(),Ts(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 nc({in:e,out:t,typeName:K.ZodPipeline})}};Uo=class Uo extends ee{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(An(n))n.value=Object.freeze(n.value);return n};return To(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodReadonly,...Q(t)});X5={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={}));v=Sr.create,fe=As.create,J5=rc.create,Q5=Ns.create,Ue=Xa.create,Z5=Ao.create,e3=Ja.create,t3=No.create,r3=Io.create,n3=Qa.create,s3=Nn.create,o3=xr.create,i3=Za.create,Ze=lr.create,ne=Ce.create,a3=Ce.strictCreate,RF=Po.create,Xw=Nl.create,c3=Co.create,u3=Rr.create,kF=ec.create,l3=tc.create,d3=Is.create,f3=Oo.create,p3=jo.create,Pn=qo.create,Ve=In.create,h3=Do.create,m3=Ps.create,g3=fr.create,y3=dr.create,_3=hn.create,v3=fr.createWithPreprocess,$3=nc.create});var Pl=F(()=>{Wa();Tl();Gw();Ro();Jw();Ba()});var jn=F(()=>{Pl();Pl()});function N3(e){return OF.includes(e)}var TF,qn,OF,I3,AF,Qw,NF,Zw,IF,PF,P3,CF,C3,j3,q3,D3,jF,eE,qF,tE,M3=20,L3=500,DF,U3;var sc=F(()=>{jn();TF=Ve(["pending","verified","approved","revoked"]),qn=Ve(["person","service","test"]),OF=qn.options;I3={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"},AF=Ve(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Qw=AF.options,NF=Ve(["active","pending","revoked"]),Zw=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),IF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),orcid:v().nullable().optional(),created_at:v().optional(),approved_at:v().nullable().optional(),dataset_count:fe().int().optional(),sandbox_completed:Ue().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),service_access:Ue().optional(),status:TF.optional(),email_verified:Ue().optional(),orcid_verified:Ue().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:Ze(Zw).optional(),username_auto_assigned:Ue().optional(),account_kind:qn.optional()}).passthrough(),PF=ne({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),P3=ne({user:IF,token:PF.optional()}).passthrough(),CF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),email_verified:fe().int().nullable().optional(),role:v().nullable(),created_at:v(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),signup_source:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),orcid:v().nullable().optional(),upload_access_requested_at:v().nullable().optional(),account_kind:qn.optional(),matched_in:Ze(v()).optional(),match_kind:v().optional()}).passthrough(),C3=ne({users:Ze(CF),count:fe().int()}).passthrough(),j3=Ve(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),q3=Ve(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),D3=ne({suggestion:v().nullable(),based_on:Ve(["name","unavailable","exhausted"])}).passthrough(),jF=Ve(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),eE=jF.options,qF=Ve(["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=qF.options,DF=ne({id:fe().int(),email:v(),username:v().nullable(),role:v(),status:NF,email_verified:Ue(),given_name:v().nullable(),family_name:v().nullable(),orcid:v().nullable(),orcid_verified:Ue(),github_username:v().nullable(),city:v().nullable(),country:v().nullable(),affiliation:v().nullable(),service_access:Ue(),service_access_granted_at:v().nullable(),upload_access_requested_at:v().nullable(),profile_gaps:Ze(Zw),username_auto_assigned:Ue()}).passthrough(),U3=ne({user:DF.nullable()}).passthrough()});function pr(e){if(e instanceof Error)return e.message;return String(e)}function V3(e){if(!(e instanceof hr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var hr,Cl;var jl=F(()=>{hr=class hr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;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 hr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function UF(){let e=new Map;for(let[t,r]of Object.entries($e)){for(let[n,s]of Object.entries(r))$e[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=$e[n],e.set(s[0],s[1]);Object.defineProperty($e,t,{value:r,enumerable:!1})}return Object.defineProperty($e,"codes",{value:e,enumerable:!1}),$e.color.close="\x1B[39m",$e.bgColor.close="\x1B[49m",$e.color.ansi=rE(),$e.color.ansi256=nE(),$e.color.ansi16m=sE(),$e.bgColor.ansi=rE(10),$e.bgColor.ansi256=nE(10),$e.bgColor.ansi16m=sE(10),Object.defineProperties($e,{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)=>$e.rgbToAnsi256(...$e.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 a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let i=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)i+=60;return i},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>$e.ansi256ToAnsi($e.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>$e.ansi256ToAnsi($e.hexToAnsi256(t)),enumerable:!1}}),$e}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`,$e,G3,MF,LF,K3,FF,It;var oE=F(()=>{$e={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]}},G3=Object.keys($e.modifier),MF=Object.keys($e.color),LF=Object.keys($e.bgColor),K3=[...MF,...LF];FF=UF(),It=FF});import ql from"process";import VF from"os";import iE from"tty";function St(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 zF(){if("FORCE_COLOR"in be){if(be.FORCE_COLOR==="true")return 1;if(be.FORCE_COLOR==="false")return 0;return be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}}function GF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function KF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=zF();if(n!==void 0)oc=n;let s=r?oc:n;if(s===0)return 0;if(r){if(St("color=16m")||St("color=full")||St("color=truecolor"))return 3;if(St("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(e&&!t&&s===void 0)return 0;let o=s||0;if(be.TERM==="dumb")return o;if(ql.platform==="win32"){let i=VF.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in be){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((i)=>(i in be)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((i)=>(i in be))||be.CI_NAME==="codeship")return 1;return o}if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor")return 3;if(be.TERM==="xterm-kitty")return 3;if(be.TERM==="xterm-ghostty")return 3;if(be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let i=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(be.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM))return 1;if("COLORTERM"in be)return 1;return o}function aE(e,t={}){let r=KF(e,{streamIsTTY:e&&e.isTTY,...t});return GF(r)}var be,oc,HF,cE;var uE=F(()=>{({env:be}=ql);if(St("no-color")||St("no-colors")||St("color=false")||St("color=never"))oc=0;else if(St("color")||St("colors")||St("color=true")||St("color=always"))oc=1;HF={stdout:aE({isTTY:iE.isatty(1)}),stderr:aE({isTTY:iE.isatty(2)})},cE=HF});function lE(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,i="";do i+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return i+=e.slice(o),i}function dE(e,t,r,n){let s=0,o="";do{let i=e[n-1]==="\r";o+=e.slice(s,i?n-1:n)+t+(i?`\r
|
|
19
19
|
`:`
|
|
20
20
|
`)+r,s=n+1,n=e.indexOf(`
|
|
21
|
-
`,s)}while(n!==-1);return o+=e.slice(s),o}function Vo(e){return
|
|
22
|
-
`);if(o!==-1)t=
|
|
23
|
-
`)}var
|
|
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 Vo(e){return WF(e)}var fE,pE,Ml,Cs,Fo,hE,js,BF=(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},WF=(e)=>{let t=(...r)=>r.join(" ");return BF(t,e),Object.setPrototypeOf(t,Vo.prototype),t},Ll=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return It[r].ansi16m(...n);if(t==="ansi256")return It[r].ansi256(It.rgbToAnsi256(...n));return It[r].ansi(It.rgbToAnsi(...n))}if(e==="hex")return Ll("rgb",t,r,...It.hexToRgb(...n));return It[r][e](...n)},YF,XF,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)=>JF(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,XF),n[Ml]=e,n[Cs]=t,n[Fo]=r,n},JF=(e,t)=>{if(e.level<=0||!t)return e[Fo]?"":t;let r=e[Cs];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},QF,tB,Pt;var Fl=F(()=>{oE();uE();({stdout:fE,stderr:pE}=cE),Ml=Symbol("GENERATOR"),Cs=Symbol("STYLER"),Fo=Symbol("IS_EMPTY"),hE=["ansi","ansi","ansi256","ansi16m"],js=Object.create(null);Object.setPrototypeOf(Vo.prototype,Function.prototype);for(let[e,t]of Object.entries(It))js[e]={get(){let r=ic(this,Ul(t.open,t.close,this[Cs]),this[Fo]);return Object.defineProperty(this,e,{value:r}),r}};js.visible={get(){let e=ic(this,this[Cs],!0);return Object.defineProperty(this,"visible",{value:e}),e}};YF=["rgb","hex","ansi256"];for(let e of YF){js[e]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,hE[r],"color",...n),It.color.close,this[Cs]);return ic(this,s,this[Fo])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);js[t]={get(){let{level:r}=this;return function(...n){let s=Ul(Ll(e,hE[r],"bgColor",...n),It.bgColor.close,this[Cs]);return ic(this,s,this[Fo])}}}}XF=Object.defineProperties(()=>{},{...js,level:{enumerable:!0,get(){return this[Ml].level},set(e){this[Ml].level=e}}});Object.defineProperties(Vo.prototype,js);QF=Vo(),tB=Vo({level:pE?pE.level:0}),Pt=QF});function nB(e){Vl=e}function ac(){return Vl}function qs(e){if(Vl)process.stderr.write(`${e}
|
|
23
|
+
`)}var Vl=!1;var{spawn:ZF}=globalThis.Bun;function zl(e,t=[]){let r=e.replace(eV,'("$1","<redacted>")');for(let n of t)if(n.length>=tV)r=r.split(n).join("<redacted>");return r}function nV(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 mE(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:i}=await r.read();if(o)break;if(i.byteLength===0)continue;t(),s+=n.decode(i,{stream:!0})}return s+n.decode()}async function gE(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=ZF({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??rV)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let d=ac()?[...nV(r),...t.redact??[]]:[];if(ac()){let y=t.cwd?` (cwd=${t.cwd})`:"";qs(Pt.dim(zl(`$ ${e.join(" ")}${y}`,d)))}let l=()=>{a=performance.now(),u()},p,f,h,m=n.exited.then((y)=>(c(),y));try{[p,f,h]=await Promise.all([mE(n.stdout,l),mE(n.stderr,l),m])}finally{if(c(),o)clearTimeout(o)}if(ac()){if(t.sensitiveOutput)qs(Pt.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())qs(Pt.dim(zl(p.trimEnd(),d)));if(f.trim())qs(Pt.yellow(zl(f.trimEnd(),d)))}qs(Pt.dim(`(exit ${h})`))}if(s)return{stdout:p,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:f,exitCode:h,timedOut:!1}}var eV,tV=8,rV=120000;var yE=F(()=>{Fl();eV=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function oV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function vE(e,t=oV()){return e.installInstructions[t]}function iV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function cV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:aV}async function $E(e){try{let{exitCode:t,stdout:r,timedOut:n}=await gE(e.cmd,{timeout:cV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:iV(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 $E(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:vE(r)}}))}async function lB(){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 dB(e){let r=sV[e].map((i)=>_E[i]).filter(Boolean),n=await Promise.all(r.map(async(i)=>{let a=await $E(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of n)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:vE(i.check)}));if(s.length===0)return;let o=[`
|
|
25
25
|
Missing required tools:`];for(let i of s)o.push(` ${i.tool} not installed`),o.push(` Install: ${i.installInstruction}`);throw Error(o.join(`
|
|
26
|
-
`))}var
|
|
27
|
-
`)}function
|
|
28
|
-
`)}async function
|
|
26
|
+
`))}var _E,sV,aV=4000;var bE=F(()=>{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)"}}},sV={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 wE=F(()=>{EE={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.38-dev.4706",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 cc;var Kl=F(()=>{wE();cc=EE.version});import{mkdirSync as lV,readdirSync as dV,unlinkSync as fV,writeFileSync as pV}from"fs";import{join as Hl}from"path";function wB(){Ds=!0}function dc(){return Ds}function EB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function SB(e){TE=e,mr(`Step: ${e}`)}function xB(){RE=!0}function RB(){return RE}function kB(){if(kE)return;Wl=!0}function TB(){Wl=!1,kE=!0}function OB(){return Wl}function mr(e){if(Ds)process.stderr.write(`[debug] ${e}
|
|
27
|
+
`)}function yV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=gV.has(r.toLowerCase())?"[REDACTED]":n;return t}function AE(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Bl(e,t,r=0){if(r>vV)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(OE,AE)}return t}function Yl(e){return e.replace($V,"Bearer [REDACTED]").replace(bV,"[REDACTED_AWS_KEY]").replace(wV,"$1[REDACTED]").replace(EV,"$1$2=[REDACTED]").replace(OE,AE)}function SV(e){return Yl(e)}function SE(e,t=mV){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 fc(e){if(!Ds)return;let t=SV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?yV(e.requestHeaders):void 0,requestBody:SE(e.requestBody),responseBody:SE(e.responseBody)};lc.push(r),mr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=pr(r);lc.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 xV(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${cc}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${pr(t)})`)}e.push(""),e.push("Active account:");try{let t=mn();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: ${pr(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: ${pr(t)})`)}return e}async function RV(){return(await xV()).join(`
|
|
28
|
+
`)}async function AB(){if(!Ds||uc!==void 0)return;try{uc=await RV()}catch(e){let t=pr(e);uc=`(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 kV(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 TV(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 OV(e){let t=[];for(let n of TV(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 AV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Yl(kV(e).join(" "))}`),r.push(""),r.push(uc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),lc.length===0)r.push(" (none)");else lc.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 NV(e,t){let r;try{r=dV(e).filter((s)=>s.startsWith("nemar-")&&s.endsWith(".log"))}catch(s){if(s.code!=="ENOENT")mr(`could not list ${e} for log rotation: ${pr(s)}`);return}r.sort();let n=r.length-t;for(let s=0;s<n;s++)try{fV(Hl(e,r[s]))}catch(o){if(o.code!=="ENOENT")mr(`could not remove old log ${r[s]}: ${pr(o)}`)}}function NB(){return zo}function IB(e,t){if(!Ds)return null;let r=Hl(Jl(),"logs");try{lV(r,{recursive:!0})}catch(i){return zo=pr(i),mr(`could not create log directory ${r}: ${zo}`),null}let s=`nemar-${new Date().toISOString().replace(/[:.]/g,"-")}-${OV(e)}.log`,o=Hl(r,s);try{pV(o,AV(e,t),"utf8")}catch(i){return zo=pr(i),mr(`could not write log file ${o}: ${zo}`),null}return NV(r,hV),o}var hV=10,mV=2048,Ds=!1,RE=!1,Wl=!1,kE=!1,TE,uc,lc,gV,_V,OE,vV=32,$V,bV,wV,EV,xE,zo;var Xl=F(()=>{jl();pc();bE();Kl();lc=[];gV=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,OE=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;$V=/Bearer\s+[A-Za-z0-9\-._~+/=]+/gi,bV=/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,wV=/((?:aws_)?secret_access_key["']?\s*[:=]\s*["']?)[A-Za-z0-9/+=]{20,}/gi,EV=/([?&])(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 IV,copyFileSync as PV,existsSync as Ql,mkdirSync as CV,statSync as jV}from"fs";import{homedir as hc}from"os";import{join as Ms}from"path";function DV(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||Ms(hc(),".config","nemar")}function LV(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Ms(e,"config.json");if(Ql(t))return;let r=[];if(process.platform==="darwin")r.push(Ms(hc(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Ms(hc(),"AppData","Roaming");r.push(Ms(n,"nemar-nodejs","config.json"))}r.push(Ms(hc(),".config","nemar-nodejs","config.json"));for(let n of r)if(Ql(n))try{CV(e,{recursive:!0}),PV(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=Xl();if(Go&&Pb===e)return Go;if(CV(e),Go=new Ka({projectName:"nemar",configFileMode:Ql,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}),Pb=e,!Nb.has(e))Nb.add(e),jV(Go.path),DV(),MV();return Go}function jV(e){if(process.platform==="win32")return;if(!Jl(e))return;try{if((AV(e).mode&511)!==Ql)TV(e,Ql)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function DV(){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 i of qV){let a=e.get(i);if(a!==void 0)o[i]=a}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function MV(){let e=St(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,i]of Object.entries(r)){let a=i?.apiUrl;if(!a)continue;if(PV.has(NV(a)))r[o]={...i,apiUrl:Ls},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${a} -> ${Ls}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...i}=t;try{e.store=i,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(a){console.error("API URL cleanup failed (config file unchanged):",a)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ko(){return St().get("activeAccount")}function mn(){return St().get("accounts")||{}}function hn(){let e={apiUrl:Ls},t=Ko();if(!t)return e;return mn()[t]||e}function PB(e,t){let r=St(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Ls};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function NB(e){let t=Ko();if(!t)return;let r=mn();if(r[t])delete r[t][e],St().set("accounts",r)}function IB(){let e=St(),t=Ko();if(!t){e.clear();return}let r=mn();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 CB(){St().clear()}function jB(){return!!hn().apiKey}function qB(){return St().path}function DB(){let e=mn(),t=Ko();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 MB(e){return e.username?.trim()||e.email}function LV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(mn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){pr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function LB(e,t){let r=St(),n=mn(),s;if(n[e])s=e;else if(t.email)s=LV(t.email);let o=s?n[s]:void 0,i={...o??{apiUrl:Ls},...t};if(s&&s!==e)delete n[s];return n[e]=i,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function UB(e){let t=e.trim();if(!t)return"unchanged";let r=St(),n=Ko();if(!n||n===t)return"unchanged";let s=mn(),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 FB(e){let t=St(),r=mn();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 Ls="https://nemar-api-dev.sccn-org.workers.dev",Ql=384,PV,IV,AB,Go=null,Pb=null,Nb,qV;var fc=F(()=>{Fw();jn();nc();Yl();PV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);IV=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),AB=ne({apiKey:v().optional(),apiUrl:v().url().default(Ls),username:v().optional(),email:v().email().optional(),githubUsername:v().optional(),sandboxCompleted:Ue().optional(),sandboxDatasetId:v().optional(),dismissedNoticeIds:Ze(fe()).optional(),serviceAccess:Ue().optional(),profileGaps:Ze(IV).optional(),orcidVerified:Ue().optional(),role:v().optional(),accountKind:qn.optional(),pendingEmailChange:v().email().optional()});Nb=new Set;qV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var UV,FV,KB,VV,HB,zV,Ib,BB,WB=8,YB=100,Cb,XB,GV,JB;var jb=F(()=>{jn();nc();UV=["given_name","family_name","affiliation","city","country"],FV=["username","github_username","email","orcid"],KB=[...UV,...FV],VV={given_name:v().max(200).optional(),family_name:v().max(200).optional(),affiliation:v().max(500).optional(),city:v().max(200).optional(),country:v().max(200).optional(),username:v().max(100).optional(),github_username:v().max(100).optional(),email:v().max(320).optional(),orcid:v().max(40).optional()},HB=ne(VV),zV=Ve(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),Ib=zV.options,BB=["exact","name","prefix","substring","fuzzy"],Cb=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),role:v().nullable(),account_kind:qn.optional(),email_verified:fe().int().nullable().optional(),orcid:v().nullable().optional(),orcid_verified:fe().int().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),affiliation:v().nullable().optional(),city:v().nullable().optional(),country:v().nullable().optional(),description:v().nullable().optional(),signup_source:v().nullable().optional(),created_at:v(),updated_at:v().nullable().optional(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),deleted_at:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),service_access_granted_by:fe().int().nullable().optional(),upload_access_requested_at:v().nullable().optional(),upload_access_notified_at:v().nullable().optional(),identity_conflict:fe().int().nullable().optional(),username_auto_assigned:fe().int().nullable().optional(),sandbox_completed:fe().int().nullable().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),aws_iam_username:v().nullable().optional(),dataset_count:fe().int().optional(),active_tokens:fe().int().optional(),linked_identities:Ze(v()).optional()}).passthrough(),XB=ne({user:Cb}).passthrough(),GV=ne({from:v().nullable(),to:v().nullable()}),JB=ne({message:v(),changed:wF(v(),GV),notes:Ze(v()).optional(),old_address_notified:Ue().optional(),user:Cb}).passthrough()});var e6=120,t6=64,r6="unnamed machine",KV=25,qb,n6,Us,Db,s6,o6,i6,HV,BV,a6,Zl,c6,u6,l6,d6,f6;var Mb=F(()=>{jn();qb=Ve(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),n6={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."},Us=Ve(["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"]),Db=Us.options,s6={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 ${KV} 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."},o6=ne({error:Us,message:v()}).passthrough(),i6=ne({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:fe().int(),interval:fe().int()}).passthrough(),HV=Yw("error",[ne({error:In("authorization_pending"),message:v()}).passthrough(),ne({error:In("slow_down"),message:v()}).passthrough()]),BV=Yw("error",[ne({error:In("expired_token"),reason:Us,message:v()}).passthrough(),ne({error:In("access_denied"),reason:Us,message:v()}).passthrough(),ne({error:In("invalid_grant"),reason:Us,message:v()}).passthrough()]),a6=EF([HV,BV]),Zl=ne({id:fe().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ue()}).passthrough(),c6=ne({api_key:v(),key:Zl,user:ne({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ue(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),u6=ne({user_code:v(),machine_name:v(),requested_at:v(),expires_in:fe().int(),account:ne({username:v().nullable(),email_masked:v()}).passthrough(),refusal:ne({code:Us,message:v()}).passthrough().nullable()}).passthrough(),l6=ne({ok:In(!0),machine_name:v()}).passthrough(),d6=ne({keys:Ze(Zl)}).passthrough(),f6=ne({api_key:v(),key:Zl}).passthrough()});var WV,Lb,Ho="https://nemar.org/settings",m6,YV,XV,JV,g6,y6;var Ub=F(()=>{jn();WV=Ve(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Lb=WV.options,m6={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, ${Ho}).`,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, ${Ho}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Ho}), 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, ${Ho}).`,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, ${Ho}).`,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."},YV=Ve(["orcid","email","github"]),XV=ne({id:fe().int(),username:v().nullable(),email:v(),created_at:v(),has_oauth_identity:Ue(),dataset_count:fe().int(),identity_conflict:fe().int(),canonical:Ue()}).passthrough(),JV=ne({kind:YV,value:v(),canonical_user_id:fe().int(),accounts:Ze(XV)}).passthrough(),g6=ne({groups:Ze(JV),group_count:fe().int(),flagged_count:fe().int()}).passthrough(),y6=ne({ok:In(!0),id:fe().int(),cleared:Ue()}).passthrough()});function b6(e){return typeof e==="string"&&ZV.includes(e)}var QV,$6,E6,w6,ZV,e9="ci_check_unavailable",Fb,Vb,zb,S6="X-Approval-Dispatch-Token",x6,R6="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 Gb=F(()=>{jn();QV=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,$6=v().regex(QV,"ORCID must be in format 0000-0000-0000-000X"),E6=Ve(["found","no_public_name","lookup_failed"]),w6=Ve(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),ZV=["bids_validation_pending","bids_validation_in_progress"];Fb=[e9],Vb=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],zb=["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"],x6=Ve(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});function Hb(e){if(Kb)return;Kb=!0;let t=Nt.yellow("\u2500".repeat(60)),r=Nt.yellow.bold("[MAINTENANCE]"),n=Nt.dim(`mode: ${e.mode}`),s=e.eta?`
|
|
33
|
-
|
|
32
|
+
[nemar] You can manually copy ${n} to ${t}`)}}function xt(){let e=Jl();if(Go&&IE===e)return Go;if(LV(e),Go=new Ha({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}),IE=e,!PE.has(e))PE.add(e),UV(Go.path),VV(),zV();return Go}function UV(e){if(process.platform==="win32")return;if(!Ql(e))return;try{if((jV(e).mode&511)!==Zl)IV(e,Zl)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function VV(){let e=xt(),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 i of FV){let a=e.get(i);if(a!==void 0)o[i]=a}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function zV(){let e=xt(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,i]of Object.entries(r)){let a=i?.apiUrl;if(!a)continue;if(qV.has(DV(a)))r[o]={...i,apiUrl:Ls},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${a} -> ${Ls}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...i}=t;try{e.store=i,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(a){console.error("API URL cleanup failed (config file unchanged):",a)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ko(){return xt().get("activeAccount")}function gn(){return xt().get("accounts")||{}}function mn(){let e={apiUrl:Ls},t=Ko();if(!t)return e;return gn()[t]||e}function VB(e,t){let r=xt(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Ls};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function zB(e){let t=Ko();if(!t)return;let r=gn();if(r[t])delete r[t][e],xt().set("accounts",r)}function GB(){let e=xt(),t=Ko();if(!t){e.clear();return}let r=gn();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 KB(){xt().clear()}function HB(){return!!mn().apiKey}function BB(){return xt().path}function WB(){let e=gn(),t=Ko();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 YB(e){return e.username?.trim()||e.email}function GV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(gn()).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 XB(e,t){let r=xt(),n=gn(),s;if(n[e])s=e;else if(t.email)s=GV(t.email);let o=s?n[s]:void 0,i={...o??{apiUrl:Ls},...t};if(s&&s!==e)delete n[s];return n[e]=i,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function JB(e){let t=e.trim();if(!t)return"unchanged";let r=xt(),n=Ko();if(!n||n===t)return"unchanged";let s=gn(),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 QB(e){let t=xt(),r=gn();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 Ls="https://nemar-api-dev.sccn-org.workers.dev",Zl=384,qV,MV,FB,Go=null,IE=null,PE,FV;var pc=F(()=>{Vw();jn();sc();Xl();qV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);MV=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),FB=ne({apiKey:v().optional(),apiUrl:v().url().default(Ls),username:v().optional(),email:v().email().optional(),githubUsername:v().optional(),sandboxCompleted:Ue().optional(),sandboxDatasetId:v().optional(),dismissedNoticeIds:Ze(fe()).optional(),serviceAccess:Ue().optional(),profileGaps:Ze(MV).optional(),orcidVerified:Ue().optional(),role:v().optional(),accountKind:qn.optional(),pendingEmailChange:v().email().optional()});PE=new Set;FV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var KV,HV,r6,BV,n6,WV,CE,s6,o6=8,i6=100,jE,a6,YV,c6;var qE=F(()=>{jn();sc();KV=["given_name","family_name","affiliation","city","country"],HV=["username","github_username","email","orcid"],r6=[...KV,...HV],BV={given_name:v().max(200).optional(),family_name:v().max(200).optional(),affiliation:v().max(500).optional(),city:v().max(200).optional(),country:v().max(200).optional(),username:v().max(100).optional(),github_username:v().max(100).optional(),email:v().max(320).optional(),orcid:v().max(40).optional()},n6=ne(BV),WV=Ve(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),CE=WV.options,s6=["exact","name","prefix","substring","fuzzy"],jE=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),role:v().nullable(),account_kind:qn.optional(),email_verified:fe().int().nullable().optional(),orcid:v().nullable().optional(),orcid_verified:fe().int().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),affiliation:v().nullable().optional(),city:v().nullable().optional(),country:v().nullable().optional(),description:v().nullable().optional(),signup_source:v().nullable().optional(),created_at:v(),updated_at:v().nullable().optional(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),deleted_at:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),service_access_granted_by:fe().int().nullable().optional(),upload_access_requested_at:v().nullable().optional(),upload_access_notified_at:v().nullable().optional(),identity_conflict:fe().int().nullable().optional(),username_auto_assigned:fe().int().nullable().optional(),sandbox_completed:fe().int().nullable().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),aws_iam_username:v().nullable().optional(),dataset_count:fe().int().optional(),active_tokens:fe().int().optional(),linked_identities:Ze(v()).optional()}).passthrough(),a6=ne({user:jE}).passthrough(),YV=ne({from:v().nullable(),to:v().nullable()}),c6=ne({message:v(),changed:kF(v(),YV),notes:Ze(v()).optional(),old_address_notified:Ue().optional(),user:jE}).passthrough()});var d6=120,f6=64,p6="unnamed machine",XV=25,DE,h6,Us,ME,m6,g6,y6,JV,QV,_6,ed,v6,$6,b6,w6,E6;var LE=F(()=>{jn();DE=Ve(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),h6={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."},Us=Ve(["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"]),ME=Us.options,m6={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 ${XV} 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."},g6=ne({error:Us,message:v()}).passthrough(),y6=ne({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:fe().int(),interval:fe().int()}).passthrough(),JV=Xw("error",[ne({error:Pn("authorization_pending"),message:v()}).passthrough(),ne({error:Pn("slow_down"),message:v()}).passthrough()]),QV=Xw("error",[ne({error:Pn("expired_token"),reason:Us,message:v()}).passthrough(),ne({error:Pn("access_denied"),reason:Us,message:v()}).passthrough(),ne({error:Pn("invalid_grant"),reason:Us,message:v()}).passthrough()]),_6=RF([JV,QV]),ed=ne({id:fe().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ue()}).passthrough(),v6=ne({api_key:v(),key:ed,user:ne({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ue(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),$6=ne({user_code:v(),machine_name:v(),requested_at:v(),expires_in:fe().int(),account:ne({username:v().nullable(),email_masked:v()}).passthrough(),refusal:ne({code:Us,message:v()}).passthrough().nullable()}).passthrough(),b6=ne({ok:Pn(!0),machine_name:v()}).passthrough(),w6=ne({keys:Ze(ed)}).passthrough(),E6=ne({api_key:v(),key:ed}).passthrough()});var ZV,UE,Ho="https://nemar.org/settings",R6,e9,t9,r9,k6,T6;var FE=F(()=>{jn();ZV=Ve(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),UE=ZV.options,R6={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, ${Ho}).`,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, ${Ho}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Ho}), 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, ${Ho}).`,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, ${Ho}).`,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."},e9=Ve(["orcid","email","github"]),t9=ne({id:fe().int(),username:v().nullable(),email:v(),created_at:v(),has_oauth_identity:Ue(),dataset_count:fe().int(),identity_conflict:fe().int(),canonical:Ue()}).passthrough(),r9=ne({kind:e9,value:v(),canonical_user_id:fe().int(),accounts:Ze(t9)}).passthrough(),k6=ne({groups:Ze(r9),group_count:fe().int(),flagged_count:fe().int()}).passthrough(),T6=ne({ok:Pn(!0),id:fe().int(),cleared:Ue()}).passthrough()});function A6(e){return Bo[e]}function N6(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>Object.hasOwn(t,n)?t[n]:r)}var Bo;var VE=F(()=>{Bo={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","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.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"&&n9.includes(e)}function q6(e){return typeof e==="string"&&zE.includes(e)}function D6(e){return Bo[`mail.category.${e}.label`]}function M6(e){return Bo[`mail.category.${e}.description`]}function L6(){return Bo["mail.recall.why"]}function o9(e){return e.replace(/\r\n?/g,`
|
|
33
|
+
`).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function i9(e){let t=/^(#{1,3})\s+(.+)$/.exec(e);if(!t)return null;return{level:t[1].length,text:t[2]}}function U6(e){let t=new Set(o9(e).map((r)=>i9(r)?.text.trim().toLowerCase()).filter((r)=>Boolean(r)));return s9.filter((r)=>!t.has(r.toLowerCase()))}function F6(e){let t=e.trim(),r=a9.exec(t);if(r)return{kind:"dataset",datasetId:r[1],version:r[2]??null,text:t};if(c9.test(t))return{kind:"github",url:t,text:t};return null}var zE,n9,C6="recall",GE,s9,a9,c9,V6="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 KE=F(()=>{VE();zE=["news","rfcs","maintenance"],n9=[...zE,"recall"];GE=["recall_cannot_be_turned_off","admin_alert_not_self_service","unknown_mail_preference","invalid_mail_preference"];s9=["What is affected","What to do"];a9=/^([a-z]{2}\d{6})(?:@v?(\d+\.\d+\.\d+))?$/,c9=/^https:\/\/github\.com\/(?:nemarOrg|nemarDatasets)\/[A-Za-z0-9._-]+\/(?:(?:issues|pull)\/\d{1,9}|security\/advisories\/GHSA(?:-[a-z0-9]{4}){3})$/});function W6(e){return typeof e==="string"&&l9.includes(e)}var u9,K6,H6,B6,l9,d9="ci_check_unavailable",HE,BE,WE,Y6="X-Approval-Dispatch-Token",X6,J6="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 YE=F(()=>{jn();u9=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,K6=v().regex(u9,"ORCID must be in format 0000-0000-0000-000X"),H6=Ve(["found","no_public_name","lookup_failed"]),B6=Ve(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),l9=["bids_validation_pending","bids_validation_in_progress"];HE=[d9],BE=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],WE=["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"],X6=Ve(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});function JE(e){if(XE)return;XE=!0;let t=Pt.yellow("\u2500".repeat(60)),r=Pt.yellow.bold("[MAINTENANCE]"),n=Pt.dim(`mode: ${e.mode}`),s=e.eta?`
|
|
34
|
+
${Pt.dim(`eta: ${e.eta}`)}`:"";process.stderr.write(`${t}
|
|
34
35
|
${r} ${e.message}
|
|
35
36
|
${n}${s}
|
|
36
37
|
${t}
|
|
37
|
-
`)}var Kb=!1;var Bb=F(()=>{Ul()});function Wb(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(td)return ed;return hn().apiUrl||ed}async function U6(e,t={},r=!1,n){let s=`${Wb()}${e}`,o={"Content-Type":"application/json","X-CLI-Version":ac,...t.headers};if(r){let p=hn();if(!p.apiKey&&r===!0)throw new fr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)o.Authorization=`Bearer ${p.apiKey}`}let i=t.method||"GET",a=typeof t.body==="string"?t.body:void 0,c=Date.now(),u;try{u=await fetch(s,{...t,headers:o})}catch(p){if(lc())dc({method:i,url:s,status:null,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new fr(0,`Network error: Could not connect to ${Wb()}`,{originalError:p instanceof Error?p.message:String(p)})}let d;try{d=await u.text()}catch(p){if(lc())dc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new fr(0,"Failed to read response body",{httpStatus:u.status,originalError:p instanceof Error?p.message:String(p)})}if(lc())dc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,responseBody:d});let l;try{l=JSON.parse(d)}catch{throw new fr(u.status,`Invalid response from server (status ${u.status})`)}if(!u.ok){if(u.status===503&&(l.mode==="read-only"||l.mode==="full")){let xt=typeof l.message==="string"?l.message:"NEMAR is in maintenance mode. Please retry shortly.",hr=typeof l.eta==="string"?l.eta:null,et=new Il(l.mode,xt,hr,l.details);throw Hb(et),et}let p=typeof l.block_reason==="string",f=Array.isArray(l.missing)?l.missing.filter((xt)=>typeof xt==="string"):void 0,h=typeof l.error==="string"&&(eb.includes(l.error)||Lb.includes(l.error)),m=typeof l.error==="string"&&(qb.options.includes(l.error)||Db.includes(l.error)),y=typeof l.error==="string"&&Jw.includes(l.error),_=typeof l.error==="string"&&Ib.includes(l.error),O=typeof l.error==="string"&&Vb.includes(l.error),T=typeof l.error==="string"&&Fb.includes(l.error),M=typeof l.error==="string"&&zb.includes(l.error),_e=p||T||M||h||m||y||_||O||f!==void 0&&typeof l.error==="string"&&Zw.includes(l.error)?l.message||l.error:l.error||l.message;if(u.status===404&&l.error==="Not Found"&&typeof l.message==="string")_e=`${l.message}. This NEMAR backend does not support this command yet.`;let ve=new fr(u.status,_e||"Request failed",l.details,typeof l.step==="string"?l.step:void 0,p?l.block_reason:void 0,f);if(typeof l.error==="string")ve.code=l.error;if(typeof l.reason==="string")ve.reason=l.reason;throw ve.rawBody=l,ve}if(n){let p=n.safeParse(l);if(!p.success)throw new fr(u.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return l}var ed="https://nemar-api-dev.sccn-org.workers.dev",td;var Yb=F(()=>{jb();Mb();Ub();Gb();nc();fc();Yl();Bb();Gl();Cl();td=ed.includes("workers.dev")});fc();import{open as c9,rm as u9}from"fs/promises";Yb();var Xb="NEMAR_DATA_HOSTS",t9="NEMAR_DATA_HOSTS_ONLY",r9="https://private.nemar.org",n9="https://private-test.nemar.org",s9=/^[a-z]{2,3}[0-9]{6}$/;function Jb(e){return s9.test(e)}function o9(e){return e}function Qb(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function Zb(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:"&&Qb(r.hostname))return r.origin;return null}function eS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=Zb(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function tS(e){return e.env??process.env}function i9(e={}){let t=tS(e),r=e.isDevBuild??td,n=t[t9]==="1"?[]:[r?n9:r9],{origins:s}=eS(t[Xb]);return[...n,...s.filter((o)=>!n.includes(o))].map(o9)}function z6(e={}){return eS(tS(e)[Xb]).rejected}function hc(e,t={}){let r=Zb(e);if(r===null)return null;return i9(t).find((n)=>n===r)??null}function rS(e,t={}){return hc(e,t)!==null}function G6(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return hc(r.origin,t)}function nS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&Qb(e.hostname)&&new URL(t).protocol==="http:"}var a9="NEMAR_DATA_HOST_TIMEOUT_MS";function rd(e,t=process.env){let r=t[a9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function nd(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 sS=3,iS=60000,l9=262144,aS=255,cS=/^[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 uS(e){return e.length<=aS&&cS.test(e)}function d9(e){if(e.length>aS)return null;let t=cS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function f9(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(!Jb(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=hc(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 p9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function lS(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 dS(e,t,r,n,s,o){if(!rS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let i=p9(e,t),a=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(i.origin===e.origin)u.Authorization=`Bearer ${r}`;let d;try{d=await fetch(i,{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 (${nd(f)}).`}}if(d.status<300||d.status>=400)return{kind:"response",response:d,redirected:a};if(await d.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:d,redirected:a};if(c>=sS)return{kind:"failed",message:`More than ${sS} redirects.`};let l=d.headers.get("location");if(!l)return{kind:"failed",message:"A redirect named no address."};let p;try{p=new URL(l,i)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!nS(p,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};i=p,a=!0}}async function fS(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 h9(e,t,r,n,s){if(!uS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=d9(t);return fS(rd(iS,e.options?.env),async(i,a)=>{let c=await dS(e,t,r,"GET",!0,i);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:d}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:lS(u.status,d)};let l=u.headers.get("content-length");if(o!==null&&l!==null&&Number(l)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${It(l,20)} bytes but its key says ${o}.`};a();let p,f=0,h=0;try{p=await c9(n,"w");let m=u.body.getReader();while(!0){let{done:y,value:_}=await m.read();if(y)break;if(a(),f+=_.byteLength,o!==null&&f>o)throw await m.cancel().catch(()=>{}),new mc(`More bytes arrived than the key's ${o}.`);if(await p.write(_),f-h>=l9)h=f,s(f)}if(await p.close(),p=void 0,o!==null&&f!==o)throw new mc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==h)s(f);return{ok:!0,bytes:f}}catch(m){if(await p?.close().catch(()=>{}),await u9(n,{force:!0}).catch(()=>{}),m instanceof mc)return{ok:!1,message:m.message};if(i.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${nd(m)}).`}}})}class mc extends Error{constructor(e){super(e);this.name="SizeError"}}async function m9(e,t,r){if(!uS(t))return{state:"unknown",message:"The key is not one a data host serves."};return fS(rd(iS,e.options?.env),async(n)=>{let s=await dS(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:lS(o,!1)}})}class gc extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function pS(e,t){let r=e.lines[Symbol.asyncIterator](),n=[],s=null,o=null,i=async()=>{let d=n.shift();if(d!==void 0)return d;let l=await r.next();return l.done?null:l.value},a=async(d)=>{await e.send(`GETCONFIG ${d}`);while(!0){let l=await r.next();if(l.done)throw new gc("git-annex closed the connection");let p=l.value;if(p==="VALUE"||p.startsWith("VALUE ")){let f=p.slice(5).trimStart();return f===""?void 0:f}if(p.startsWith("ERROR"))throw new gc(p);n.push(p)}},c=async()=>{let d=await a("host"),l=await a("dataset");return f9(d,l,t.options)},u=async(d,l)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${It(d)} The remote has not been prepared.`);return}let p=Promise.resolve(),f=await h9(s,d,o,l,(h)=>{p=p.then(()=>e.send(`PROGRESS ${h}`))});if(await p,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${d}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${It(d)} ${It(f.message)}`)};await e.send("VERSION 1");while(!0){let d=await i();if(d===null)return 0;if(d.trim()==="")continue;let[l,...p]=oS(d,1),f=p[0]??"";try{switch(l){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let h=await c();await e.send(h.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${It(h.message)}`);break}case"PREPARE":{let h=await c();if(!h.ok){s=null,await e.send(`PREPARE-FAILURE ${It(h.message)}`);break}let m=t.loadApiKey();if(!m){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=h.settings,o=m,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[h,m,...y]=oS(f,2);if(h==="STORE")await e.send(`TRANSFER-FAILURE STORE ${It(m??"")} This remote is read-only for now.`);else if(h==="RETRIEVE"&&m&&y[0])await u(m,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 h=await m9(s,f,o);if(h.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(h.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} ${h.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(h){if(h instanceof gc)return 1;throw h}}}function oS(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*g9(){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 XE=!1;var QE=F(()=>{Fl()});function ZE(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(rd)return td;return mn().apiUrl||td}async function fW(e,t={},r=!1,n){let s=`${ZE()}${e}`,o={"Content-Type":"application/json","X-CLI-Version":cc,...t.headers};if(r){let p=mn();if(!p.apiKey&&r===!0)throw new hr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)o.Authorization=`Bearer ${p.apiKey}`}let i=t.method||"GET",a=typeof t.body==="string"?t.body:void 0,c=Date.now(),u;try{u=await fetch(s,{...t,headers:o})}catch(p){if(dc())fc({method:i,url:s,status:null,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new hr(0,`Network error: Could not connect to ${ZE()}`,{originalError:p instanceof Error?p.message:String(p)})}let d;try{d=await u.text()}catch(p){if(dc())fc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new hr(0,"Failed to read response body",{httpStatus:u.status,originalError:p instanceof Error?p.message:String(p)})}if(dc())fc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,responseBody:d});let l;try{l=JSON.parse(d)}catch{throw new hr(u.status,`Invalid response from server (status ${u.status})`)}if(!u.ok){if(u.status===503&&(l.mode==="read-only"||l.mode==="full")){let Rt=typeof l.message==="string"?l.message:"NEMAR is in maintenance mode. Please retry shortly.",lt=typeof l.eta==="string"?l.eta:null,jt=new Cl(l.mode,Rt,lt,l.details);throw JE(jt),jt}let p=typeof l.block_reason==="string",f=Array.isArray(l.missing)?l.missing.filter((Rt)=>typeof Rt==="string"):void 0,h=typeof l.error==="string"&&(tE.includes(l.error)||UE.includes(l.error)),m=typeof l.error==="string"&&(DE.options.includes(l.error)||ME.includes(l.error)),y=typeof l.error==="string"&&Qw.includes(l.error),_=typeof l.error==="string"&&CE.includes(l.error),O=typeof l.error==="string"&&BE.includes(l.error),k=typeof l.error==="string"&&HE.includes(l.error),M=typeof l.error==="string"&&WE.includes(l.error),S=typeof l.error==="string"&&GE.includes(l.error),Se=p||S||k||M||h||m||y||_||O||f!==void 0&&typeof l.error==="string"&&eE.includes(l.error)?l.message||l.error:l.error||l.message;if(u.status===404&&l.error==="Not Found"&&typeof l.message==="string")Se=`${l.message}. This NEMAR backend does not support this command yet.`;let pt=new hr(u.status,Se||"Request failed",l.details,typeof l.step==="string"?l.step:void 0,p?l.block_reason:void 0,f);if(typeof l.error==="string")pt.code=l.error;if(typeof l.reason==="string")pt.reason=l.reason;throw pt.rawBody=l,pt}if(n){let p=n.safeParse(l);if(!p.success)throw new hr(u.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return l}var td="https://nemar-api-dev.sccn-org.workers.dev",rd;var eS=F(()=>{qE();LE();FE();KE();YE();sc();pc();Xl();QE();Kl();jl();rd=td.includes("workers.dev")});pc();import{open as v9,rm as $9}from"fs/promises";eS();var tS="NEMAR_DATA_HOSTS",f9="NEMAR_DATA_HOSTS_ONLY",p9="https://private.nemar.org",h9="https://private-test.nemar.org",m9=/^[a-z]{2,3}[0-9]{6}$/;function rS(e){return m9.test(e)}function g9(e){return e}function nS(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function sS(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:"&&nS(r.hostname))return r.origin;return null}function oS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=sS(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function iS(e){return e.env??process.env}function y9(e={}){let t=iS(e),r=e.isDevBuild??rd,n=t[f9]==="1"?[]:[r?h9:p9],{origins:s}=oS(t[tS]);return[...n,...s.filter((o)=>!n.includes(o))].map(g9)}function mW(e={}){return oS(iS(e)[tS]).rejected}function mc(e,t={}){let r=sS(e);if(r===null)return null;return y9(t).find((n)=>n===r)??null}function aS(e,t={}){return mc(e,t)!==null}function gW(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return mc(r.origin,t)}function cS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&nS(e.hostname)&&new URL(t).protocol==="http:"}var _9="NEMAR_DATA_HOST_TIMEOUT_MS";function nd(e,t=process.env){let r=t[_9];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 uS=3,dS=60000,b9=262144,fS=255,pS=/^[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 hS(e){return e.length<=fS&&pS.test(e)}function w9(e){if(e.length>fS)return null;let t=pS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function E9(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(!rS(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=mc(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 S9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function mS(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 gS(e,t,r,n,s,o){if(!aS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let i=S9(e,t),a=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(i.origin===e.origin)u.Authorization=`Bearer ${r}`;let d;try{d=await fetch(i,{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(d.status<300||d.status>=400)return{kind:"response",response:d,redirected:a};if(await d.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:d,redirected:a};if(c>=uS)return{kind:"failed",message:`More than ${uS} redirects.`};let l=d.headers.get("location");if(!l)return{kind:"failed",message:"A redirect named no address."};let p;try{p=new URL(l,i)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!cS(p,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};i=p,a=!0}}async function yS(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 x9(e,t,r,n,s){if(!hS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=w9(t);return yS(nd(dS,e.options?.env),async(i,a)=>{let c=await gS(e,t,r,"GET",!0,i);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:d}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:mS(u.status,d)};let l=u.headers.get("content-length");if(o!==null&&l!==null&&Number(l)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${Ct(l,20)} bytes but its key says ${o}.`};a();let p,f=0,h=0;try{p=await v9(n,"w");let m=u.body.getReader();while(!0){let{done:y,value:_}=await m.read();if(y)break;if(a(),f+=_.byteLength,o!==null&&f>o)throw await m.cancel().catch(()=>{}),new gc(`More bytes arrived than the key's ${o}.`);if(await p.write(_),f-h>=b9)h=f,s(f)}if(await p.close(),p=void 0,o!==null&&f!==o)throw new gc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==h)s(f);return{ok:!0,bytes:f}}catch(m){if(await p?.close().catch(()=>{}),await $9(n,{force:!0}).catch(()=>{}),m instanceof gc)return{ok:!1,message:m.message};if(i.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${sd(m)}).`}}})}class gc extends Error{constructor(e){super(e);this.name="SizeError"}}async function R9(e,t,r){if(!hS(t))return{state:"unknown",message:"The key is not one a data host serves."};return yS(nd(dS,e.options?.env),async(n)=>{let s=await gS(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:mS(o,!1)}})}class yc 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,i=async()=>{let d=n.shift();if(d!==void 0)return d;let l=await r.next();return l.done?null:l.value},a=async(d)=>{await e.send(`GETCONFIG ${d}`);while(!0){let l=await r.next();if(l.done)throw new yc("git-annex closed the connection");let p=l.value;if(p==="VALUE"||p.startsWith("VALUE ")){let f=p.slice(5).trimStart();return f===""?void 0:f}if(p.startsWith("ERROR"))throw new yc(p);n.push(p)}},c=async()=>{let d=await a("host"),l=await a("dataset");return E9(d,l,t.options)},u=async(d,l)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${Ct(d)} The remote has not been prepared.`);return}let p=Promise.resolve(),f=await x9(s,d,o,l,(h)=>{p=p.then(()=>e.send(`PROGRESS ${h}`))});if(await p,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${d}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${Ct(d)} ${Ct(f.message)}`)};await e.send("VERSION 1");while(!0){let d=await i();if(d===null)return 0;if(d.trim()==="")continue;let[l,...p]=lS(d,1),f=p[0]??"";try{switch(l){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let h=await c();await e.send(h.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${Ct(h.message)}`);break}case"PREPARE":{let h=await c();if(!h.ok){s=null,await e.send(`PREPARE-FAILURE ${Ct(h.message)}`);break}let m=t.loadApiKey();if(!m){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=h.settings,o=m,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[h,m,...y]=lS(f,2);if(h==="STORE")await e.send(`TRANSFER-FAILURE STORE ${Ct(m??"")} This remote is read-only for now.`);else if(h==="RETRIEVE"&&m&&y[0])await u(m,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 h=await R9(s,f,o);if(h.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(h.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${Ct(f)} ${h.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(h){if(h instanceof yc)return 1;throw h}}}function lS(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*k9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
|
|
38
39
|
`);while(n>=0)yield t.slice(0,n).replace(/\r$/,""),t=t.slice(n+1),n=t.indexOf(`
|
|
39
|
-
`)}if(t+=e.decode(),t!=="")yield t}var
|
|
40
|
-
`),await
|
|
40
|
+
`)}if(t+=e.decode(),t!=="")yield t}var od=Bun.stdout.writer(),T9=await _S({lines:k9(),send:async(e)=>{od.write(`${e}
|
|
41
|
+
`),await od.flush()}},{loadApiKey:()=>mn().apiKey||void 0});await od.end();process.exit(T9);
|