@codions/portta 0.1.0 → 0.2.0
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 +41 -88
- package/dist/assets/agents/hook.sh.tmpl +21 -0
- package/dist/assets/agents/instruction.md +8 -0
- package/dist/assets/agents/portta-context.ts.tmpl +24 -0
- package/dist/assets/skills/portta-adopt-compose/SKILL.md +220 -0
- package/dist/assets/skills/portta-dockerize/SKILL.md +118 -0
- package/dist/assets/skills/portta-host-context/SKILL.md +142 -0
- package/dist/cli.js +1542 -1017
- package/dist/documentation.json.gz +0 -0
- package/dist/runtime/.env.example +6 -42
- package/dist/runtime/VERSION +1 -1
- package/dist/runtime/docker/compose/features/web-dev.yaml +0 -2
- package/dist/runtime/docker/compose/features/web.yaml +0 -8
- package/dist/runtime/templates/README.md +3 -3
- package/dist/runtime/templates/overlays/06-monorepo.yaml +0 -7
- package/dist/runtime/templates/overlays/07-worktree.env +0 -1
- package/dist/runtime/templates/project/PORTTA.md +8 -7
- package/package.json +4 -15
- package/dist/acp-providers-M3DUUBYJ.js +0 -3
- package/dist/arktype-aI7TBD0R-SOJGD3SZ.js +0 -3
- package/dist/assets/skills/portta-workflows/SKILL.md +0 -285
- package/dist/assets/workflows/bake-off.workflow.js +0 -172
- package/dist/assets/workflows/code-review.workflow.js +0 -179
- package/dist/assets/workflows/deep-research.workflow.js +0 -223
- package/dist/assets/workflows/multi-provider-review.workflow.js +0 -169
- package/dist/assets/workflows/provider-debate.workflow.js +0 -141
- package/dist/assets/workflows/second-opinion.workflow.js +0 -176
- package/dist/chunk-3EZNE4MC.js +0 -6
- package/dist/chunk-4TGTGGMK.js +0 -4
- package/dist/chunk-4YGEG6YX.js +0 -1878
- package/dist/chunk-5SBYE3YH.js +0 -26
- package/dist/chunk-6J5HN4ZN.js +0 -3
- package/dist/chunk-6TV2V7RR.js +0 -3
- package/dist/chunk-CFWGQ7VJ.js +0 -19
- package/dist/chunk-EFZZFIRZ.js +0 -3
- package/dist/chunk-EH7H7D7J.js +0 -15
- package/dist/chunk-EYT7VTYA.js +0 -4
- package/dist/chunk-FRQCKCCK.js +0 -332
- package/dist/chunk-GI2EUNAK.js +0 -16
- package/dist/chunk-HB5T7XDN.js +0 -5
- package/dist/chunk-IILMQFWO.js +0 -14
- package/dist/chunk-LAYNTFDR.js +0 -70
- package/dist/chunk-MH5YJA5O.js +0 -2
- package/dist/chunk-O6U47HHQ.js +0 -341
- package/dist/chunk-OPVZAG2C.js +0 -10
- package/dist/chunk-PTKKSRMI.js +0 -223
- package/dist/chunk-Q3VNQ3LU.js +0 -3
- package/dist/chunk-QBKADN76.js +0 -4
- package/dist/chunk-QS5PHDYT.js +0 -240
- package/dist/chunk-SBVO6RXF.js +0 -87
- package/dist/chunk-T3TSZO4I.js +0 -7
- package/dist/chunk-TA2XHP5D.js +0 -4
- package/dist/chunk-UUSUJUAD.js +0 -7
- package/dist/chunk-UX7P3YHF.js +0 -3
- package/dist/chunk-VDSWNWUY.js +0 -168
- package/dist/chunk-WNZR7VOO.js +0 -145
- package/dist/chunk-YYSFNLBX.js +0 -5
- package/dist/cli-O2MMC25H.js +0 -98
- package/dist/completions-F4476JAU.js +0 -12
- package/dist/config-E5XLLPKE.js +0 -3
- package/dist/core-FSKGFGJO.js +0 -18
- package/dist/default-u_dwuiYb-OWTONHM6.js +0 -3
- package/dist/dispatch-ZCNGHCNP.js +0 -8
- package/dist/doctor-7F6ZXPZE.js +0 -5
- package/dist/effect-QlVUlMFu-4UNP2EGS.js +0 -3
- package/dist/esm-575VQW4T.js +0 -4
- package/dist/host.js +0 -8
- package/dist/init-HGEXUJP3.js +0 -245
- package/dist/linear-commands-XGHGICI7.js +0 -5
- package/dist/oneshot-DL57ZA55.js +0 -36
- package/dist/opencode-YDUTVKTG.js +0 -3
- package/dist/pi-L73UX3S5.js +0 -3
- package/dist/project-commands-2N44CRGM.js +0 -7
- package/dist/project-env-NWBVITHM.js +0 -4
- package/dist/run-commands-TCBNFJOT.js +0 -13
- package/dist/runtime/docker/compose/features/panel-host.yaml +0 -42
- package/dist/shell-ZWXPCUMD.js +0 -3
- package/dist/subprocess-jsonl-FQKDRENI.js +0 -3
- package/dist/supervisor.js +0 -179
- package/dist/sury-CWZTCd75-XQOYZHNU.js +0 -3
- package/dist/typebox-Dei93FPO-RCGWIHUQ.js +0 -3
- package/dist/valibot--1zFm7rT-DKLMYF44.js +0 -3
- package/dist/valibot-D_HTw1Gn-QTR63R64.js +0 -4
- package/dist/worktree-commands-F7REOKFJ.js +0 -50
- package/dist/zod-Bwrt9trS-6RSVELLV.js +0 -3
- package/dist/zod-DSgpEGAE-5JBFOUHY.js +0 -3
package/dist/chunk-QS5PHDYT.js
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as o,c as $,e as Qi}from"./chunk-6J5HN4ZN.js";var Ye=$(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.regexpCode=I.getEsmExportName=I.getProperty=I.safeStringify=I.stringify=I.strConcat=I.addCodeArg=I.str=I._=I.nil=I._Code=I.Name=I.IDENTIFIER=I._CodeOrName=void 0;var Ze=class{static{o(this,"_CodeOrName")}};I._CodeOrName=Ze;I.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Se=class extends Ze{static{o(this,"Name")}constructor(e){if(super(),!I.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=
|
|
4
|
-
e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};I.Name=Se;var X=class extends Ze{static{o(this,"_Code")}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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this.
|
|
5
|
-
_items.reduce((r,n)=>(n instanceof Se&&(r[n.str]=(r[n.str]||0)+1),r),{})}};I._Code=X;I.nil=new X("");function rs(t,...e){let r=[t[0]],n=0;for(;n<e.length;)dr(r,e[n]),r.push(t[++n]);return new X(r)}o(rs,"_");I._=rs;var lr=new X("+");function ns(t,...e){let r=[Xe(t[0])],n=0;for(;n<e.length;)r.push(lr),dr(r,e[n]),r.push(lr,Xe(t[++n]));return Zi(r),new X(r)}o(ns,"str");I.str=ns;function dr(t,e){e instanceof X?t.push(...e._items):e instanceof Se?t.push(e):t.push(ea(e))}o(dr,"addCodeArg");I.addCodeArg=
|
|
6
|
-
dr;function Zi(t){let e=1;for(;e<t.length-1;){if(t[e]===lr){let r=Xi(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}o(Zi,"optimize");function Xi(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Se||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Se))return`"${t}${e.slice(1)}`}o(Xi,"mergeExprItems");function Yi(t,e){return e.
|
|
7
|
-
emptyStr()?t:t.emptyStr()?e:ns`${t}${e}`}o(Yi,"strConcat");I.strConcat=Yi;function ea(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Xe(Array.isArray(t)?t.join(","):t)}o(ea,"interpolate");function ta(t){return new X(Xe(t))}o(ta,"stringify");I.stringify=ta;function Xe(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Xe,"safeStringify");I.safeStringify=Xe;function ra(t){return typeof t=="string"&&I.IDENTIFIER.test(t)?new X(`.${t}`):rs`[${t}]`}o(
|
|
8
|
-
ra,"getProperty");I.getProperty=ra;function na(t){if(typeof t=="string"&&I.IDENTIFIER.test(t))return new X(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}o(na,"getEsmExportName");I.getEsmExportName=na;function sa(t){return new X(t.toString())}o(sa,"regexpCode");I.regexpCode=sa});var pr=$(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.ValueScope=B.ValueScopeName=B.Scope=B.varKinds=B.UsedValueState=void 0;var G=Ye(),fr=class extends Error{static{o(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ot;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ot||(B.UsedValueState=Ot={}));B.varKinds={const:new G.Name("const"),let:new G.Name("let"),var:new G.Name("var")};var Nt=class{static{o(this,
|
|
9
|
-
"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof G.Name?e:this.name(e)}name(e){return new G.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this.
|
|
10
|
-
_names[e]={prefix:e,index:0}}};B.Scope=Nt;var kt=class extends G.Name{static{o(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,G._)`.${new G.Name(r)}[${n}]`}};B.ValueScopeName=kt;var oa=(0,G._)`\n`,hr=class extends Nt{static{o(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?oa:G.nil}}get(){return this._scope}name(e){return new kt(e,this._newName(e))}value(e,r){
|
|
11
|
-
var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,a=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[i];if(c){let d=c.get(a);if(d)return d}else c=this._values[i]=new Map;c.set(a,s);let u=this._scope[i]||(this._scope[i]=[]),l=u.length;return u[l]=r.ref,s.setValue(r,{property:i,itemIndex:l}),s}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)
|
|
12
|
-
throw new Error(`CodeGen: name "${n}" has no value`);return(0,G._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(e,r,n={},s){let i=G.nil;for(let a in e){let c=e[a];if(!c)continue;let u=n[a]=n[a]||new Map;c.forEach(l=>{if(u.has(l))return;u.set(l,Ot.Started);let d=r(l);if(d){let f=this.opts.es5?B.varKinds.var:B.varKinds.const;i=(0,G._)`${i}${f} ${l} = ${d};${this.
|
|
13
|
-
opts._n}`}else if(d=s?.(l))i=(0,G._)`${i}${d}${this.opts._n}`;else throw new fr(l);u.set(l,Ot.Completed)})}return i}};B.ValueScope=hr});var N=$(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var j=Ye(),re=pr(),ye=Ye();Object.defineProperty(P,"_",{enumerable:!0,get:o(function(){return ye._},"get")});Object.defineProperty(P,"str",{enumerable:!0,get:o(function(){return ye.str},"get")});Object.defineProperty(P,"strConcat",{enumerable:!0,get:o(function(){
|
|
14
|
-
return ye.strConcat},"get")});Object.defineProperty(P,"nil",{enumerable:!0,get:o(function(){return ye.nil},"get")});Object.defineProperty(P,"getProperty",{enumerable:!0,get:o(function(){return ye.getProperty},"get")});Object.defineProperty(P,"stringify",{enumerable:!0,get:o(function(){return ye.stringify},"get")});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:o(function(){return ye.regexpCode},"get")});Object.defineProperty(P,"Name",{enumerable:!0,get:o(function(){return ye.Name},"get")});
|
|
15
|
-
var It=pr();Object.defineProperty(P,"Scope",{enumerable:!0,get:o(function(){return It.Scope},"get")});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:o(function(){return It.ValueScope},"get")});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:o(function(){return It.ValueScopeName},"get")});Object.defineProperty(P,"varKinds",{enumerable:!0,get:o(function(){return It.varKinds},"get")});P.operators={GT:new j._Code(">"),GTE:new j._Code(">="),LT:new j._Code("<"),LTE:new j._Code("<="),
|
|
16
|
-
EQ:new j._Code("==="),NEQ:new j._Code("!=="),NOT:new j._Code("!"),OR:new j._Code("||"),AND:new j._Code("&&"),ADD:new j._Code("+")};var fe=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},mr=class extends fe{static{o(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?re.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(e,r){if(e[this.name.str])
|
|
17
|
-
return this.rhs&&(this.rhs=De(this.rhs,e,r)),this}get names(){return this.rhs instanceof j._CodeOrName?this.rhs.names:{}}},jt=class extends fe{static{o(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof j.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=De(this.rhs,e,r),this}get names(){let e=this.lhs instanceof j.Name?{}:{...this.lhs.names};return Rt(e,this.rhs)}},
|
|
18
|
-
yr=class extends jt{static{o(this,"AssignOp")}constructor(e,r,n,s){super(e,n,s),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},gr=class extends fe{static{o(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},_r=class extends fe{static{o(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},$r=class extends fe{static{o(this,"Throw")}constructor(e){
|
|
19
|
-
super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vr=class extends fe{static{o(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=De(this.code,e,r),this}get names(){return this.code instanceof j._CodeOrName?this.code.names:{}}},et=class extends fe{static{o(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){
|
|
20
|
-
return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,r)||(ia(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Oe(e,r.names),{})}},he=class extends et{static{o(this,"BlockNode")}render(e){return"\
|
|
21
|
-
{"+e._n+super.render(e)+"}"+e._n}},wr=class extends et{static{o(this,"Root")}},Ce=class extends he{static{o(this,"Else")}};Ce.kind="else";var Ee=class t extends he{static{o(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Ce(
|
|
22
|
-
n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(ss(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=De(this.condition,e,r),this}get names(){let e=super.names;return Rt(e,this.condition),this.else&&Oe(e,this.else.names),e}};Ee.kind="if";var Pe=class extends he{static{o(this,"For")}};
|
|
23
|
-
Pe.kind="for";var br=class extends Pe{static{o(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=De(this.iteration,e,r),this}get names(){return Oe(super.names,this.iteration.names)}},Sr=class extends Pe{static{o(this,"ForRange")}constructor(e,r,n,s){super(),this.varKind=e,this.name=r,this.from=n,this.to=s}render(e){let r=e.es5?re.varKinds.var:this.varKind,{name:n,from:s,
|
|
24
|
-
to:i}=this;return`for(${r} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Rt(super.names,this.from);return Rt(e,this.to)}},qt=class extends Pe{static{o(this,"ForIter")}constructor(e,r,n,s){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=De(this.iterable,e,r),this}get names(){return Oe(super.names,this.
|
|
25
|
-
iterable.names)}},tt=class extends he{static{o(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};tt.kind="func";var rt=class extends et{static{o(this,"Return")}render(e){return"return "+super.render(e)}};rt.kind="return";var Er=class extends he{static{o(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.
|
|
26
|
-
render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,s;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(s=this.finally)===null||s===void 0||s.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Oe(e,this.catch.names),this.finally&&Oe(e,this.finally.names),e}},nt=class extends he{static{o(
|
|
27
|
-
this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};nt.kind="catch";var st=class extends he{static{o(this,"Finally")}render(e){return"finally"+super.render(e)}};st.kind="finally";var Pr=class{static{o(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
28
|
-
`:""},this._extScope=e,this._scope=new re.Scope({parent:e}),this._nodes=[new wr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,s){
|
|
29
|
-
let i=this._scope.toName(r);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new mr(e,i,n)),i}const(e,r,n){return this._def(re.varKinds.const,e,r,n)}let(e,r,n){return this._def(re.varKinds.let,e,r,n)}var(e,r,n){return this._def(re.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new jt(e,r,n))}add(e,r){return this._leafNode(new yr(e,P.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==j.nil&&this._leafNode(new vr(e)),this}object(...e){let r=["{"];for(let[n,s]of e)
|
|
30
|
-
r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,j.addCodeArg)(r,s));return r.push("}"),new j._Code(r)}if(e,r,n){if(this._blockNode(new Ee(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ee(e))}else(){return this._elseNode(new Ce)}endIf(){return this._endBlockNode(Ee,Ce)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),
|
|
31
|
-
this}for(e,r){return this._for(new br(e),r)}forRange(e,r,n,s,i=this.opts.es5?re.varKinds.var:re.varKinds.let){let a=this._scope.toName(e);return this._for(new Sr(i,a,r,n),()=>s(a))}forOf(e,r,n,s=re.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let a=r instanceof j.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,j._)`${a}.length`,c=>{this.var(i,(0,j._)`${a}[${c}]`),n(i)})}return this._for(new qt("of",s,i,r),()=>n(i))}forIn(e,r,n,s=this.opts.es5?re.varKinds.var:re.varKinds.
|
|
32
|
-
const){if(this.opts.ownProperties)return this.forOf(e,(0,j._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new qt("in",s,i,r),()=>n(i))}endFor(){return this._endBlockNode(Pe)}label(e){return this._leafNode(new gr(e))}break(e){return this._leafNode(new _r(e))}return(e){let r=new rt;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(rt)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" w\
|
|
33
|
-
ithout "catch" and "finally"');let s=new Er;if(this._blockNode(s),this.code(e),r){let i=this.name("e");this._currNode=s.catch=new nt(i),r(i)}return n&&(this._currNode=s.finally=new st,this.code(n)),this._endBlockNode(nt,st)}throw(e){return this._leafNode(new $r(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<
|
|
34
|
-
0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=j.nil,n,s){return this._blockNode(new tt(e,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(tt)}optimize(e=1){for(;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,r){
|
|
35
|
-
let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ee))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};P.CodeGen=Pr;function Oe(t,e){for(let r in e)t[r]=(t[r]||
|
|
36
|
-
0)+(e[r]||0);return t}o(Oe,"addNames");function Rt(t,e){return e instanceof j._CodeOrName?Oe(t,e.names):t}o(Rt,"addExprNames");function De(t,e,r){if(t instanceof j.Name)return n(t);if(!s(t))return t;return new j._Code(t._items.reduce((i,a)=>(a instanceof j.Name&&(a=n(a)),a instanceof j._Code?i.push(...a._items):i.push(a),i),[]));function n(i){let a=r[i.str];return a===void 0||e[i.str]!==1?i:(delete e[i.str],a)}function s(i){return i instanceof j._Code&&i._items.some(a=>a instanceof j.Name&&e[a.str]===
|
|
37
|
-
1&&r[a.str]!==void 0)}}o(De,"optimizeExpr");function ia(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}o(ia,"subtractNames");function ss(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,j._)`!${Or(t)}`}o(ss,"not");P.not=ss;var aa=os(P.operators.AND);function ca(...t){return t.reduce(aa)}o(ca,"and");P.and=ca;var ua=os(P.operators.OR);function la(...t){return t.reduce(ua)}o(la,"or");P.or=la;function os(t){return(e,r)=>e===j.nil?r:r===j.nil?e:(0,j._)`${Or(e)} ${t} ${Or(r)}`}o(os,"map\
|
|
38
|
-
pend");function Or(t){return t instanceof j.Name?t:(0,j._)`(${t})`}o(Or,"par")});var q=$(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.checkStrictMode=k.getErrorPath=k.Type=k.useFunc=k.setEvaluated=k.evaluatedPropsToName=k.mergeEvaluated=k.eachItem=k.unescapeJsonPointer=k.escapeJsonPointer=k.escapeFragment=k.unescapeFragment=k.schemaRefOrVal=k.schemaHasRulesButRef=k.schemaHasRules=k.checkUnknownRules=k.alwaysValidSchema=k.toHash=void 0;var C=N(),da=Ye();function fa(t){let e={};for(let r of t)e[r]=!0;return e}o(fa,"toHash");k.toHash=fa;function ha(t,e){return typeof e==
|
|
39
|
-
"boolean"?e:Object.keys(e).length===0?!0:(cs(t,e),!us(e,t.self.RULES.all))}o(ha,"alwaysValidSchema");k.alwaysValidSchema=ha;function cs(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||fs(t,`unknown keyword: "${i}"`)}o(cs,"checkUnknownRules");k.checkUnknownRules=cs;function us(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}o(us,"schemaHasRules");k.schemaHasRules=us;function pa(t,e){if(typeof t==
|
|
40
|
-
"boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}o(pa,"schemaHasRulesButRef");k.schemaHasRulesButRef=pa;function ma({topSchemaRef:t,schemaPath:e},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,C._)`${r}`}return(0,C._)`${t}${e}${(0,C.getProperty)(n)}`}o(ma,"schemaRefOrVal");k.schemaRefOrVal=ma;function ya(t){return ls(decodeURIComponent(t))}o(ya,"unescapeFragment");k.unescapeFragment=ya;function ga(t){return encodeURIComponent(
|
|
41
|
-
kr(t))}o(ga,"escapeFragment");k.escapeFragment=ga;function kr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}o(kr,"escapeJsonPointer");k.escapeJsonPointer=kr;function ls(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}o(ls,"unescapeJsonPointer");k.unescapeJsonPointer=ls;function _a(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}o(_a,"eachItem");k.eachItem=_a;function is({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(s,i,a,c)=>{let u=a===
|
|
42
|
-
void 0?i:a instanceof C.Name?(i instanceof C.Name?t(s,i,a):e(s,i,a),a):i instanceof C.Name?(e(s,a,i),i):r(i,a);return c===C.Name&&!(u instanceof C.Name)?n(s,u):u}}o(is,"makeMergeEvaluated");k.mergeEvaluated={props:is({mergeNames:o((t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,C._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,C._)`${r} || {}`).code((0,C._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:o((t,e,r)=>t.if((0,C._)`${r} !== true`,()=>{e===!0?t.
|
|
43
|
-
assign(r,!0):(t.assign(r,(0,C._)`${r} || {}`),jr(t,r,e))}),"mergeToName"),mergeValues:o((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:ds}),items:is({mergeNames:o((t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,C._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:o((t,e,r)=>t.if((0,C._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,C._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:o((t,e)=>t===!0?!0:Math.max(t,e),"merge\
|
|
44
|
-
Values"),resultToName:o((t,e)=>t.var("items",e),"resultToName")})};function ds(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,C._)`{}`);return e!==void 0&&jr(t,r,e),r}o(ds,"evaluatedPropsToName");k.evaluatedPropsToName=ds;function jr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,C._)`${e}${(0,C.getProperty)(n)}`,!0))}o(jr,"setEvaluated");k.setEvaluated=jr;var as={};function $a(t,e){return t.scopeValue("func",{ref:e,code:as[e.code]||(as[e.code]=new da._Code(e.code))})}o($a,"useFunc");
|
|
45
|
-
k.useFunc=$a;var Nr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Nr||(k.Type=Nr={}));function va(t,e,r){if(t instanceof C.Name){let n=e===Nr.Num;return r?n?(0,C._)`"[" + ${t} + "]"`:(0,C._)`"['" + ${t} + "']"`:n?(0,C._)`"/" + ${t}`:(0,C._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,C.getProperty)(t).toString():"/"+kr(t)}o(va,"getErrorPath");k.getErrorPath=va;function fs(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(
|
|
46
|
-
e)}}o(fs,"checkStrictMode");k.checkStrictMode=fs});var pe=$(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});var z=N(),wa={data:new z.Name("data"),valCxt:new z.Name("valCxt"),instancePath:new z.Name("instancePath"),parentData:new z.Name("parentData"),parentDataProperty:new z.Name("parentDataProperty"),rootData:new z.Name("rootData"),dynamicAnchors:new z.Name("dynamicAnchors"),vErrors:new z.Name("vErrors"),errors:new z.Name("errors"),this:new z.Name("this"),self:new z.Name("self"),scope:new z.Name("scope"),json:new z.Name("json"),
|
|
47
|
-
jsonPos:new z.Name("jsonPos"),jsonLen:new z.Name("jsonLen"),jsonPart:new z.Name("jsonPart")};qr.default=wa});var ot=$(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.extendErrors=U.resetErrorsCount=U.reportExtraError=U.reportError=U.keyword$DataError=U.keywordError=void 0;var R=N(),Tt=q(),L=pe();U.keywordError={message:o(({keyword:t})=>(0,R.str)`must pass "${t}" keyword validation`,"message")};U.keyword$DataError={message:o(({keyword:t,schemaType:e})=>e?(0,R.str)`"${t}" keyword must be ${e} ($data)`:(0,R.str)`"${t}" keyword is invalid ($data)`,"message")};function ba(t,e=U.keywordError,r,n){
|
|
48
|
-
let{it:s}=t,{gen:i,compositeRule:a,allErrors:c}=s,u=ms(t,e,r);n??(a||c)?hs(i,u):ps(s,(0,R._)`[${u}]`)}o(ba,"reportError");U.reportError=ba;function Sa(t,e=U.keywordError,r){let{it:n}=t,{gen:s,compositeRule:i,allErrors:a}=n,c=ms(t,e,r);hs(s,c),i||a||ps(n,L.default.vErrors)}o(Sa,"reportExtraError");U.reportExtraError=Sa;function Ea(t,e){t.assign(L.default.errors,e),t.if((0,R._)`${L.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,R._)`${L.default.vErrors}.length`,e),()=>t.assign(L.default.vErrors,
|
|
49
|
-
null)))}o(Ea,"resetErrorsCount");U.resetErrorsCount=Ea;function Pa({gen:t,keyword:e,schemaValue:r,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",s,L.default.errors,c=>{t.const(a,(0,R._)`${L.default.vErrors}[${c}]`),t.if((0,R._)`${a}.instancePath === undefined`,()=>t.assign((0,R._)`${a}.instancePath`,(0,R.strConcat)(L.default.instancePath,i.errorPath))),t.assign((0,R._)`${a}.schemaPath`,(0,R.str)`${i.errSchemaPath}/${e}`),i.opts.
|
|
50
|
-
verbose&&(t.assign((0,R._)`${a}.schema`,r),t.assign((0,R._)`${a}.data`,n))})}o(Pa,"extendErrors");U.extendErrors=Pa;function hs(t,e){let r=t.const("err",e);t.if((0,R._)`${L.default.vErrors} === null`,()=>t.assign(L.default.vErrors,(0,R._)`[${r}]`),(0,R._)`${L.default.vErrors}.push(${r})`),t.code((0,R._)`${L.default.errors}++`)}o(hs,"addError");function ps(t,e){let{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw((0,R._)`new ${t.ValidationError}(${e})`):(r.assign((0,R._)`${n}.errors`,e),r.return(
|
|
51
|
-
!1))}o(ps,"returnErrors");var Ne={keyword:new R.Name("keyword"),schemaPath:new R.Name("schemaPath"),params:new R.Name("params"),propertyName:new R.Name("propertyName"),message:new R.Name("message"),schema:new R.Name("schema"),parentSchema:new R.Name("parentSchema")};function ms(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,R._)`{}`:Oa(t,e,r)}o(ms,"errorObjectCode");function Oa(t,e,r={}){let{gen:n,it:s}=t,i=[Na(s,r),ka(t,r)];return ja(t,e,i),n.object(...i)}o(Oa,"errorObject");function Na({errorPath:t},{
|
|
52
|
-
instancePath:e}){let r=e?(0,R.str)`${t}${(0,Tt.getErrorPath)(e,Tt.Type.Str)}`:t;return[L.default.instancePath,(0,R.strConcat)(L.default.instancePath,r)]}o(Na,"errorInstancePath");function ka({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let s=n?e:(0,R.str)`${e}/${t}`;return r&&(s=(0,R.str)`${s}${(0,Tt.getErrorPath)(r,Tt.Type.Str)}`),[Ne.schemaPath,s]}o(ka,"errorSchemaPath");function ja(t,{params:e,message:r},n){let{keyword:s,data:i,schemaValue:a,it:c}=t,{opts:u,propertyName:l,topSchemaRef:d,
|
|
53
|
-
schemaPath:f}=c;n.push([Ne.keyword,s],[Ne.params,typeof e=="function"?e(t):e||(0,R._)`{}`]),u.messages&&n.push([Ne.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([Ne.schema,a],[Ne.parentSchema,(0,R._)`${d}${f}`],[L.default.data,i]),l&&n.push([Ne.propertyName,l])}o(ja,"extraErrorProps")});var gs=$(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.boolOrEmptySchema=Me.topBoolOrEmptySchema=void 0;var qa=ot(),Ra=N(),Ia=pe(),Ta={message:"boolean schema is false"};function Aa(t){let{gen:e,schema:r,validateName:n}=t;r===!1?ys(t,!1):typeof r=="object"&&r.$async===!0?e.return(Ia.default.data):(e.assign((0,Ra._)`${n}.errors`,null),e.return(!0))}o(Aa,"topBoolOrEmptySchema");Me.topBoolOrEmptySchema=Aa;function Ca(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),ys(t)):r.var(
|
|
54
|
-
e,!0)}o(Ca,"boolOrEmptySchema");Me.boolOrEmptySchema=Ca;function ys(t,e){let{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,qa.reportError)(s,Ta,void 0,e)}o(ys,"falseSchemaError")});var Rr=$(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.getRules=xe.isJSONType=void 0;var Da=["string","number","integer","boolean","null","object","array"],Ma=new Set(Da);function xa(t){return typeof t=="string"&&Ma.has(t)}o(xa,"isJSONType");xe.isJSONType=xa;function Fa(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},
|
|
55
|
-
t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}o(Fa,"getRules");xe.getRules=Fa});var Ir=$(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.shouldUseRule=ge.shouldUseGroup=ge.schemaHasRulesForType=void 0;function Va({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&_s(t,n)}o(Va,"schemaHasRulesForType");ge.schemaHasRulesForType=Va;function _s(t,e){return e.rules.some(r=>$s(t,r))}o(_s,"shouldUseGroup");ge.shouldUseGroup=_s;function $s(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==
|
|
56
|
-
void 0))}o($s,"shouldUseRule");ge.shouldUseRule=$s});var it=$(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.reportTypeError=K.checkDataTypes=K.checkDataType=K.coerceAndCheckDataType=K.getJSONTypes=K.getSchemaTypes=K.DataType=void 0;var za=Rr(),Ua=Ir(),Ka=ot(),E=N(),vs=q(),Fe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Fe||(K.DataType=Fe={}));function Ha(t){let e=ws(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)
|
|
57
|
-
throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}o(Ha,"getSchemaTypes");K.getSchemaTypes=Ha;function ws(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(za.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}o(ws,"getJSONTypes");K.getJSONTypes=ws;function La(t,e){let{gen:r,data:n,opts:s}=t,i=Ja(e,s.coerceTypes),a=e.length>0&&!(i.length===0&&e.length===1&&(0,Ua.schemaHasRulesForType)(t,e[0]));if(a){let c=Ar(e,
|
|
58
|
-
n,s.strictNumbers,Fe.Wrong);r.if(c,()=>{i.length?Ga(t,e,i):Cr(t)})}return a}o(La,"coerceAndCheckDataType");K.coerceAndCheckDataType=La;var bs=new Set(["string","number","integer","boolean","null"]);function Ja(t,e){return e?t.filter(r=>bs.has(r)||e==="array"&&r==="array"):[]}o(Ja,"coerceToTypes");function Ga(t,e,r){let{gen:n,data:s,opts:i}=t,a=n.let("dataType",(0,E._)`typeof ${s}`),c=n.let("coerced",(0,E._)`undefined`);i.coerceTypes==="array"&&n.if((0,E._)`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,
|
|
59
|
-
()=>n.assign(s,(0,E._)`${s}[0]`).assign(a,(0,E._)`typeof ${s}`).if(Ar(e,s,i.strictNumbers),()=>n.assign(c,s))),n.if((0,E._)`${c} !== undefined`);for(let l of r)(bs.has(l)||l==="array"&&i.coerceTypes==="array")&&u(l);n.else(),Cr(t),n.endIf(),n.if((0,E._)`${c} !== undefined`,()=>{n.assign(s,c),Ba(t,c)});function u(l){switch(l){case"string":n.elseIf((0,E._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,E._)`"" + ${s}`).elseIf((0,E._)`${s} === null`).assign(c,(0,E._)`""`);return;case"number":n.
|
|
60
|
-
elseIf((0,E._)`${a} == "boolean" || ${s} === null
|
|
61
|
-
|| (${a} == "string" && ${s} && ${s} == +${s})`).assign(c,(0,E._)`+${s}`);return;case"integer":n.elseIf((0,E._)`${a} === "boolean" || ${s} === null
|
|
62
|
-
|| (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(c,(0,E._)`+${s}`);return;case"boolean":n.elseIf((0,E._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(c,!1).elseIf((0,E._)`${s} === "true" || ${s} === 1`).assign(c,!0);return;case"null":n.elseIf((0,E._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(c,null);return;case"array":n.elseIf((0,E._)`${a} === "string" || ${a} === "number"
|
|
63
|
-
|| ${a} === "boolean" || ${s} === null`).assign(c,(0,E._)`[${s}]`)}}o(u,"coerceSpecificType")}o(Ga,"coerceData");function Ba({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,E._)`${e} !== undefined`,()=>t.assign((0,E._)`${e}[${r}]`,n))}o(Ba,"assignParentData");function Tr(t,e,r,n=Fe.Correct){let s=n===Fe.Correct?E.operators.EQ:E.operators.NEQ,i;switch(t){case"null":return(0,E._)`${e} ${s} null`;case"array":i=(0,E._)`Array.isArray(${e})`;break;case"object":i=(0,E._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;
|
|
64
|
-
break;case"integer":i=a((0,E._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=a();break;default:return(0,E._)`typeof ${e} ${s} ${t}`}return n===Fe.Correct?i:(0,E.not)(i);function a(c=E.nil){return(0,E.and)((0,E._)`typeof ${e} == "number"`,c,r?(0,E._)`isFinite(${e})`:E.nil)}}o(Tr,"checkDataType");K.checkDataType=Tr;function Ar(t,e,r,n){if(t.length===1)return Tr(t[0],e,r,n);let s,i=(0,vs.toHash)(t);if(i.array&&i.object){let a=(0,E._)`typeof ${e} != "object"`;s=i.null?a:(0,E._)`!${e} || ${a}`,
|
|
65
|
-
delete i.null,delete i.array,delete i.object}else s=E.nil;i.number&&delete i.integer;for(let a in i)s=(0,E.and)(s,Tr(a,e,r,n));return s}o(Ar,"checkDataTypes");K.checkDataTypes=Ar;var Wa={message:o(({schema:t})=>`must be ${t}`,"message"),params:o(({schema:t,schemaValue:e})=>typeof t=="string"?(0,E._)`{type: ${t}}`:(0,E._)`{type: ${e}}`,"params")};function Cr(t){let e=Qa(t);(0,Ka.reportError)(e,Wa)}o(Cr,"reportTypeError");K.reportTypeError=Cr;function Qa(t){let{gen:e,data:r,schema:n}=t,s=(0,vs.schemaRefOrVal)(
|
|
66
|
-
t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}o(Qa,"getTypeErrorContext")});var Es=$(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.assignDefaults=void 0;var Ve=N(),Za=q();function Xa(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let s in r)Ss(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>Ss(t,i,s.default))}o(Xa,"assignDefaults");At.assignDefaults=Xa;function Ss(t,e,r){let{gen:n,compositeRule:s,data:i,opts:a}=t;if(r===void 0)return;let c=(0,Ve._)`${i}${(0,Ve.getProperty)(e)}`;if(s){(0,Za.checkStrictMode)(
|
|
67
|
-
t,`default is ignored for: ${c}`);return}let u=(0,Ve._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,Ve._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,Ve._)`${c} = ${(0,Ve.stringify)(r)}`)}o(Ss,"assignDefault")});var Y=$(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.validateUnion=A.validateArray=A.usePattern=A.callValidateCode=A.schemaProperties=A.allSchemaProperties=A.noPropertyInData=A.propertyInData=A.isOwnProperty=A.hasPropFunc=A.reportMissingProp=A.checkMissingProp=A.checkReportMissingProp=void 0;var D=N(),Dr=q(),_e=pe(),Ya=q();function ec(t,e){let{gen:r,data:n,it:s}=t;r.if(xr(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,D._)`${e}`},!0),t.error()})}o(ec,"che\
|
|
68
|
-
ckReportMissingProp");A.checkReportMissingProp=ec;function tc({gen:t,data:e,it:{opts:r}},n,s){return(0,D.or)(...n.map(i=>(0,D.and)(xr(t,e,i,r.ownProperties),(0,D._)`${s} = ${i}`)))}o(tc,"checkMissingProp");A.checkMissingProp=tc;function rc(t,e){t.setParams({missingProperty:e},!0),t.error()}o(rc,"reportMissingProp");A.reportMissingProp=rc;function Ps(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,D._)`Object.prototype.hasOwnProperty`})}o(Ps,"hasPropFunc");A.hasPropFunc=
|
|
69
|
-
Ps;function Mr(t,e,r){return(0,D._)`${Ps(t)}.call(${e}, ${r})`}o(Mr,"isOwnProperty");A.isOwnProperty=Mr;function nc(t,e,r,n){let s=(0,D._)`${e}${(0,D.getProperty)(r)} !== undefined`;return n?(0,D._)`${s} && ${Mr(t,e,r)}`:s}o(nc,"propertyInData");A.propertyInData=nc;function xr(t,e,r,n){let s=(0,D._)`${e}${(0,D.getProperty)(r)} === undefined`;return n?(0,D.or)(s,(0,D.not)(Mr(t,e,r))):s}o(xr,"noPropertyInData");A.noPropertyInData=xr;function Os(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):
|
|
70
|
-
[]}o(Os,"allSchemaProperties");A.allSchemaProperties=Os;function sc(t,e){return Os(e).filter(r=>!(0,Dr.alwaysValidSchema)(t,e[r]))}o(sc,"schemaProperties");A.schemaProperties=sc;function oc({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:a},c,u,l){let d=l?(0,D._)`${t}, ${e}, ${n}${s}`:e,f=[[_e.default.instancePath,(0,D.strConcat)(_e.default.instancePath,i)],[_e.default.parentData,a.parentData],[_e.default.parentDataProperty,a.parentDataProperty],[_e.default.rootData,_e.
|
|
71
|
-
default.rootData]];a.opts.dynamicRef&&f.push([_e.default.dynamicAnchors,_e.default.dynamicAnchors]);let g=(0,D._)`${d}, ${r.object(...f)}`;return u!==D.nil?(0,D._)`${c}.call(${u}, ${g})`:(0,D._)`${c}(${g})`}o(oc,"callValidateCode");A.callValidateCode=oc;var ic=(0,D._)`new RegExp`;function ac({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,D._)`${s.code==="new RegExp"?ic:(0,Ya.useFunc)(t,s)}(${r}, ${n})`})}
|
|
72
|
-
o(ac,"usePattern");A.usePattern=ac;function cc(t){let{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){let c=e.let("valid",!0);return a(()=>e.assign(c,!1)),c}return e.var(i,!0),a(()=>e.break()),i;function a(c){let u=e.const("len",(0,D._)`${r}.length`);e.forRange("i",0,u,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:Dr.Type.Num},i),e.if((0,D.not)(i),c)})}o(a,"validateItems")}o(cc,"validateArray");A.validateArray=cc;function uc(t){let{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.
|
|
73
|
-
isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Dr.alwaysValidSchema)(s,u))&&!s.opts.unevaluated)return;let a=e.let("valid",!1),c=e.name("_valid");e.block(()=>r.forEach((u,l)=>{let d=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);e.assign(a,(0,D._)`${a} || ${c}`),t.mergeValidEvaluated(d,c)||e.if((0,D.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}o(uc,"validateUnion");A.validateUnion=uc});var js=$(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.validateKeywordUsage=ce.validSchemaType=ce.funcKeywordCode=ce.macroKeywordCode=void 0;var J=N(),ke=pe(),lc=Y(),dc=ot();function fc(t,e){let{gen:r,keyword:n,schema:s,parentSchema:i,it:a}=t,c=e.macro.call(a.self,s,i,a),u=ks(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let l=r.name("valid");t.subschema({schema:c,schemaPath:J.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),
|
|
74
|
-
t.pass(l,()=>t.error(!0))}o(fc,"macroKeywordCode");ce.macroKeywordCode=fc;function hc(t,e){var r;let{gen:n,keyword:s,schema:i,parentSchema:a,$data:c,it:u}=t;mc(u,e);let l=!c&&e.compile?e.compile.call(u.self,i,a,u):e.validate,d=ks(n,s,l),f=n.let("valid");t.block$data(f,g),t.ok((r=e.valid)!==null&&r!==void 0?r:f);function g(){if(e.errors===!1)h(),e.modifying&&Ns(t),y(()=>t.error());else{let _=e.async?m():p();e.modifying&&Ns(t),y(()=>pc(t,_))}}o(g,"validateKeyword");function m(){let _=n.let("ruleEr\
|
|
75
|
-
rs",null);return n.try(()=>h((0,J._)`await `),w=>n.assign(f,!1).if((0,J._)`${w} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,J._)`${w}.errors`),()=>n.throw(w))),_}o(m,"validateAsync");function p(){let _=(0,J._)`${d}.errors`;return n.assign(_,null),h(J.nil),_}o(p,"validateSync");function h(_=e.async?(0,J._)`await `:J.nil){let w=u.opts.passContext?ke.default.this:ke.default.self,O=!("compile"in e&&!c||e.schema===!1);n.assign(f,(0,J._)`${_}${(0,lc.callValidateCode)(t,d,w,O)}`,e.modifying)}o(h,
|
|
76
|
-
"assignValid");function y(_){var w;n.if((0,J.not)((w=e.valid)!==null&&w!==void 0?w:f),_)}o(y,"reportErrs")}o(hc,"funcKeywordCode");ce.funcKeywordCode=hc;function Ns(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,J._)`${n.parentData}[${n.parentDataProperty}]`))}o(Ns,"modifyData");function pc(t,e){let{gen:r}=t;r.if((0,J._)`Array.isArray(${e})`,()=>{r.assign(ke.default.vErrors,(0,J._)`${ke.default.vErrors} === null ? ${e} : ${ke.default.vErrors}.concat(${e})`).assign(ke.default.errors,
|
|
77
|
-
(0,J._)`${ke.default.vErrors}.length`),(0,dc.extendErrors)(t)},()=>t.error())}o(pc,"addErrs");function mc({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}o(mc,"checkAsyncKeyword");function ks(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,J.stringify)(r)})}o(ks,"useKeyword");function yc(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="ob\
|
|
78
|
-
ject"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}o(yc,"validSchemaType");ce.validSchemaType=yc;function gc({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let a=s.dependencies;if(a?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let u=`\
|
|
79
|
-
keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(gc,"validateKeywordUsage");ce.validateKeywordUsage=gc});var Rs=$($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;var ue=N(),qs=q();function _c(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return r===void 0?{schema:c,schemaPath:(0,ue._)`${t.schemaPath}${(0,ue.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}\
|
|
80
|
-
/${e}`}:{schema:c[r],schemaPath:(0,ue._)`${t.schemaPath}${(0,ue.getProperty)(e)}${(0,ue.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,qs.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}o(_c,"getSubschema");$e.getSubschema=_c;function $c(t,e,{
|
|
81
|
-
dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(r!==void 0){let{errorPath:l,dataPathArr:d,opts:f}=e,g=c.let("data",(0,ue._)`${e.data}${(0,ue.getProperty)(r)}`,!0);u(g),t.errorPath=(0,ue.str)`${l}${(0,qs.getErrorPath)(r,n,f.jsPropertySyntax)}`,t.parentDataProperty=(0,ue._)`${r}`,t.dataPathArr=[...d,t.parentDataProperty]}if(s!==void 0){let l=s instanceof ue.Name?s:c.let("d\
|
|
82
|
-
ata",s,!0);u(l),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);function u(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}o(u,"dataContextProps")}o($c,"extendSubschemaData");$e.extendSubschemaData=$c;function vc(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=
|
|
83
|
-
r}o(vc,"extendSubschemaMode");$e.extendSubschemaMode=vc});var Fr=$((_h,Is)=>{"use strict";Is.exports=o(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();
|
|
84
|
-
if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},"equal")});var As=$((vh,Ts)=>{"use strict";var ve=Ts.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ct(e,n,s,t,"",t)};ve.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ve.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ve.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ve.skipKeywords={default:!0,
|
|
85
|
-
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 Ct(t,e,r,n,s,i,a,c,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,a,c,u,l);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in ve.arrayKeywords)for(var g=0;g<f.length;g++)Ct(t,e,r,f[g],s+"/"+d+"/"+g,i,s,d,n,g)}else if(d in ve.propsKeywords){if(f&&typeof f==
|
|
86
|
-
"object")for(var m in f)Ct(t,e,r,f[m],s+"/"+d+"/"+wc(m),i,s,d,n,m)}else(d in ve.keywords||t.allKeys&&!(d in ve.skipKeywords))&&Ct(t,e,r,f,s+"/"+d,i,s,d,n)}r(n,s,i,a,c,u,l)}}o(Ct,"_traverse");function wc(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}o(wc,"escapeJsonPtr")});var at=$(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.getSchemaRefs=W.resolveUrl=W.normalizeId=W._getFullPath=W.getFullPath=W.inlineRef=void 0;var bc=q(),Sc=Fr(),Ec=As(),Pc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Oc(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Vr(t):e?Cs(t)<=e:!1}o(Oc,"inlineRef");W.inlineRef=Oc;var Nc=new Set(
|
|
87
|
-
["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Vr(t){for(let e in t){if(Nc.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Vr)||typeof r=="object"&&Vr(r))return!0}return!1}o(Vr,"hasRef");function Cs(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Pc.has(r)&&(typeof t[r]=="object"&&(0,bc.eachItem)(t[r],n=>e+=Cs(n)),e===1/0))return 1/0}return e}o(Cs,"countKeys");function Ds(t,e="",r){r!==!1&&(e=ze(e));let n=t.parse(e);return Ms(t,n)}o(Ds,"ge\
|
|
88
|
-
tFullPath");W.getFullPath=Ds;function Ms(t,e){return t.serialize(e).split("#")[0]+"#"}o(Ms,"_getFullPath");W._getFullPath=Ms;var kc=/#\/?$/;function ze(t){return t?t.replace(kc,""):""}o(ze,"normalizeId");W.normalizeId=ze;function jc(t,e,r){return r=ze(r),t.resolve(e,r)}o(jc,"resolveUrl");W.resolveUrl=jc;var qc=/^[a-z_][-a-z0-9._]*$/i;function Rc(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ze(t[r]||e),i={"":s},a=Ds(n,s,!1),c={},u=new Set;return Ec(t,{allKeys:!0},
|
|
89
|
-
(f,g,m,p)=>{if(p===void 0)return;let h=a+g,y=i[p];typeof f[r]=="string"&&(y=_.call(this,f[r])),w.call(this,f.$anchor),w.call(this,f.$dynamicAnchor),i[g]=y;function _(O){let T=this.opts.uriResolver.resolve;if(O=ze(y?T(y,O):O),u.has(O))throw d(O);u.add(O);let S=this.refs[O];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?l(f,S.schema,O):O!==ze(h)&&(O[0]==="#"?(l(f,c[O],O),c[O]=f):this.refs[O]=h),O}o(_,"addRef");function w(O){if(typeof O=="string"){if(!qc.test(O))throw new Error(`inv\
|
|
90
|
-
alid anchor "${O}"`);_.call(this,`#${O}`)}}o(w,"addAnchor")}),c;function l(f,g,m){if(g!==void 0&&!Sc(f,g))throw d(m)}o(l,"checkAmbiguosRef");function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}o(d,"ambiguos")}o(Rc,"getSchemaRefs");W.getSchemaRefs=Rc});var lt=$(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.getData=we.KeywordCxt=we.validateFunctionCode=void 0;var Us=gs(),xs=it(),Ur=Ir(),Dt=it(),Ic=Es(),ut=js(),zr=Rs(),v=N(),b=pe(),Tc=at(),me=q(),ct=ot();function Ac(t){if(Ls(t)&&(Js(t),Hs(t))){Mc(t);return}Ks(t,()=>(0,Us.topBoolOrEmptySchema)(t))}o(Ac,"validateFunctionCode");we.validateFunctionCode=Ac;function Ks({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,v._)`${b.default.data}, ${b.default.
|
|
91
|
-
valCxt}`,n.$async,()=>{t.code((0,v._)`"use strict"; ${Fs(r,s)}`),Dc(t,s),t.code(i)}):t.func(e,(0,v._)`${b.default.data}, ${Cc(s)}`,n.$async,()=>t.code(Fs(r,s)).code(i))}o(Ks,"validateFunction");function Cc(t){return(0,v._)`{${b.default.instancePath}="", ${b.default.parentData}, ${b.default.parentDataProperty}, ${b.default.rootData}=${b.default.data}${t.dynamicRef?(0,v._)`, ${b.default.dynamicAnchors}={}`:v.nil}}={}`}o(Cc,"destructureValCxt");function Dc(t,e){t.if(b.default.valCxt,()=>{t.var(b.default.
|
|
92
|
-
instancePath,(0,v._)`${b.default.valCxt}.${b.default.instancePath}`),t.var(b.default.parentData,(0,v._)`${b.default.valCxt}.${b.default.parentData}`),t.var(b.default.parentDataProperty,(0,v._)`${b.default.valCxt}.${b.default.parentDataProperty}`),t.var(b.default.rootData,(0,v._)`${b.default.valCxt}.${b.default.rootData}`),e.dynamicRef&&t.var(b.default.dynamicAnchors,(0,v._)`${b.default.valCxt}.${b.default.dynamicAnchors}`)},()=>{t.var(b.default.instancePath,(0,v._)`""`),t.var(b.default.parentData,
|
|
93
|
-
(0,v._)`undefined`),t.var(b.default.parentDataProperty,(0,v._)`undefined`),t.var(b.default.rootData,b.default.data),e.dynamicRef&&t.var(b.default.dynamicAnchors,(0,v._)`{}`)})}o(Dc,"destructureValCxtES5");function Mc(t){let{schema:e,opts:r,gen:n}=t;Ks(t,()=>{r.$comment&&e.$comment&&Bs(t),Uc(t),n.let(b.default.vErrors,null),n.let(b.default.errors,0),r.unevaluated&&xc(t),Gs(t),Lc(t)})}o(Mc,"topSchemaObjCode");function xc(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,v._)`${r}.evaluated`),
|
|
94
|
-
e.if((0,v._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,v._)`${t.evaluated}.props`,(0,v._)`undefined`)),e.if((0,v._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,v._)`${t.evaluated}.items`,(0,v._)`undefined`))}o(xc,"resetEvaluated");function Fs(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,v._)`/*# sourceURL=${r} */`:v.nil}o(Fs,"funcSourceUrl");function Fc(t,e){if(Ls(t)&&(Js(t),Hs(t))){Vc(t,e);return}(0,Us.boolOrEmptySchema)(t,e)}o(Fc,"subschemaCode");
|
|
95
|
-
function Hs({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}o(Hs,"schemaCxtHasRules");function Ls(t){return typeof t.schema!="boolean"}o(Ls,"isSchemaObj");function Vc(t,e){let{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&Bs(t),Kc(t),Hc(t);let i=n.const("_errs",b.default.errors);Gs(t,i),n.var(e,(0,v._)`${i} === ${b.default.errors}`)}o(Vc,"subSchemaObjCode");function Js(t){(0,me.checkUnknownRules)(t),zc(t)}o(Js,"checkKeywords");function Gs(t,e){
|
|
96
|
-
if(t.opts.jtd)return Vs(t,[],!1,e);let r=(0,xs.getSchemaTypes)(t.schema),n=(0,xs.coerceAndCheckDataType)(t,r);Vs(t,r,!n,e)}o(Gs,"typeAndKeywords");function zc(t){let{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,me.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}o(zc,"checkRefsAndKeywords");function Uc(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,me.checkStrictMode)(t,"default is\
|
|
97
|
-
ignored in the schema root")}o(Uc,"checkNoDefault");function Kc(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Tc.resolveUrl)(t.opts.uriResolver,t.baseId,e))}o(Kc,"updateContext");function Hc(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}o(Hc,"checkAsyncSchema");function Bs({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){let i=r.$comment;if(s.$comment===!0)t.code((0,v._)`${b.default.self}.logger.log(${i})`);else if(typeof s.$comment=="functio\
|
|
98
|
-
n"){let a=(0,v.str)`${n}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,v._)`${b.default.self}.opts.$comment(${i}, ${a}, ${c}.schema)`)}}o(Bs,"commentKeyword");function Lc(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,v._)`${b.default.errors} === 0`,()=>e.return(b.default.data),()=>e.throw((0,v._)`new ${s}(${b.default.vErrors})`)):(e.assign((0,v._)`${n}.errors`,b.default.vErrors),i.unevaluated&&Jc(t),e.return((0,v._)`${b.default.errors} === 0`))}o(
|
|
99
|
-
Lc,"returnResults");function Jc({gen:t,evaluated:e,props:r,items:n}){r instanceof v.Name&&t.assign((0,v._)`${e}.props`,r),n instanceof v.Name&&t.assign((0,v._)`${e}.items`,n)}o(Jc,"assignEvaluated");function Vs(t,e,r,n){let{gen:s,schema:i,data:a,allErrors:c,opts:u,self:l}=t,{RULES:d}=l;if(i.$ref&&(u.ignoreKeywordsWithRef||!(0,me.schemaHasRulesButRef)(i,d))){s.block(()=>Qs(t,"$ref",d.all.$ref.definition));return}u.jtd||Gc(t,e),s.block(()=>{for(let g of d.rules)f(g);f(d.post)});function f(g){(0,Ur.
|
|
100
|
-
shouldUseGroup)(i,g)&&(g.type?(s.if((0,Dt.checkDataType)(g.type,a,u.strictNumbers)),zs(t,g),e.length===1&&e[0]===g.type&&r&&(s.else(),(0,Dt.reportTypeError)(t)),s.endIf()):zs(t,g),c||s.if((0,v._)`${b.default.errors} === ${n||0}`))}o(f,"groupKeywords")}o(Vs,"schemaKeywords");function zs(t,e){let{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Ic.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,Ur.shouldUseRule)(n,i)&&Qs(t,i.keyword,i.definition,e.type)})}o(zs,"iterateKeywords");function Gc(t,e){
|
|
101
|
-
t.schemaEnv.meta||!t.opts.strictTypes||(Bc(t,e),t.opts.allowUnionTypes||Wc(t,e),Qc(t,t.dataTypes))}o(Gc,"checkStrictTypes");function Bc(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Ws(t.dataTypes,r)||Kr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Xc(t,e)}}o(Bc,"checkContextTypes");function Wc(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Kr(t,"use allowUnionTypes to allow union type keyword")}o(Wc,"checkMultipleTypes");function Qc(t,e){
|
|
102
|
-
let r=t.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,Ur.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(a=>Zc(e,a))&&Kr(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}o(Qc,"checkKeywordTypes");function Zc(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}o(Zc,"hasApplicableType");function Ws(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}o(Ws,"includesType");function Xc(t,e){let r=[];for(let n of t.dataTypes)Ws(e,
|
|
103
|
-
n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}o(Xc,"narrowSchemaTypes");function Kr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,me.checkStrictMode)(t,e,t.opts.strictTypes)}o(Kr,"strictTypesError");var Mt=class{static{o(this,"KeywordCxt")}constructor(e,r,n){if((0,ut.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.
|
|
104
|
-
schema&&this.schema.$data,this.schemaValue=(0,me.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Zs(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ut.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const(
|
|
105
|
-
"_errs",b.default.errors))}result(e,r,n){this.failResult((0,v.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,v.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;
|
|
106
|
-
this.fail((0,v._)`${r} !== undefined && (${(0,v.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?ct.reportExtraError:ct.reportError)(this,this.def.error,r)}$dataError(){(0,ct.reportError)(this,this.def.$dataError||ct.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ct.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.
|
|
107
|
-
gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=v.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=v.nil,r=v.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:a}=this;n.if((0,v.or)((0,v._)`${s} === undefined`,r)),e!==v.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==v.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,v.
|
|
108
|
-
or)(a(),c());function a(){if(n.length){if(!(r instanceof v.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,v._)`${(0,Dt.checkDataTypes)(u,r,i.opts.strictNumbers,Dt.DataType.Wrong)}`}return v.nil}function c(){if(s.validateSchema){let u=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,v._)`!${u}(${r})`}return v.nil}}subschema(e,r){let n=(0,zr.getSubschema)(this.it,e);(0,zr.extendSubschemaData)(n,this.it,e),(0,zr.extendSubschemaMode)(n,e);let s={
|
|
109
|
-
...this.it,...n,items:void 0,props:void 0};return Fc(s,r),s}mergeEvaluated(e,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=me.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=me.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,v.Name)),!0}};we.KeywordCxt=Mt;function Qs(t,e,r,n){let s=new Mt(
|
|
110
|
-
t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,ut.funcKeywordCode)(s,r):"macro"in r?(0,ut.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,ut.funcKeywordCode)(s,r)}o(Qs,"keywordCode");var Yc=/^\/(?:[^~]|~0|~1)*$/,eu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Zs(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return b.default.rootData;if(t[0]==="/"){if(!Yc.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=b.default.rootData}else{let l=eu.exec(t);if(!l)throw new Error(
|
|
111
|
-
`Invalid JSON-pointer: ${t}`);let d=+l[1];if(s=l[2],s==="#"){if(d>=e)throw new Error(u("property/index",d));return n[e-d]}if(d>e)throw new Error(u("data",d));if(i=r[e-d],!s)return i}let a=i,c=s.split("/");for(let l of c)l&&(i=(0,v._)`${i}${(0,v.getProperty)((0,me.unescapeJsonPointer)(l))}`,a=(0,v._)`${a} && ${i}`);return a;function u(l,d){return`Cannot access ${l} ${d} levels up, current level is ${e}`}}o(Zs,"getData");we.getData=Zs});var xt=$(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});var Hr=class extends Error{static{o(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Lr.default=Hr});var dt=$(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});var Jr=at(),Gr=class extends Error{static{o(this,"MissingRefError")}constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jr.resolveUrl)(e,r,n),this.missingSchema=(0,Jr.normalizeId)((0,Jr.getFullPath)(e,this.missingRef))}};Br.default=Gr});var Vt=$(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.resolveSchema=ee.getCompilingSchema=ee.resolveRef=ee.compileSchema=ee.SchemaEnv=void 0;var ne=N(),tu=xt(),je=pe(),se=at(),Xs=q(),ru=lt(),Ue=class{static{o(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,se.normalizeId)(n?.[e.schemaId||
|
|
112
|
-
"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ee.SchemaEnv=Ue;function Qr(t){let e=Ys.call(this,t);if(e)return e;let r=(0,se.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,a=new ne.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),c;t.$async&&(c=a.scopeValue("Error",{ref:tu.default,code:(0,ne._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName(
|
|
113
|
-
"validate");t.validateName=u;let l={gen:a,allErrors:this.opts.allErrors,data:je.default.data,parentData:je.default.parentData,parentDataProperty:je.default.parentDataProperty,dataNames:[je.default.data],dataPathArr:[ne.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,ne.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ne.
|
|
114
|
-
nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ne._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(t),(0,ru.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let f=a.toString();d=`${a.scopeRefs(je.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,t));let m=new Function(`${je.default.self}`,`${je.default.scope}`,d)(this,this.scope.get());if(this.scope.value(u,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&
|
|
115
|
-
(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:u,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){let{props:p,items:h}=l;m.evaluated={props:p instanceof ne.Name?void 0:p,items:h instanceof ne.Name?void 0:h,dynamicProps:p instanceof ne.Name,dynamicItems:h instanceof ne.Name},m.source&&(m.source.evaluated=(0,ne.stringify)(m.evaluated))}return t.validate=m,t}catch(f){throw delete t.validate,delete t.validateName,d&&this.logger.error("Error compiling schema, function \
|
|
116
|
-
code:",d),f}finally{this._compilations.delete(t)}}o(Qr,"compileSchema");ee.compileSchema=Qr;function nu(t,e,r){var n;r=(0,se.resolveUrl)(this.opts.uriResolver,e,r);let s=t.refs[r];if(s)return s;let i=iu.call(this,t,r);if(i===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;a&&(i=new Ue({schema:a,schemaId:c,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=su.call(this,i)}o(nu,"resolveRef");ee.resolveRef=nu;function su(t){return(0,se.inlineRef)(t.schema,this.opts.
|
|
117
|
-
inlineRefs)?t.schema:t.validate?t:Qr.call(this,t)}o(su,"inlineOrCompile");function Ys(t){for(let e of this._compilations)if(ou(e,t))return e}o(Ys,"getCompilingSchema");ee.getCompilingSchema=Ys;function ou(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}o(ou,"sameSchemaEnv");function iu(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Ft.call(this,t,e)}o(iu,"resolve");function Ft(t,e){let r=this.opts.uriResolver.parse(e),n=(0,se._getFullPath)(
|
|
118
|
-
this.opts.uriResolver,r),s=(0,se.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return Wr.call(this,r,t);let i=(0,se.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let c=Ft.call(this,t,a);return typeof c?.schema!="object"?void 0:Wr.call(this,r,c)}if(typeof a?.schema=="object"){if(a.validate||Qr.call(this,a),i===(0,se.normalizeId)(e)){let{schema:c}=a,{schemaId:u}=this.opts,l=c[u];return l&&(s=(0,se.resolveUrl)(this.opts.uriResolver,
|
|
119
|
-
s,l)),new Ue({schema:c,schemaId:u,root:t,baseId:s})}return Wr.call(this,r,a)}}o(Ft,"resolveSchema");ee.resolveSchema=Ft;var au=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Wr(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,Xs.unescapeFragment)(c)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];
|
|
120
|
-
!au.has(c)&&l&&(e=(0,se.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Xs.schemaHasRulesButRef)(r,this.RULES)){let c=(0,se.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Ft.call(this,n,c)}let{schemaId:a}=this.opts;if(i=i||new Ue({schema:r,schemaId:a,root:n,baseId:e}),i.schema!==i.root.schema)return i}o(Wr,"getJsonPointer")});var eo=$((Ih,cu)=>{cu.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 rn=$((Th,ao)=>{"use strict";var uu=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Xr=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),qe=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Yr=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ro=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),en=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),lu=RegExp.prototype.
|
|
121
|
-
test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Q=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)Q[e]="%"+t[e>>4]+t[e&15]}function H(t){return t<2048?Q[192|t>>6]+Q[128|t&63]:t<65536?Q[224|t>>12]+Q[128|t>>6&63]+Q[128|t&63]:Q[240|t>>18]+Q[128|t>>12&63]+Q[128|t>>6&63]+Q[128|t&63]}o(H,"percentEncodeNonAscii");function du(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){
|
|
122
|
-
if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}o(du,"stringArrayToHexStripped");var fu=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),hu=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),pu=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),mu=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function yu(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!pu(t[e])){if(t[e]==="%"&&e+2<t.length&&qe(t.slice(e+1,
|
|
123
|
-
e+3))){e+=2;continue}return!1}return!0}o(yu,"isZoneIdentifier");function to(t){let e=-1,r=0,n=-1,s=0;for(let c=0;c<t.length;c++)t[c]==="0"?(n===-1&&(n=c),s++,s>r&&(r=s,e=n)):(n=-1,s=0);if(r<2)return t.join(":");let i=t.slice(0,e).join(":"),a=t.slice(e+r).join(":");return i+"::"+a}o(to,"compressIPv6ZeroRun");function gu(t){let e=t.indexOf("::");if(e!==-1&&t.indexOf("::",e+1)!==-1)return;let r=e===-1?t.split(":"):t.slice(0,e).split(":"),n=e===-1?[]:t.slice(e+2).split(":");e!==-1&&(r.length===1&&r[0]===
|
|
124
|
-
""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));let s=r.concat(n),i=0;for(let c=0;c<s.length;c++){let u=s[c];if(u==="")return;if(u.indexOf(".")!==-1){if(c!==s.length-1||e!==-1&&n.length===0||!Xr(u))return;i+=2;continue}if(!fu(u))return;s[c]=parseInt(u,16).toString(16),i++}if(e===-1)return i!==8?void 0:to(s);if(i>=8)return;let a=s.slice(0,r.length);for(let c=i;c<8;c++)a.push("0");for(let c=r.length;c<s.length;c++)a.push(s[c]);return to(a)}o(gu,"normalizeIPv6Address");function Zr(t){let e=t[0]===
|
|
125
|
-
"["&&t[t.length-1]==="]";if((t[0]==="["||t[t.length-1]==="]")&&!e)return{host:t,isIPV6:!1,error:!0};let n=e?t.slice(1,-1):t;if(e&&hu(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(_u(n,":")<2)return{host:t,isIPV6:!1,error:e};let s="",i=n.indexOf("%");if(i!==-1){let c=n.slice(i,i+3).toLowerCase()==="%25"?3:1;if(s=n.slice(i+c),!yu(s))return{host:t,isIPV6:!1,error:!0};n=n.slice(0,i)}let a=gu(n);return a===void 0?{host:t,isIPV6:!1,error:!0}:{host:a+(s?"%"+s:""),
|
|
126
|
-
escapedHost:a+(s?"%25"+s:""),isIPV6:!0}}o(Zr,"normalizeIPv6");function _u(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}o(_u,"findToken");function $u(t){let e=t,r=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(s===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");
|
|
127
|
-
break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}o($u,"removeDotSegments");var vu={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},wu=/[@/?#:]/g,bu=/[@/?#]/g;function no(t,e){let r=e?
|
|
128
|
-
bu:wu;return r.lastIndex=0,t.replace(r,n=>vu[n])}o(no,"reescapeHostDelimiters");function so(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let s=t.slice(n+1,n+3);if(qe(s)){let i=s.toUpperCase(),a=String.fromCharCode(parseInt(i,16));e&&Yr(a)?r+=a:r+="%"+i,n+=2;continue}}r+=t[n]}return r}o(so,"normalizePercentEncoding");function Su(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(qe(s)){
|
|
129
|
-
let i=s.toUpperCase(),a=String.fromCharCode(parseInt(i,16));a!=="."&&Yr(a)?e+=a:e+="%"+i,r+=2;continue}}if(ro(n))e+=n;else{let s=t.charCodeAt(r);if(s<128)e+=io(s)?n:Q[s];else if(s<55296||s>57343)e+=H(s);else if(s<=56319&&r+1<t.length){let i=t.charCodeAt(r+1);i>=56320&&i<=57343?(e+=H(65536+(s-55296<<10)+(i-56320)),r++):e+=H(65533)}else e+=H(65533)}}return e}o(Su,"normalizePathEncoding");function Eu(t,e=!1){let r="",n=e&&t[0]!=="/";for(let s=0;s<t.length;s++){let i=t[s];if(i==="%"&&s+2<t.length){let a=t.
|
|
130
|
-
slice(s+1,s+3);if(qe(a)){r+="%"+a.toUpperCase(),s+=2;continue}}if(i==="/"&&(n=!1),ro(i)&&(i!==":"||!n))r+=i;else{let a=t.charCodeAt(s);if(a<128)r+=Q[a];else if(a<55296||a>57343)r+=H(a);else if(a<=56319&&s+1<t.length){let c=t.charCodeAt(s+1);c>=56320&&c<=57343?(r+=H(65536+(a-55296<<10)+(c-56320)),s++):r+=H(65533)}else r+=H(65533)}}return r}o(Eu,"serializePathEncoding");function tn(t,e){let r="";for(let n=0;n<t.length;n++){let s=t[n];if(s==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(qe(i)){r+="%"+
|
|
131
|
-
i.toUpperCase(),n+=2;continue}}if(e(s))r+=s;else{let i=t.charCodeAt(n);if(i<128)r+=Q[i];else if(i<55296||i>57343)r+=H(i);else if(i<=56319&&n+1<t.length){let a=t.charCodeAt(n+1);a>=56320&&a<=57343?(r+=H(65536+(i-55296<<10)+(a-56320)),n++):r+=H(65533)}else r+=H(65533)}}return r}o(tn,"encodeComponent");function oo(t){return tn(t,lu)}o(oo,"encodeUserinfo");function Pu(t){return tn(t,en)}o(Pu,"encodeQuery");function Ou(t){return tn(t,en)}o(Ou,"encodeFragment");function io(t){return t>=48&&t<=57||t>=65&&
|
|
132
|
-
t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}o(io,"isEscapeSafe");function Nu(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(qe(s)){let i=s.toUpperCase(),a=String.fromCharCode(parseInt(i,16));Yr(a)?e+=a:e+="%"+i,r+=2;continue}}if(en(n))e+=n;else{let s=t.charCodeAt(r);if(s<128)e+=io(s)?n:Q[s];else if(s<55296||s>57343)e+=H(s);else if(s<=56319&&r+1<t.length){let i=t.charCodeAt(r+1);i>=56320&&i<=57343?(e+=H(65536+
|
|
133
|
-
(s-55296<<10)+(i-56320)),r++):e+=H(65533)}else e+=H(65533)}}return e}o(Nu,"normalizeQueryFragmentEncoding");function ku(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(qe(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}o(ku,"escapePreservingEscapes");function ju(t){let e=[];if(t.userinfo!==void 0&&(e.push(oo(t.userinfo)),e.push("@")),t.host!==void 0){let r=t.host;if(!Xr(r)){let n=Zr(r);n.isIPV6!==!0&&n.isIPVFuture!==!0&&(r=so(r,!0),
|
|
134
|
-
n=Zr(r)),n.isIPV6===!0||n.isIPVFuture===!0?r=`[${n.escapedHost}]`:r=no(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}o(ju,"recomposeAuthority");ao.exports={nonSimpleDomain:mu,recomposeAuthority:ju,reescapeHostDelimiters:no,normalizePercentEncoding:so,normalizePathEncoding:Su,serializePathEncoding:Eu,normalizeQueryFragmentEncoding:Nu,encodeUserinfo:oo,encodeQuery:Pu,encodeFragment:Ou,escapePreservingEscapes:ku,
|
|
135
|
-
removeDotSegments:$u,isIPv4:Xr,isUUID:uu,normalizeIPv6:Zr,stringArrayToHexStripped:du}});var ho=$((Ch,fo)=>{"use strict";var{isUUID:qu}=rn(),Ru=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,Iu=["http","https","ws","wss","urn","urn:uuid"];function Tu(t){return Iu.indexOf(t)!==-1}o(Tu,"isValidSchemeName");function nn(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}o(nn,"wsIsSecure");function co(t){return t.host||(t.
|
|
136
|
-
error=t.error||"HTTP URIs must have a host."),t}o(co,"httpParse");function uo(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}o(uo,"httpSerialize");function Au(t){return t.secure=nn(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}o(Au,"wsParse");function Cu(t){if((t.port===(nn(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",
|
|
137
|
-
t.secure=void 0),t.resourceName){let e=t.resourceName.indexOf("?"),r=e===-1?t.resourceName:t.resourceName.slice(0,e);t.path=r&&r!=="/"?r:void 0,t.query=e===-1?void 0:t.resourceName.slice(e+1),t.resourceName=void 0}return t.fragment=void 0,t}o(Cu,"wsSerialize");function Du(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Ru);if(r&&r[0]===t.path){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let s=`${n}:${e.nid||t.nid}`,i=sn(s);t.path=void 0,i&&(t=i.
|
|
138
|
-
parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}o(Du,"urnParse");function Mu(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=`${r}:${e.nid||n}`,i=sn(s);i&&(t=i.serialize(t,e));let a=t,c=t.nss;return a.path=`${n||e.nid}:${c}`,e.skipEscape=!0,a}o(Mu,"urnSerialize");function xu(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!qu(r.uuid))&&(r.error=r.error||"UUID is not val\
|
|
139
|
-
id."),r}o(xu,"urnuuidParse");function Fu(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}o(Fu,"urnuuidSerialize");var lo={scheme:"http",domainHost:!0,parse:co,serialize:uo},Vu={scheme:"https",domainHost:lo.domainHost,parse:co,serialize:uo},zt={scheme:"ws",domainHost:!0,parse:Au,serialize:Cu},zu={scheme:"wss",domainHost:zt.domainHost,parse:zt.parse,serialize:zt.serialize},Uu={scheme:"urn",parse:Du,serialize:Mu,skipNormalize:!0},Ku={scheme:"urn:uuid",parse:xu,serialize:Fu,skipNormalize:!0},Ut={
|
|
140
|
-
http:lo,https:Vu,ws:zt,wss:zu,urn:Uu,"urn:uuid":Ku};Object.setPrototypeOf(Ut,null);function sn(t){return t&&(Ut[t]||Ut[t.toLowerCase()])||void 0}o(sn,"getSchemeHandler");fo.exports={wsIsSecure:nn,SCHEMES:Ut,isValidSchemeName:Tu,getSchemeHandler:sn}});var No=$((Mh,Lt)=>{"use strict";var{normalizeIPv6:_o,removeDotSegments:ht,recomposeAuthority:Hu,normalizePercentEncoding:$o,normalizePathEncoding:Lu,serializePathEncoding:po,normalizeQueryFragmentEncoding:mo,encodeQuery:Ju,encodeFragment:Gu,reescapeHostDelimiters:Bu,isIPv4:vo,nonSimpleDomain:Wu}=rn(),{SCHEMES:wo,getSchemeHandler:on}=ho(),bo=/^[A-Za-z][A-Za-z0-9+.-]*$/u,So="URI scheme is malformed.";function yo(t){let e=unescape(String(t));if(!bo.test(e))throw new TypeError(So);return e}o(yo,"dec\
|
|
141
|
-
odeValidScheme");function Qu(t,e){return typeof t=="string"?t=sl(t,e):typeof t=="object"&&(t=Ht(Re(t,e),e)),t}o(Qu,"normalize");function Zu(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:i,malformedPercentEncoding:a,malformedSchemeSpecific:c,malformedHost:u,malformedScheme:l}=Kt(t,n),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:g,malformedSchemeSpecific:m,malformedHost:p,malformedScheme:h}=Kt(e,n);if(i||f||a||g||c||m||u||p||l||
|
|
142
|
-
h)throw new Error(s.error||d.error||"URI is malformed.");let y=Eo(s,d,n,!0),_=on(r&&r.scheme||y.scheme),w=y.host,O=w!==void 0&&w!==""&&(vo(w)||_o(w).isIPV6);Po(y,r||{},_,O);let T=w&&w.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(w);if(y.error&&!T)throw new Error(y.error);return n.skipEscape=!0,Re(y,n)}o(Zu,"resolve");function Eo(t,e,r,n){let s={};return n||(t=Ht(Re(t,r),r),e=Ht(Re(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,
|
|
143
|
-
s.path=ht(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ht(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=ht(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=ht(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=
|
|
144
|
-
t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}o(Eo,"resolveComponent");function Xu(t,e,r){let n=go(t,r),s=go(e,r);return n!==void 0&&s!==void 0&&n===s}o(Xu,"equal");function Re(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),s=[];r.scheme&&(r.scheme=yo(r.scheme));
|
|
145
|
-
let i=on(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n);let a=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,c=!n.skipEscape&&r.scheme===void 0&&!a;r.path!==void 0&&(n.skipEscape?r.path=$o(r.path):r.path=po(r.path,c)),n.reference!=="suffix"&&r.scheme&&(r.scheme=yo(r.scheme),s.push(r.scheme,":"));let u=Hu(r);if(u!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(u),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(l=ht(l)),
|
|
146
|
-
c&&(l=po(l,!0)),u===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),s.push(l)}return r.query!==void 0&&s.push("?",Ju(r.query)),r.fragment!==void 0&&s.push("#",Gu(r.fragment)),s.join("")}o(Re,"serialize");var Yu=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,el=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,tl=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function rl(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start wi\
|
|
147
|
-
th "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}o(rl,"getParseError");function ft(t){if(t===void 0)return!1;let e=t.indexOf("%");for(;e!==-1;){if(e+2>=t.length||!/^[\da-f]{2}$/iu.test(t.slice(e+1,e+3)))return!0;e=t.indexOf("%",e+3)}return!1}o(ft,"hasMalformedPercentEncoding");function nl(t){let e=t[4];return ft(t[3])||e!==void 0&&!(e[0]==="["&&e[e.length-1]==="]")&&ft(e)||ft(t[6])||ft(t[7])||ft(t[8])}o(nl,"hasMalformedCompone\
|
|
148
|
-
ntPercentEncoding");function Po(t,e,r,n){if(!e.unicodeSupport&&(!r||!r.unicodeSupport)&&t.host&&t.host[0]!=="["&&(e.domainHost||r&&r.domainHost)&&n===!1&&Wu(t.host))try{t.host=new URL("http://"+t.host).hostname}catch(s){return t.error=t.error||"Host's domain name can not be converted to ASCII: "+s,!0}return!1}o(Po,"canonicalizeHost");function Kt(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,i=!1,a=!1,c=!1,u=!1,l=!1,
|
|
149
|
-
d=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let f=t.match(el);f!==null&&f[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",s=!0);let g=t.match(tl);if(g!==null){let p=g[1],h=p.replace(/[\t\n\r]/g,"");h.length>=2&&(h.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",s=!0):p.length!==h.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0))}let m=t.match(Yu);if(m){if(n.
|
|
150
|
-
scheme=m[1],n.userinfo=m[3],n.host=m[4],n.port=parseInt(m[5],10),n.path=m[6]||"",n.query=m[7],n.fragment=m[8],n.scheme!==void 0){let y=unescape(n.scheme);bo.test(y)?n.scheme=y.toLowerCase():(n.error=n.error||So,l=!0)}i=nl(m),i&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=m[5]);let p=rl(n,m);if(p!==void 0&&(n.error=n.error||p,s=!0),n.host)if(vo(n.host)===!1){let _=n.host[0]==="["&&n.host[n.host.length-1]==="]",w=_o(n.host);d=w.isIPV6||w.isIPVFuture===!0,u=
|
|
151
|
-
_&&w.error===!0,n.host=d?w.host:w.host.toLowerCase(),u&&(n.error=n.error||"URI host is malformed.",s=!0)}else d=!0;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":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let h=on(r.scheme||n.scheme);if(c=
|
|
152
|
-
Po(n,r,h,d),!h||h&&!h.skipNormalize){if(t.indexOf("%")!==-1&&n.host!==void 0&&!u){let y=d?n.host:$o(n.host,!0);n.host=Bu(y,d)}n.path&&(n.path=Lu(n.path)),n.query&&(n.query=mo(n.query)),n.fragment&&(n.fragment=mo(n.fragment))}h&&h.parse&&(h.parse(n,r),h===wo.urn&&n.nid===void 0&&(a=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:l}}o(Kt,"parseWithStatus");function Ht(t,e){
|
|
153
|
-
return Kt(t,e).parsed}o(Ht,"parse");function sl(t,e){return Oo(t,e).normalized}o(sl,"normalizeString");function Oo(t,e){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=Kt(t,e);return{normalized:n||s||i||a||c?t:Re(r,e),malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}}o(Oo,"normalizeStringWithStatus");function go(t,e){if(typeof t!="string"&&typeof t!="ob\
|
|
154
|
-
ject")return;let r;try{r=typeof t=="string"?t:Re(t,e)}catch{return}let{normalized:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=Oo(r,e);return s||i||a||c||u?void 0:n}o(go,"normalizeComparableURI");var an={SCHEMES:wo,normalize:Qu,resolve:Zu,resolveComponent:Eo,equal:Xu,serialize:Re,parse:Ht};Lt.exports=an;Lt.exports.default=an;Lt.exports.fastUri=an});var jo=$(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});var ko=No();ko.code='require("ajv/dist/runtime/uri").default';cn.default=ko});var Mo=$(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;var ol=lt();Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:o(function(){return ol.KeywordCxt},"get")});var Ke=N();Object.defineProperty(F,"_",{enumerable:!0,get:o(function(){return Ke._},"get")});Object.defineProperty(F,"str",{enumerable:!0,get:o(function(){return Ke.str},"get")});Object.defineProperty(F,"stringify",{enumerable:!0,get:o(function(){return Ke.
|
|
155
|
-
stringify},"get")});Object.defineProperty(F,"nil",{enumerable:!0,get:o(function(){return Ke.nil},"get")});Object.defineProperty(F,"Name",{enumerable:!0,get:o(function(){return Ke.Name},"get")});Object.defineProperty(F,"CodeGen",{enumerable:!0,get:o(function(){return Ke.CodeGen},"get")});var il=xt(),Ao=dt(),al=Rr(),pt=Vt(),cl=N(),mt=at(),Jt=it(),ln=q(),qo=eo(),ul=jo(),Co=o((t,e)=>new RegExp(t,e),"defaultRegExp");Co.code="new RegExp";var ll=["removeAdditional","useDefaults","coerceTypes"],dl=new Set(
|
|
156
|
-
["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),fl={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\
|
|
157
|
-
: {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."},
|
|
158
|
-
hl={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ro=200;function pl(t){var e,r,n,s,i,a,c,u,l,d,f,g,m,p,h,y,_,w,O,T,S,ae,de,ar,cr;let Qe=t.strict,ur=(e=t.code)===null||e===void 0?void 0:e.optimize,es=ur===!0||ur===void 0?1:ur||0,ts=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Co,Wi=(s=t.uriResolver)!==null&&s!==void 0?s:ul.default;return{strictSchema:(a=(i=t.strictSchema)!==null&&i!==void 0?i:Qe)!==
|
|
159
|
-
null&&a!==void 0?a:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:Qe)!==null&&u!==void 0?u:!0,strictTypes:(d=(l=t.strictTypes)!==null&&l!==void 0?l:Qe)!==null&&d!==void 0?d:"log",strictTuples:(g=(f=t.strictTuples)!==null&&f!==void 0?f:Qe)!==null&&g!==void 0?g:"log",strictRequired:(p=(m=t.strictRequired)!==null&&m!==void 0?m:Qe)!==null&&p!==void 0?p:!1,code:t.code?{...t.code,optimize:es,regExp:ts}:{optimize:es,regExp:ts},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Ro,loopEnum:(y=
|
|
160
|
-
t.loopEnum)!==null&&y!==void 0?y:Ro,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(w=t.messages)!==null&&w!==void 0?w:!0,inlineRefs:(O=t.inlineRefs)!==null&&O!==void 0?O:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(S=t.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(ae=t.validateSchema)!==null&&ae!==void 0?ae:!0,validateFormats:(de=t.validateFormats)!==null&&de!==void 0?de:!0,unicodeRegExp:(ar=t.unicodeRegExp)!==null&&ar!==void 0?ar:!0,int32range:(cr=t.int32range)!==
|
|
161
|
-
null&&cr!==void 0?cr:!0,uriResolver:Wi}}o(pl,"requiredOptions");var yt=class{static{o(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...pl(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new cl.ValueScope({scope:{},prefixes:dl,es5:r,lines:n}),this.logger=vl(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,al.getRules)(),Io.call(this,fl,e,"NOT SUPPORT\
|
|
162
|
-
ED"),Io.call(this,hl,e,"DEPRECATED","warn"),this._metaOpts=_l.call(this),e.formats&&yl.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&gl.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),ml.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,s=qo;n==="id"&&(s={...qo},s.id=s.$id,delete s.$id),r&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.
|
|
163
|
-
opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;
|
|
164
|
-
return s.call(this,e,r);async function s(d,f){await i.call(this,d.$schema);let g=this._addSchema(d,f);return g.validate||a.call(this,g)}async function i(d){d&&!this.getSchema(d)&&await s.call(this,{$ref:d},!0)}async function a(d){try{return this._compileSchemaEnv(d)}catch(f){if(!(f instanceof Ao.default))throw f;return c.call(this,f),await u.call(this,f.missingSchema),a.call(this,d)}}function c({missingSchema:d,missingRef:f}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${f} can\
|
|
165
|
-
not be resolved`)}async function u(d){let f=await l.call(this,d);this.refs[d]||await i.call(this,f.$schema),this.refs[d]||this.addSchema(f,d,r)}async function l(d){let f=this._loading[d];if(f)return f;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(e,r,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:a}=this.opts;if(i=e[a],i!==void 0&&typeof i!="string")throw new Error(
|
|
166
|
-
`schema ${a} must be string`)}return r=(0,mt.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,s,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.
|
|
167
|
-
validate(n,e);if(!s&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let r;for(;typeof(r=To.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,s=new pt.SchemaEnv({schema:{},schemaId:n});if(r=pt.resolveSchema.call(this,s,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),
|
|
168
|
-
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 r=To.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,mt.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("aj\
|
|
169
|
-
v.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(bl.call(this,n,r),!r)return(0,ln.
|
|
170
|
-
eachItem)(n,i=>un.call(this,i)),this;El.call(this,r);let s={...r,type:(0,Jt.getJSONTypes)(r.type),schemaType:(0,Jt.getJSONTypes)(r.schemaType)};return(0,ln.eachItem)(n,s.type.length===0?i=>un.call(this,i,s):i=>s.type.forEach(a=>un.call(this,i,s,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,r){
|
|
171
|
-
return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of r){let i=s.split("/").slice(1),a=e;for(let c of i)a=a[c];for(let c in n){let u=n[c];if(typeof u!="object")continue;let{$data:l}=u.definition,d=a[c];l&&d&&(a[c]=Do(d))}}return e}_removeAllSchemas(e,r){
|
|
172
|
-
for(let n in e){let s=e[n];(!r||r.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,r,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof e=="object")a=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,mt.normalizeId)(a||n);let l=mt.getSchemaRefs.call(
|
|
173
|
-
this,e,n);return u=new pt.SchemaEnv({schema:e,schemaId:c,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),s&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):pt.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){
|
|
174
|
-
let r=this.opts;this.opts=this._metaOpts;try{pt.compileSchema.call(this,e)}finally{this.opts=r}}};yt.ValidationError=il.default;yt.MissingRefError=Ao.default;F.default=yt;function Io(t,e,r,n="error"){for(let s in t){let i=s;i in e&&this.logger[n](`${r}: option ${s}. ${t[i]}`)}}o(Io,"checkOptions");function To(t){return t=(0,mt.normalizeId)(t),this.schemas[t]||this.refs[t]}o(To,"getSchEnv");function ml(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(
|
|
175
|
-
t[e],e)}o(ml,"addInitialSchemas");function yl(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}o(yl,"addInitialFormats");function gl(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}o(gl,"addInitialKeywords");function _l(){let t={...this.opts};for(let e of ll)delete t[e];return t}o(_l,"getMetaSchemaOptions");var $l={log(){},
|
|
176
|
-
warn(){},error(){}};function vl(t){if(t===!1)return $l;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}o(vl,"getLogger");var wl=/^[a-z_$][a-z0-9_$:-]*$/i;function bl(t,e){let{RULES:r}=this;if((0,ln.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!wl.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data \
|
|
177
|
-
keyword must have "code" or "validate" function')}o(bl,"checkKeyword");function un(t,e,r){var n;let s=e?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=s?i.post:i.rules.find(({type:u})=>u===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,Jt.getJSONTypes)(e.type),schemaType:(0,Jt.getJSONTypes)(e.schemaType)}};e.before?Sl.call(this,a,c,e.before):a.rules.push(c),i.all[t]=c,(n=e.implements)===
|
|
178
|
-
null||n===void 0||n.forEach(u=>this.addKeyword(u))}o(un,"addRule");function Sl(t,e,r){let n=t.rules.findIndex(s=>s.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}o(Sl,"addBeforeRule");function El(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Do(e)),t.validateSchema=this.compile(e,!0))}o(El,"keywordMetaschema");var Pl={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Do(t){return{
|
|
179
|
-
anyOf:[t,Pl]}}o(Do,"schemaOrData")});var xo=$(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});var Ol={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};dn.default=Ol});var Uo=$(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.callRef=Ie.getValidate=void 0;var Nl=dt(),Fo=Y(),Z=N(),He=pe(),Vo=Vt(),Gt=q(),kl={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:a,opts:c,self:u}=n,{root:l}=i;if((r==="#"||r==="#/")&&s===l.baseId)return f();let d=Vo.resolveRef.call(u,l,s,r);if(d===void 0)throw new Nl.default(n.opts.uriResolver,s,r);if(d instanceof Vo.SchemaEnv)return g(d);return m(d);function f(){
|
|
180
|
-
if(i===l)return Bt(t,a,i,i.$async);let p=e.scopeValue("root",{ref:l});return Bt(t,(0,Z._)`${p}.validate`,l,l.$async)}function g(p){let h=zo(t,p);Bt(t,h,p,p.$async)}function m(p){let h=e.scopeValue("schema",c.code.source===!0?{ref:p,code:(0,Z.stringify)(p)}:{ref:p}),y=e.name("valid"),_=t.subschema({schema:p,dataTypes:[],schemaPath:Z.nil,topSchemaRef:h,errSchemaPath:r},y);t.mergeEvaluated(_),t.ok(y)}}};function zo(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Z._)`${r.
|
|
181
|
-
scopeValue("wrapper",{ref:e})}.validate`}o(zo,"getValidate");Ie.getValidate=zo;function Bt(t,e,r,n){let{gen:s,it:i}=t,{allErrors:a,schemaEnv:c,opts:u}=i,l=u.passContext?He.default.this:Z.nil;n?d():f();function d(){if(!c.$async)throw new Error("async schema referenced by sync schema");let p=s.let("valid");s.try(()=>{s.code((0,Z._)`await ${(0,Fo.callValidateCode)(t,e,l)}`),m(e),a||s.assign(p,!0)},h=>{s.if((0,Z._)`!(${h} instanceof ${i.ValidationError})`,()=>s.throw(h)),g(h),a||s.assign(p,!1)}),t.ok(
|
|
182
|
-
p)}o(d,"callAsyncRef");function f(){t.result((0,Fo.callValidateCode)(t,e,l),()=>m(e),()=>g(e))}o(f,"callSyncRef");function g(p){let h=(0,Z._)`${p}.errors`;s.assign(He.default.vErrors,(0,Z._)`${He.default.vErrors} === null ? ${h} : ${He.default.vErrors}.concat(${h})`),s.assign(He.default.errors,(0,Z._)`${He.default.vErrors}.length`)}o(g,"addErrorsFrom");function m(p){var h;if(!i.opts.unevaluated)return;let y=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)
|
|
183
|
-
y.props!==void 0&&(i.props=Gt.mergeEvaluated.props(s,y.props,i.props));else{let _=s.var("props",(0,Z._)`${p}.evaluated.props`);i.props=Gt.mergeEvaluated.props(s,_,i.props,Z.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Gt.mergeEvaluated.items(s,y.items,i.items));else{let _=s.var("items",(0,Z._)`${p}.evaluated.items`);i.items=Gt.mergeEvaluated.items(s,_,i.items,Z.Name)}}o(m,"addEvaluatedFrom")}o(Bt,"callRef");Ie.callRef=Bt;Ie.default=kl});var Ko=$(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});var jl=xo(),ql=Uo(),Rl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",jl.default,ql.default];fn.default=Rl});var Ho=$(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});var Wt=N(),be=Wt.operators,Qt={maximum:{okStr:"<=",ok:be.LTE,fail:be.GT},minimum:{okStr:">=",ok:be.GTE,fail:be.LT},exclusiveMaximum:{okStr:"<",ok:be.LT,fail:be.GTE},exclusiveMinimum:{okStr:">",ok:be.GT,fail:be.LTE}},Il={message:o(({keyword:t,schemaCode:e})=>(0,Wt.str)`must be ${Qt[t].okStr} ${e}`,"message"),params:o(({keyword:t,schemaCode:e})=>(0,Wt._)`{comparison: ${Qt[t].okStr}, limit: ${e}}`,"params")},Tl={keyword:Object.
|
|
184
|
-
keys(Qt),type:"number",schemaType:"number",$data:!0,error:Il,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Wt._)`${r} ${Qt[e].fail} ${n} || isNaN(${r})`)}};hn.default=Tl});var Lo=$(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});var gt=N(),Al={message:o(({schemaCode:t})=>(0,gt.str)`must be multiple of ${t}`,"message"),params:o(({schemaCode:t})=>(0,gt._)`{multipleOf: ${t}}`,"params")},Cl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Al,code(t){let{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,a=e.let("res"),c=i?(0,gt._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,gt._)`${a} !== parseInt(${a})`;t.fail$data(
|
|
185
|
-
(0,gt._)`(${n} === 0 || (${a} = ${r}/${n}, ${c}))`)}};pn.default=Cl});var Go=$(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});function Jo(t){let e=t.length,r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}o(Jo,"ucs2length");mn.default=Jo;Jo.code='require("ajv/dist/runtime/ucs2length").default'});var Bo=$(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});var Te=N(),Dl=q(),Ml=Go(),xl={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Te.str)`must NOT have ${r} than ${e} characters`},params:o(({schemaCode:t})=>(0,Te._)`{limit: ${t}}`,"params")},Fl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xl,code(t){let{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?Te.operators.GT:Te.operators.LT,a=s.opts.unicode===
|
|
186
|
-
!1?(0,Te._)`${r}.length`:(0,Te._)`${(0,Dl.useFunc)(t.gen,Ml.default)}(${r})`;t.fail$data((0,Te._)`${a} ${i} ${n}`)}};yn.default=Fl});var Wo=$(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});var Vl=Y(),zl=q(),Le=N(),Ul={message:o(({schemaCode:t})=>(0,Le.str)`must match pattern "${t}"`,"message"),params:o(({schemaCode:t})=>(0,Le._)`{pattern: ${t}}`,"params")},Kl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ul,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:a}=t,c=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=a.opts.code,l=u.code==="new RegExp"?(0,Le._)`new RegExp`:(0,zl.useFunc)(
|
|
187
|
-
e,u),d=e.let("valid");e.try(()=>e.assign(d,(0,Le._)`${l}(${i}, ${c}).test(${r})`),()=>e.assign(d,!1)),t.fail$data((0,Le._)`!${d}`)}else{let u=(0,Vl.usePattern)(t,s);t.fail$data((0,Le._)`!${u}.test(${r})`)}}};gn.default=Kl});var Qo=$(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});var _t=N(),Hl={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,_t.str)`must NOT have ${r} than ${e} properties`},params:o(({schemaCode:t})=>(0,_t._)`{limit: ${t}}`,"params")},Ll={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Hl,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?_t.operators.GT:_t.operators.LT;t.fail$data((0,_t.
|
|
188
|
-
_)`Object.keys(${r}).length ${s} ${n}`)}};_n.default=Ll});var Zo=$($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});var $t=Y(),vt=N(),Jl=q(),Gl={message:o(({params:{missingProperty:t}})=>(0,vt.str)`must have required property '${t}'`,"message"),params:o(({params:{missingProperty:t}})=>(0,vt._)`{missingProperty: ${t}}`,"params")},Bl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Gl,code(t){let{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:a}=t,{opts:c}=a;if(!i&&r.length===0)return;let u=r.length>=c.loopRequired;if(a.
|
|
189
|
-
allErrors?l():d(),c.strictRequired){let m=t.parentSchema.properties,{definedProperties:p}=t.it;for(let h of r)if(m?.[h]===void 0&&!p.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,_=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,Jl.checkStrictMode)(a,_,a.opts.strictRequired)}}function l(){if(u||i)t.block$data(vt.nil,f);else for(let m of r)(0,$t.checkReportMissingProp)(t,m)}o(l,"allErrorsMode");function d(){let m=e.let("missing");if(u||i){let p=e.let("valid",!0);t.block$data(
|
|
190
|
-
p,()=>g(m,p)),t.ok(p)}else e.if((0,$t.checkMissingProp)(t,r,m)),(0,$t.reportMissingProp)(t,m),e.else()}o(d,"exitOnErrorMode");function f(){e.forOf("prop",n,m=>{t.setParams({missingProperty:m}),e.if((0,$t.noPropertyInData)(e,s,m,c.ownProperties),()=>t.error())})}o(f,"loopAllRequired");function g(m,p){t.setParams({missingProperty:m}),e.forOf(m,n,()=>{e.assign(p,(0,$t.propertyInData)(e,s,m,c.ownProperties)),e.if((0,vt.not)(p),()=>{t.error(),e.break()})},vt.nil)}o(g,"loopUntilMissing")}};$n.default=
|
|
191
|
-
Bl});var Xo=$(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});var wt=N(),Wl={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,wt.str)`must NOT have ${r} than ${e} items`},params:o(({schemaCode:t})=>(0,wt._)`{limit: ${t}}`,"params")},Ql={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Wl,code(t){let{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?wt.operators.GT:wt.operators.LT;t.fail$data((0,wt._)`${r}.length ${s} ${n}`)}};
|
|
192
|
-
vn.default=Ql});var Zt=$(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});var Yo=Fr();Yo.code='require("ajv/dist/runtime/equal").default';wn.default=Yo});var ei=$(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var bn=it(),V=N(),Zl=q(),Xl=Zt(),Yl={message:o(({params:{i:t,j:e}})=>(0,V.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:o(({params:{i:t,j:e}})=>(0,V._)`{i: ${t}, j: ${e}}`,"params")},ed={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Yl,code(t){let{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:a,it:c}=t;if(!n&&!s)return;let u=e.let("valid"),
|
|
193
|
-
l=i.items?(0,bn.getSchemaTypes)(i.items):[];t.block$data(u,d,(0,V._)`${a} === false`),t.ok(u);function d(){let p=e.let("i",(0,V._)`${r}.length`),h=e.let("j");t.setParams({i:p,j:h}),e.assign(u,!0),e.if((0,V._)`${p} > 1`,()=>(f()?g:m)(p,h))}o(d,"validateUniqueItems");function f(){return l.length>0&&!l.some(p=>p==="object"||p==="array")}o(f,"canOptimize");function g(p,h){let y=e.name("item"),_=(0,bn.checkDataTypes)(l,y,c.opts.strictNumbers,bn.DataType.Wrong),w=e.const("indices",(0,V._)`{}`);e.for((0,V.
|
|
194
|
-
_)`;${p}--;`,()=>{e.let(y,(0,V._)`${r}[${p}]`),e.if(_,(0,V._)`continue`),l.length>1&&e.if((0,V._)`typeof ${y} == "string"`,(0,V._)`${y} += "_"`),e.if((0,V._)`typeof ${w}[${y}] == "number"`,()=>{e.assign(h,(0,V._)`${w}[${y}]`),t.error(),e.assign(u,!1).break()}).code((0,V._)`${w}[${y}] = ${p}`)})}o(g,"loopN");function m(p,h){let y=(0,Zl.useFunc)(e,Xl.default),_=e.name("outer");e.label(_).for((0,V._)`;${p}--;`,()=>e.for((0,V._)`${h} = ${p}; ${h}--;`,()=>e.if((0,V._)`${y}(${r}[${p}], ${r}[${h}])`,()=>{
|
|
195
|
-
t.error(),e.assign(u,!1).break(_)})))}o(m,"loopN2")}};Sn.default=ed});var ti=$(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});var En=N(),td=q(),rd=Zt(),nd={message:"must be equal to constant",params:o(({schemaCode:t})=>(0,En._)`{allowedValue: ${t}}`,"params")},sd={keyword:"const",$data:!0,error:nd,code(t){let{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,En._)`!${(0,td.useFunc)(e,rd.default)}(${r}, ${s})`):t.fail((0,En._)`${i} !== ${r}`)}};Pn.default=sd});var ri=$(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});var bt=N(),od=q(),id=Zt(),ad={message:"must be equal to one of the allowed values",params:o(({schemaCode:t})=>(0,bt._)`{allowedValues: ${t}}`,"params")},cd={keyword:"enum",schemaType:"array",$data:!0,error:ad,code(t){let{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:a}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let c=s.length>=a.opts.loopEnum,u,l=o(()=>u??(u=(0,od.useFunc)(e,id.default)),"ge\
|
|
196
|
-
tEql"),d;if(c||n)d=e.let("valid"),t.block$data(d,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let m=e.const("vSchema",i);d=(0,bt.or)(...s.map((p,h)=>g(m,h)))}t.pass(d);function f(){e.assign(d,!1),e.forOf("v",i,m=>e.if((0,bt._)`${l()}(${r}, ${m})`,()=>e.assign(d,!0).break()))}o(f,"loopEnum");function g(m,p){let h=s[p];return typeof h=="object"&&h!==null?(0,bt._)`${l()}(${r}, ${m}[${p}])`:(0,bt._)`${r} === ${h}`}o(g,"equalCode")}};On.default=cd});var ni=$(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});var ud=Ho(),ld=Lo(),dd=Bo(),fd=Wo(),hd=Qo(),pd=Zo(),md=Xo(),yd=ei(),gd=ti(),_d=ri(),$d=[ud.default,ld.default,dd.default,fd.default,hd.default,pd.default,md.default,yd.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gd.default,_d.default];Nn.default=$d});var jn=$(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.validateAdditionalItems=void 0;var Ae=N(),kn=q(),vd={message:o(({params:{len:t}})=>(0,Ae.str)`must NOT have more than ${t} items`,"message"),params:o(({params:{len:t}})=>(0,Ae._)`{limit: ${t}}`,"params")},wd={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:vd,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,kn.checkStrictMode)(r,'"additionalItem\
|
|
197
|
-
s" is ignored when "items" is not an array of schemas');return}si(t,n)}};function si(t,e){let{gen:r,schema:n,data:s,keyword:i,it:a}=t;a.items=!0;let c=r.const("len",(0,Ae._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ae._)`${c} <= ${e.length}`);else if(typeof n=="object"&&!(0,kn.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,Ae._)`${c} <= ${e.length}`);r.if((0,Ae.not)(l),()=>u(l)),t.ok(l)}function u(l){r.forRange("i",e.length,c,d=>{t.subschema({keyword:i,dataProp:d,dataPropType:kn.
|
|
198
|
-
Type.Num},l),a.allErrors||r.if((0,Ae.not)(l),()=>r.break())})}o(u,"validateItems")}o(si,"validateAdditionalItems");St.validateAdditionalItems=si;St.default=wd});var qn=$(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateTuple=void 0;var oi=N(),Xt=q(),bd=Y(),Sd={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ii(t,"additionalItems",e);r.items=!0,!(0,Xt.alwaysValidSchema)(r,e)&&t.ok((0,bd.validateArray)(t))}};function ii(t,e,r=t.schema){let{gen:n,parentSchema:s,data:i,keyword:a,it:c}=t;d(s),c.opts.unevaluated&&r.length&&c.items!==
|
|
199
|
-
!0&&(c.items=Xt.mergeEvaluated.items(n,r.length,c.items));let u=n.name("valid"),l=n.const("len",(0,oi._)`${i}.length`);r.forEach((f,g)=>{(0,Xt.alwaysValidSchema)(c,f)||(n.if((0,oi._)`${l} > ${g}`,()=>t.subschema({keyword:a,schemaProp:g,dataProp:g},u)),t.ok(u))});function d(f){let{opts:g,errSchemaPath:m}=c,p=r.length,h=p===f.minItems&&(p===f.maxItems||f[e]===!1);if(g.strictTuples&&!h){let y=`"${a}" is ${p}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,Xt.checkStrictMode)(
|
|
200
|
-
c,y,g.strictTuples)}}o(d,"checkStrictTuple")}o(ii,"validateTuple");Et.validateTuple=ii;Et.default=Sd});var ai=$(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});var Ed=qn(),Pd={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(t=>(0,Ed.validateTuple)(t,"items"),"code")};Rn.default=Pd});var ui=$(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});var ci=N(),Od=q(),Nd=Y(),kd=jn(),jd={message:o(({params:{len:t}})=>(0,ci.str)`must NOT have more than ${t} items`,"message"),params:o(({params:{len:t}})=>(0,ci._)`{limit: ${t}}`,"params")},qd={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:jd,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,Od.alwaysValidSchema)(n,e)&&(s?(0,kd.validateAdditionalItems)(
|
|
201
|
-
t,s):t.ok((0,Nd.validateArray)(t)))}};In.default=qd});var li=$(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});var te=N(),Yt=q(),Rd={message:o(({params:{min:t,max:e}})=>e===void 0?(0,te.str)`must contain at least ${t} valid item(s)`:(0,te.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:o(({params:{min:t,max:e}})=>e===void 0?(0,te._)`{minContains: ${t}}`:(0,te._)`{minContains: ${t}, maxContains: ${e}}`,"params")},Id={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uni\
|
|
202
|
-
queItems",trackErrors:!0,error:Rd,code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t,a,c,{minContains:u,maxContains:l}=n;i.opts.next?(a=u===void 0?1:u,c=l):a=1;let d=e.const("len",(0,te._)`${s}.length`);if(t.setParams({min:a,max:c}),c===void 0&&a===0){(0,Yt.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,Yt.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Yt.alwaysValidSchema)(
|
|
203
|
-
i,r)){let h=(0,te._)`${d} >= ${a}`;c!==void 0&&(h=(0,te._)`${h} && ${d} <= ${c}`),t.pass(h);return}i.items=!0;let f=e.name("valid");c===void 0&&a===1?m(f,()=>e.if(f,()=>e.break())):a===0?(e.let(f,!0),c!==void 0&&e.if((0,te._)`${s}.length > 0`,g)):(e.let(f,!1),g()),t.result(f,()=>t.reset());function g(){let h=e.name("_valid"),y=e.let("count",0);m(h,()=>e.if(h,()=>p(y)))}o(g,"validateItemsWithCount");function m(h,y){e.forRange("i",0,d,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:Yt.
|
|
204
|
-
Type.Num,compositeRule:!0},h),y()})}o(m,"validateItems");function p(h){e.code((0,te._)`${h}++`),c===void 0?e.if((0,te._)`${h} >= ${a}`,()=>e.assign(f,!0).break()):(e.if((0,te._)`${h} > ${c}`,()=>e.assign(f,!1).break()),a===1?e.assign(f,!0):e.if((0,te._)`${h} >= ${a}`,()=>e.assign(f,!0)))}o(p,"checkLimits")}};Tn.default=Id});var hi=$(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.validateSchemaDeps=le.validatePropertyDeps=le.error=void 0;var An=N(),Td=q(),Pt=Y();le.error={message:o(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,An.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:o(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,An._)`{property: ${t},
|
|
205
|
-
missingProperty: ${n},
|
|
206
|
-
depsCount: ${e},
|
|
207
|
-
deps: ${r}}`,"params")};var Ad={keyword:"dependencies",type:"object",schemaType:"object",error:le.error,code(t){let[e,r]=Cd(t);di(t,e),fi(t,r)}};function Cd({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let s=Array.isArray(t[n])?e:r;s[n]=t[n]}return[e,r]}o(Cd,"splitDependencies");function di(t,e=t.schema){let{gen:r,data:n,it:s}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let a in e){let c=e[a];if(c.length===0)continue;let u=(0,Pt.propertyInData)(r,
|
|
208
|
-
n,a,s.opts.ownProperties);t.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),s.allErrors?r.if(u,()=>{for(let l of c)(0,Pt.checkReportMissingProp)(t,l)}):(r.if((0,An._)`${u} && (${(0,Pt.checkMissingProp)(t,c,i)})`),(0,Pt.reportMissingProp)(t,i),r.else())}}o(di,"validatePropertyDeps");le.validatePropertyDeps=di;function fi(t,e=t.schema){let{gen:r,data:n,keyword:s,it:i}=t,a=r.name("valid");for(let c in e)(0,Td.alwaysValidSchema)(i,e[c])||(r.if((0,Pt.propertyInData)(r,n,c,i.opts.ownProperties),
|
|
209
|
-
()=>{let u=t.subschema({keyword:s,schemaProp:c},a);t.mergeValidEvaluated(u,a)},()=>r.var(a,!0)),t.ok(a))}o(fi,"validateSchemaDeps");le.validateSchemaDeps=fi;le.default=Ad});var mi=$(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});var pi=N(),Dd=q(),Md={message:"property name must be valid",params:o(({params:t})=>(0,pi._)`{propertyName: ${t.propertyName}}`,"params")},xd={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Md,code(t){let{gen:e,schema:r,data:n,it:s}=t;if((0,Dd.alwaysValidSchema)(s,r))return;let i=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:[
|
|
210
|
-
"string"],propertyName:a,compositeRule:!0},i),e.if((0,pi.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};Cn.default=xd});var Mn=$(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});var er=Y(),oe=N(),Fd=pe(),tr=q(),Vd={message:"must NOT have additional properties",params:o(({params:t})=>(0,oe._)`{additionalProperty: ${t.additionalProperty}}`,"params")},zd={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Vd,code(t){let{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:c,
|
|
211
|
-
opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,tr.alwaysValidSchema)(a,r))return;let l=(0,er.allSchemaProperties)(n.properties),d=(0,er.allSchemaProperties)(n.patternProperties);f(),t.ok((0,oe._)`${i} === ${Fd.default.errors}`);function f(){e.forIn("key",s,y=>{!l.length&&!d.length?p(y):e.if(g(y),()=>p(y))})}o(f,"checkAdditionalProperties");function g(y){let _;if(l.length>8){let w=(0,tr.schemaRefOrVal)(a,n.properties,"properties");_=(0,er.isOwnProperty)(e,w,y)}else l.length?_=(0,oe.or)(...l.
|
|
212
|
-
map(w=>(0,oe._)`${y} === ${w}`)):_=oe.nil;return d.length&&(_=(0,oe.or)(_,...d.map(w=>(0,oe._)`${(0,er.usePattern)(t,w)}.test(${y})`))),(0,oe.not)(_)}o(g,"isAdditional");function m(y){e.code((0,oe._)`delete ${s}[${y}]`)}o(m,"deleteAdditional");function p(y){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){m(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),c||e.break();return}if(typeof r=="object"&&!(0,tr.alwaysValidSchema)(a,r)){let _=e.name("valid");u.removeAdditional===
|
|
213
|
-
"failing"?(h(y,_,!1),e.if((0,oe.not)(_),()=>{t.reset(),m(y)})):(h(y,_),c||e.if((0,oe.not)(_),()=>e.break()))}}o(p,"additionalPropertyCode");function h(y,_,w){let O={keyword:"additionalProperties",dataProp:y,dataPropType:tr.Type.Str};w===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(O,_)}o(h,"applyAdditionalSchema")}};Dn.default=zd});var _i=$(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});var Ud=lt(),yi=Y(),xn=q(),gi=Mn(),Kd={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&gi.default.code(new Ud.KeywordCxt(i,gi.default,"additionalProperties"));let a=(0,yi.allSchemaProperties)(r);for(let f of a)i.definedProperties.add(f);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=xn.mergeEvaluated.
|
|
214
|
-
props(e,(0,xn.toHash)(a),i.props));let c=a.filter(f=>!(0,xn.alwaysValidSchema)(i,r[f]));if(c.length===0)return;let u=e.name("valid");for(let f of c)l(f)?d(f):(e.if((0,yi.propertyInData)(e,s,f,i.opts.ownProperties)),d(f),i.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(u);function l(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}o(l,"hasDefault");function d(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}o(d,"applyPropertySchema")}};
|
|
215
|
-
Fn.default=Kd});var bi=$(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});var $i=Y(),rr=N(),vi=q(),wi=q(),Hd={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:a}=i,c=(0,$i.allSchemaProperties)(r),u=c.filter(h=>(0,vi.alwaysValidSchema)(i,r[h]));if(c.length===0||u.length===c.length&&(!i.opts.unevaluated||i.props===!0))return;let l=a.strictSchema&&!a.allowMatchingProperties&&s.properties,d=e.name("valid");i.props!==!0&&!(i.
|
|
216
|
-
props instanceof rr.Name)&&(i.props=(0,wi.evaluatedPropsToName)(e,i.props));let{props:f}=i;g();function g(){for(let h of c)l&&m(h),i.allErrors?p(h):(e.var(d,!0),p(h),e.if(d))}o(g,"validatePatternProperties");function m(h){for(let y in l)new RegExp(h).test(y)&&(0,vi.checkStrictMode)(i,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}o(m,"checkMatchingProperties");function p(h){e.forIn("key",n,y=>{e.if((0,rr._)`${(0,$i.usePattern)(t,h)}.test(${y})`,()=>{let _=u.includes(h);_||t.
|
|
217
|
-
subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:wi.Type.Str},d),i.opts.unevaluated&&f!==!0?e.assign((0,rr._)`${f}[${y}]`,!0):!_&&!i.allErrors&&e.if((0,rr.not)(d),()=>e.break())})})}o(p,"validateProperties")}};Vn.default=Hd});var Si=$(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});var Ld=q(),Jd={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Ld.alwaysValidSchema)(n,r)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};zn.default=Jd});var Ei=$(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});var Gd=Y(),Bd={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Gd.validateUnion,error:{message:"must match a schema in anyOf"}};Un.default=Bd});var Pi=$(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});var nr=N(),Wd=q(),Qd={message:"must match exactly one schema in oneOf",params:o(({params:t})=>(0,nr._)`{passingSchemas: ${t.passing}}`,"params")},Zd={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Qd,code(t){let{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=r,a=e.let("valid",!1),c=e.let("passing",null),
|
|
218
|
-
u=e.name("_valid");t.setParams({passing:c}),e.block(l),t.result(a,()=>t.reset(),()=>t.error(!0));function l(){i.forEach((d,f)=>{let g;(0,Wd.alwaysValidSchema)(s,d)?e.var(u,!0):g=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&e.if((0,nr._)`${u} && ${a}`).assign(a,!1).assign(c,(0,nr._)`[${c}, ${f}]`).else(),e.if(u,()=>{e.assign(a,!0),e.assign(c,f),g&&t.mergeEvaluated(g,nr.Name)})})}o(l,"validateOneOf")}};Kn.default=Zd});var Oi=$(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});var Xd=q(),Yd={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=e.name("valid");r.forEach((i,a)=>{if((0,Xd.alwaysValidSchema)(n,i))return;let c=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(c)})}};Hn.default=Yd});var ji=$(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});var sr=N(),ki=q(),ef={message:o(({params:t})=>(0,sr.str)`must match "${t.ifClause}" schema`,"message"),params:o(({params:t})=>(0,sr._)`{failingKeyword: ${t.ifClause}}`,"params")},tf={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ef,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,ki.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Ni(n,"then"),i=Ni(n,
|
|
219
|
-
"else");if(!s&&!i)return;let a=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),s&&i){let d=e.let("ifClause");t.setParams({ifClause:d}),e.if(c,l("then",d),l("else",d))}else s?e.if(c,l("then")):e.if((0,sr.not)(c),l("else"));t.pass(a,()=>t.error(!0));function u(){let d=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(d)}o(u,"validateIf");function l(d,f){return()=>{let g=t.subschema({keyword:d},c);e.assign(a,c),t.mergeValidEvaluated(g,a),f?e.assign(f,
|
|
220
|
-
(0,sr._)`${d}`):t.setParams({ifClause:d})}}o(l,"validateClause")}};function Ni(t,e){let r=t.schema[e];return r!==void 0&&!(0,ki.alwaysValidSchema)(t,r)}o(Ni,"hasSchema");Ln.default=tf});var qi=$(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});var rf=q(),nf={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,rf.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Jn.default=nf});var Ri=$(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});var sf=jn(),of=ai(),af=qn(),cf=ui(),uf=li(),lf=hi(),df=mi(),ff=Mn(),hf=_i(),pf=bi(),mf=Si(),yf=Ei(),gf=Pi(),_f=Oi(),$f=ji(),vf=qi();function wf(t=!1){let e=[mf.default,yf.default,gf.default,_f.default,$f.default,vf.default,df.default,ff.default,lf.default,hf.default,pf.default];return t?e.push(of.default,cf.default):e.push(sf.default,af.default),e.push(uf.default),e}o(wf,"getApplicator");Gn.default=wf});var Ii=$(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});var x=N(),bf={message:o(({schemaCode:t})=>(0,x.str)`must match format "${t}"`,"message"),params:o(({schemaCode:t})=>(0,x._)`{format: ${t}}`,"params")},Sf={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bf,code(t,e){let{gen:r,data:n,$data:s,schema:i,schemaCode:a,it:c}=t,{opts:u,errSchemaPath:l,schemaEnv:d,self:f}=c;if(!u.validateFormats)return;s?g():m();function g(){let p=r.scopeValue("forma\
|
|
221
|
-
ts",{ref:f.formats,code:u.code.formats}),h=r.const("fDef",(0,x._)`${p}[${a}]`),y=r.let("fType"),_=r.let("format");r.if((0,x._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,(0,x._)`${h}.type || "string"`).assign(_,(0,x._)`${h}.validate`),()=>r.assign(y,(0,x._)`"string"`).assign(_,h)),t.fail$data((0,x.or)(w(),O()));function w(){return u.strictSchema===!1?x.nil:(0,x._)`${a} && !${_}`}o(w,"unknownFmt");function O(){let T=d.$async?(0,x._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:
|
|
222
|
-
(0,x._)`${_}(${n})`,S=(0,x._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,x._)`${_} && ${_} !== true && ${y} === ${e} && !${S}`}o(O,"invalidFmt")}o(g,"validate$DataFormat");function m(){let p=f.formats[i];if(!p){w();return}if(p===!0)return;let[h,y,_]=O(p);h===e&&t.pass(T());function w(){if(u.strictSchema===!1){f.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${i}" ignored in schema at path "${l}"`}}o(w,"unknownFormat");function O(S){let ae=S instanceof
|
|
223
|
-
RegExp?(0,x.regexpCode)(S):u.code.formats?(0,x._)`${u.code.formats}${(0,x.getProperty)(i)}`:void 0,de=r.scopeValue("formats",{key:i,ref:S,code:ae});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,x._)`${de}.validate`]:["string",S,de]}o(O,"getFormat");function T(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!d.$async)throw new Error("async format in sync schema");return(0,x._)`await ${_}(${n})`}return typeof y=="function"?(0,x._)`${_}(${n})`:(0,x._)`${_}.test(${n})`}
|
|
224
|
-
o(T,"validCondition")}o(m,"validateFormat")}};Bn.default=Sf});var Ti=$(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});var Ef=Ii(),Pf=[Ef.default];Wn.default=Pf});var Ai=$(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.contentVocabulary=Je.metadataVocabulary=void 0;Je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Di=$(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});var Of=Ko(),Nf=ni(),kf=Ri(),jf=Ti(),Ci=Ai(),qf=[Of.default,Nf.default,(0,kf.default)(),jf.default,Ci.metadataVocabulary,Ci.contentVocabulary];Qn.default=qf});var xi=$(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.DiscrError=void 0;var Mi;(function(t){t.Tag="tag",t.Mapping="mapping"})(Mi||(or.DiscrError=Mi={}))});var Vi=$(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var Ge=N(),Zn=xi(),Fi=Vt(),Rf=dt(),If=q(),Tf={message:o(({params:{discrError:t,tagName:e}})=>t===Zn.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:o(({params:{discrError:t,tag:e,tagName:r}})=>(0,Ge._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Af={keyword:"discriminator",type:"object",schemaType:"object",error:Tf,code(t){let{gen:e,data:r,schema:n,parentSchema:s,
|
|
225
|
-
it:i}=t,{oneOf:a}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),l=e.const("tag",(0,Ge._)`${r}${(0,Ge.getProperty)(c)}`);e.if((0,Ge._)`typeof ${l} == "string"`,()=>d(),()=>t.error(!1,{discrError:Zn.
|
|
226
|
-
DiscrError.Tag,tag:l,tagName:c})),t.ok(u);function d(){let m=g();e.if(!1);for(let p in m)e.elseIf((0,Ge._)`${l} === ${p}`),e.assign(u,f(m[p]));e.else(),t.error(!1,{discrError:Zn.DiscrError.Mapping,tag:l,tagName:c}),e.endIf()}o(d,"validateMapping");function f(m){let p=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:m},p);return t.mergeEvaluated(h,Ge.Name),p}o(f,"applyTagSchema");function g(){var m;let p={},h=_(s),y=!0;for(let T=0;T<a.length;T++){let S=a[T];if(S?.$ref&&!(0,If.schemaHasRulesButRef)(
|
|
227
|
-
S,i.self.RULES)){let de=S.$ref;if(S=Fi.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,de),S instanceof Fi.SchemaEnv&&(S=S.schema),S===void 0)throw new Rf.default(i.opts.uriResolver,i.baseId,de)}let ae=(m=S?.properties)===null||m===void 0?void 0:m[c];if(typeof ae!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);y=y&&(h||_(S)),w(ae,T)}if(!y)throw new Error(`discriminator: "${c}" must be required`);return p;function _({required:T}){return Array.
|
|
228
|
-
isArray(T)&&T.includes(c)}function w(T,S){if(T.const)O(T.const,S);else if(T.enum)for(let ae of T.enum)O(ae,S);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function O(T,S){if(typeof T!="string"||T in p)throw new Error(`discriminator: "${c}" values must be unique strings`);p[T]=S}}o(g,"getMapping")}};Xn.default=Af});var zi=$((em,Cf)=>{Cf.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,
|
|
229
|
-
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:{
|
|
230
|
-
$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\
|
|
231
|
-
/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:{
|
|
232
|
-
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 Ki=$((M,Yn)=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.MissingRefError=M.ValidationError=M.CodeGen=M.Name=M.nil=M.stringify=M.str=M._=M.KeywordCxt=M.Ajv=void 0;var Df=Mo(),Mf=Di(),xf=Vi(),Ui=zi(),Ff=["/properties"],ir="http://json-schema.org/draft-07/schema",Be=class extends Df.default{static{o(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Mf.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(xf.default)}_addDefaultMetaSchema(){
|
|
233
|
-
if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ui,Ff):Ui;this.addMetaSchema(e,ir,!1),this.refs["http://json-schema.org/schema"]=ir}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ir)?ir:void 0)}};M.Ajv=Be;Yn.exports=M=Be;Yn.exports.Ajv=Be;Object.defineProperty(M,"__esModule",{value:!0});M.default=Be;var Vf=lt();Object.defineProperty(M,"KeywordCxt",{enumerable:!0,get:o(function(){return Vf.KeywordCxt},"get")});var We=N();
|
|
234
|
-
Object.defineProperty(M,"_",{enumerable:!0,get:o(function(){return We._},"get")});Object.defineProperty(M,"str",{enumerable:!0,get:o(function(){return We.str},"get")});Object.defineProperty(M,"stringify",{enumerable:!0,get:o(function(){return We.stringify},"get")});Object.defineProperty(M,"nil",{enumerable:!0,get:o(function(){return We.nil},"get")});Object.defineProperty(M,"Name",{enumerable:!0,get:o(function(){return We.Name},"get")});Object.defineProperty(M,"CodeGen",{enumerable:!0,get:o(function(){
|
|
235
|
-
return We.CodeGen},"get")});var zf=xt();Object.defineProperty(M,"ValidationError",{enumerable:!0,get:o(function(){return zf.default},"get")});var Uf=dt();Object.defineProperty(M,"MissingRefError",{enumerable:!0,get:o(function(){return Uf.default},"get")})});var Ji=Qi(Ki(),1);var Kf=new Ji.Ajv({allErrors:!0,strict:!1}),Hi=new WeakMap;function Gi(t){let e=Hi.get(t);if(e)return e;let r=Kf.compile(t);return Hi.set(t,r),r}o(Gi,"compile");function rm(t){Gi(t)}o(rm,"assertValidSchema");function nm(t,e){let r=Gi(t);return r(e)?{ok:!0}:{ok:!1,errors:(r.errors??[]).map(s=>`${s.instancePath||"root"}: ${s.message??"invalid"}`).join("; ")}}o(nm,"validate");function sm(t){return ie(t)}o(sm,"toCodexOutputSchema");function om(t){return{type:"json_schema",schema:t}}o(om,"toClaudeOut\
|
|
236
|
-
putFormat");function ie(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(ie);let e=t,r={};for(let[s,i]of Object.entries(e))if(s==="properties"&&i&&typeof i=="object"&&!Array.isArray(i)){let a=i,c={};for(let[u,l]of Object.entries(a))c[u]=ie(l);r[s]=c}else if(s==="items")r[s]=Array.isArray(i)?i.map(ie):ie(i);else if(s==="additionalProperties"||s==="patternProperties")if(s==="patternProperties"&&i&&typeof i=="object"&&!Array.isArray(i)){let a=i,c={};for(let[u,l]of Object.
|
|
237
|
-
entries(a))c[u]=ie(l);r[s]=c}else r[s]=ie(i);else if(s==="anyOf"||s==="oneOf"||s==="allOf")r[s]=Array.isArray(i)?i.map(ie):ie(i);else if(s==="$defs"||s==="definitions")if(i&&typeof i=="object"&&!Array.isArray(i)){let a=i,c={};for(let[u,l]of Object.entries(a))c[u]=ie(l);r[s]=c}else r[s]=i;else s==="not"||s==="if"||s==="then"||s==="else"?r[s]=ie(i):r[s]=i;let n=r.properties;if((r.type==="object"||n!==void 0)&&n&&typeof n=="object"&&!Array.isArray(n)){let s=n,i=Object.keys(s),a=new Set(Array.isArray(
|
|
238
|
-
r.required)?r.required:[]);r.additionalProperties=!1,r.required=i;for(let c of i)a.has(c)||(s[c]=Hf(s[c]))}return r}o(ie,"strictify");function Hf(t){if(t===null||typeof t!="object")return{anyOf:[t,{type:"null"}]};let e=t;if(Array.isArray(t))return{anyOf:[t,{type:"null"}]};let r=e.type;if(typeof r=="string"){if(r==="null")return e;let n={...e,type:[r,"null"]};return Array.isArray(e.enum)&&!e.enum.includes(null)&&(n.enum=[...e.enum,null]),n}if(Array.isArray(r)){let n=r.includes("null")?{...e}:{...e,
|
|
239
|
-
type:[...r,"null"]};return Array.isArray(e.enum)&&!e.enum.includes(null)&&(n.enum=[...e.enum,null]),n}return Array.isArray(e.enum)?e.enum.includes(null)?{...e}:{...e,enum:[...e.enum,null]}:{anyOf:[e,{type:"null"}]}}o(Hf,"makeNullable");function Li(t,e){if(t===null||typeof t!="object")return t;if(Array.isArray(t)){let i=e.items??{};return t.map(a=>Li(a,i))}let r=e.properties??{},n=new Set(Array.isArray(e.required)?e.required:[]),s={};for(let[i,a]of Object.entries(t)){let c=r[i];a===null&&!n.has(i)&&
|
|
240
|
-
!Bi(c)||(s[i]=Li(a,c??{}))}return s}o(Li,"stripNullOptionals");function Bi(t){if(!t||typeof t!="object")return!1;let e=t.type;if(e==="null"||Array.isArray(e)&&e.includes("null")||Array.isArray(t.enum)&&t.enum.includes(null))return!0;for(let r of["anyOf","oneOf","allOf"]){let n=t[r];if(Array.isArray(n)&&n.some(s=>Bi(s)))return!0}return!1}o(Bi,"allowsNull");function im(t){let e=t.trim(),n=/```(?:json)?\s*([\s\S]*?)```/.exec(e)?.[1]??e;return JSON.parse(n)}o(im,"parseJsonLoose");export{N as a,Ki as b,rm as c,nm as d,sm as e,om as f,Li as g,im as h};
|