@anov/cic-standard-sdk 0.0.1 → 0.0.3
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 +22 -62
- package/dist/cic-sdk.cjs.js +6 -6
- package/dist/cic-sdk.es.js +1226 -1209
- package/dist/cic-sdk.umd.js +6 -6
- package/dist/sdk/CICSDK.d.ts +70 -0
- package/dist/sdk/ICICSDK.d.ts +43 -0
- package/dist/sdk/generators/ajv.d.ts +9 -0
- package/dist/sdk/generators/common.d.ts +26 -0
- package/dist/sdk/generators/component.d.ts +5 -0
- package/dist/sdk/generators/dataSource.d.ts +5 -0
- package/dist/sdk/generators/dependency.d.ts +5 -0
- package/dist/sdk/generators/meta.d.ts +8 -0
- package/dist/sdk/generators/page.d.ts +5 -0
- package/dist/sdk/generators/registry.d.ts +5 -0
- package/dist/sdk/generators/variables.d.ts +5 -0
- package/dist/types/componets.d.ts +49 -0
- package/dist/types/data.d.ts +35 -0
- package/dist/types/dataSources.d.ts +38 -0
- package/dist/types/deps.d.ts +71 -0
- package/dist/types/events.d.ts +133 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/meta.d.ts +54 -0
- package/dist/types/page.d.ts +17 -0
- package/dist/types/registry.d.ts +22 -0
- package/dist/types/variables.d.ts +58 -0
- package/package.json +4 -3
package/dist/cic-sdk.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qe={exports:{}},Mt={},he={},be={},At={},Vt={},zt={},er;function vt(){return er||(er=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=a;class n extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((o,h)=>`${o}${h}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((o,h)=>(h instanceof a&&(o[h.str]=(o[h.str]||0)+1),o),{})}}e._Code=n,e.nil=new n("");function v(d,...r){const o=[d[0]];let h=0;for(;h<r.length;)u(o,r[h]),o.push(d[++h]);return new n(o)}e._=v;const i=new n("+");function p(d,...r){const o=[y(d[0])];let h=0;for(;h<r.length;)o.push(i),u(o,r[h]),o.push(i,y(d[++h]));return m(o),new n(o)}e.str=p;function u(d,r){r instanceof n?d.push(...r._items):r instanceof a?d.push(r):d.push(S(r))}e.addCodeArg=u;function m(d){let r=1;for(;r<d.length-1;){if(d[r]===i){const o=b(d[r-1],d[r+1]);if(o!==void 0){d.splice(r-1,3,o);continue}d[r++]="+"}r++}}function b(d,r){if(r==='""')return d;if(d==='""')return r;if(typeof d=="string")return r instanceof a||d[d.length-1]!=='"'?void 0:typeof r!="string"?`${d.slice(0,-1)}${r}"`:r[0]==='"'?d.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(d instanceof a))return`"${d}${r.slice(1)}`}function _(d,r){return r.emptyStr()?d:d.emptyStr()?r:p`${d}${r}`}e.strConcat=_;function S(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:y(Array.isArray(d)?d.join(","):d)}function $(d){return new n(y(d))}e.stringify=$;function y(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function g(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new n(`.${d}`):v`[${d}]`}e.getProperty=g;function w(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new n(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(d){return new n(d.toString())}e.regexpCode=c})(zt)),zt}var Ft={},tr;function rr(){return tr||(tr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=vt();class a extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class v{constructor({prefixes:b,parent:_}={}){this._names={},this._prefixes=b,this._parent=_}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const _=this._names[b]||this._nameGroup(b);return`${b}${_.index++}`}_nameGroup(b){var _,S;if(!((S=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||S===void 0)&&S.has(b)||this._prefixes&&!this._prefixes.has(b))throw new Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}}e.Scope=v;class i extends t.Name{constructor(b,_){super(_),this.prefix=b}setValue(b,{property:_,itemIndex:S}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(_)}[${S}]`}}e.ValueScopeName=i;const p=(0,t._)`\n`;class u extends v{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?p:t.nil}}get(){return this._scope}name(b){return new i(b,this._newName(b))}value(b,_){var S;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(b),{prefix:y}=$,g=(S=_.key)!==null&&S!==void 0?S:_.ref;let w=this._values[y];if(w){const r=w.get(g);if(r)return r}else w=this._values[y]=new Map;w.set(g,$);const c=this._scope[y]||(this._scope[y]=[]),d=c.length;return c[d]=_.ref,$.setValue(_,{property:y,itemIndex:d}),$}getValue(b,_){const S=this._values[b];if(S)return S.get(_)}scopeRefs(b,_=this._values){return this._reduceValues(_,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,t._)`${b}${S.scopePath}`})}scopeCode(b=this._values,_,S){return this._reduceValues(b,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},_,S)}_reduceValues(b,_,S={},$){let y=t.nil;for(const g in b){const w=b[g];if(!w)continue;const c=S[g]=S[g]||new Map;w.forEach(d=>{if(c.has(d))return;c.set(d,n.Started);let r=_(d);if(r){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${o} ${d} = ${r};${this.opts._n}`}else if(r=$?.(d))y=(0,t._)`${y}${r}${this.opts._n}`;else throw new a(d);c.set(d,n.Completed)})}return y}}e.ValueScope=u})(Ft)),Ft}var nr;function J(){return nr||(nr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=vt(),a=rr();var n=vt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var v=rr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return v.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return v.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return v.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return v.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(l,E){return this}}class p extends i{constructor(l,E,O){super(),this.varKind=l,this.name=E,this.rhs=O}render({es5:l,_n:E}){const O=l?a.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${U};`+E}optimizeNames(l,E){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(l,E,O){super(),this.lhs=l,this.rhs=E,this.sideEffects=O}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,E){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,E),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class m extends u{constructor(l,E,O,U){super(l,O,U),this.op=E}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class b extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class _ extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class S extends i{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class $ extends i{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,E){return this.code=L(this.code,l,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends i{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((E,O)=>E+O.render(l),"")}optimizeNodes(){const{nodes:l}=this;let E=l.length;for(;E--;){const O=l[E].optimizeNodes();Array.isArray(O)?l.splice(E,1,...O):O?l[E]=O:l.splice(E,1)}return l.length>0?this:void 0}optimizeNames(l,E){const{nodes:O}=this;let U=O.length;for(;U--;){const H=O[U];H.optimizeNames(l,E)||(Q(l,H.names),O.splice(U,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((l,E)=>V(l,E.names),{})}}class g extends y{render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class w extends y{}class c extends g{}c.kind="else";class d extends g{constructor(l,E){super(E),this.condition=l}render(l){let E=`if(${this.condition})`+super.render(l);return this.else&&(E+="else "+this.else.render(l)),E}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let E=this.else;if(E){const O=E.optimizeNodes();E=this.else=Array.isArray(O)?new c(O):O}if(E)return l===!1?E instanceof d?E:E.nodes:this.nodes.length?this:new d(ne(l),E instanceof d?[E]:E.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,E){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(l,E),!!(super.optimizeNames(l,E)||this.else))return this.condition=L(this.condition,l,E),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}d.kind="if";class r extends g{}r.kind="for";class o extends r{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iteration=L(this.iteration,l,E),this}get names(){return V(super.names,this.iteration.names)}}class h extends r{constructor(l,E,O,U){super(),this.varKind=l,this.name=E,this.from=O,this.to=U}render(l){const E=l.es5?a.varKinds.var:this.varKind,{name:O,from:U,to:H}=this;return`for(${E} ${O}=${U}; ${O}<${H}; ${O}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class s extends r{constructor(l,E,O,U){super(),this.loop=l,this.varKind=E,this.name=O,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iterable=L(this.iterable,l,E),this}get names(){return V(super.names,this.iterable.names)}}class f extends g{constructor(l,E,O){super(),this.name=l,this.args=E,this.async=O}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}f.kind="func";class P extends y{render(l){return"return "+super.render(l)}}P.kind="return";class R extends g{render(l){let E="try"+super.render(l);return this.catch&&(E+=this.catch.render(l)),this.finally&&(E+=this.finally.render(l)),E}optimizeNodes(){var l,E;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(l,E){var O,U;return super.optimizeNames(l,E),(O=this.catch)===null||O===void 0||O.optimizeNames(l,E),(U=this.finally)===null||U===void 0||U.optimizeNames(l,E),this}get names(){const l=super.names;return this.catch&&V(l,this.catch.names),this.finally&&V(l,this.finally.names),l}}class D extends g{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}D.kind="catch";class z extends g{render(l){return"finally"+super.render(l)}}z.kind="finally";class q{constructor(l,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
|
|
2
|
-
`:""},this._extScope=l,this._scope=new a.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,E){const O=this._extScope.value(l,E);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(l,E){return this._extScope.getValue(l,E)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,E,O,U){const H=this._scope.toName(E);return O!==void 0&&U&&(this._constants[H.str]=O),this._leafNode(new p(l,H,O)),H}const(l,E,O){return this._def(a.varKinds.const,l,E,O)}let(l,E,O){return this._def(a.varKinds.let,l,E,O)}var(l,E,O){return this._def(a.varKinds.var,l,E,O)}assign(l,E,O){return this._leafNode(new u(l,E,O))}add(l,E){return this._leafNode(new m(l,e.operators.ADD,E))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const E=["{"];for(const[O,U]of l)E.length>1&&E.push(","),E.push(O),(O!==U||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,U));return E.push("}"),new t._Code(E)}if(l,E,O){if(this._blockNode(new d(l)),E&&O)this.code(E).else().code(O).endIf();else if(E)this.code(E).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new d(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(d,c)}_for(l,E){return this._blockNode(l),E&&this.code(E).endFor(),this}for(l,E){return this._for(new o(l),E)}forRange(l,E,O,U,H=this.opts.es5?a.varKinds.var:a.varKinds.let){const Z=this._scope.toName(l);return this._for(new h(H,Z,E,O),()=>U(Z))}forOf(l,E,O,U=a.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Z=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(H,(0,t._)`${Z}[${B}]`),O(H)})}return this._for(new s("of",U,H,E),()=>O(H))}forIn(l,E,O,U=this.opts.es5?a.varKinds.var:a.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${E})`,O);const H=this._scope.toName(l);return this._for(new s("in",U,H,E),()=>O(H))}endFor(){return this._endBlockNode(r)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const E=new P;if(this._blockNode(E),this.code(l),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,E,O){if(!E&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new R;if(this._blockNode(U),this.code(l),E){const H=this.name("e");this._currNode=U.catch=new D(H),E(H)}return O&&(this._currNode=U.finally=new z,this.code(O)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new S(l))}block(l,E){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(E),this}endBlock(l){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-E;if(O<0||l!==void 0&&O!==l)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${l} expected`);return this._nodes.length=E,this}func(l,E=t.nil,O,U){return this._blockNode(new f(l,E,O)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,E){const O=this._currNode;if(O instanceof l||E&&O instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${l.kind}/${E.kind}`:l.kind}"`)}_elseNode(l){const E=this._currNode;if(!(E instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const E=this._nodes;E[E.length-1]=l}}e.CodeGen=q;function V(N,l){for(const E in l)N[E]=(N[E]||0)+(l[E]||0);return N}function F(N,l){return l instanceof t._CodeOrName?V(N,l.names):N}function L(N,l,E){if(N instanceof t.Name)return O(N);if(!U(N))return N;return new t._Code(N._items.reduce((H,Z)=>(Z instanceof t.Name&&(Z=O(Z)),Z instanceof t._Code?H.push(...Z._items):H.push(Z),H),[]));function O(H){const Z=E[H.str];return Z===void 0||l[H.str]!==1?H:(delete l[H.str],Z)}function U(H){return H instanceof t._Code&&H._items.some(Z=>Z instanceof t.Name&&l[Z.str]===1&&E[Z.str]!==void 0)}}function Q(N,l){for(const E in l)N[E]=(N[E]||0)-(l[E]||0)}function ne(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,t._)`!${T(N)}`}e.not=ne;const ie=k(e.operators.AND);function x(...N){return N.reduce(ie)}e.and=x;const le=k(e.operators.OR);function M(...N){return N.reduce(le)}e.or=M;function k(N){return(l,E)=>l===t.nil?E:E===t.nil?l:(0,t._)`${T(l)} ${N} ${T(E)}`}function T(N){return N instanceof t.Name?N:(0,t._)`(${N})`}})(Vt)),Vt}var G={},ir;function Y(){if(ir)return G;ir=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=J(),t=vt();function a(s){const f={};for(const P of s)f[P]=!0;return f}G.toHash=a;function n(s,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(v(s,f),!i(f,s.self.RULES.all))}G.alwaysValidSchema=n;function v(s,f=s.schema){const{opts:P,self:R}=s;if(!P.strictSchema||typeof f=="boolean")return;const D=R.RULES.keywords;for(const z in f)D[z]||h(s,`unknown keyword: "${z}"`)}G.checkUnknownRules=v;function i(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(f[P])return!0;return!1}G.schemaHasRules=i;function p(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(P!=="$ref"&&f.all[P])return!0;return!1}G.schemaHasRulesButRef=p;function u({topSchemaRef:s,schemaPath:f},P,R,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${s}${f}${(0,e.getProperty)(R)}`}G.schemaRefOrVal=u;function m(s){return S(decodeURIComponent(s))}G.unescapeFragment=m;function b(s){return encodeURIComponent(_(s))}G.escapeFragment=b;function _(s){return typeof s=="number"?`${s}`:s.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=_;function S(s){return s.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=S;function $(s,f){if(Array.isArray(s))for(const P of s)f(P);else f(s)}G.eachItem=$;function y({mergeNames:s,mergeToName:f,mergeValues:P,resultToName:R}){return(D,z,q,V)=>{const F=q===void 0?z:q instanceof e.Name?(z instanceof e.Name?s(D,z,q):f(D,z,q),q):z instanceof e.Name?(f(D,q,z),z):P(z,q);return V===e.Name&&!(F instanceof e.Name)?R(D,F):F}}G.mergeEvaluated={props:y({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>{s.if((0,e._)`${f} === true`,()=>s.assign(P,!0),()=>s.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${f})`))}),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>{f===!0?s.assign(P,!0):(s.assign(P,(0,e._)`${P} || {}`),w(s,P,f))}),mergeValues:(s,f)=>s===!0?!0:{...s,...f},resultToName:g}),items:y({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>s.assign(P,(0,e._)`${f} === true ? true : ${P} > ${f} ? ${P} : ${f}`)),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>s.assign(P,f===!0?!0:(0,e._)`${P} > ${f} ? ${P} : ${f}`)),mergeValues:(s,f)=>s===!0?!0:Math.max(s,f),resultToName:(s,f)=>s.var("items",f)})};function g(s,f){if(f===!0)return s.var("props",!0);const P=s.var("props",(0,e._)`{}`);return f!==void 0&&w(s,P,f),P}G.evaluatedPropsToName=g;function w(s,f,P){Object.keys(P).forEach(R=>s.assign((0,e._)`${f}${(0,e.getProperty)(R)}`,!0))}G.setEvaluated=w;const c={};function d(s,f){return s.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}G.useFunc=d;var r;(function(s){s[s.Num=0]="Num",s[s.Str=1]="Str"})(r||(G.Type=r={}));function o(s,f,P){if(s instanceof e.Name){const R=f===r.Num;return P?R?(0,e._)`"[" + ${s} + "]"`:(0,e._)`"['" + ${s} + "']"`:R?(0,e._)`"/" + ${s}`:(0,e._)`"/" + ${s}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(s).toString():"/"+_(s)}G.getErrorPath=o;function h(s,f,P=s.opts.strictSchema){if(P){if(f=`strict mode: ${f}`,P===!0)throw new Error(f);s.self.logger.warn(f)}}return G.checkStrictMode=h,G}var Ce={},sr;function _e(){if(sr)return Ce;sr=1,Object.defineProperty(Ce,"__esModule",{value:!0});const e=J(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ce.default=t,Ce}var or;function Nt(){return or||(or=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=J(),a=Y(),n=_e();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:d})=>d?(0,t.str)`"${c}" keyword must be ${d} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function v(c,d=e.keywordError,r,o){const{it:h}=c,{gen:s,compositeRule:f,allErrors:P}=h,R=S(c,d,r);o??(f||P)?m(s,R):b(h,(0,t._)`[${R}]`)}e.reportError=v;function i(c,d=e.keywordError,r){const{it:o}=c,{gen:h,compositeRule:s,allErrors:f}=o,P=S(c,d,r);m(h,P),s||f||b(o,n.default.vErrors)}e.reportExtraError=i;function p(c,d){c.assign(n.default.errors,d),c.if((0,t._)`${n.default.vErrors} !== null`,()=>c.if(d,()=>c.assign((0,t._)`${n.default.vErrors}.length`,d),()=>c.assign(n.default.vErrors,null)))}e.resetErrorsCount=p;function u({gen:c,keyword:d,schemaValue:r,data:o,errsCount:h,it:s}){if(h===void 0)throw new Error("ajv implementation error");const f=c.name("err");c.forRange("i",h,n.default.errors,P=>{c.const(f,(0,t._)`${n.default.vErrors}[${P}]`),c.if((0,t._)`${f}.instancePath === undefined`,()=>c.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath))),c.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${d}`),s.opts.verbose&&(c.assign((0,t._)`${f}.schema`,r),c.assign((0,t._)`${f}.data`,o))})}e.extendErrors=u;function m(c,d){const r=c.const("err",d);c.if((0,t._)`${n.default.vErrors} === null`,()=>c.assign(n.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${n.default.vErrors}.push(${r})`),c.code((0,t._)`${n.default.errors}++`)}function b(c,d){const{gen:r,validateName:o,schemaEnv:h}=c;h.$async?r.throw((0,t._)`new ${c.ValidationError}(${d})`):(r.assign((0,t._)`${o}.errors`,d),r.return(!1))}const _={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function S(c,d,r){const{createErrors:o}=c.it;return o===!1?(0,t._)`{}`:$(c,d,r)}function $(c,d,r={}){const{gen:o,it:h}=c,s=[y(h,r),g(c,r)];return w(c,d,s),o.object(...s)}function y({errorPath:c},{instancePath:d}){const r=d?(0,t.str)`${c}${(0,a.getErrorPath)(d,a.Type.Str)}`:c;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,r)]}function g({keyword:c,it:{errSchemaPath:d}},{schemaPath:r,parentSchema:o}){let h=o?d:(0,t.str)`${d}/${c}`;return r&&(h=(0,t.str)`${h}${(0,a.getErrorPath)(r,a.Type.Str)}`),[_.schemaPath,h]}function w(c,{params:d,message:r},o){const{keyword:h,data:s,schemaValue:f,it:P}=c,{opts:R,propertyName:D,topSchemaRef:z,schemaPath:q}=P;o.push([_.keyword,h],[_.params,typeof d=="function"?d(c):d||(0,t._)`{}`]),R.messages&&o.push([_.message,typeof r=="function"?r(c):r]),R.verbose&&o.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${q}`],[n.default.data,s]),D&&o.push([_.propertyName,D])}})(At)),At}var ar;function Vn(){if(ar)return be;ar=1,Object.defineProperty(be,"__esModule",{value:!0}),be.boolOrEmptySchema=be.topBoolOrEmptySchema=void 0;const e=Nt(),t=J(),a=_e(),n={message:"boolean schema is false"};function v(u){const{gen:m,schema:b,validateName:_}=u;b===!1?p(u,!1):typeof b=="object"&&b.$async===!0?m.return(a.default.data):(m.assign((0,t._)`${_}.errors`,null),m.return(!0))}be.topBoolOrEmptySchema=v;function i(u,m){const{gen:b,schema:_}=u;_===!1?(b.var(m,!1),p(u)):b.var(m,!0)}be.boolOrEmptySchema=i;function p(u,m){const{gen:b,data:_}=u,S={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(S,n,void 0,m)}return be}var re={},we={},cr;function _n(){if(cr)return we;cr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.getRules=we.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function a(v){return typeof v=="string"&&t.has(v)}we.isJSONType=a;function n(){const v={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...v,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},v.number,v.string,v.array,v.object],post:{rules:[]},all:{},keywords:{}}}return we.getRules=n,we}var ye={},dr;function $n(){if(dr)return ye;dr=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.shouldUseRule=ye.shouldUseGroup=ye.schemaHasRulesForType=void 0;function e({schema:n,self:v},i){const p=v.RULES.types[i];return p&&p!==!0&&t(n,p)}ye.schemaHasRulesForType=e;function t(n,v){return v.rules.some(i=>a(n,i))}ye.shouldUseGroup=t;function a(n,v){var i;return n[v.keyword]!==void 0||((i=v.definition.implements)===null||i===void 0?void 0:i.some(p=>n[p]!==void 0))}return ye.shouldUseRule=a,ye}var ur;function _t(){if(ur)return re;ur=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=_n(),t=$n(),a=Nt(),n=J(),v=Y();var i;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(i||(re.DataType=i={}));function p(r){const o=u(r.type);if(o.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&o.push("null")}return o}re.getSchemaTypes=p;function u(r){const o=Array.isArray(r)?r:r?[r]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}re.getJSONTypes=u;function m(r,o){const{gen:h,data:s,opts:f}=r,P=_(o,f.coerceTypes),R=o.length>0&&!(P.length===0&&o.length===1&&(0,t.schemaHasRulesForType)(r,o[0]));if(R){const D=g(o,s,f.strictNumbers,i.Wrong);h.if(D,()=>{P.length?S(r,o,P):c(r)})}return R}re.coerceAndCheckDataType=m;const b=new Set(["string","number","integer","boolean","null"]);function _(r,o){return o?r.filter(h=>b.has(h)||o==="array"&&h==="array"):[]}function S(r,o,h){const{gen:s,data:f,opts:P}=r,R=s.let("dataType",(0,n._)`typeof ${f}`),D=s.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&s.if((0,n._)`${R} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>s.assign(f,(0,n._)`${f}[0]`).assign(R,(0,n._)`typeof ${f}`).if(g(o,f,P.strictNumbers),()=>s.assign(D,f))),s.if((0,n._)`${D} !== undefined`);for(const q of h)(b.has(q)||q==="array"&&P.coerceTypes==="array")&&z(q);s.else(),c(r),s.endIf(),s.if((0,n._)`${D} !== undefined`,()=>{s.assign(f,D),$(r,D)});function z(q){switch(q){case"string":s.elseIf((0,n._)`${R} == "number" || ${R} == "boolean"`).assign(D,(0,n._)`"" + ${f}`).elseIf((0,n._)`${f} === null`).assign(D,(0,n._)`""`);return;case"number":s.elseIf((0,n._)`${R} == "boolean" || ${f} === null
|
|
3
|
-
|| (${
|
|
4
|
-
|| (${
|
|
5
|
-
|| ${R} === "boolean" || ${f} === null`).assign(D,(0,n._)`[${f}]`)}}}function $({gen:r,parentData:o,parentDataProperty:h},s){r.if((0,n._)`${o} !== undefined`,()=>r.assign((0,n._)`${o}[${h}]`,s))}function y(r,o,h,s=i.Correct){const f=s===i.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(r){case"null":return(0,n._)`${o} ${f} null`;case"array":P=(0,n._)`Array.isArray(${o})`;break;case"object":P=(0,n._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":P=R((0,n._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":P=R();break;default:return(0,n._)`typeof ${o} ${f} ${r}`}return s===i.Correct?P:(0,n.not)(P);function R(D=n.nil){return(0,n.and)((0,n._)`typeof ${o} == "number"`,D,h?(0,n._)`isFinite(${o})`:n.nil)}}re.checkDataType=y;function g(r,o,h,s){if(r.length===1)return y(r[0],o,h,s);let f;const P=(0,v.toHash)(r);if(P.array&&P.object){const R=(0,n._)`typeof ${o} != "object"`;f=P.null?R:(0,n._)`!${o} || ${R}`,delete P.null,delete P.array,delete P.object}else f=n.nil;P.number&&delete P.integer;for(const R in P)f=(0,n.and)(f,y(R,o,h,s));return f}re.checkDataTypes=g;const w={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:o})=>typeof r=="string"?(0,n._)`{type: ${r}}`:(0,n._)`{type: ${o}}`};function c(r){const o=d(r);(0,a.reportError)(o,w)}re.reportTypeError=c;function d(r){const{gen:o,data:h,schema:s}=r,f=(0,v.schemaRefOrVal)(r,s,"type");return{gen:o,keyword:"type",data:h,schema:s.type,schemaCode:f,schemaValue:f,parentSchema:s,params:{},it:r}}return re}var Ie={},lr;function zn(){if(lr)return Ie;lr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.assignDefaults=void 0;const e=J(),t=Y();function a(v,i){const{properties:p,items:u}=v.schema;if(i==="object"&&p)for(const m in p)n(v,m,p[m].default);else i==="array"&&Array.isArray(u)&&u.forEach((m,b)=>n(v,b,m.default))}Ie.assignDefaults=a;function n(v,i,p){const{gen:u,compositeRule:m,data:b,opts:_}=v;if(p===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(i)}`;if(m){(0,t.checkStrictMode)(v,`default is ignored for: ${S}`);return}let $=(0,e._)`${S} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${S} === null || ${S} === ""`),u.if($,(0,e._)`${S} = ${(0,e.stringify)(p)}`)}return Ie}var pe={},X={},fr;function me(){if(fr)return X;fr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=J(),t=Y(),a=_e(),n=Y();function v(r,o){const{gen:h,data:s,it:f}=r;h.if(_(h,s,o,f.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${o}`},!0),r.error()})}X.checkReportMissingProp=v;function i({gen:r,data:o,it:{opts:h}},s,f){return(0,e.or)(...s.map(P=>(0,e.and)(_(r,o,P,h.ownProperties),(0,e._)`${f} = ${P}`)))}X.checkMissingProp=i;function p(r,o){r.setParams({missingProperty:o},!0),r.error()}X.reportMissingProp=p;function u(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=u;function m(r,o,h){return(0,e._)`${u(r)}.call(${o}, ${h})`}X.isOwnProperty=m;function b(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} !== undefined`;return s?(0,e._)`${f} && ${m(r,o,h)}`:f}X.propertyInData=b;function _(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} === undefined`;return s?(0,e.or)(f,(0,e.not)(m(r,o,h))):f}X.noPropertyInData=_;function S(r){return r?Object.keys(r).filter(o=>o!=="__proto__"):[]}X.allSchemaProperties=S;function $(r,o){return S(o).filter(h=>!(0,t.alwaysValidSchema)(r,o[h]))}X.schemaProperties=$;function y({schemaCode:r,data:o,it:{gen:h,topSchemaRef:s,schemaPath:f,errorPath:P},it:R},D,z,q){const V=q?(0,e._)`${r}, ${o}, ${s}${f}`:o,F=[[a.default.instancePath,(0,e.strConcat)(a.default.instancePath,P)],[a.default.parentData,R.parentData],[a.default.parentDataProperty,R.parentDataProperty],[a.default.rootData,a.default.rootData]];R.opts.dynamicRef&&F.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);const L=(0,e._)`${V}, ${h.object(...F)}`;return z!==e.nil?(0,e._)`${D}.call(${z}, ${L})`:(0,e._)`${D}(${L})`}X.callValidateCode=y;const g=(0,e._)`new RegExp`;function w({gen:r,it:{opts:o}},h){const s=o.unicodeRegExp?"u":"",{regExp:f}=o.code,P=f(h,s);return r.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?g:(0,n.useFunc)(r,f)}(${h}, ${s})`})}X.usePattern=w;function c(r){const{gen:o,data:h,keyword:s,it:f}=r,P=o.name("valid");if(f.allErrors){const D=o.let("valid",!0);return R(()=>o.assign(D,!1)),D}return o.var(P,!0),R(()=>o.break()),P;function R(D){const z=o.const("len",(0,e._)`${h}.length`);o.forRange("i",0,z,q=>{r.subschema({keyword:s,dataProp:q,dataPropType:t.Type.Num},P),o.if((0,e.not)(P),D)})}}X.validateArray=c;function d(r){const{gen:o,schema:h,keyword:s,it:f}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");if(h.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const R=o.let("valid",!1),D=o.name("_valid");o.block(()=>h.forEach((z,q)=>{const V=r.subschema({keyword:s,schemaProp:q,compositeRule:!0},D);o.assign(R,(0,e._)`${R} || ${D}`),r.mergeValidEvaluated(V,D)||o.if((0,e.not)(R))})),r.result(R,()=>r.reset(),()=>r.error(!0))}return X.validateUnion=d,X}var pr;function Fn(){if(pr)return pe;pr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateKeywordUsage=pe.validSchemaType=pe.funcKeywordCode=pe.macroKeywordCode=void 0;const e=J(),t=_e(),a=me(),n=Nt();function v($,y){const{gen:g,keyword:w,schema:c,parentSchema:d,it:r}=$,o=y.macro.call(r.self,c,d,r),h=b(g,w,o);r.opts.validateSchema!==!1&&r.self.validateSchema(o,!0);const s=g.name("valid");$.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${w}`,topSchemaRef:h,compositeRule:!0},s),$.pass(s,()=>$.error(!0))}pe.macroKeywordCode=v;function i($,y){var g;const{gen:w,keyword:c,schema:d,parentSchema:r,$data:o,it:h}=$;m(h,y);const s=!o&&y.compile?y.compile.call(h.self,d,r,h):y.validate,f=b(w,c,s),P=w.let("valid");$.block$data(P,R),$.ok((g=y.valid)!==null&&g!==void 0?g:P);function R(){if(y.errors===!1)q(),y.modifying&&p($),V(()=>$.error());else{const F=y.async?D():z();y.modifying&&p($),V(()=>u($,F))}}function D(){const F=w.let("ruleErrs",null);return w.try(()=>q((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${h.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${f}.errors`;return w.assign(F,null),q(e.nil),F}function q(F=y.async?(0,e._)`await `:e.nil){const L=h.opts.passContext?t.default.this:t.default.self,Q=!("compile"in y&&!o||y.schema===!1);w.assign(P,(0,e._)`${F}${(0,a.callValidateCode)($,f,L,Q)}`,y.modifying)}function V(F){var L;w.if((0,e.not)((L=y.valid)!==null&&L!==void 0?L:P),F)}}pe.funcKeywordCode=i;function p($){const{gen:y,data:g,it:w}=$;y.if(w.parentData,()=>y.assign(g,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function u($,y){const{gen:g}=$;g.if((0,e._)`Array.isArray(${y})`,()=>{g.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${y} : ${t.default.vErrors}.concat(${y})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)($)},()=>$.error())}function m({schemaEnv:$},y){if(y.async&&!$.$async)throw new Error("async keyword in sync schema")}function b($,y,g){if(g===void 0)throw new Error(`keyword "${y}" failed to compile`);return $.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,e.stringify)(g)})}function _($,y,g=!1){return!y.length||y.some(w=>w==="array"?Array.isArray($):w==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==w||g&&typeof $>"u")}pe.validSchemaType=_;function S({schema:$,opts:y,self:g,errSchemaPath:w},c,d){if(Array.isArray(c.keyword)?!c.keyword.includes(d):c.keyword!==d)throw new Error("ajv implementation error");const r=c.dependencies;if(r?.some(o=>!Object.prototype.hasOwnProperty.call($,o)))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(c.validateSchema&&!c.validateSchema($[d])){const h=`keyword "${d}" value is invalid at path "${w}": `+g.errorsText(c.validateSchema.errors);if(y.validateSchema==="log")g.logger.error(h);else throw new Error(h)}}return pe.validateKeywordUsage=S,pe}var ge={},mr;function Ln(){if(mr)return ge;mr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.extendSubschemaMode=ge.extendSubschemaData=ge.getSubschema=void 0;const e=J(),t=Y();function a(i,{keyword:p,schemaProp:u,schema:m,schemaPath:b,errSchemaPath:_,topSchemaRef:S}){if(p!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=i.schema[p];return u===void 0?{schema:$,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${i.errSchemaPath}/${p}`}:{schema:$[u],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(u)}`,errSchemaPath:`${i.errSchemaPath}/${p}/${(0,t.escapeFragment)(u)}`}}if(m!==void 0){if(b===void 0||_===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:b,topSchemaRef:S,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}ge.getSubschema=a;function n(i,p,{dataProp:u,dataPropType:m,data:b,dataTypes:_,propertyName:S}){if(b!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(u!==void 0){const{errorPath:g,dataPathArr:w,opts:c}=p,d=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(u)}`,!0);y(d),i.errorPath=(0,e.str)`${g}${(0,t.getErrorPath)(u,m,c.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${u}`,i.dataPathArr=[...w,i.parentDataProperty]}if(b!==void 0){const g=b instanceof e.Name?b:$.let("data",b,!0);y(g),S!==void 0&&(i.propertyName=S)}_&&(i.dataTypes=_);function y(g){i.data=g,i.dataLevel=p.dataLevel+1,i.dataTypes=[],p.definedProperties=new Set,i.parentData=p.data,i.dataNames=[...p.dataNames,g]}}ge.extendSubschemaData=n;function v(i,{jtdDiscriminator:p,jtdMetadata:u,compositeRule:m,createErrors:b,allErrors:_}){m!==void 0&&(i.compositeRule=m),b!==void 0&&(i.createErrors=b),_!==void 0&&(i.allErrors=_),i.jtdDiscriminator=p,i.jtdMetadata=u}return ge.extendSubschemaMode=v,ge}var se={},Lt,hr;function bn(){return hr||(hr=1,Lt=function e(t,a){if(t===a)return!0;if(t&&a&&typeof t=="object"&&typeof a=="object"){if(t.constructor!==a.constructor)return!1;var n,v,i;if(Array.isArray(t)){if(n=t.length,n!=a.length)return!1;for(v=n;v--!==0;)if(!e(t[v],a[v]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(a).length)return!1;for(v=n;v--!==0;)if(!Object.prototype.hasOwnProperty.call(a,i[v]))return!1;for(v=n;v--!==0;){var p=i[v];if(!e(t[p],a[p]))return!1}return!0}return t!==t&&a!==a}),Lt}var Ut={exports:{}},yr;function Un(){if(yr)return Ut.exports;yr=1;var e=Ut.exports=function(n,v,i){typeof v=="function"&&(i=v,v={}),i=v.cb||i;var p=typeof i=="function"?i:i.pre||function(){},u=i.post||function(){};t(v,p,u,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,v,i,p,u,m,b,_,S,$){if(p&&typeof p=="object"&&!Array.isArray(p)){v(p,u,m,b,_,S,$);for(var y in p){var g=p[y];if(Array.isArray(g)){if(y in e.arrayKeywords)for(var w=0;w<g.length;w++)t(n,v,i,g[w],u+"/"+y+"/"+w,m,u,y,p,w)}else if(y in e.propsKeywords){if(g&&typeof g=="object")for(var c in g)t(n,v,i,g[c],u+"/"+y+"/"+a(c),m,u,y,p,c)}else(y in e.keywords||n.allKeys&&!(y in e.skipKeywords))&&t(n,v,i,g,u+"/"+y,m,u,y,p)}i(p,u,m,b,_,S,$)}}function a(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Ut.exports}var gr;function Rt(){if(gr)return se;gr=1,Object.defineProperty(se,"__esModule",{value:!0}),se.getSchemaRefs=se.resolveUrl=se.normalizeId=se._getFullPath=se.getFullPath=se.inlineRef=void 0;const e=Y(),t=bn(),a=Un(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function v(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?u(w)<=c:!1}se.inlineRef=v;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(i.has(c))return!0;const d=w[c];if(Array.isArray(d)&&d.some(p)||typeof d=="object"&&p(d))return!0}return!1}function u(w){let c=0;for(const d in w){if(d==="$ref")return 1/0;if(c++,!n.has(d)&&(typeof w[d]=="object"&&(0,e.eachItem)(w[d],r=>c+=u(r)),c===1/0))return 1/0}return c}function m(w,c="",d){d!==!1&&(c=S(c));const r=w.parse(c);return b(w,r)}se.getFullPath=m;function b(w,c){return w.serialize(c).split("#")[0]+"#"}se._getFullPath=b;const _=/#\/?$/;function S(w){return w?w.replace(_,""):""}se.normalizeId=S;function $(w,c,d){return d=S(d),w.resolve(c,d)}se.resolveUrl=$;const y=/^[a-z_][-a-z0-9._]*$/i;function g(w,c){if(typeof w=="boolean")return{};const{schemaId:d,uriResolver:r}=this.opts,o=S(w[d]||c),h={"":o},s=m(r,o,!1),f={},P=new Set;return a(w,{allKeys:!0},(z,q,V,F)=>{if(F===void 0)return;const L=s+q;let Q=h[F];typeof z[d]=="string"&&(Q=ne.call(this,z[d])),ie.call(this,z.$anchor),ie.call(this,z.$dynamicAnchor),h[q]=Q;function ne(x){const le=this.opts.uriResolver.resolve;if(x=S(Q?le(Q,x):x),P.has(x))throw D(x);P.add(x);let M=this.refs[x];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?R(z,M.schema,x):x!==S(L)&&(x[0]==="#"?(R(z,f[x],x),f[x]=z):this.refs[x]=L),x}function ie(x){if(typeof x=="string"){if(!y.test(x))throw new Error(`invalid anchor "${x}"`);ne.call(this,`#${x}`)}}}),f;function R(z,q,V){if(q!==void 0&&!t(z,q))throw D(V)}function D(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return se.getSchemaRefs=g,se}var vr;function Ot(){if(vr)return he;vr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Vn(),t=_t(),a=$n(),n=_t(),v=zn(),i=Fn(),p=Ln(),u=J(),m=_e(),b=Rt(),_=Y(),S=Nt();function $(j){if(s(j)&&(P(j),h(j))){c(j);return}y(j,()=>(0,e.topBoolOrEmptySchema)(j))}he.validateFunctionCode=$;function y({gen:j,validateName:I,schema:C,schemaEnv:A,opts:K},W){K.code.es5?j.func(I,(0,u._)`${m.default.data}, ${m.default.valCxt}`,A.$async,()=>{j.code((0,u._)`"use strict"; ${r(C,K)}`),w(j,K),j.code(W)}):j.func(I,(0,u._)`${m.default.data}, ${g(K)}`,A.$async,()=>j.code(r(C,K)).code(W))}function g(j){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${j.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function w(j,I){j.if(m.default.valCxt,()=>{j.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),j.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),j.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),j.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{j.var(m.default.instancePath,(0,u._)`""`),j.var(m.default.parentData,(0,u._)`undefined`),j.var(m.default.parentDataProperty,(0,u._)`undefined`),j.var(m.default.rootData,m.default.data),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function c(j){const{schema:I,opts:C,gen:A}=j;y(j,()=>{C.$comment&&I.$comment&&F(j),z(j),A.let(m.default.vErrors,null),A.let(m.default.errors,0),C.unevaluated&&d(j),R(j),L(j)})}function d(j){const{gen:I,validateName:C}=j;j.evaluated=I.const("evaluated",(0,u._)`${C}.evaluated`),I.if((0,u._)`${j.evaluated}.dynamicProps`,()=>I.assign((0,u._)`${j.evaluated}.props`,(0,u._)`undefined`)),I.if((0,u._)`${j.evaluated}.dynamicItems`,()=>I.assign((0,u._)`${j.evaluated}.items`,(0,u._)`undefined`))}function r(j,I){const C=typeof j=="object"&&j[I.schemaId];return C&&(I.code.source||I.code.process)?(0,u._)`/*# sourceURL=${C} */`:u.nil}function o(j,I){if(s(j)&&(P(j),h(j))){f(j,I);return}(0,e.boolOrEmptySchema)(j,I)}function h({schema:j,self:I}){if(typeof j=="boolean")return!j;for(const C in j)if(I.RULES.all[C])return!0;return!1}function s(j){return typeof j.schema!="boolean"}function f(j,I){const{schema:C,gen:A,opts:K}=j;K.$comment&&C.$comment&&F(j),q(j),V(j);const W=A.const("_errs",m.default.errors);R(j,W),A.var(I,(0,u._)`${W} === ${m.default.errors}`)}function P(j){(0,_.checkUnknownRules)(j),D(j)}function R(j,I){if(j.opts.jtd)return ne(j,[],!1,I);const C=(0,t.getSchemaTypes)(j.schema),A=(0,t.coerceAndCheckDataType)(j,C);ne(j,C,!A,I)}function D(j){const{schema:I,errSchemaPath:C,opts:A,self:K}=j;I.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${C}"`)}function z(j){const{schema:I,opts:C}=j;I.default!==void 0&&C.useDefaults&&C.strictSchema&&(0,_.checkStrictMode)(j,"default is ignored in the schema root")}function q(j){const I=j.schema[j.opts.schemaId];I&&(j.baseId=(0,b.resolveUrl)(j.opts.uriResolver,j.baseId,I))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:j,schemaEnv:I,schema:C,errSchemaPath:A,opts:K}){const W=C.$comment;if(K.$comment===!0)j.code((0,u._)`${m.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const ee=(0,u.str)`${A}/$comment`,fe=j.scopeValue("root",{ref:I.root});j.code((0,u._)`${m.default.self}.opts.$comment(${W}, ${ee}, ${fe}.schema)`)}}function L(j){const{gen:I,schemaEnv:C,validateName:A,ValidationError:K,opts:W}=j;C.$async?I.if((0,u._)`${m.default.errors} === 0`,()=>I.return(m.default.data),()=>I.throw((0,u._)`new ${K}(${m.default.vErrors})`)):(I.assign((0,u._)`${A}.errors`,m.default.vErrors),W.unevaluated&&Q(j),I.return((0,u._)`${m.default.errors} === 0`))}function Q({gen:j,evaluated:I,props:C,items:A}){C instanceof u.Name&&j.assign((0,u._)`${I}.props`,C),A instanceof u.Name&&j.assign((0,u._)`${I}.items`,A)}function ne(j,I,C,A){const{gen:K,schema:W,data:ee,allErrors:fe,opts:oe,self:ae}=j,{RULES:te}=ae;if(W.$ref&&(oe.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,te))){K.block(()=>U(j,"$ref",te.all.$ref.definition));return}oe.jtd||x(j,I),K.block(()=>{for(const ue of te.rules)Ee(ue);Ee(te.post)});function Ee(ue){(0,a.shouldUseGroup)(W,ue)&&(ue.type?(K.if((0,n.checkDataType)(ue.type,ee,oe.strictNumbers)),ie(j,ue),I.length===1&&I[0]===ue.type&&C&&(K.else(),(0,n.reportTypeError)(j)),K.endIf()):ie(j,ue),fe||K.if((0,u._)`${m.default.errors} === ${A||0}`))}}function ie(j,I){const{gen:C,schema:A,opts:{useDefaults:K}}=j;K&&(0,v.assignDefaults)(j,I.type),C.block(()=>{for(const W of I.rules)(0,a.shouldUseRule)(A,W)&&U(j,W.keyword,W.definition,I.type)})}function x(j,I){j.schemaEnv.meta||!j.opts.strictTypes||(le(j,I),j.opts.allowUnionTypes||M(j,I),k(j,j.dataTypes))}function le(j,I){if(I.length){if(!j.dataTypes.length){j.dataTypes=I;return}I.forEach(C=>{N(j.dataTypes,C)||E(j,`type "${C}" not allowed by context "${j.dataTypes.join(",")}"`)}),l(j,I)}}function M(j,I){I.length>1&&!(I.length===2&&I.includes("null"))&&E(j,"use allowUnionTypes to allow union type keyword")}function k(j,I){const C=j.self.RULES.all;for(const A in C){const K=C[A];if(typeof K=="object"&&(0,a.shouldUseRule)(j.schema,K)){const{type:W}=K.definition;W.length&&!W.some(ee=>T(I,ee))&&E(j,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function T(j,I){return j.includes(I)||I==="number"&&j.includes("integer")}function N(j,I){return j.includes(I)||I==="integer"&&j.includes("number")}function l(j,I){const C=[];for(const A of j.dataTypes)N(I,A)?C.push(A):I.includes("integer")&&A==="number"&&C.push("integer");j.dataTypes=C}function E(j,I){const C=j.schemaEnv.baseId+j.errSchemaPath;I+=` at "${C}" (strictTypes)`,(0,_.checkStrictMode)(j,I,j.opts.strictTypes)}class O{constructor(I,C,A){if((0,i.validateKeywordUsage)(I,C,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=C.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=C.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=C,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,C.schemaType,C.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(C.schemaType)}`);("code"in C?C.trackErrors:C.errors!==!1)&&(this.errsCount=I.gen.const("_errs",m.default.errors))}result(I,C,A){this.failResult((0,u.not)(I),C,A)}failResult(I,C,A){this.gen.if(I),A?A():this.error(),C?(this.gen.else(),C(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,C){this.failResult((0,u.not)(I),void 0,C)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:C}=this;this.fail((0,u._)`${C} !== undefined && (${(0,u.or)(this.invalid$data(),I)})`)}error(I,C,A){if(C){this.setParams(C),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,C){(I?S.reportExtraError:S.reportError)(this,this.def.error,C)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,C){C?Object.assign(this.params,I):this.params=I}block$data(I,C,A=u.nil){this.gen.block(()=>{this.check$data(I,A),C()})}check$data(I=u.nil,C=u.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:ee}=this;A.if((0,u.or)((0,u._)`${K} === undefined`,C)),I!==u.nil&&A.assign(I,!0),(W.length||ee.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==u.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:C,schemaType:A,def:K,it:W}=this;return(0,u.or)(ee(),fe());function ee(){if(A.length){if(!(C instanceof u.Name))throw new Error("ajv implementation error");const oe=Array.isArray(A)?A:[A];return(0,u._)`${(0,n.checkDataTypes)(oe,C,W.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}function fe(){if(K.validateSchema){const oe=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,u._)`!${oe}(${C})`}return u.nil}}subschema(I,C){const A=(0,p.getSubschema)(this.it,I);(0,p.extendSubschemaData)(A,this.it,I),(0,p.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return o(K,C),K}mergeEvaluated(I,C){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=_.mergeEvaluated.props(K,I.props,A.props,C)),A.items!==!0&&I.items!==void 0&&(A.items=_.mergeEvaluated.items(K,I.items,A.items,C)))}mergeValidEvaluated(I,C){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(C,()=>this.mergeEvaluated(I,u.Name)),!0}}he.KeywordCxt=O;function U(j,I,C,A){const K=new O(j,C,I);"code"in C?C.code(K,A):K.$data&&C.validate?(0,i.funcKeywordCode)(K,C):"macro"in C?(0,i.macroKeywordCode)(K,C):(C.compile||C.validate)&&(0,i.funcKeywordCode)(K,C)}const H=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(j,{dataLevel:I,dataNames:C,dataPathArr:A}){let K,W;if(j==="")return m.default.rootData;if(j[0]==="/"){if(!H.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);K=j,W=m.default.rootData}else{const ae=Z.exec(j);if(!ae)throw new Error(`Invalid JSON-pointer: ${j}`);const te=+ae[1];if(K=ae[2],K==="#"){if(te>=I)throw new Error(oe("property/index",te));return A[I-te]}if(te>I)throw new Error(oe("data",te));if(W=C[I-te],!K)return W}let ee=W;const fe=K.split("/");for(const ae of fe)ae&&(W=(0,u._)`${W}${(0,u.getProperty)((0,_.unescapeJsonPointer)(ae))}`,ee=(0,u._)`${ee} && ${W}`);return ee;function oe(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${I}`}}return he.getData=B,he}var Te={},_r;function Bt(){if(_r)return Te;_r=1,Object.defineProperty(Te,"__esModule",{value:!0});class e extends Error{constructor(a){super("validation failed"),this.errors=a,this.ajv=this.validation=!0}}return Te.default=e,Te}var De={},$r;function qt(){if($r)return De;$r=1,Object.defineProperty(De,"__esModule",{value:!0});const e=Rt();class t extends Error{constructor(n,v,i,p){super(p||`can't resolve reference ${i} from id ${v}`),this.missingRef=(0,e.resolveUrl)(n,v,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return De.default=t,De}var de={},br;function Yt(){if(br)return de;br=1,Object.defineProperty(de,"__esModule",{value:!0}),de.resolveSchema=de.getCompilingSchema=de.resolveRef=de.compileSchema=de.SchemaEnv=void 0;const e=J(),t=Bt(),a=_e(),n=Rt(),v=Y(),i=Ot();class p{constructor(d){var r;this.refs={},this.dynamicAnchors={};let o;typeof d.schema=="object"&&(o=d.schema),this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(r=d.baseId)!==null&&r!==void 0?r:(0,n.normalizeId)(o?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=o?.$async,this.refs={}}}de.SchemaEnv=p;function u(c){const d=_.call(this,c);if(d)return d;const r=(0,n.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:o,lines:h}=this.opts.code,{ownProperties:s}=this.opts,f=new e.CodeGen(this.scope,{es5:o,lines:h,ownProperties:s});let P;c.$async&&(P=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=f.scopeName("validate");c.validateName=R;const D={gen:f,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:c.schema,code:(0,e.stringify)(c.schema)}:{ref:c.schema}),validateName:R,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:r,baseId:c.baseId||r,schemaPath:e.nil,errSchemaPath:c.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(c),(0,i.validateFunctionCode)(D),f.optimize(this.opts.code.optimize);const q=f.toString();z=`${f.scopeRefs(a.default.scope)}return ${q}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${a.default.self}`,`${a.default.scope}`,z)(this,this.scope.get());if(this.scope.value(R,{ref:F}),F.errors=null,F.schema=c.schema,F.schemaEnv=c,c.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:R,validateCode:q,scopeValues:f._values}),this.opts.unevaluated){const{props:L,items:Q}=D;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return c.validate=F,c}catch(q){throw delete c.validate,delete c.validateName,z&&this.logger.error("Error compiling schema, function code:",z),q}finally{this._compilations.delete(c)}}de.compileSchema=u;function m(c,d,r){var o;r=(0,n.resolveUrl)(this.opts.uriResolver,d,r);const h=c.refs[r];if(h)return h;let s=$.call(this,c,r);if(s===void 0){const f=(o=c.localRefs)===null||o===void 0?void 0:o[r],{schemaId:P}=this.opts;f&&(s=new p({schema:f,schemaId:P,root:c,baseId:d}))}if(s!==void 0)return c.refs[r]=b.call(this,s)}de.resolveRef=m;function b(c){return(0,n.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:u.call(this,c)}function _(c){for(const d of this._compilations)if(S(d,c))return d}de.getCompilingSchema=_;function S(c,d){return c.schema===d.schema&&c.root===d.root&&c.baseId===d.baseId}function $(c,d){let r;for(;typeof(r=this.refs[d])=="string";)d=r;return r||this.schemas[d]||y.call(this,c,d)}function y(c,d){const r=this.opts.uriResolver.parse(d),o=(0,n._getFullPath)(this.opts.uriResolver,r);let h=(0,n.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&o===h)return w.call(this,r,c);const s=(0,n.normalizeId)(o),f=this.refs[s]||this.schemas[s];if(typeof f=="string"){const P=y.call(this,c,f);return typeof P?.schema!="object"?void 0:w.call(this,r,P)}if(typeof f?.schema=="object"){if(f.validate||u.call(this,f),s===(0,n.normalizeId)(d)){const{schema:P}=f,{schemaId:R}=this.opts,D=P[R];return D&&(h=(0,n.resolveUrl)(this.opts.uriResolver,h,D)),new p({schema:P,schemaId:R,root:c,baseId:h})}return w.call(this,r,f)}}de.resolveSchema=y;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:d,schema:r,root:o}){var h;if(((h=c.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const R=r[(0,v.unescapeFragment)(P)];if(R===void 0)return;r=R;const D=typeof r=="object"&&r[this.opts.schemaId];!g.has(P)&&D&&(d=(0,n.resolveUrl)(this.opts.uriResolver,d,D))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,v.schemaHasRulesButRef)(r,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,d,r.$ref);s=y.call(this,o,P)}const{schemaId:f}=this.opts;if(s=s||new p({schema:r,schemaId:f,root:o,baseId:d}),s.schema!==s.root.schema)return s}return de}const Kn="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Hn="Meta-schema for $data reference (JSON AnySchema extension proposal)",Gn="object",Jn=["$data"],Wn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Bn=!1,Yn={$id:Kn,description:Hn,type:Gn,required:Jn,properties:Wn,additionalProperties:Bn};var Me={},Ne={exports:{}},Kt,wr;function wn(){if(wr)return Kt;wr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a($){let y="",g=0,w=0;for(w=0;w<$.length;w++)if(g=$[w].charCodeAt(0),g!==48){if(!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";y+=$[w];break}for(w+=1;w<$.length;w++){if(g=$[w].charCodeAt(0),!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";y+=$[w]}return y}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function v($){return $.length=0,!0}function i($,y,g){if($.length){const w=a($);if(w!=="")y.push(w);else return g.error=!0,!1;$.length=0}return!0}function p($){let y=0;const g={error:!1,address:"",zone:""},w=[],c=[];let d=!1,r=!1,o=i;for(let h=0;h<$.length;h++){const s=$[h];if(!(s==="["||s==="]"))if(s===":"){if(d===!0&&(r=!0),!o(c,w,g))break;if(++y>7){g.error=!0;break}h>0&&$[h-1]===":"&&(d=!0),w.push(":");continue}else if(s==="%"){if(!o(c,w,g))break;o=v}else{c.push(s);continue}}return c.length&&(o===v?g.zone=c.join(""):r?w.push(c.join("")):w.push(a(c))),g.address=w.join(""),g}function u($){if(m($,":")<2)return{host:$,isIPV6:!1};const y=p($);if(y.error)return{host:$,isIPV6:!1};{let g=y.address,w=y.address;return y.zone&&(g+="%"+y.zone,w+="%25"+y.zone),{host:g,isIPV6:!0,escapedHost:w}}}function m($,y){let g=0;for(let w=0;w<$.length;w++)$[w]===y&&g++;return g}function b($){let y=$;const g=[];let w=-1,c=0;for(;c=y.length;){if(c===1){if(y===".")break;if(y==="/"){g.push("/");break}else{g.push(y);break}}else if(c===2){if(y[0]==="."){if(y[1]===".")break;if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&(y[1]==="."||y[1]==="/")){g.push("/");break}}else if(c===3&&y==="/.."){g.length!==0&&g.pop(),g.push("/");break}if(y[0]==="."){if(y[1]==="."){if(y[2]==="/"){y=y.slice(3);continue}}else if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&y[1]==="."){if(y[2]==="/"){y=y.slice(2);continue}else if(y[2]==="."&&y[3]==="/"){y=y.slice(3),g.length!==0&&g.pop();continue}}if((w=y.indexOf("/",1))===-1){g.push(y);break}else g.push(y.slice(0,w)),y=y.slice(w)}return g.join("")}function _($,y){const g=y!==!0?escape:unescape;return $.scheme!==void 0&&($.scheme=g($.scheme)),$.userinfo!==void 0&&($.userinfo=g($.userinfo)),$.host!==void 0&&($.host=g($.host)),$.path!==void 0&&($.path=g($.path)),$.query!==void 0&&($.query=g($.query)),$.fragment!==void 0&&($.fragment=g($.fragment)),$}function S($){const y=[];if($.userinfo!==void 0&&(y.push($.userinfo),y.push("@")),$.host!==void 0){let g=unescape($.host);if(!t(g)){const w=u(g);w.isIPV6===!0?g=`[${w.escapedHost}]`:g=$.host}y.push(g)}return(typeof $.port=="number"||typeof $.port=="string")&&(y.push(":"),y.push(String($.port))),y.length?y.join(""):void 0}return Kt={nonSimpleDomain:n,recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:a},Kt}var Ht,Pr;function Zn(){if(Pr)return Ht;Pr=1;const{isUUID:e}=wn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function n(s){return a.indexOf(s)!==-1}function v(s){return s.secure===!0?!0:s.secure===!1?!1:s.scheme?s.scheme.length===3&&(s.scheme[0]==="w"||s.scheme[0]==="W")&&(s.scheme[1]==="s"||s.scheme[1]==="S")&&(s.scheme[2]==="s"||s.scheme[2]==="S"):!1}function i(s){return s.host||(s.error=s.error||"HTTP URIs must have a host."),s}function p(s){const f=String(s.scheme).toLowerCase()==="https";return(s.port===(f?443:80)||s.port==="")&&(s.port=void 0),s.path||(s.path="/"),s}function u(s){return s.secure=v(s),s.resourceName=(s.path||"/")+(s.query?"?"+s.query:""),s.path=void 0,s.query=void 0,s}function m(s){if((s.port===(v(s)?443:80)||s.port==="")&&(s.port=void 0),typeof s.secure=="boolean"&&(s.scheme=s.secure?"wss":"ws",s.secure=void 0),s.resourceName){const[f,P]=s.resourceName.split("?");s.path=f&&f!=="/"?f:void 0,s.query=P,s.resourceName=void 0}return s.fragment=void 0,s}function b(s,f){if(!s.path)return s.error="URN can not be parsed",s;const P=s.path.match(t);if(P){const R=f.scheme||s.scheme||"urn";s.nid=P[1].toLowerCase(),s.nss=P[2];const D=`${R}:${f.nid||s.nid}`,z=h(D);s.path=void 0,z&&(s=z.parse(s,f))}else s.error=s.error||"URN can not be parsed.";return s}function _(s,f){if(s.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=f.scheme||s.scheme||"urn",R=s.nid.toLowerCase(),D=`${P}:${f.nid||R}`,z=h(D);z&&(s=z.serialize(s,f));const q=s,V=s.nss;return q.path=`${R||f.nid}:${V}`,f.skipEscape=!0,q}function S(s,f){const P=s;return P.uuid=P.nss,P.nss=void 0,!f.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function $(s){const f=s;return f.nss=(s.uuid||"").toLowerCase(),f}const y={scheme:"http",domainHost:!0,parse:i,serialize:p},g={scheme:"https",domainHost:y.domainHost,parse:i,serialize:p},w={scheme:"ws",domainHost:!0,parse:u,serialize:m},c={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},o={http:y,https:g,ws:w,wss:c,urn:{scheme:"urn",parse:b,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:S,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(o,null);function h(s){return s&&(o[s]||o[s.toLowerCase()])||void 0}return Ht={wsIsSecure:v,SCHEMES:o,isValidSchemeName:n,getSchemeHandler:h},Ht}var Er;function Qn(){if(Er)return Ne.exports;Er=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:a,normalizeComponentEncoding:n,isIPv4:v,nonSimpleDomain:i}=wn(),{SCHEMES:p,getSchemeHandler:u}=Zn();function m(c,d){return typeof c=="string"?c=$(g(c,d),d):typeof c=="object"&&(c=g($(c,d),d)),c}function b(c,d,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},h=_(g(c,o),g(d,o),o,!0);return o.skipEscape=!0,$(h,o)}function _(c,d,r,o){const h={};return o||(c=g($(c,r),r),d=g($(d,r),r)),r=r||{},!r.tolerant&&d.scheme?(h.scheme=d.scheme,h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.path?(d.path[0]==="/"?h.path=t(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?h.path="/"+d.path:c.path?h.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:h.path=d.path,h.path=t(h.path)),h.query=d.query):(h.path=c.path,d.query!==void 0?h.query=d.query:h.query=c.query),h.userinfo=c.userinfo,h.host=c.host,h.port=c.port),h.scheme=c.scheme),h.fragment=d.fragment,h}function S(c,d,r){return typeof c=="string"?(c=unescape(c),c=$(n(g(c,r),!0),{...r,skipEscape:!0})):typeof c=="object"&&(c=$(n(c,!0),{...r,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=$(n(g(d,r),!0),{...r,skipEscape:!0})):typeof d=="object"&&(d=$(n(d,!0),{...r,skipEscape:!0})),c.toLowerCase()===d.toLowerCase()}function $(c,d){const r={host:c.host,scheme:c.scheme,userinfo:c.userinfo,port:c.port,path:c.path,query:c.query,nid:c.nid,nss:c.nss,uuid:c.uuid,fragment:c.fragment,reference:c.reference,resourceName:c.resourceName,secure:c.secure,error:""},o=Object.assign({},d),h=[],s=u(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&h.push(r.scheme,":");const f=a(r);if(f!==void 0&&(o.reference!=="suffix"&&h.push("//"),h.push(f),r.path&&r.path[0]!=="/"&&h.push("/")),r.path!==void 0){let P=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(P=t(P)),f===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),h.push(P)}return r.query!==void 0&&h.push("?",r.query),r.fragment!==void 0&&h.push("#",r.fragment),h.join("")}const y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(c,d){const r=Object.assign({},d),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;r.reference==="suffix"&&(r.scheme?c=r.scheme+":"+c:c="//"+c);const s=c.match(y);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(v(o.host)===!1){const R=e(o.host);o.host=R.host.toLowerCase(),h=R.isIPV6}else h=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const f=u(r.scheme||o.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&o.host&&(r.domainHost||f&&f.domainHost)&&h===!1&&i(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(P){o.error=o.error||"Host's domain name can not be converted to ASCII: "+P}(!f||f&&!f.skipNormalize)&&(c.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),f&&f.parse&&f.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const w={SCHEMES:p,normalize:m,resolve:b,resolveComponent:_,equal:S,serialize:$,parse:g};return Ne.exports=w,Ne.exports.default=w,Ne.exports.fastUri=w,Ne.exports}var Sr;function Xn(){if(Sr)return Me;Sr=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=Qn();return e.code='require("ajv/dist/runtime/uri").default',Me.default=e,Me}var jr;function xn(){return jr||(jr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ot();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var a=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return a.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return a.CodeGen}});const n=Bt(),v=qt(),i=_n(),p=Yt(),u=J(),m=Rt(),b=_t(),_=Y(),S=Yn,$=Xn(),y=(M,k)=>new RegExp(M,k);y.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function o(M){var k,T,N,l,E,O,U,H,Z,B,j,I,C,A,K,W,ee,fe,oe,ae,te,Ee,ue,Ct,Tt;const ke=M.strict,Dt=(k=M.code)===null||k===void 0?void 0:k.optimize,Xt=Dt===!0||Dt===void 0?1:Dt||0,xt=(N=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&N!==void 0?N:y,An=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(O=(E=M.strictSchema)!==null&&E!==void 0?E:ke)!==null&&O!==void 0?O:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:ke)!==null&&H!==void 0?H:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:ke)!==null&&B!==void 0?B:"log",strictTuples:(I=(j=M.strictTuples)!==null&&j!==void 0?j:ke)!==null&&I!==void 0?I:"log",strictRequired:(A=(C=M.strictRequired)!==null&&C!==void 0?C:ke)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:Xt,regExp:xt}:{optimize:Xt,regExp:xt},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:r,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:r,meta:(ee=M.meta)!==null&&ee!==void 0?ee:!0,messages:(fe=M.messages)!==null&&fe!==void 0?fe:!0,inlineRefs:(oe=M.inlineRefs)!==null&&oe!==void 0?oe:!0,schemaId:(ae=M.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=M.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(Ee=M.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(ue=M.validateFormats)!==null&&ue!==void 0?ue:!0,unicodeRegExp:(Ct=M.unicodeRegExp)!==null&&Ct!==void 0?Ct:!0,int32range:(Tt=M.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:An}}class h{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...o(k)};const{es5:T,lines:N}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:w,es5:T,lines:N}),this.logger=V(k.logger);const l=k.validateFormats;k.validateFormats=!1,this.RULES=(0,i.getRules)(),s.call(this,c,k,"NOT SUPPORTED"),s.call(this,d,k,"DEPRECATED","warn"),this._metaOpts=z.call(this),k.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&D.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),P.call(this),k.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:T,schemaId:N}=this.opts;let l=S;N==="id"&&(l={...S},l.id=l.$id,delete l.$id),T&&k&&this.addMetaSchema(l,l[N],!1)}defaultMeta(){const{meta:k,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[T]||k:void 0}validate(k,T){let N;if(typeof k=="string"){if(N=this.getSchema(k),!N)throw new Error(`no schema with key or ref "${k}"`)}else N=this.compile(k);const l=N(T);return"$async"in N||(this.errors=N.errors),l}compile(k,T){const N=this._addSchema(k,T);return N.validate||this._compileSchemaEnv(N)}compileAsync(k,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return l.call(this,k,T);async function l(B,j){await E.call(this,B.$schema);const I=this._addSchema(B,j);return I.validate||O.call(this,I)}async function E(B){B&&!this.getSchema(B)&&await l.call(this,{$ref:B},!0)}async function O(B){try{return this._compileSchemaEnv(B)}catch(j){if(!(j instanceof v.default))throw j;return U.call(this,j),await H.call(this,j.missingSchema),O.call(this,B)}}function U({missingSchema:B,missingRef:j}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${j} cannot be resolved`)}async function H(B){const j=await Z.call(this,B);this.refs[B]||await E.call(this,j.$schema),this.refs[B]||this.addSchema(j,B,T)}async function Z(B){const j=this._loading[B];if(j)return j;try{return await(this._loading[B]=N(B))}finally{delete this._loading[B]}}}addSchema(k,T,N,l=this.opts.validateSchema){if(Array.isArray(k)){for(const O of k)this.addSchema(O,void 0,N,l);return this}let E;if(typeof k=="object"){const{schemaId:O}=this.opts;if(E=k[O],E!==void 0&&typeof E!="string")throw new Error(`schema ${O} must be string`)}return T=(0,m.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(k,N,T,l,!0),this}addMetaSchema(k,T,N=this.opts.validateSchema){return this.addSchema(k,T,!0,N),this}validateSchema(k,T){if(typeof k=="boolean")return!0;let N;if(N=k.$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;const l=this.validate(N,k);if(!l&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return l}getSchema(k){let T;for(;typeof(T=f.call(this,k))=="string";)k=T;if(T===void 0){const{schemaId:N}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:N});if(T=p.resolveSchema.call(this,l,k),!T)return;this.refs[k]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=f.call(this,k);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const T=k;this._cache.delete(T);let N=k[this.opts.schemaId];return N&&(N=(0,m.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const T of k)this.addKeyword(T);return this}addKeyword(k,T){let N;if(typeof k=="string")N=k,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=N);else if(typeof k=="object"&&T===void 0){if(T=k,N=T.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(L.call(this,N,T),!T)return(0,_.eachItem)(N,E=>Q.call(this,E)),this;ie.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(N,l.type.length===0?E=>Q.call(this,E,l):E=>l.type.forEach(O=>Q.call(this,E,l,O))),this}getKeyword(k){const T=this.RULES.all[k];return typeof T=="object"?T.definition:!!T}removeKeyword(k){const{RULES:T}=this;delete T.keywords[k],delete T.all[k];for(const N of T.rules){const l=N.rules.findIndex(E=>E.keyword===k);l>=0&&N.rules.splice(l,1)}return this}addFormat(k,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[k]=T,this}errorsText(k=this.errors,{separator:T=", ",dataVar:N="data"}={}){return!k||k.length===0?"No errors":k.map(l=>`${N}${l.instancePath} ${l.message}`).reduce((l,E)=>l+T+E)}$dataMetaSchema(k,T){const N=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const l of T){const E=l.split("/").slice(1);let O=k;for(const U of E)O=O[U];for(const U in N){const H=N[U];if(typeof H!="object")continue;const{$data:Z}=H.definition,B=O[U];Z&&B&&(O[U]=le(B))}}return k}_removeAllSchemas(k,T){for(const N in k){const l=k[N];(!T||T.test(N))&&(typeof l=="string"?delete k[N]:l&&!l.meta&&(this._cache.delete(l.schema),delete k[N]))}}_addSchema(k,T,N,l=this.opts.validateSchema,E=this.opts.addUsedSchema){let O;const{schemaId:U}=this.opts;if(typeof k=="object")O=k[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(k);if(H!==void 0)return H;N=(0,m.normalizeId)(O||N);const Z=m.getSchemaRefs.call(this,k,N);return H=new p.SchemaEnv({schema:k,schemaId:U,meta:T,baseId:N,localRefs:Z}),this._cache.set(H.schema,H),E&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=H),l&&this.validateSchema(k,!0),H}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):p.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const T=this.opts;this.opts=this._metaOpts;try{p.compileSchema.call(this,k)}finally{this.opts=T}}}h.ValidationError=n.default,h.MissingRefError=v.default,e.default=h;function s(M,k,T,N="error"){for(const l in M){const E=l;E in k&&this.logger[N](`${T}: option ${l}. ${M[E]}`)}}function f(M){return M=(0,m.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const k in M)this.addSchema(M[k],k)}function R(){for(const M in this.opts.formats){const k=this.opts.formats[M];k&&this.addFormat(M,k)}}function D(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in M){const T=M[k];T.keyword||(T.keyword=k),this.addKeyword(T)}}function z(){const M={...this.opts};for(const k of g)delete M[k];return M}const q={log(){},warn(){},error(){}};function V(M){if(M===!1)return q;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,k){const{RULES:T}=this;if((0,_.eachItem)(M,N=>{if(T.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!F.test(N))throw new Error(`Keyword ${N} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,k,T){var N;const l=k?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let O=l?E.post:E.rules.find(({type:H})=>H===T);if(O||(O={type:T,rules:[]},E.rules.push(O)),E.keywords[M]=!0,!k)return;const U={keyword:M,definition:{...k,type:(0,b.getJSONTypes)(k.type),schemaType:(0,b.getJSONTypes)(k.schemaType)}};k.before?ne.call(this,O,U,k.before):O.rules.push(U),E.all[M]=U,(N=k.implements)===null||N===void 0||N.forEach(H=>this.addKeyword(H))}function ne(M,k,T){const N=M.rules.findIndex(l=>l.keyword===T);N>=0?M.rules.splice(N,0,k):(M.rules.push(k),this.logger.warn(`rule ${T} is not defined`))}function ie(M){let{metaSchema:k}=M;k!==void 0&&(M.$data&&this.opts.$data&&(k=le(k)),M.validateSchema=this.compile(k,!0))}const x={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(M){return{anyOf:[M,x]}}})(Mt)),Mt}var Ae={},Ve={},ze={},kr;function ei(){if(kr)return ze;kr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ze.default=e,ze}var ve={},Ir;function ti(){if(Ir)return ve;Ir=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=qt(),t=me(),a=J(),n=_e(),v=Yt(),i=Y(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:S,it:$}=b,{baseId:y,schemaEnv:g,validateName:w,opts:c,self:d}=$,{root:r}=g;if((S==="#"||S==="#/")&&y===r.baseId)return h();const o=v.resolveRef.call(d,r,y,S);if(o===void 0)throw new e.default($.opts.uriResolver,y,S);if(o instanceof v.SchemaEnv)return s(o);return f(o);function h(){if(g===r)return m(b,w,g,g.$async);const P=_.scopeValue("root",{ref:r});return m(b,(0,a._)`${P}.validate`,r,r.$async)}function s(P){const R=u(b,P);m(b,R,P,P.$async)}function f(P){const R=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,a.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:a.nil,topSchemaRef:R,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function u(b,_){const{gen:S}=b;return _.validate?S.scopeValue("validate",{ref:_.validate}):(0,a._)`${S.scopeValue("wrapper",{ref:_})}.validate`}ve.getValidate=u;function m(b,_,S,$){const{gen:y,it:g}=b,{allErrors:w,schemaEnv:c,opts:d}=g,r=d.passContext?n.default.this:a.nil;$?o():h();function o(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=y.let("valid");y.try(()=>{y.code((0,a._)`await ${(0,t.callValidateCode)(b,_,r)}`),f(_),w||y.assign(P,!0)},R=>{y.if((0,a._)`!(${R} instanceof ${g.ValidationError})`,()=>y.throw(R)),s(R),w||y.assign(P,!1)}),b.ok(P)}function h(){b.result((0,t.callValidateCode)(b,_,r),()=>f(_),()=>s(_))}function s(P){const R=(0,a._)`${P}.errors`;y.assign(n.default.vErrors,(0,a._)`${n.default.vErrors} === null ? ${R} : ${n.default.vErrors}.concat(${R})`),y.assign(n.default.errors,(0,a._)`${n.default.vErrors}.length`)}function f(P){var R;if(!g.opts.unevaluated)return;const D=(R=S?.validate)===null||R===void 0?void 0:R.evaluated;if(g.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&(g.props=i.mergeEvaluated.props(y,D.props,g.props));else{const z=y.var("props",(0,a._)`${P}.evaluated.props`);g.props=i.mergeEvaluated.props(y,z,g.props,a.Name)}if(g.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&(g.items=i.mergeEvaluated.items(y,D.items,g.items));else{const z=y.var("items",(0,a._)`${P}.evaluated.items`);g.items=i.mergeEvaluated.items(y,z,g.items,a.Name)}}}return ve.callRef=m,ve.default=p,ve}var Nr;function ri(){if(Nr)return Ve;Nr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=ei(),t=ti(),a=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ve.default=a,Ve}var Fe={},Le={},Rr;function ni(){if(Rr)return Le;Rr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=J(),t=e.operators,a={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:i,schemaCode:p})=>(0,e.str)`must be ${a[i].okStr} ${p}`,params:({keyword:i,schemaCode:p})=>(0,e._)`{comparison: ${a[i].okStr}, limit: ${p}}`},v={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:p,data:u,schemaCode:m}=i;i.fail$data((0,e._)`${u} ${a[p].fail} ${m} || isNaN(${u})`)}};return Le.default=v,Le}var Ue={},Or;function ii(){if(Or)return Ue;Or=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=J(),a={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:v,data:i,schemaCode:p,it:u}=n,m=u.opts.multipleOfPrecision,b=v.let("res"),_=m?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${m}`:(0,e._)`${b} !== parseInt(${b})`;n.fail$data((0,e._)`(${p} === 0 || (${b} = ${i}/${p}, ${_}))`)}};return Ue.default=a,Ue}var Ke={},He={},qr;function si(){if(qr)return He;qr=1,Object.defineProperty(He,"__esModule",{value:!0});function e(t){const a=t.length;let n=0,v=0,i;for(;v<a;)n++,i=t.charCodeAt(v++),i>=55296&&i<=56319&&v<a&&(i=t.charCodeAt(v),(i&64512)===56320&&v++);return n}return He.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',He}var Cr;function oi(){if(Cr)return Ke;Cr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=J(),t=Y(),a=si(),v={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:p}){const u=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${p} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:p,data:u,schemaCode:m,it:b}=i,_=p==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(i.gen,a.default)}(${u})`;i.fail$data((0,e._)`${S} ${_} ${m}`)}};return Ke.default=v,Ke}var Ge={},Tr;function ai(){if(Tr)return Ge;Tr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=me(),t=J(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:v})=>(0,t.str)`must match pattern "${v}"`,params:({schemaCode:v})=>(0,t._)`{pattern: ${v}}`},code(v){const{data:i,$data:p,schema:u,schemaCode:m,it:b}=v,_=b.opts.unicodeRegExp?"u":"",S=p?(0,t._)`(new RegExp(${m}, ${_}))`:(0,e.usePattern)(v,u);v.fail$data((0,t._)`!${S}.test(${i})`)}};return Ge.default=n,Ge}var Je={},Dr;function ci(){if(Dr)return Je;Dr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=J(),a={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:v}){const i=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${v} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:v,data:i,schemaCode:p}=n,u=v==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${i}).length ${u} ${p}`)}};return Je.default=a,Je}var We={},Mr;function di(){if(Mr)return We;Mr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=me(),t=J(),a=Y(),v={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:p,schema:u,schemaCode:m,data:b,$data:_,it:S}=i,{opts:$}=S;if(!_&&u.length===0)return;const y=u.length>=$.loopRequired;if(S.allErrors?g():w(),$.strictRequired){const r=i.parentSchema.properties,{definedProperties:o}=i.it;for(const h of u)if(r?.[h]===void 0&&!o.has(h)){const s=S.schemaEnv.baseId+S.errSchemaPath,f=`required property "${h}" is not defined at "${s}" (strictRequired)`;(0,a.checkStrictMode)(S,f,S.opts.strictRequired)}}function g(){if(y||_)i.block$data(t.nil,c);else for(const r of u)(0,e.checkReportMissingProp)(i,r)}function w(){const r=p.let("missing");if(y||_){const o=p.let("valid",!0);i.block$data(o,()=>d(r,o)),i.ok(o)}else p.if((0,e.checkMissingProp)(i,u,r)),(0,e.reportMissingProp)(i,r),p.else()}function c(){p.forOf("prop",m,r=>{i.setParams({missingProperty:r}),p.if((0,e.noPropertyInData)(p,b,r,$.ownProperties),()=>i.error())})}function d(r,o){i.setParams({missingProperty:r}),p.forOf(r,m,()=>{p.assign(o,(0,e.propertyInData)(p,b,r,$.ownProperties)),p.if((0,t.not)(o),()=>{i.error(),p.break()})},t.nil)}}};return We.default=v,We}var Be={},Ar;function ui(){if(Ar)return Be;Ar=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=J(),a={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:v}){const i=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${v} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:v,data:i,schemaCode:p}=n,u=v==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${i}.length ${u} ${p}`)}};return Be.default=a,Be}var Ye={},Ze={},Vr;function Zt(){if(Vr)return Ze;Vr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=bn();return e.code='require("ajv/dist/runtime/equal").default',Ze.default=e,Ze}var zr;function li(){if(zr)return Ye;zr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=_t(),t=J(),a=Y(),n=Zt(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${p} are identical)`,params:({params:{i:p,j:u}})=>(0,t._)`{i: ${p}, j: ${u}}`},code(p){const{gen:u,data:m,$data:b,schema:_,parentSchema:S,schemaCode:$,it:y}=p;if(!b&&!_)return;const g=u.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];p.block$data(g,c,(0,t._)`${$} === false`),p.ok(g);function c(){const h=u.let("i",(0,t._)`${m}.length`),s=u.let("j");p.setParams({i:h,j:s}),u.assign(g,!0),u.if((0,t._)`${h} > 1`,()=>(d()?r:o)(h,s))}function d(){return w.length>0&&!w.some(h=>h==="object"||h==="array")}function r(h,s){const f=u.name("item"),P=(0,e.checkDataTypes)(w,f,y.opts.strictNumbers,e.DataType.Wrong),R=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${h}--;`,()=>{u.let(f,(0,t._)`${m}[${h}]`),u.if(P,(0,t._)`continue`),w.length>1&&u.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),u.if((0,t._)`typeof ${R}[${f}] == "number"`,()=>{u.assign(s,(0,t._)`${R}[${f}]`),p.error(),u.assign(g,!1).break()}).code((0,t._)`${R}[${f}] = ${h}`)})}function o(h,s){const f=(0,a.useFunc)(u,n.default),P=u.name("outer");u.label(P).for((0,t._)`;${h}--;`,()=>u.for((0,t._)`${s} = ${h}; ${s}--;`,()=>u.if((0,t._)`${f}(${m}[${h}], ${m}[${s}])`,()=>{p.error(),u.assign(g,!1).break(P)})))}}};return Ye.default=i,Ye}var Qe={},Fr;function fi(){if(Fr)return Qe;Fr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=J(),t=Y(),a=Zt(),v={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:p,data:u,$data:m,schemaCode:b,schema:_}=i;m||_&&typeof _=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(p,a.default)}(${u}, ${b})`):i.fail((0,e._)`${_} !== ${u}`)}};return Qe.default=v,Qe}var Xe={},Lr;function pi(){if(Lr)return Xe;Lr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=J(),t=Y(),a=Zt(),v={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:p,data:u,$data:m,schema:b,schemaCode:_,it:S}=i;if(!m&&b.length===0)throw new Error("enum must have non-empty array");const $=b.length>=S.opts.loopEnum;let y;const g=()=>y??(y=(0,t.useFunc)(p,a.default));let w;if($||m)w=p.let("valid"),i.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const r=p.const("vSchema",_);w=(0,e.or)(...b.map((o,h)=>d(r,h)))}i.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,r=>p.if((0,e._)`${g()}(${u}, ${r})`,()=>p.assign(w,!0).break()))}function d(r,o){const h=b[o];return typeof h=="object"&&h!==null?(0,e._)`${g()}(${u}, ${r}[${o}])`:(0,e._)`${u} === ${h}`}}};return Xe.default=v,Xe}var Ur;function mi(){if(Ur)return Fe;Ur=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=ni(),t=ii(),a=oi(),n=ai(),v=ci(),i=di(),p=ui(),u=li(),m=fi(),b=pi(),_=[e.default,t.default,a.default,n.default,v.default,i.default,p.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,b.default];return Fe.default=_,Fe}var xe={},Se={},Kr;function Pn(){if(Kr)return Se;Kr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateAdditionalItems=void 0;const e=J(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:p,it:u}=i,{items:m}=p;if(!Array.isArray(m)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}v(i,m)}};function v(i,p){const{gen:u,schema:m,data:b,keyword:_,it:S}=i;S.items=!0;const $=u.const("len",(0,e._)`${b}.length`);if(m===!1)i.setParams({len:p.length}),i.pass((0,e._)`${$} <= ${p.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(S,m)){const g=u.var("valid",(0,e._)`${$} <= ${p.length}`);u.if((0,e.not)(g),()=>y(g)),i.ok(g)}function y(g){u.forRange("i",p.length,$,w=>{i.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},g),S.allErrors||u.if((0,e.not)(g),()=>u.break())})}}return Se.validateAdditionalItems=v,Se.default=n,Se}var et={},je={},Hr;function En(){if(Hr)return je;Hr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateTuple=void 0;const e=J(),t=Y(),a=me(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:p,it:u}=i;if(Array.isArray(p))return v(i,"additionalItems",p);u.items=!0,!(0,t.alwaysValidSchema)(u,p)&&i.ok((0,a.validateArray)(i))}};function v(i,p,u=i.schema){const{gen:m,parentSchema:b,data:_,keyword:S,it:$}=i;w(b),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(m,u.length,$.items));const y=m.name("valid"),g=m.const("len",(0,e._)`${_}.length`);u.forEach((c,d)=>{(0,t.alwaysValidSchema)($,c)||(m.if((0,e._)`${g} > ${d}`,()=>i.subschema({keyword:S,schemaProp:d,dataProp:d},y)),i.ok(y))});function w(c){const{opts:d,errSchemaPath:r}=$,o=u.length,h=o===c.minItems&&(o===c.maxItems||c[p]===!1);if(d.strictTuples&&!h){const s=`"${S}" is ${o}-tuple, but minItems or maxItems/${p} are not specified or different at path "${r}"`;(0,t.checkStrictMode)($,s,d.strictTuples)}}}return je.validateTuple=v,je.default=n,je}var Gr;function hi(){if(Gr)return et;Gr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=En(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a=>(0,e.validateTuple)(a,"items")};return et.default=t,et}var tt={},Jr;function yi(){if(Jr)return tt;Jr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=J(),t=Y(),a=me(),n=Pn(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:p}})=>(0,e.str)`must NOT have more than ${p} items`,params:({params:{len:p}})=>(0,e._)`{limit: ${p}}`},code(p){const{schema:u,parentSchema:m,it:b}=p,{prefixItems:_}=m;b.items=!0,!(0,t.alwaysValidSchema)(b,u)&&(_?(0,n.validateAdditionalItems)(p,_):p.ok((0,a.validateArray)(p)))}};return tt.default=i,tt}var rt={},Wr;function gi(){if(Wr)return rt;Wr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:v,max:i}})=>i===void 0?(0,e.str)`must contain at least ${v} valid item(s)`:(0,e.str)`must contain at least ${v} and no more than ${i} valid item(s)`,params:({params:{min:v,max:i}})=>i===void 0?(0,e._)`{minContains: ${v}}`:(0,e._)`{minContains: ${v}, maxContains: ${i}}`},code(v){const{gen:i,schema:p,parentSchema:u,data:m,it:b}=v;let _,S;const{minContains:$,maxContains:y}=u;b.opts.next?(_=$===void 0?1:$,S=y):_=1;const g=i.const("len",(0,e._)`${m}.length`);if(v.setParams({min:_,max:S}),S===void 0&&_===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&_>S){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),v.fail();return}if((0,t.alwaysValidSchema)(b,p)){let o=(0,e._)`${g} >= ${_}`;S!==void 0&&(o=(0,e._)`${o} && ${g} <= ${S}`),v.pass(o);return}b.items=!0;const w=i.name("valid");S===void 0&&_===1?d(w,()=>i.if(w,()=>i.break())):_===0?(i.let(w,!0),S!==void 0&&i.if((0,e._)`${m}.length > 0`,c)):(i.let(w,!1),c()),v.result(w,()=>v.reset());function c(){const o=i.name("_valid"),h=i.let("count",0);d(o,()=>i.if(o,()=>r(h)))}function d(o,h){i.forRange("i",0,g,s=>{v.subschema({keyword:"contains",dataProp:s,dataPropType:t.Type.Num,compositeRule:!0},o),h()})}function r(o){i.code((0,e._)`${o}++`),S===void 0?i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0).break()):(i.if((0,e._)`${o} > ${S}`,()=>i.assign(w,!1).break()),_===1?i.assign(w,!0):i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0)))}}};return rt.default=n,rt}var Gt={},Br;function vi(){return Br||(Br=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=J(),a=Y(),n=me();e.error={message:({params:{property:m,depsCount:b,deps:_}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:b,deps:_,missingProperty:S}})=>(0,t._)`{property: ${m},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce={exports:{}},At={},he={},$e={},Vt={},zt={},Ft={},tr;function _t(){return tr||(tr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=a;class n extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((o,h)=>`${o}${h}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((o,h)=>(h instanceof a&&(o[h.str]=(o[h.str]||0)+1),o),{})}}e._Code=n,e.nil=new n("");function y(d,...r){const o=[d[0]];let h=0;for(;h<r.length;)u(o,r[h]),o.push(d[++h]);return new n(o)}e._=y;const i=new n("+");function p(d,...r){const o=[g(d[0])];let h=0;for(;h<r.length;)o.push(i),u(o,r[h]),o.push(i,g(d[++h]));return m(o),new n(o)}e.str=p;function u(d,r){r instanceof n?d.push(...r._items):r instanceof a?d.push(r):d.push(S(r))}e.addCodeArg=u;function m(d){let r=1;for(;r<d.length-1;){if(d[r]===i){const o=b(d[r-1],d[r+1]);if(o!==void 0){d.splice(r-1,3,o);continue}d[r++]="+"}r++}}function b(d,r){if(r==='""')return d;if(d==='""')return r;if(typeof d=="string")return r instanceof a||d[d.length-1]!=='"'?void 0:typeof r!="string"?`${d.slice(0,-1)}${r}"`:r[0]==='"'?d.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(d instanceof a))return`"${d}${r.slice(1)}`}function _(d,r){return r.emptyStr()?d:d.emptyStr()?r:p`${d}${r}`}e.strConcat=_;function S(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:g(Array.isArray(d)?d.join(","):d)}function $(d){return new n(g(d))}e.stringify=$;function g(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new n(`.${d}`):y`[${d}]`}e.getProperty=v;function w(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new n(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(d){return new n(d.toString())}e.regexpCode=c})(Ft)),Ft}var Lt={},rr;function nr(){return rr||(rr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=_t();class a extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class y{constructor({prefixes:b,parent:_}={}){this._names={},this._prefixes=b,this._parent=_}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const _=this._names[b]||this._nameGroup(b);return`${b}${_.index++}`}_nameGroup(b){var _,S;if(!((S=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||S===void 0)&&S.has(b)||this._prefixes&&!this._prefixes.has(b))throw new Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}}e.Scope=y;class i extends t.Name{constructor(b,_){super(_),this.prefix=b}setValue(b,{property:_,itemIndex:S}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(_)}[${S}]`}}e.ValueScopeName=i;const p=(0,t._)`\n`;class u extends y{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?p:t.nil}}get(){return this._scope}name(b){return new i(b,this._newName(b))}value(b,_){var S;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(b),{prefix:g}=$,v=(S=_.key)!==null&&S!==void 0?S:_.ref;let w=this._values[g];if(w){const r=w.get(v);if(r)return r}else w=this._values[g]=new Map;w.set(v,$);const c=this._scope[g]||(this._scope[g]=[]),d=c.length;return c[d]=_.ref,$.setValue(_,{property:g,itemIndex:d}),$}getValue(b,_){const S=this._values[b];if(S)return S.get(_)}scopeRefs(b,_=this._values){return this._reduceValues(_,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,t._)`${b}${S.scopePath}`})}scopeCode(b=this._values,_,S){return this._reduceValues(b,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},_,S)}_reduceValues(b,_,S={},$){let g=t.nil;for(const v in b){const w=b[v];if(!w)continue;const c=S[v]=S[v]||new Map;w.forEach(d=>{if(c.has(d))return;c.set(d,n.Started);let r=_(d);if(r){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${o} ${d} = ${r};${this.opts._n}`}else if(r=$?.(d))g=(0,t._)`${g}${r}${this.opts._n}`;else throw new a(d);c.set(d,n.Completed)})}return g}}e.ValueScope=u})(Lt)),Lt}var ir;function J(){return ir||(ir=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=_t(),a=nr();var n=_t();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var y=nr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return y.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return y.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return y.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return y.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(l,E){return this}}class p extends i{constructor(l,E,O){super(),this.varKind=l,this.name=E,this.rhs=O}render({es5:l,_n:E}){const O=l?a.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${U};`+E}optimizeNames(l,E){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(l,E,O){super(),this.lhs=l,this.rhs=E,this.sideEffects=O}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,E){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,E),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class m extends u{constructor(l,E,O,U){super(l,O,U),this.op=E}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class b extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class _ extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class S extends i{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class $ extends i{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,E){return this.code=L(this.code,l,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends i{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((E,O)=>E+O.render(l),"")}optimizeNodes(){const{nodes:l}=this;let E=l.length;for(;E--;){const O=l[E].optimizeNodes();Array.isArray(O)?l.splice(E,1,...O):O?l[E]=O:l.splice(E,1)}return l.length>0?this:void 0}optimizeNames(l,E){const{nodes:O}=this;let U=O.length;for(;U--;){const H=O[U];H.optimizeNames(l,E)||(Q(l,H.names),O.splice(U,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((l,E)=>V(l,E.names),{})}}class v extends g{render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class w extends g{}class c extends v{}c.kind="else";class d extends v{constructor(l,E){super(E),this.condition=l}render(l){let E=`if(${this.condition})`+super.render(l);return this.else&&(E+="else "+this.else.render(l)),E}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let E=this.else;if(E){const O=E.optimizeNodes();E=this.else=Array.isArray(O)?new c(O):O}if(E)return l===!1?E instanceof d?E:E.nodes:this.nodes.length?this:new d(ne(l),E instanceof d?[E]:E.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,E){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(l,E),!!(super.optimizeNames(l,E)||this.else))return this.condition=L(this.condition,l,E),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}d.kind="if";class r extends v{}r.kind="for";class o extends r{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iteration=L(this.iteration,l,E),this}get names(){return V(super.names,this.iteration.names)}}class h extends r{constructor(l,E,O,U){super(),this.varKind=l,this.name=E,this.from=O,this.to=U}render(l){const E=l.es5?a.varKinds.var:this.varKind,{name:O,from:U,to:H}=this;return`for(${E} ${O}=${U}; ${O}<${H}; ${O}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class s extends r{constructor(l,E,O,U){super(),this.loop=l,this.varKind=E,this.name=O,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iterable=L(this.iterable,l,E),this}get names(){return V(super.names,this.iterable.names)}}class f extends v{constructor(l,E,O){super(),this.name=l,this.args=E,this.async=O}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}f.kind="func";class P extends g{render(l){return"return "+super.render(l)}}P.kind="return";class N extends v{render(l){let E="try"+super.render(l);return this.catch&&(E+=this.catch.render(l)),this.finally&&(E+=this.finally.render(l)),E}optimizeNodes(){var l,E;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(l,E){var O,U;return super.optimizeNames(l,E),(O=this.catch)===null||O===void 0||O.optimizeNames(l,E),(U=this.finally)===null||U===void 0||U.optimizeNames(l,E),this}get names(){const l=super.names;return this.catch&&V(l,this.catch.names),this.finally&&V(l,this.finally.names),l}}class D extends v{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}D.kind="catch";class z extends v{render(l){return"finally"+super.render(l)}}z.kind="finally";class q{constructor(l,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
|
|
2
|
+
`:""},this._extScope=l,this._scope=new a.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,E){const O=this._extScope.value(l,E);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(l,E){return this._extScope.getValue(l,E)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,E,O,U){const H=this._scope.toName(E);return O!==void 0&&U&&(this._constants[H.str]=O),this._leafNode(new p(l,H,O)),H}const(l,E,O){return this._def(a.varKinds.const,l,E,O)}let(l,E,O){return this._def(a.varKinds.let,l,E,O)}var(l,E,O){return this._def(a.varKinds.var,l,E,O)}assign(l,E,O){return this._leafNode(new u(l,E,O))}add(l,E){return this._leafNode(new m(l,e.operators.ADD,E))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const E=["{"];for(const[O,U]of l)E.length>1&&E.push(","),E.push(O),(O!==U||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,U));return E.push("}"),new t._Code(E)}if(l,E,O){if(this._blockNode(new d(l)),E&&O)this.code(E).else().code(O).endIf();else if(E)this.code(E).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new d(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(d,c)}_for(l,E){return this._blockNode(l),E&&this.code(E).endFor(),this}for(l,E){return this._for(new o(l),E)}forRange(l,E,O,U,H=this.opts.es5?a.varKinds.var:a.varKinds.let){const Z=this._scope.toName(l);return this._for(new h(H,Z,E,O),()=>U(Z))}forOf(l,E,O,U=a.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Z=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(H,(0,t._)`${Z}[${B}]`),O(H)})}return this._for(new s("of",U,H,E),()=>O(H))}forIn(l,E,O,U=this.opts.es5?a.varKinds.var:a.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${E})`,O);const H=this._scope.toName(l);return this._for(new s("in",U,H,E),()=>O(H))}endFor(){return this._endBlockNode(r)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const E=new P;if(this._blockNode(E),this.code(l),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,E,O){if(!E&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new N;if(this._blockNode(U),this.code(l),E){const H=this.name("e");this._currNode=U.catch=new D(H),E(H)}return O&&(this._currNode=U.finally=new z,this.code(O)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new S(l))}block(l,E){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(E),this}endBlock(l){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-E;if(O<0||l!==void 0&&O!==l)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${l} expected`);return this._nodes.length=E,this}func(l,E=t.nil,O,U){return this._blockNode(new f(l,E,O)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,E){const O=this._currNode;if(O instanceof l||E&&O instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${l.kind}/${E.kind}`:l.kind}"`)}_elseNode(l){const E=this._currNode;if(!(E instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const E=this._nodes;E[E.length-1]=l}}e.CodeGen=q;function V(R,l){for(const E in l)R[E]=(R[E]||0)+(l[E]||0);return R}function F(R,l){return l instanceof t._CodeOrName?V(R,l.names):R}function L(R,l,E){if(R instanceof t.Name)return O(R);if(!U(R))return R;return new t._Code(R._items.reduce((H,Z)=>(Z instanceof t.Name&&(Z=O(Z)),Z instanceof t._Code?H.push(...Z._items):H.push(Z),H),[]));function O(H){const Z=E[H.str];return Z===void 0||l[H.str]!==1?H:(delete l[H.str],Z)}function U(H){return H instanceof t._Code&&H._items.some(Z=>Z instanceof t.Name&&l[Z.str]===1&&E[Z.str]!==void 0)}}function Q(R,l){for(const E in l)R[E]=(R[E]||0)-(l[E]||0)}function ne(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${T(R)}`}e.not=ne;const ie=k(e.operators.AND);function x(...R){return R.reduce(ie)}e.and=x;const le=k(e.operators.OR);function M(...R){return R.reduce(le)}e.or=M;function k(R){return(l,E)=>l===t.nil?E:E===t.nil?l:(0,t._)`${T(l)} ${R} ${T(E)}`}function T(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(zt)),zt}var G={},sr;function Y(){if(sr)return G;sr=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=J(),t=_t();function a(s){const f={};for(const P of s)f[P]=!0;return f}G.toHash=a;function n(s,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(y(s,f),!i(f,s.self.RULES.all))}G.alwaysValidSchema=n;function y(s,f=s.schema){const{opts:P,self:N}=s;if(!P.strictSchema||typeof f=="boolean")return;const D=N.RULES.keywords;for(const z in f)D[z]||h(s,`unknown keyword: "${z}"`)}G.checkUnknownRules=y;function i(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(f[P])return!0;return!1}G.schemaHasRules=i;function p(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(P!=="$ref"&&f.all[P])return!0;return!1}G.schemaHasRulesButRef=p;function u({topSchemaRef:s,schemaPath:f},P,N,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${s}${f}${(0,e.getProperty)(N)}`}G.schemaRefOrVal=u;function m(s){return S(decodeURIComponent(s))}G.unescapeFragment=m;function b(s){return encodeURIComponent(_(s))}G.escapeFragment=b;function _(s){return typeof s=="number"?`${s}`:s.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=_;function S(s){return s.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=S;function $(s,f){if(Array.isArray(s))for(const P of s)f(P);else f(s)}G.eachItem=$;function g({mergeNames:s,mergeToName:f,mergeValues:P,resultToName:N}){return(D,z,q,V)=>{const F=q===void 0?z:q instanceof e.Name?(z instanceof e.Name?s(D,z,q):f(D,z,q),q):z instanceof e.Name?(f(D,q,z),z):P(z,q);return V===e.Name&&!(F instanceof e.Name)?N(D,F):F}}G.mergeEvaluated={props:g({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>{s.if((0,e._)`${f} === true`,()=>s.assign(P,!0),()=>s.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${f})`))}),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>{f===!0?s.assign(P,!0):(s.assign(P,(0,e._)`${P} || {}`),w(s,P,f))}),mergeValues:(s,f)=>s===!0?!0:{...s,...f},resultToName:v}),items:g({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>s.assign(P,(0,e._)`${f} === true ? true : ${P} > ${f} ? ${P} : ${f}`)),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>s.assign(P,f===!0?!0:(0,e._)`${P} > ${f} ? ${P} : ${f}`)),mergeValues:(s,f)=>s===!0?!0:Math.max(s,f),resultToName:(s,f)=>s.var("items",f)})};function v(s,f){if(f===!0)return s.var("props",!0);const P=s.var("props",(0,e._)`{}`);return f!==void 0&&w(s,P,f),P}G.evaluatedPropsToName=v;function w(s,f,P){Object.keys(P).forEach(N=>s.assign((0,e._)`${f}${(0,e.getProperty)(N)}`,!0))}G.setEvaluated=w;const c={};function d(s,f){return s.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}G.useFunc=d;var r;(function(s){s[s.Num=0]="Num",s[s.Str=1]="Str"})(r||(G.Type=r={}));function o(s,f,P){if(s instanceof e.Name){const N=f===r.Num;return P?N?(0,e._)`"[" + ${s} + "]"`:(0,e._)`"['" + ${s} + "']"`:N?(0,e._)`"/" + ${s}`:(0,e._)`"/" + ${s}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(s).toString():"/"+_(s)}G.getErrorPath=o;function h(s,f,P=s.opts.strictSchema){if(P){if(f=`strict mode: ${f}`,P===!0)throw new Error(f);s.self.logger.warn(f)}}return G.checkStrictMode=h,G}var Te={},or;function _e(){if(or)return Te;or=1,Object.defineProperty(Te,"__esModule",{value:!0});const e=J(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Te.default=t,Te}var ar;function Nt(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=J(),a=Y(),n=_e();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:d})=>d?(0,t.str)`"${c}" keyword must be ${d} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function y(c,d=e.keywordError,r,o){const{it:h}=c,{gen:s,compositeRule:f,allErrors:P}=h,N=S(c,d,r);o??(f||P)?m(s,N):b(h,(0,t._)`[${N}]`)}e.reportError=y;function i(c,d=e.keywordError,r){const{it:o}=c,{gen:h,compositeRule:s,allErrors:f}=o,P=S(c,d,r);m(h,P),s||f||b(o,n.default.vErrors)}e.reportExtraError=i;function p(c,d){c.assign(n.default.errors,d),c.if((0,t._)`${n.default.vErrors} !== null`,()=>c.if(d,()=>c.assign((0,t._)`${n.default.vErrors}.length`,d),()=>c.assign(n.default.vErrors,null)))}e.resetErrorsCount=p;function u({gen:c,keyword:d,schemaValue:r,data:o,errsCount:h,it:s}){if(h===void 0)throw new Error("ajv implementation error");const f=c.name("err");c.forRange("i",h,n.default.errors,P=>{c.const(f,(0,t._)`${n.default.vErrors}[${P}]`),c.if((0,t._)`${f}.instancePath === undefined`,()=>c.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath))),c.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${d}`),s.opts.verbose&&(c.assign((0,t._)`${f}.schema`,r),c.assign((0,t._)`${f}.data`,o))})}e.extendErrors=u;function m(c,d){const r=c.const("err",d);c.if((0,t._)`${n.default.vErrors} === null`,()=>c.assign(n.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${n.default.vErrors}.push(${r})`),c.code((0,t._)`${n.default.errors}++`)}function b(c,d){const{gen:r,validateName:o,schemaEnv:h}=c;h.$async?r.throw((0,t._)`new ${c.ValidationError}(${d})`):(r.assign((0,t._)`${o}.errors`,d),r.return(!1))}const _={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function S(c,d,r){const{createErrors:o}=c.it;return o===!1?(0,t._)`{}`:$(c,d,r)}function $(c,d,r={}){const{gen:o,it:h}=c,s=[g(h,r),v(c,r)];return w(c,d,s),o.object(...s)}function g({errorPath:c},{instancePath:d}){const r=d?(0,t.str)`${c}${(0,a.getErrorPath)(d,a.Type.Str)}`:c;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,r)]}function v({keyword:c,it:{errSchemaPath:d}},{schemaPath:r,parentSchema:o}){let h=o?d:(0,t.str)`${d}/${c}`;return r&&(h=(0,t.str)`${h}${(0,a.getErrorPath)(r,a.Type.Str)}`),[_.schemaPath,h]}function w(c,{params:d,message:r},o){const{keyword:h,data:s,schemaValue:f,it:P}=c,{opts:N,propertyName:D,topSchemaRef:z,schemaPath:q}=P;o.push([_.keyword,h],[_.params,typeof d=="function"?d(c):d||(0,t._)`{}`]),N.messages&&o.push([_.message,typeof r=="function"?r(c):r]),N.verbose&&o.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${q}`],[n.default.data,s]),D&&o.push([_.propertyName,D])}})(Vt)),Vt}var cr;function Ln(){if(cr)return $e;cr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.boolOrEmptySchema=$e.topBoolOrEmptySchema=void 0;const e=Nt(),t=J(),a=_e(),n={message:"boolean schema is false"};function y(u){const{gen:m,schema:b,validateName:_}=u;b===!1?p(u,!1):typeof b=="object"&&b.$async===!0?m.return(a.default.data):(m.assign((0,t._)`${_}.errors`,null),m.return(!0))}$e.topBoolOrEmptySchema=y;function i(u,m){const{gen:b,schema:_}=u;_===!1?(b.var(m,!1),p(u)):b.var(m,!0)}$e.boolOrEmptySchema=i;function p(u,m){const{gen:b,data:_}=u,S={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(S,n,void 0,m)}return $e}var re={},be={},dr;function _n(){if(dr)return be;dr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.getRules=be.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function a(y){return typeof y=="string"&&t.has(y)}be.isJSONType=a;function n(){const y={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...y,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},y.number,y.string,y.array,y.object],post:{rules:[]},all:{},keywords:{}}}return be.getRules=n,be}var ye={},ur;function $n(){if(ur)return ye;ur=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.shouldUseRule=ye.shouldUseGroup=ye.schemaHasRulesForType=void 0;function e({schema:n,self:y},i){const p=y.RULES.types[i];return p&&p!==!0&&t(n,p)}ye.schemaHasRulesForType=e;function t(n,y){return y.rules.some(i=>a(n,i))}ye.shouldUseGroup=t;function a(n,y){var i;return n[y.keyword]!==void 0||((i=y.definition.implements)===null||i===void 0?void 0:i.some(p=>n[p]!==void 0))}return ye.shouldUseRule=a,ye}var lr;function $t(){if(lr)return re;lr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=_n(),t=$n(),a=Nt(),n=J(),y=Y();var i;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(i||(re.DataType=i={}));function p(r){const o=u(r.type);if(o.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&o.push("null")}return o}re.getSchemaTypes=p;function u(r){const o=Array.isArray(r)?r:r?[r]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}re.getJSONTypes=u;function m(r,o){const{gen:h,data:s,opts:f}=r,P=_(o,f.coerceTypes),N=o.length>0&&!(P.length===0&&o.length===1&&(0,t.schemaHasRulesForType)(r,o[0]));if(N){const D=v(o,s,f.strictNumbers,i.Wrong);h.if(D,()=>{P.length?S(r,o,P):c(r)})}return N}re.coerceAndCheckDataType=m;const b=new Set(["string","number","integer","boolean","null"]);function _(r,o){return o?r.filter(h=>b.has(h)||o==="array"&&h==="array"):[]}function S(r,o,h){const{gen:s,data:f,opts:P}=r,N=s.let("dataType",(0,n._)`typeof ${f}`),D=s.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&s.if((0,n._)`${N} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>s.assign(f,(0,n._)`${f}[0]`).assign(N,(0,n._)`typeof ${f}`).if(v(o,f,P.strictNumbers),()=>s.assign(D,f))),s.if((0,n._)`${D} !== undefined`);for(const q of h)(b.has(q)||q==="array"&&P.coerceTypes==="array")&&z(q);s.else(),c(r),s.endIf(),s.if((0,n._)`${D} !== undefined`,()=>{s.assign(f,D),$(r,D)});function z(q){switch(q){case"string":s.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(D,(0,n._)`"" + ${f}`).elseIf((0,n._)`${f} === null`).assign(D,(0,n._)`""`);return;case"number":s.elseIf((0,n._)`${N} == "boolean" || ${f} === null
|
|
3
|
+
|| (${N} == "string" && ${f} && ${f} == +${f})`).assign(D,(0,n._)`+${f}`);return;case"integer":s.elseIf((0,n._)`${N} === "boolean" || ${f} === null
|
|
4
|
+
|| (${N} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(D,(0,n._)`+${f}`);return;case"boolean":s.elseIf((0,n._)`${f} === "false" || ${f} === 0 || ${f} === null`).assign(D,!1).elseIf((0,n._)`${f} === "true" || ${f} === 1`).assign(D,!0);return;case"null":s.elseIf((0,n._)`${f} === "" || ${f} === 0 || ${f} === false`),s.assign(D,null);return;case"array":s.elseIf((0,n._)`${N} === "string" || ${N} === "number"
|
|
5
|
+
|| ${N} === "boolean" || ${f} === null`).assign(D,(0,n._)`[${f}]`)}}}function $({gen:r,parentData:o,parentDataProperty:h},s){r.if((0,n._)`${o} !== undefined`,()=>r.assign((0,n._)`${o}[${h}]`,s))}function g(r,o,h,s=i.Correct){const f=s===i.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(r){case"null":return(0,n._)`${o} ${f} null`;case"array":P=(0,n._)`Array.isArray(${o})`;break;case"object":P=(0,n._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":P=N((0,n._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":P=N();break;default:return(0,n._)`typeof ${o} ${f} ${r}`}return s===i.Correct?P:(0,n.not)(P);function N(D=n.nil){return(0,n.and)((0,n._)`typeof ${o} == "number"`,D,h?(0,n._)`isFinite(${o})`:n.nil)}}re.checkDataType=g;function v(r,o,h,s){if(r.length===1)return g(r[0],o,h,s);let f;const P=(0,y.toHash)(r);if(P.array&&P.object){const N=(0,n._)`typeof ${o} != "object"`;f=P.null?N:(0,n._)`!${o} || ${N}`,delete P.null,delete P.array,delete P.object}else f=n.nil;P.number&&delete P.integer;for(const N in P)f=(0,n.and)(f,g(N,o,h,s));return f}re.checkDataTypes=v;const w={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:o})=>typeof r=="string"?(0,n._)`{type: ${r}}`:(0,n._)`{type: ${o}}`};function c(r){const o=d(r);(0,a.reportError)(o,w)}re.reportTypeError=c;function d(r){const{gen:o,data:h,schema:s}=r,f=(0,y.schemaRefOrVal)(r,s,"type");return{gen:o,keyword:"type",data:h,schema:s.type,schemaCode:f,schemaValue:f,parentSchema:s,params:{},it:r}}return re}var Ie={},fr;function Un(){if(fr)return Ie;fr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.assignDefaults=void 0;const e=J(),t=Y();function a(y,i){const{properties:p,items:u}=y.schema;if(i==="object"&&p)for(const m in p)n(y,m,p[m].default);else i==="array"&&Array.isArray(u)&&u.forEach((m,b)=>n(y,b,m.default))}Ie.assignDefaults=a;function n(y,i,p){const{gen:u,compositeRule:m,data:b,opts:_}=y;if(p===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(i)}`;if(m){(0,t.checkStrictMode)(y,`default is ignored for: ${S}`);return}let $=(0,e._)`${S} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${S} === null || ${S} === ""`),u.if($,(0,e._)`${S} = ${(0,e.stringify)(p)}`)}return Ie}var pe={},X={},pr;function me(){if(pr)return X;pr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=J(),t=Y(),a=_e(),n=Y();function y(r,o){const{gen:h,data:s,it:f}=r;h.if(_(h,s,o,f.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${o}`},!0),r.error()})}X.checkReportMissingProp=y;function i({gen:r,data:o,it:{opts:h}},s,f){return(0,e.or)(...s.map(P=>(0,e.and)(_(r,o,P,h.ownProperties),(0,e._)`${f} = ${P}`)))}X.checkMissingProp=i;function p(r,o){r.setParams({missingProperty:o},!0),r.error()}X.reportMissingProp=p;function u(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=u;function m(r,o,h){return(0,e._)`${u(r)}.call(${o}, ${h})`}X.isOwnProperty=m;function b(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} !== undefined`;return s?(0,e._)`${f} && ${m(r,o,h)}`:f}X.propertyInData=b;function _(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} === undefined`;return s?(0,e.or)(f,(0,e.not)(m(r,o,h))):f}X.noPropertyInData=_;function S(r){return r?Object.keys(r).filter(o=>o!=="__proto__"):[]}X.allSchemaProperties=S;function $(r,o){return S(o).filter(h=>!(0,t.alwaysValidSchema)(r,o[h]))}X.schemaProperties=$;function g({schemaCode:r,data:o,it:{gen:h,topSchemaRef:s,schemaPath:f,errorPath:P},it:N},D,z,q){const V=q?(0,e._)`${r}, ${o}, ${s}${f}`:o,F=[[a.default.instancePath,(0,e.strConcat)(a.default.instancePath,P)],[a.default.parentData,N.parentData],[a.default.parentDataProperty,N.parentDataProperty],[a.default.rootData,a.default.rootData]];N.opts.dynamicRef&&F.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);const L=(0,e._)`${V}, ${h.object(...F)}`;return z!==e.nil?(0,e._)`${D}.call(${z}, ${L})`:(0,e._)`${D}(${L})`}X.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:r,it:{opts:o}},h){const s=o.unicodeRegExp?"u":"",{regExp:f}=o.code,P=f(h,s);return r.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?v:(0,n.useFunc)(r,f)}(${h}, ${s})`})}X.usePattern=w;function c(r){const{gen:o,data:h,keyword:s,it:f}=r,P=o.name("valid");if(f.allErrors){const D=o.let("valid",!0);return N(()=>o.assign(D,!1)),D}return o.var(P,!0),N(()=>o.break()),P;function N(D){const z=o.const("len",(0,e._)`${h}.length`);o.forRange("i",0,z,q=>{r.subschema({keyword:s,dataProp:q,dataPropType:t.Type.Num},P),o.if((0,e.not)(P),D)})}}X.validateArray=c;function d(r){const{gen:o,schema:h,keyword:s,it:f}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");if(h.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const N=o.let("valid",!1),D=o.name("_valid");o.block(()=>h.forEach((z,q)=>{const V=r.subschema({keyword:s,schemaProp:q,compositeRule:!0},D);o.assign(N,(0,e._)`${N} || ${D}`),r.mergeValidEvaluated(V,D)||o.if((0,e.not)(N))})),r.result(N,()=>r.reset(),()=>r.error(!0))}return X.validateUnion=d,X}var mr;function Kn(){if(mr)return pe;mr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateKeywordUsage=pe.validSchemaType=pe.funcKeywordCode=pe.macroKeywordCode=void 0;const e=J(),t=_e(),a=me(),n=Nt();function y($,g){const{gen:v,keyword:w,schema:c,parentSchema:d,it:r}=$,o=g.macro.call(r.self,c,d,r),h=b(v,w,o);r.opts.validateSchema!==!1&&r.self.validateSchema(o,!0);const s=v.name("valid");$.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${w}`,topSchemaRef:h,compositeRule:!0},s),$.pass(s,()=>$.error(!0))}pe.macroKeywordCode=y;function i($,g){var v;const{gen:w,keyword:c,schema:d,parentSchema:r,$data:o,it:h}=$;m(h,g);const s=!o&&g.compile?g.compile.call(h.self,d,r,h):g.validate,f=b(w,c,s),P=w.let("valid");$.block$data(P,N),$.ok((v=g.valid)!==null&&v!==void 0?v:P);function N(){if(g.errors===!1)q(),g.modifying&&p($),V(()=>$.error());else{const F=g.async?D():z();g.modifying&&p($),V(()=>u($,F))}}function D(){const F=w.let("ruleErrs",null);return w.try(()=>q((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${h.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${f}.errors`;return w.assign(F,null),q(e.nil),F}function q(F=g.async?(0,e._)`await `:e.nil){const L=h.opts.passContext?t.default.this:t.default.self,Q=!("compile"in g&&!o||g.schema===!1);w.assign(P,(0,e._)`${F}${(0,a.callValidateCode)($,f,L,Q)}`,g.modifying)}function V(F){var L;w.if((0,e.not)((L=g.valid)!==null&&L!==void 0?L:P),F)}}pe.funcKeywordCode=i;function p($){const{gen:g,data:v,it:w}=$;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function u($,g){const{gen:v}=$;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)($)},()=>$.error())}function m({schemaEnv:$},g){if(g.async&&!$.$async)throw new Error("async keyword in sync schema")}function b($,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return $.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function _($,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray($):w==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==w||v&&typeof $>"u")}pe.validSchemaType=_;function S({schema:$,opts:g,self:v,errSchemaPath:w},c,d){if(Array.isArray(c.keyword)?!c.keyword.includes(d):c.keyword!==d)throw new Error("ajv implementation error");const r=c.dependencies;if(r?.some(o=>!Object.prototype.hasOwnProperty.call($,o)))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(c.validateSchema&&!c.validateSchema($[d])){const h=`keyword "${d}" value is invalid at path "${w}": `+v.errorsText(c.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(h);else throw new Error(h)}}return pe.validateKeywordUsage=S,pe}var ge={},hr;function Hn(){if(hr)return ge;hr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.extendSubschemaMode=ge.extendSubschemaData=ge.getSubschema=void 0;const e=J(),t=Y();function a(i,{keyword:p,schemaProp:u,schema:m,schemaPath:b,errSchemaPath:_,topSchemaRef:S}){if(p!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=i.schema[p];return u===void 0?{schema:$,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${i.errSchemaPath}/${p}`}:{schema:$[u],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(u)}`,errSchemaPath:`${i.errSchemaPath}/${p}/${(0,t.escapeFragment)(u)}`}}if(m!==void 0){if(b===void 0||_===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:b,topSchemaRef:S,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}ge.getSubschema=a;function n(i,p,{dataProp:u,dataPropType:m,data:b,dataTypes:_,propertyName:S}){if(b!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(u!==void 0){const{errorPath:v,dataPathArr:w,opts:c}=p,d=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(u)}`,!0);g(d),i.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(u,m,c.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${u}`,i.dataPathArr=[...w,i.parentDataProperty]}if(b!==void 0){const v=b instanceof e.Name?b:$.let("data",b,!0);g(v),S!==void 0&&(i.propertyName=S)}_&&(i.dataTypes=_);function g(v){i.data=v,i.dataLevel=p.dataLevel+1,i.dataTypes=[],p.definedProperties=new Set,i.parentData=p.data,i.dataNames=[...p.dataNames,v]}}ge.extendSubschemaData=n;function y(i,{jtdDiscriminator:p,jtdMetadata:u,compositeRule:m,createErrors:b,allErrors:_}){m!==void 0&&(i.compositeRule=m),b!==void 0&&(i.createErrors=b),_!==void 0&&(i.allErrors=_),i.jtdDiscriminator=p,i.jtdMetadata=u}return ge.extendSubschemaMode=y,ge}var se={},Ut,yr;function bn(){return yr||(yr=1,Ut=function e(t,a){if(t===a)return!0;if(t&&a&&typeof t=="object"&&typeof a=="object"){if(t.constructor!==a.constructor)return!1;var n,y,i;if(Array.isArray(t)){if(n=t.length,n!=a.length)return!1;for(y=n;y--!==0;)if(!e(t[y],a[y]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(a).length)return!1;for(y=n;y--!==0;)if(!Object.prototype.hasOwnProperty.call(a,i[y]))return!1;for(y=n;y--!==0;){var p=i[y];if(!e(t[p],a[p]))return!1}return!0}return t!==t&&a!==a}),Ut}var Kt={exports:{}},gr;function Gn(){if(gr)return Kt.exports;gr=1;var e=Kt.exports=function(n,y,i){typeof y=="function"&&(i=y,y={}),i=y.cb||i;var p=typeof i=="function"?i:i.pre||function(){},u=i.post||function(){};t(y,p,u,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,y,i,p,u,m,b,_,S,$){if(p&&typeof p=="object"&&!Array.isArray(p)){y(p,u,m,b,_,S,$);for(var g in p){var v=p[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(n,y,i,v[w],u+"/"+g+"/"+w,m,u,g,p,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var c in v)t(n,y,i,v[c],u+"/"+g+"/"+a(c),m,u,g,p,c)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,y,i,v,u+"/"+g,m,u,g,p)}i(p,u,m,b,_,S,$)}}function a(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Kt.exports}var vr;function Ot(){if(vr)return se;vr=1,Object.defineProperty(se,"__esModule",{value:!0}),se.getSchemaRefs=se.resolveUrl=se.normalizeId=se._getFullPath=se.getFullPath=se.inlineRef=void 0;const e=Y(),t=bn(),a=Gn(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function y(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?u(w)<=c:!1}se.inlineRef=y;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(i.has(c))return!0;const d=w[c];if(Array.isArray(d)&&d.some(p)||typeof d=="object"&&p(d))return!0}return!1}function u(w){let c=0;for(const d in w){if(d==="$ref")return 1/0;if(c++,!n.has(d)&&(typeof w[d]=="object"&&(0,e.eachItem)(w[d],r=>c+=u(r)),c===1/0))return 1/0}return c}function m(w,c="",d){d!==!1&&(c=S(c));const r=w.parse(c);return b(w,r)}se.getFullPath=m;function b(w,c){return w.serialize(c).split("#")[0]+"#"}se._getFullPath=b;const _=/#\/?$/;function S(w){return w?w.replace(_,""):""}se.normalizeId=S;function $(w,c,d){return d=S(d),w.resolve(c,d)}se.resolveUrl=$;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,c){if(typeof w=="boolean")return{};const{schemaId:d,uriResolver:r}=this.opts,o=S(w[d]||c),h={"":o},s=m(r,o,!1),f={},P=new Set;return a(w,{allKeys:!0},(z,q,V,F)=>{if(F===void 0)return;const L=s+q;let Q=h[F];typeof z[d]=="string"&&(Q=ne.call(this,z[d])),ie.call(this,z.$anchor),ie.call(this,z.$dynamicAnchor),h[q]=Q;function ne(x){const le=this.opts.uriResolver.resolve;if(x=S(Q?le(Q,x):x),P.has(x))throw D(x);P.add(x);let M=this.refs[x];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?N(z,M.schema,x):x!==S(L)&&(x[0]==="#"?(N(z,f[x],x),f[x]=z):this.refs[x]=L),x}function ie(x){if(typeof x=="string"){if(!g.test(x))throw new Error(`invalid anchor "${x}"`);ne.call(this,`#${x}`)}}}),f;function N(z,q,V){if(q!==void 0&&!t(z,q))throw D(V)}function D(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return se.getSchemaRefs=v,se}var _r;function qt(){if(_r)return he;_r=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Ln(),t=$t(),a=$n(),n=$t(),y=Un(),i=Kn(),p=Hn(),u=J(),m=_e(),b=Ot(),_=Y(),S=Nt();function $(j){if(s(j)&&(P(j),h(j))){c(j);return}g(j,()=>(0,e.topBoolOrEmptySchema)(j))}he.validateFunctionCode=$;function g({gen:j,validateName:I,schema:C,schemaEnv:A,opts:K},W){K.code.es5?j.func(I,(0,u._)`${m.default.data}, ${m.default.valCxt}`,A.$async,()=>{j.code((0,u._)`"use strict"; ${r(C,K)}`),w(j,K),j.code(W)}):j.func(I,(0,u._)`${m.default.data}, ${v(K)}`,A.$async,()=>j.code(r(C,K)).code(W))}function v(j){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${j.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function w(j,I){j.if(m.default.valCxt,()=>{j.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),j.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),j.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),j.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{j.var(m.default.instancePath,(0,u._)`""`),j.var(m.default.parentData,(0,u._)`undefined`),j.var(m.default.parentDataProperty,(0,u._)`undefined`),j.var(m.default.rootData,m.default.data),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function c(j){const{schema:I,opts:C,gen:A}=j;g(j,()=>{C.$comment&&I.$comment&&F(j),z(j),A.let(m.default.vErrors,null),A.let(m.default.errors,0),C.unevaluated&&d(j),N(j),L(j)})}function d(j){const{gen:I,validateName:C}=j;j.evaluated=I.const("evaluated",(0,u._)`${C}.evaluated`),I.if((0,u._)`${j.evaluated}.dynamicProps`,()=>I.assign((0,u._)`${j.evaluated}.props`,(0,u._)`undefined`)),I.if((0,u._)`${j.evaluated}.dynamicItems`,()=>I.assign((0,u._)`${j.evaluated}.items`,(0,u._)`undefined`))}function r(j,I){const C=typeof j=="object"&&j[I.schemaId];return C&&(I.code.source||I.code.process)?(0,u._)`/*# sourceURL=${C} */`:u.nil}function o(j,I){if(s(j)&&(P(j),h(j))){f(j,I);return}(0,e.boolOrEmptySchema)(j,I)}function h({schema:j,self:I}){if(typeof j=="boolean")return!j;for(const C in j)if(I.RULES.all[C])return!0;return!1}function s(j){return typeof j.schema!="boolean"}function f(j,I){const{schema:C,gen:A,opts:K}=j;K.$comment&&C.$comment&&F(j),q(j),V(j);const W=A.const("_errs",m.default.errors);N(j,W),A.var(I,(0,u._)`${W} === ${m.default.errors}`)}function P(j){(0,_.checkUnknownRules)(j),D(j)}function N(j,I){if(j.opts.jtd)return ne(j,[],!1,I);const C=(0,t.getSchemaTypes)(j.schema),A=(0,t.coerceAndCheckDataType)(j,C);ne(j,C,!A,I)}function D(j){const{schema:I,errSchemaPath:C,opts:A,self:K}=j;I.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${C}"`)}function z(j){const{schema:I,opts:C}=j;I.default!==void 0&&C.useDefaults&&C.strictSchema&&(0,_.checkStrictMode)(j,"default is ignored in the schema root")}function q(j){const I=j.schema[j.opts.schemaId];I&&(j.baseId=(0,b.resolveUrl)(j.opts.uriResolver,j.baseId,I))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:j,schemaEnv:I,schema:C,errSchemaPath:A,opts:K}){const W=C.$comment;if(K.$comment===!0)j.code((0,u._)`${m.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const ee=(0,u.str)`${A}/$comment`,fe=j.scopeValue("root",{ref:I.root});j.code((0,u._)`${m.default.self}.opts.$comment(${W}, ${ee}, ${fe}.schema)`)}}function L(j){const{gen:I,schemaEnv:C,validateName:A,ValidationError:K,opts:W}=j;C.$async?I.if((0,u._)`${m.default.errors} === 0`,()=>I.return(m.default.data),()=>I.throw((0,u._)`new ${K}(${m.default.vErrors})`)):(I.assign((0,u._)`${A}.errors`,m.default.vErrors),W.unevaluated&&Q(j),I.return((0,u._)`${m.default.errors} === 0`))}function Q({gen:j,evaluated:I,props:C,items:A}){C instanceof u.Name&&j.assign((0,u._)`${I}.props`,C),A instanceof u.Name&&j.assign((0,u._)`${I}.items`,A)}function ne(j,I,C,A){const{gen:K,schema:W,data:ee,allErrors:fe,opts:oe,self:ae}=j,{RULES:te}=ae;if(W.$ref&&(oe.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,te))){K.block(()=>U(j,"$ref",te.all.$ref.definition));return}oe.jtd||x(j,I),K.block(()=>{for(const ue of te.rules)Ee(ue);Ee(te.post)});function Ee(ue){(0,a.shouldUseGroup)(W,ue)&&(ue.type?(K.if((0,n.checkDataType)(ue.type,ee,oe.strictNumbers)),ie(j,ue),I.length===1&&I[0]===ue.type&&C&&(K.else(),(0,n.reportTypeError)(j)),K.endIf()):ie(j,ue),fe||K.if((0,u._)`${m.default.errors} === ${A||0}`))}}function ie(j,I){const{gen:C,schema:A,opts:{useDefaults:K}}=j;K&&(0,y.assignDefaults)(j,I.type),C.block(()=>{for(const W of I.rules)(0,a.shouldUseRule)(A,W)&&U(j,W.keyword,W.definition,I.type)})}function x(j,I){j.schemaEnv.meta||!j.opts.strictTypes||(le(j,I),j.opts.allowUnionTypes||M(j,I),k(j,j.dataTypes))}function le(j,I){if(I.length){if(!j.dataTypes.length){j.dataTypes=I;return}I.forEach(C=>{R(j.dataTypes,C)||E(j,`type "${C}" not allowed by context "${j.dataTypes.join(",")}"`)}),l(j,I)}}function M(j,I){I.length>1&&!(I.length===2&&I.includes("null"))&&E(j,"use allowUnionTypes to allow union type keyword")}function k(j,I){const C=j.self.RULES.all;for(const A in C){const K=C[A];if(typeof K=="object"&&(0,a.shouldUseRule)(j.schema,K)){const{type:W}=K.definition;W.length&&!W.some(ee=>T(I,ee))&&E(j,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function T(j,I){return j.includes(I)||I==="number"&&j.includes("integer")}function R(j,I){return j.includes(I)||I==="integer"&&j.includes("number")}function l(j,I){const C=[];for(const A of j.dataTypes)R(I,A)?C.push(A):I.includes("integer")&&A==="number"&&C.push("integer");j.dataTypes=C}function E(j,I){const C=j.schemaEnv.baseId+j.errSchemaPath;I+=` at "${C}" (strictTypes)`,(0,_.checkStrictMode)(j,I,j.opts.strictTypes)}class O{constructor(I,C,A){if((0,i.validateKeywordUsage)(I,C,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=C.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=C.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=C,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,C.schemaType,C.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(C.schemaType)}`);("code"in C?C.trackErrors:C.errors!==!1)&&(this.errsCount=I.gen.const("_errs",m.default.errors))}result(I,C,A){this.failResult((0,u.not)(I),C,A)}failResult(I,C,A){this.gen.if(I),A?A():this.error(),C?(this.gen.else(),C(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,C){this.failResult((0,u.not)(I),void 0,C)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:C}=this;this.fail((0,u._)`${C} !== undefined && (${(0,u.or)(this.invalid$data(),I)})`)}error(I,C,A){if(C){this.setParams(C),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,C){(I?S.reportExtraError:S.reportError)(this,this.def.error,C)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,C){C?Object.assign(this.params,I):this.params=I}block$data(I,C,A=u.nil){this.gen.block(()=>{this.check$data(I,A),C()})}check$data(I=u.nil,C=u.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:ee}=this;A.if((0,u.or)((0,u._)`${K} === undefined`,C)),I!==u.nil&&A.assign(I,!0),(W.length||ee.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==u.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:C,schemaType:A,def:K,it:W}=this;return(0,u.or)(ee(),fe());function ee(){if(A.length){if(!(C instanceof u.Name))throw new Error("ajv implementation error");const oe=Array.isArray(A)?A:[A];return(0,u._)`${(0,n.checkDataTypes)(oe,C,W.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}function fe(){if(K.validateSchema){const oe=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,u._)`!${oe}(${C})`}return u.nil}}subschema(I,C){const A=(0,p.getSubschema)(this.it,I);(0,p.extendSubschemaData)(A,this.it,I),(0,p.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return o(K,C),K}mergeEvaluated(I,C){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=_.mergeEvaluated.props(K,I.props,A.props,C)),A.items!==!0&&I.items!==void 0&&(A.items=_.mergeEvaluated.items(K,I.items,A.items,C)))}mergeValidEvaluated(I,C){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(C,()=>this.mergeEvaluated(I,u.Name)),!0}}he.KeywordCxt=O;function U(j,I,C,A){const K=new O(j,C,I);"code"in C?C.code(K,A):K.$data&&C.validate?(0,i.funcKeywordCode)(K,C):"macro"in C?(0,i.macroKeywordCode)(K,C):(C.compile||C.validate)&&(0,i.funcKeywordCode)(K,C)}const H=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(j,{dataLevel:I,dataNames:C,dataPathArr:A}){let K,W;if(j==="")return m.default.rootData;if(j[0]==="/"){if(!H.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);K=j,W=m.default.rootData}else{const ae=Z.exec(j);if(!ae)throw new Error(`Invalid JSON-pointer: ${j}`);const te=+ae[1];if(K=ae[2],K==="#"){if(te>=I)throw new Error(oe("property/index",te));return A[I-te]}if(te>I)throw new Error(oe("data",te));if(W=C[I-te],!K)return W}let ee=W;const fe=K.split("/");for(const ae of fe)ae&&(W=(0,u._)`${W}${(0,u.getProperty)((0,_.unescapeJsonPointer)(ae))}`,ee=(0,u._)`${ee} && ${W}`);return ee;function oe(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${I}`}}return he.getData=B,he}var De={},$r;function Yt(){if($r)return De;$r=1,Object.defineProperty(De,"__esModule",{value:!0});class e extends Error{constructor(a){super("validation failed"),this.errors=a,this.ajv=this.validation=!0}}return De.default=e,De}var Me={},br;function Ct(){if(br)return Me;br=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=Ot();class t extends Error{constructor(n,y,i,p){super(p||`can't resolve reference ${i} from id ${y}`),this.missingRef=(0,e.resolveUrl)(n,y,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Me.default=t,Me}var de={},wr;function Zt(){if(wr)return de;wr=1,Object.defineProperty(de,"__esModule",{value:!0}),de.resolveSchema=de.getCompilingSchema=de.resolveRef=de.compileSchema=de.SchemaEnv=void 0;const e=J(),t=Yt(),a=_e(),n=Ot(),y=Y(),i=qt();class p{constructor(d){var r;this.refs={},this.dynamicAnchors={};let o;typeof d.schema=="object"&&(o=d.schema),this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(r=d.baseId)!==null&&r!==void 0?r:(0,n.normalizeId)(o?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=o?.$async,this.refs={}}}de.SchemaEnv=p;function u(c){const d=_.call(this,c);if(d)return d;const r=(0,n.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:o,lines:h}=this.opts.code,{ownProperties:s}=this.opts,f=new e.CodeGen(this.scope,{es5:o,lines:h,ownProperties:s});let P;c.$async&&(P=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=f.scopeName("validate");c.validateName=N;const D={gen:f,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:c.schema,code:(0,e.stringify)(c.schema)}:{ref:c.schema}),validateName:N,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:r,baseId:c.baseId||r,schemaPath:e.nil,errSchemaPath:c.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(c),(0,i.validateFunctionCode)(D),f.optimize(this.opts.code.optimize);const q=f.toString();z=`${f.scopeRefs(a.default.scope)}return ${q}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${a.default.self}`,`${a.default.scope}`,z)(this,this.scope.get());if(this.scope.value(N,{ref:F}),F.errors=null,F.schema=c.schema,F.schemaEnv=c,c.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:N,validateCode:q,scopeValues:f._values}),this.opts.unevaluated){const{props:L,items:Q}=D;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return c.validate=F,c}catch(q){throw delete c.validate,delete c.validateName,z&&this.logger.error("Error compiling schema, function code:",z),q}finally{this._compilations.delete(c)}}de.compileSchema=u;function m(c,d,r){var o;r=(0,n.resolveUrl)(this.opts.uriResolver,d,r);const h=c.refs[r];if(h)return h;let s=$.call(this,c,r);if(s===void 0){const f=(o=c.localRefs)===null||o===void 0?void 0:o[r],{schemaId:P}=this.opts;f&&(s=new p({schema:f,schemaId:P,root:c,baseId:d}))}if(s!==void 0)return c.refs[r]=b.call(this,s)}de.resolveRef=m;function b(c){return(0,n.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:u.call(this,c)}function _(c){for(const d of this._compilations)if(S(d,c))return d}de.getCompilingSchema=_;function S(c,d){return c.schema===d.schema&&c.root===d.root&&c.baseId===d.baseId}function $(c,d){let r;for(;typeof(r=this.refs[d])=="string";)d=r;return r||this.schemas[d]||g.call(this,c,d)}function g(c,d){const r=this.opts.uriResolver.parse(d),o=(0,n._getFullPath)(this.opts.uriResolver,r);let h=(0,n.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&o===h)return w.call(this,r,c);const s=(0,n.normalizeId)(o),f=this.refs[s]||this.schemas[s];if(typeof f=="string"){const P=g.call(this,c,f);return typeof P?.schema!="object"?void 0:w.call(this,r,P)}if(typeof f?.schema=="object"){if(f.validate||u.call(this,f),s===(0,n.normalizeId)(d)){const{schema:P}=f,{schemaId:N}=this.opts,D=P[N];return D&&(h=(0,n.resolveUrl)(this.opts.uriResolver,h,D)),new p({schema:P,schemaId:N,root:c,baseId:h})}return w.call(this,r,f)}}de.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:d,schema:r,root:o}){var h;if(((h=c.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const N=r[(0,y.unescapeFragment)(P)];if(N===void 0)return;r=N;const D=typeof r=="object"&&r[this.opts.schemaId];!v.has(P)&&D&&(d=(0,n.resolveUrl)(this.opts.uriResolver,d,D))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,y.schemaHasRulesButRef)(r,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,d,r.$ref);s=g.call(this,o,P)}const{schemaId:f}=this.opts;if(s=s||new p({schema:r,schemaId:f,root:o,baseId:d}),s.schema!==s.root.schema)return s}return de}const Jn="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Wn="Meta-schema for $data reference (JSON AnySchema extension proposal)",Bn="object",Yn=["$data"],Zn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Qn=!1,Xn={$id:Jn,description:Wn,type:Bn,required:Yn,properties:Zn,additionalProperties:Qn};var Ae={},Re={exports:{}},Ht,Pr;function wn(){if(Pr)return Ht;Pr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function a($){let g="",v=0,w=0;for(w=0;w<$.length;w++)if(v=$[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w];break}for(w+=1;w<$.length;w++){if(v=$[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w]}return g}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y($){return $.length=0,!0}function i($,g,v){if($.length){const w=a($);if(w!=="")g.push(w);else return v.error=!0,!1;$.length=0}return!0}function p($){let g=0;const v={error:!1,address:"",zone:""},w=[],c=[];let d=!1,r=!1,o=i;for(let h=0;h<$.length;h++){const s=$[h];if(!(s==="["||s==="]"))if(s===":"){if(d===!0&&(r=!0),!o(c,w,v))break;if(++g>7){v.error=!0;break}h>0&&$[h-1]===":"&&(d=!0),w.push(":");continue}else if(s==="%"){if(!o(c,w,v))break;o=y}else{c.push(s);continue}}return c.length&&(o===y?v.zone=c.join(""):r?w.push(c.join("")):w.push(a(c))),v.address=w.join(""),v}function u($){if(m($,":")<2)return{host:$,isIPV6:!1};const g=p($);if(g.error)return{host:$,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function m($,g){let v=0;for(let w=0;w<$.length;w++)$[w]===g&&v++;return v}function b($){let g=$;const v=[];let w=-1,c=0;for(;c=g.length;){if(c===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(c===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(c===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function _($,g){const v=g!==!0?escape:unescape;return $.scheme!==void 0&&($.scheme=v($.scheme)),$.userinfo!==void 0&&($.userinfo=v($.userinfo)),$.host!==void 0&&($.host=v($.host)),$.path!==void 0&&($.path=v($.path)),$.query!==void 0&&($.query=v($.query)),$.fragment!==void 0&&($.fragment=v($.fragment)),$}function S($){const g=[];if($.userinfo!==void 0&&(g.push($.userinfo),g.push("@")),$.host!==void 0){let v=unescape($.host);if(!t(v)){const w=u(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=$.host}g.push(v)}return(typeof $.port=="number"||typeof $.port=="string")&&(g.push(":"),g.push(String($.port))),g.length?g.join(""):void 0}return Ht={nonSimpleDomain:n,recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:a},Ht}var Gt,Er;function xn(){if(Er)return Gt;Er=1;const{isUUID:e}=wn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function n(s){return a.indexOf(s)!==-1}function y(s){return s.secure===!0?!0:s.secure===!1?!1:s.scheme?s.scheme.length===3&&(s.scheme[0]==="w"||s.scheme[0]==="W")&&(s.scheme[1]==="s"||s.scheme[1]==="S")&&(s.scheme[2]==="s"||s.scheme[2]==="S"):!1}function i(s){return s.host||(s.error=s.error||"HTTP URIs must have a host."),s}function p(s){const f=String(s.scheme).toLowerCase()==="https";return(s.port===(f?443:80)||s.port==="")&&(s.port=void 0),s.path||(s.path="/"),s}function u(s){return s.secure=y(s),s.resourceName=(s.path||"/")+(s.query?"?"+s.query:""),s.path=void 0,s.query=void 0,s}function m(s){if((s.port===(y(s)?443:80)||s.port==="")&&(s.port=void 0),typeof s.secure=="boolean"&&(s.scheme=s.secure?"wss":"ws",s.secure=void 0),s.resourceName){const[f,P]=s.resourceName.split("?");s.path=f&&f!=="/"?f:void 0,s.query=P,s.resourceName=void 0}return s.fragment=void 0,s}function b(s,f){if(!s.path)return s.error="URN can not be parsed",s;const P=s.path.match(t);if(P){const N=f.scheme||s.scheme||"urn";s.nid=P[1].toLowerCase(),s.nss=P[2];const D=`${N}:${f.nid||s.nid}`,z=h(D);s.path=void 0,z&&(s=z.parse(s,f))}else s.error=s.error||"URN can not be parsed.";return s}function _(s,f){if(s.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=f.scheme||s.scheme||"urn",N=s.nid.toLowerCase(),D=`${P}:${f.nid||N}`,z=h(D);z&&(s=z.serialize(s,f));const q=s,V=s.nss;return q.path=`${N||f.nid}:${V}`,f.skipEscape=!0,q}function S(s,f){const P=s;return P.uuid=P.nss,P.nss=void 0,!f.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function $(s){const f=s;return f.nss=(s.uuid||"").toLowerCase(),f}const g={scheme:"http",domainHost:!0,parse:i,serialize:p},v={scheme:"https",domainHost:g.domainHost,parse:i,serialize:p},w={scheme:"ws",domainHost:!0,parse:u,serialize:m},c={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},o={http:g,https:v,ws:w,wss:c,urn:{scheme:"urn",parse:b,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:S,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(o,null);function h(s){return s&&(o[s]||o[s.toLowerCase()])||void 0}return Gt={wsIsSecure:y,SCHEMES:o,isValidSchemeName:n,getSchemeHandler:h},Gt}var Sr;function ei(){if(Sr)return Re.exports;Sr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:a,normalizeComponentEncoding:n,isIPv4:y,nonSimpleDomain:i}=wn(),{SCHEMES:p,getSchemeHandler:u}=xn();function m(c,d){return typeof c=="string"?c=$(v(c,d),d):typeof c=="object"&&(c=v($(c,d),d)),c}function b(c,d,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},h=_(v(c,o),v(d,o),o,!0);return o.skipEscape=!0,$(h,o)}function _(c,d,r,o){const h={};return o||(c=v($(c,r),r),d=v($(d,r),r)),r=r||{},!r.tolerant&&d.scheme?(h.scheme=d.scheme,h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.path?(d.path[0]==="/"?h.path=t(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?h.path="/"+d.path:c.path?h.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:h.path=d.path,h.path=t(h.path)),h.query=d.query):(h.path=c.path,d.query!==void 0?h.query=d.query:h.query=c.query),h.userinfo=c.userinfo,h.host=c.host,h.port=c.port),h.scheme=c.scheme),h.fragment=d.fragment,h}function S(c,d,r){return typeof c=="string"?(c=unescape(c),c=$(n(v(c,r),!0),{...r,skipEscape:!0})):typeof c=="object"&&(c=$(n(c,!0),{...r,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=$(n(v(d,r),!0),{...r,skipEscape:!0})):typeof d=="object"&&(d=$(n(d,!0),{...r,skipEscape:!0})),c.toLowerCase()===d.toLowerCase()}function $(c,d){const r={host:c.host,scheme:c.scheme,userinfo:c.userinfo,port:c.port,path:c.path,query:c.query,nid:c.nid,nss:c.nss,uuid:c.uuid,fragment:c.fragment,reference:c.reference,resourceName:c.resourceName,secure:c.secure,error:""},o=Object.assign({},d),h=[],s=u(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&h.push(r.scheme,":");const f=a(r);if(f!==void 0&&(o.reference!=="suffix"&&h.push("//"),h.push(f),r.path&&r.path[0]!=="/"&&h.push("/")),r.path!==void 0){let P=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(P=t(P)),f===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),h.push(P)}return r.query!==void 0&&h.push("?",r.query),r.fragment!==void 0&&h.push("#",r.fragment),h.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(c,d){const r=Object.assign({},d),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;r.reference==="suffix"&&(r.scheme?c=r.scheme+":"+c:c="//"+c);const s=c.match(g);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(y(o.host)===!1){const N=e(o.host);o.host=N.host.toLowerCase(),h=N.isIPV6}else h=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const f=u(r.scheme||o.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&o.host&&(r.domainHost||f&&f.domainHost)&&h===!1&&i(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(P){o.error=o.error||"Host's domain name can not be converted to ASCII: "+P}(!f||f&&!f.skipNormalize)&&(c.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),f&&f.parse&&f.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const w={SCHEMES:p,normalize:m,resolve:b,resolveComponent:_,equal:S,serialize:$,parse:v};return Re.exports=w,Re.exports.default=w,Re.exports.fastUri=w,Re.exports}var jr;function ti(){if(jr)return Ae;jr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=ei();return e.code='require("ajv/dist/runtime/uri").default',Ae.default=e,Ae}var kr;function ri(){return kr||(kr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=qt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var a=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return a.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return a.CodeGen}});const n=Yt(),y=Ct(),i=_n(),p=Zt(),u=J(),m=Ot(),b=$t(),_=Y(),S=Xn,$=ti(),g=(M,k)=>new RegExp(M,k);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function o(M){var k,T,R,l,E,O,U,H,Z,B,j,I,C,A,K,W,ee,fe,oe,ae,te,Ee,ue,Tt,Dt;const ke=M.strict,Mt=(k=M.code)===null||k===void 0?void 0:k.optimize,xt=Mt===!0||Mt===void 0?1:Mt||0,er=(R=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&R!==void 0?R:g,Fn=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(O=(E=M.strictSchema)!==null&&E!==void 0?E:ke)!==null&&O!==void 0?O:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:ke)!==null&&H!==void 0?H:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:ke)!==null&&B!==void 0?B:"log",strictTuples:(I=(j=M.strictTuples)!==null&&j!==void 0?j:ke)!==null&&I!==void 0?I:"log",strictRequired:(A=(C=M.strictRequired)!==null&&C!==void 0?C:ke)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:xt,regExp:er}:{optimize:xt,regExp:er},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:r,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:r,meta:(ee=M.meta)!==null&&ee!==void 0?ee:!0,messages:(fe=M.messages)!==null&&fe!==void 0?fe:!0,inlineRefs:(oe=M.inlineRefs)!==null&&oe!==void 0?oe:!0,schemaId:(ae=M.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=M.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(Ee=M.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(ue=M.validateFormats)!==null&&ue!==void 0?ue:!0,unicodeRegExp:(Tt=M.unicodeRegExp)!==null&&Tt!==void 0?Tt:!0,int32range:(Dt=M.int32range)!==null&&Dt!==void 0?Dt:!0,uriResolver:Fn}}class h{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...o(k)};const{es5:T,lines:R}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:w,es5:T,lines:R}),this.logger=V(k.logger);const l=k.validateFormats;k.validateFormats=!1,this.RULES=(0,i.getRules)(),s.call(this,c,k,"NOT SUPPORTED"),s.call(this,d,k,"DEPRECATED","warn"),this._metaOpts=z.call(this),k.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&D.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),P.call(this),k.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:T,schemaId:R}=this.opts;let l=S;R==="id"&&(l={...S},l.id=l.$id,delete l.$id),T&&k&&this.addMetaSchema(l,l[R],!1)}defaultMeta(){const{meta:k,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[T]||k:void 0}validate(k,T){let R;if(typeof k=="string"){if(R=this.getSchema(k),!R)throw new Error(`no schema with key or ref "${k}"`)}else R=this.compile(k);const l=R(T);return"$async"in R||(this.errors=R.errors),l}compile(k,T){const R=this._addSchema(k,T);return R.validate||this._compileSchemaEnv(R)}compileAsync(k,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return l.call(this,k,T);async function l(B,j){await E.call(this,B.$schema);const I=this._addSchema(B,j);return I.validate||O.call(this,I)}async function E(B){B&&!this.getSchema(B)&&await l.call(this,{$ref:B},!0)}async function O(B){try{return this._compileSchemaEnv(B)}catch(j){if(!(j instanceof y.default))throw j;return U.call(this,j),await H.call(this,j.missingSchema),O.call(this,B)}}function U({missingSchema:B,missingRef:j}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${j} cannot be resolved`)}async function H(B){const j=await Z.call(this,B);this.refs[B]||await E.call(this,j.$schema),this.refs[B]||this.addSchema(j,B,T)}async function Z(B){const j=this._loading[B];if(j)return j;try{return await(this._loading[B]=R(B))}finally{delete this._loading[B]}}}addSchema(k,T,R,l=this.opts.validateSchema){if(Array.isArray(k)){for(const O of k)this.addSchema(O,void 0,R,l);return this}let E;if(typeof k=="object"){const{schemaId:O}=this.opts;if(E=k[O],E!==void 0&&typeof E!="string")throw new Error(`schema ${O} must be string`)}return T=(0,m.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(k,R,T,l,!0),this}addMetaSchema(k,T,R=this.opts.validateSchema){return this.addSchema(k,T,!0,R),this}validateSchema(k,T){if(typeof k=="boolean")return!0;let R;if(R=k.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(R,k);if(!l&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return l}getSchema(k){let T;for(;typeof(T=f.call(this,k))=="string";)k=T;if(T===void 0){const{schemaId:R}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:R});if(T=p.resolveSchema.call(this,l,k),!T)return;this.refs[k]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=f.call(this,k);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const T=k;this._cache.delete(T);let R=k[this.opts.schemaId];return R&&(R=(0,m.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const T of k)this.addKeyword(T);return this}addKeyword(k,T){let R;if(typeof k=="string")R=k,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=R);else if(typeof k=="object"&&T===void 0){if(T=k,R=T.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,R,T),!T)return(0,_.eachItem)(R,E=>Q.call(this,E)),this;ie.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(R,l.type.length===0?E=>Q.call(this,E,l):E=>l.type.forEach(O=>Q.call(this,E,l,O))),this}getKeyword(k){const T=this.RULES.all[k];return typeof T=="object"?T.definition:!!T}removeKeyword(k){const{RULES:T}=this;delete T.keywords[k],delete T.all[k];for(const R of T.rules){const l=R.rules.findIndex(E=>E.keyword===k);l>=0&&R.rules.splice(l,1)}return this}addFormat(k,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[k]=T,this}errorsText(k=this.errors,{separator:T=", ",dataVar:R="data"}={}){return!k||k.length===0?"No errors":k.map(l=>`${R}${l.instancePath} ${l.message}`).reduce((l,E)=>l+T+E)}$dataMetaSchema(k,T){const R=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const l of T){const E=l.split("/").slice(1);let O=k;for(const U of E)O=O[U];for(const U in R){const H=R[U];if(typeof H!="object")continue;const{$data:Z}=H.definition,B=O[U];Z&&B&&(O[U]=le(B))}}return k}_removeAllSchemas(k,T){for(const R in k){const l=k[R];(!T||T.test(R))&&(typeof l=="string"?delete k[R]:l&&!l.meta&&(this._cache.delete(l.schema),delete k[R]))}}_addSchema(k,T,R,l=this.opts.validateSchema,E=this.opts.addUsedSchema){let O;const{schemaId:U}=this.opts;if(typeof k=="object")O=k[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(k);if(H!==void 0)return H;R=(0,m.normalizeId)(O||R);const Z=m.getSchemaRefs.call(this,k,R);return H=new p.SchemaEnv({schema:k,schemaId:U,meta:T,baseId:R,localRefs:Z}),this._cache.set(H.schema,H),E&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=H),l&&this.validateSchema(k,!0),H}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):p.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const T=this.opts;this.opts=this._metaOpts;try{p.compileSchema.call(this,k)}finally{this.opts=T}}}h.ValidationError=n.default,h.MissingRefError=y.default,e.default=h;function s(M,k,T,R="error"){for(const l in M){const E=l;E in k&&this.logger[R](`${T}: option ${l}. ${M[E]}`)}}function f(M){return M=(0,m.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const k in M)this.addSchema(M[k],k)}function N(){for(const M in this.opts.formats){const k=this.opts.formats[M];k&&this.addFormat(M,k)}}function D(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in M){const T=M[k];T.keyword||(T.keyword=k),this.addKeyword(T)}}function z(){const M={...this.opts};for(const k of v)delete M[k];return M}const q={log(){},warn(){},error(){}};function V(M){if(M===!1)return q;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,k){const{RULES:T}=this;if((0,_.eachItem)(M,R=>{if(T.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!F.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,k,T){var R;const l=k?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let O=l?E.post:E.rules.find(({type:H})=>H===T);if(O||(O={type:T,rules:[]},E.rules.push(O)),E.keywords[M]=!0,!k)return;const U={keyword:M,definition:{...k,type:(0,b.getJSONTypes)(k.type),schemaType:(0,b.getJSONTypes)(k.schemaType)}};k.before?ne.call(this,O,U,k.before):O.rules.push(U),E.all[M]=U,(R=k.implements)===null||R===void 0||R.forEach(H=>this.addKeyword(H))}function ne(M,k,T){const R=M.rules.findIndex(l=>l.keyword===T);R>=0?M.rules.splice(R,0,k):(M.rules.push(k),this.logger.warn(`rule ${T} is not defined`))}function ie(M){let{metaSchema:k}=M;k!==void 0&&(M.$data&&this.opts.$data&&(k=le(k)),M.validateSchema=this.compile(k,!0))}const x={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function le(M){return{anyOf:[M,x]}}})(At)),At}var Ve={},ze={},Fe={},Ir;function ni(){if(Ir)return Fe;Ir=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Fe.default=e,Fe}var ve={},Rr;function ii(){if(Rr)return ve;Rr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=Ct(),t=me(),a=J(),n=_e(),y=Zt(),i=Y(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:S,it:$}=b,{baseId:g,schemaEnv:v,validateName:w,opts:c,self:d}=$,{root:r}=v;if((S==="#"||S==="#/")&&g===r.baseId)return h();const o=y.resolveRef.call(d,r,g,S);if(o===void 0)throw new e.default($.opts.uriResolver,g,S);if(o instanceof y.SchemaEnv)return s(o);return f(o);function h(){if(v===r)return m(b,w,v,v.$async);const P=_.scopeValue("root",{ref:r});return m(b,(0,a._)`${P}.validate`,r,r.$async)}function s(P){const N=u(b,P);m(b,N,P,P.$async)}function f(P){const N=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,a.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:a.nil,topSchemaRef:N,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function u(b,_){const{gen:S}=b;return _.validate?S.scopeValue("validate",{ref:_.validate}):(0,a._)`${S.scopeValue("wrapper",{ref:_})}.validate`}ve.getValidate=u;function m(b,_,S,$){const{gen:g,it:v}=b,{allErrors:w,schemaEnv:c,opts:d}=v,r=d.passContext?n.default.this:a.nil;$?o():h();function o(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,a._)`await ${(0,t.callValidateCode)(b,_,r)}`),f(_),w||g.assign(P,!0)},N=>{g.if((0,a._)`!(${N} instanceof ${v.ValidationError})`,()=>g.throw(N)),s(N),w||g.assign(P,!1)}),b.ok(P)}function h(){b.result((0,t.callValidateCode)(b,_,r),()=>f(_),()=>s(_))}function s(P){const N=(0,a._)`${P}.errors`;g.assign(n.default.vErrors,(0,a._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),g.assign(n.default.errors,(0,a._)`${n.default.vErrors}.length`)}function f(P){var N;if(!v.opts.unevaluated)return;const D=(N=S?.validate)===null||N===void 0?void 0:N.evaluated;if(v.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&(v.props=i.mergeEvaluated.props(g,D.props,v.props));else{const z=g.var("props",(0,a._)`${P}.evaluated.props`);v.props=i.mergeEvaluated.props(g,z,v.props,a.Name)}if(v.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&(v.items=i.mergeEvaluated.items(g,D.items,v.items));else{const z=g.var("items",(0,a._)`${P}.evaluated.items`);v.items=i.mergeEvaluated.items(g,z,v.items,a.Name)}}}return ve.callRef=m,ve.default=p,ve}var Nr;function si(){if(Nr)return ze;Nr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=ni(),t=ii(),a=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ze.default=a,ze}var Le={},Ue={},Or;function oi(){if(Or)return Ue;Or=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=J(),t=e.operators,a={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:i,schemaCode:p})=>(0,e.str)`must be ${a[i].okStr} ${p}`,params:({keyword:i,schemaCode:p})=>(0,e._)`{comparison: ${a[i].okStr}, limit: ${p}}`},y={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:p,data:u,schemaCode:m}=i;i.fail$data((0,e._)`${u} ${a[p].fail} ${m} || isNaN(${u})`)}};return Ue.default=y,Ue}var Ke={},qr;function ai(){if(qr)return Ke;qr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=J(),a={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:y,data:i,schemaCode:p,it:u}=n,m=u.opts.multipleOfPrecision,b=y.let("res"),_=m?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${m}`:(0,e._)`${b} !== parseInt(${b})`;n.fail$data((0,e._)`(${p} === 0 || (${b} = ${i}/${p}, ${_}))`)}};return Ke.default=a,Ke}var He={},Ge={},Cr;function ci(){if(Cr)return Ge;Cr=1,Object.defineProperty(Ge,"__esModule",{value:!0});function e(t){const a=t.length;let n=0,y=0,i;for(;y<a;)n++,i=t.charCodeAt(y++),i>=55296&&i<=56319&&y<a&&(i=t.charCodeAt(y),(i&64512)===56320&&y++);return n}return Ge.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ge}var Tr;function di(){if(Tr)return He;Tr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=J(),t=Y(),a=ci(),y={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:p}){const u=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${p} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:p,data:u,schemaCode:m,it:b}=i,_=p==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(i.gen,a.default)}(${u})`;i.fail$data((0,e._)`${S} ${_} ${m}`)}};return He.default=y,He}var Je={},Dr;function ui(){if(Dr)return Je;Dr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=me(),t=J(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:y})=>(0,t.str)`must match pattern "${y}"`,params:({schemaCode:y})=>(0,t._)`{pattern: ${y}}`},code(y){const{data:i,$data:p,schema:u,schemaCode:m,it:b}=y,_=b.opts.unicodeRegExp?"u":"",S=p?(0,t._)`(new RegExp(${m}, ${_}))`:(0,e.usePattern)(y,u);y.fail$data((0,t._)`!${S}.test(${i})`)}};return Je.default=n,Je}var We={},Mr;function li(){if(Mr)return We;Mr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=J(),a={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:y}){const i=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${y} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:y,data:i,schemaCode:p}=n,u=y==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${i}).length ${u} ${p}`)}};return We.default=a,We}var Be={},Ar;function fi(){if(Ar)return Be;Ar=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=me(),t=J(),a=Y(),y={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:p,schema:u,schemaCode:m,data:b,$data:_,it:S}=i,{opts:$}=S;if(!_&&u.length===0)return;const g=u.length>=$.loopRequired;if(S.allErrors?v():w(),$.strictRequired){const r=i.parentSchema.properties,{definedProperties:o}=i.it;for(const h of u)if(r?.[h]===void 0&&!o.has(h)){const s=S.schemaEnv.baseId+S.errSchemaPath,f=`required property "${h}" is not defined at "${s}" (strictRequired)`;(0,a.checkStrictMode)(S,f,S.opts.strictRequired)}}function v(){if(g||_)i.block$data(t.nil,c);else for(const r of u)(0,e.checkReportMissingProp)(i,r)}function w(){const r=p.let("missing");if(g||_){const o=p.let("valid",!0);i.block$data(o,()=>d(r,o)),i.ok(o)}else p.if((0,e.checkMissingProp)(i,u,r)),(0,e.reportMissingProp)(i,r),p.else()}function c(){p.forOf("prop",m,r=>{i.setParams({missingProperty:r}),p.if((0,e.noPropertyInData)(p,b,r,$.ownProperties),()=>i.error())})}function d(r,o){i.setParams({missingProperty:r}),p.forOf(r,m,()=>{p.assign(o,(0,e.propertyInData)(p,b,r,$.ownProperties)),p.if((0,t.not)(o),()=>{i.error(),p.break()})},t.nil)}}};return Be.default=y,Be}var Ye={},Vr;function pi(){if(Vr)return Ye;Vr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=J(),a={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:y}){const i=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${y} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:y,data:i,schemaCode:p}=n,u=y==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${i}.length ${u} ${p}`)}};return Ye.default=a,Ye}var Ze={},Qe={},zr;function Qt(){if(zr)return Qe;zr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=bn();return e.code='require("ajv/dist/runtime/equal").default',Qe.default=e,Qe}var Fr;function mi(){if(Fr)return Ze;Fr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=$t(),t=J(),a=Y(),n=Qt(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${p} are identical)`,params:({params:{i:p,j:u}})=>(0,t._)`{i: ${p}, j: ${u}}`},code(p){const{gen:u,data:m,$data:b,schema:_,parentSchema:S,schemaCode:$,it:g}=p;if(!b&&!_)return;const v=u.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];p.block$data(v,c,(0,t._)`${$} === false`),p.ok(v);function c(){const h=u.let("i",(0,t._)`${m}.length`),s=u.let("j");p.setParams({i:h,j:s}),u.assign(v,!0),u.if((0,t._)`${h} > 1`,()=>(d()?r:o)(h,s))}function d(){return w.length>0&&!w.some(h=>h==="object"||h==="array")}function r(h,s){const f=u.name("item"),P=(0,e.checkDataTypes)(w,f,g.opts.strictNumbers,e.DataType.Wrong),N=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${h}--;`,()=>{u.let(f,(0,t._)`${m}[${h}]`),u.if(P,(0,t._)`continue`),w.length>1&&u.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),u.if((0,t._)`typeof ${N}[${f}] == "number"`,()=>{u.assign(s,(0,t._)`${N}[${f}]`),p.error(),u.assign(v,!1).break()}).code((0,t._)`${N}[${f}] = ${h}`)})}function o(h,s){const f=(0,a.useFunc)(u,n.default),P=u.name("outer");u.label(P).for((0,t._)`;${h}--;`,()=>u.for((0,t._)`${s} = ${h}; ${s}--;`,()=>u.if((0,t._)`${f}(${m}[${h}], ${m}[${s}])`,()=>{p.error(),u.assign(v,!1).break(P)})))}}};return Ze.default=i,Ze}var Xe={},Lr;function hi(){if(Lr)return Xe;Lr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=J(),t=Y(),a=Qt(),y={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:p,data:u,$data:m,schemaCode:b,schema:_}=i;m||_&&typeof _=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(p,a.default)}(${u}, ${b})`):i.fail((0,e._)`${_} !== ${u}`)}};return Xe.default=y,Xe}var xe={},Ur;function yi(){if(Ur)return xe;Ur=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=J(),t=Y(),a=Qt(),y={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:p,data:u,$data:m,schema:b,schemaCode:_,it:S}=i;if(!m&&b.length===0)throw new Error("enum must have non-empty array");const $=b.length>=S.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(p,a.default));let w;if($||m)w=p.let("valid"),i.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const r=p.const("vSchema",_);w=(0,e.or)(...b.map((o,h)=>d(r,h)))}i.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,r=>p.if((0,e._)`${v()}(${u}, ${r})`,()=>p.assign(w,!0).break()))}function d(r,o){const h=b[o];return typeof h=="object"&&h!==null?(0,e._)`${v()}(${u}, ${r}[${o}])`:(0,e._)`${u} === ${h}`}}};return xe.default=y,xe}var Kr;function gi(){if(Kr)return Le;Kr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=oi(),t=ai(),a=di(),n=ui(),y=li(),i=fi(),p=pi(),u=mi(),m=hi(),b=yi(),_=[e.default,t.default,a.default,n.default,y.default,i.default,p.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,b.default];return Le.default=_,Le}var et={},Se={},Hr;function Pn(){if(Hr)return Se;Hr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateAdditionalItems=void 0;const e=J(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:p,it:u}=i,{items:m}=p;if(!Array.isArray(m)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}y(i,m)}};function y(i,p){const{gen:u,schema:m,data:b,keyword:_,it:S}=i;S.items=!0;const $=u.const("len",(0,e._)`${b}.length`);if(m===!1)i.setParams({len:p.length}),i.pass((0,e._)`${$} <= ${p.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(S,m)){const v=u.var("valid",(0,e._)`${$} <= ${p.length}`);u.if((0,e.not)(v),()=>g(v)),i.ok(v)}function g(v){u.forRange("i",p.length,$,w=>{i.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},v),S.allErrors||u.if((0,e.not)(v),()=>u.break())})}}return Se.validateAdditionalItems=y,Se.default=n,Se}var tt={},je={},Gr;function En(){if(Gr)return je;Gr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateTuple=void 0;const e=J(),t=Y(),a=me(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:p,it:u}=i;if(Array.isArray(p))return y(i,"additionalItems",p);u.items=!0,!(0,t.alwaysValidSchema)(u,p)&&i.ok((0,a.validateArray)(i))}};function y(i,p,u=i.schema){const{gen:m,parentSchema:b,data:_,keyword:S,it:$}=i;w(b),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(m,u.length,$.items));const g=m.name("valid"),v=m.const("len",(0,e._)`${_}.length`);u.forEach((c,d)=>{(0,t.alwaysValidSchema)($,c)||(m.if((0,e._)`${v} > ${d}`,()=>i.subschema({keyword:S,schemaProp:d,dataProp:d},g)),i.ok(g))});function w(c){const{opts:d,errSchemaPath:r}=$,o=u.length,h=o===c.minItems&&(o===c.maxItems||c[p]===!1);if(d.strictTuples&&!h){const s=`"${S}" is ${o}-tuple, but minItems or maxItems/${p} are not specified or different at path "${r}"`;(0,t.checkStrictMode)($,s,d.strictTuples)}}}return je.validateTuple=y,je.default=n,je}var Jr;function vi(){if(Jr)return tt;Jr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=En(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a=>(0,e.validateTuple)(a,"items")};return tt.default=t,tt}var rt={},Wr;function _i(){if(Wr)return rt;Wr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=J(),t=Y(),a=me(),n=Pn(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:p}})=>(0,e.str)`must NOT have more than ${p} items`,params:({params:{len:p}})=>(0,e._)`{limit: ${p}}`},code(p){const{schema:u,parentSchema:m,it:b}=p,{prefixItems:_}=m;b.items=!0,!(0,t.alwaysValidSchema)(b,u)&&(_?(0,n.validateAdditionalItems)(p,_):p.ok((0,a.validateArray)(p)))}};return rt.default=i,rt}var nt={},Br;function $i(){if(Br)return nt;Br=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:y,max:i}})=>i===void 0?(0,e.str)`must contain at least ${y} valid item(s)`:(0,e.str)`must contain at least ${y} and no more than ${i} valid item(s)`,params:({params:{min:y,max:i}})=>i===void 0?(0,e._)`{minContains: ${y}}`:(0,e._)`{minContains: ${y}, maxContains: ${i}}`},code(y){const{gen:i,schema:p,parentSchema:u,data:m,it:b}=y;let _,S;const{minContains:$,maxContains:g}=u;b.opts.next?(_=$===void 0?1:$,S=g):_=1;const v=i.const("len",(0,e._)`${m}.length`);if(y.setParams({min:_,max:S}),S===void 0&&_===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&_>S){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),y.fail();return}if((0,t.alwaysValidSchema)(b,p)){let o=(0,e._)`${v} >= ${_}`;S!==void 0&&(o=(0,e._)`${o} && ${v} <= ${S}`),y.pass(o);return}b.items=!0;const w=i.name("valid");S===void 0&&_===1?d(w,()=>i.if(w,()=>i.break())):_===0?(i.let(w,!0),S!==void 0&&i.if((0,e._)`${m}.length > 0`,c)):(i.let(w,!1),c()),y.result(w,()=>y.reset());function c(){const o=i.name("_valid"),h=i.let("count",0);d(o,()=>i.if(o,()=>r(h)))}function d(o,h){i.forRange("i",0,v,s=>{y.subschema({keyword:"contains",dataProp:s,dataPropType:t.Type.Num,compositeRule:!0},o),h()})}function r(o){i.code((0,e._)`${o}++`),S===void 0?i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0).break()):(i.if((0,e._)`${o} > ${S}`,()=>i.assign(w,!1).break()),_===1?i.assign(w,!0):i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0)))}}};return nt.default=n,nt}var Jt={},Yr;function bi(){return Yr||(Yr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=J(),a=Y(),n=me();e.error={message:({params:{property:m,depsCount:b,deps:_}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:b,deps:_,missingProperty:S}})=>(0,t._)`{property: ${m},
|
|
6
6
|
missingProperty: ${S},
|
|
7
7
|
depsCount: ${b},
|
|
8
|
-
deps: ${_}}`};const v={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[b,_]=i(m);p(m,b),u(m,_)}};function i({schema:m}){const b={},_={};for(const S in m){if(S==="__proto__")continue;const $=Array.isArray(m[S])?b:_;$[S]=m[S]}return[b,_]}function p(m,b=m.schema){const{gen:_,data:S,it:$}=m;if(Object.keys(b).length===0)return;const y=_.let("missing");for(const g in b){const w=b[g];if(w.length===0)continue;const c=(0,n.propertyInData)(_,S,g,$.opts.ownProperties);m.setParams({property:g,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const d of w)(0,n.checkReportMissingProp)(m,d)}):(_.if((0,t._)`${c} && (${(0,n.checkMissingProp)(m,w,y)})`),(0,n.reportMissingProp)(m,y),_.else())}}e.validatePropertyDeps=p;function u(m,b=m.schema){const{gen:_,data:S,keyword:$,it:y}=m,g=_.name("valid");for(const w in b)(0,a.alwaysValidSchema)(y,b[w])||(_.if((0,n.propertyInData)(_,S,w,y.opts.ownProperties),()=>{const c=m.subschema({keyword:$,schemaProp:w},g);m.mergeValidEvaluated(c,g)},()=>_.var(g,!0)),m.ok(g))}e.validateSchemaDeps=u,e.default=v})(Gt)),Gt}var nt={},Yr;function _i(){if(Yr)return nt;Yr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:v})=>(0,e._)`{propertyName: ${v.propertyName}}`},code(v){const{gen:i,schema:p,data:u,it:m}=v;if((0,t.alwaysValidSchema)(m,p))return;const b=i.name("valid");i.forIn("key",u,_=>{v.setParams({propertyName:_}),v.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),i.if((0,e.not)(b),()=>{v.error(!0),m.allErrors||i.break()})}),v.ok(b)}};return nt.default=n,nt}var it={},Zr;function Sn(){if(Zr)return it;Zr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=me(),t=J(),a=_e(),n=Y(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:p})=>(0,t._)`{additionalProperty: ${p.additionalProperty}}`},code(p){const{gen:u,schema:m,parentSchema:b,data:_,errsCount:S,it:$}=p;if(!S)throw new Error("ajv implementation error");const{allErrors:y,opts:g}=$;if($.props=!0,g.removeAdditional!=="all"&&(0,n.alwaysValidSchema)($,m))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);d(),p.ok((0,t._)`${S} === ${a.default.errors}`);function d(){u.forIn("key",_,f=>{!w.length&&!c.length?h(f):u.if(r(f),()=>h(f))})}function r(f){let P;if(w.length>8){const R=(0,n.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(u,R,f)}else w.length?P=(0,t.or)(...w.map(R=>(0,t._)`${f} === ${R}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(R=>(0,t._)`${(0,e.usePattern)(p,R)}.test(${f})`))),(0,t.not)(P)}function o(f){u.code((0,t._)`delete ${_}[${f}]`)}function h(f){if(g.removeAdditional==="all"||g.removeAdditional&&m===!1){o(f);return}if(m===!1){p.setParams({additionalProperty:f}),p.error(),y||u.break();return}if(typeof m=="object"&&!(0,n.alwaysValidSchema)($,m)){const P=u.name("valid");g.removeAdditional==="failing"?(s(f,P,!1),u.if((0,t.not)(P),()=>{p.reset(),o(f)})):(s(f,P),y||u.if((0,t.not)(P),()=>u.break()))}}function s(f,P,R){const D={keyword:"additionalProperties",dataProp:f,dataPropType:n.Type.Str};R===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return it.default=i,it}var st={},Qr;function $i(){if(Qr)return st;Qr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Ot(),t=me(),a=Y(),n=Sn(),v={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,parentSchema:m,data:b,it:_}=i;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(u);for(const c of S)_.definedProperties.add(c);_.opts.unevaluated&&S.length&&_.props!==!0&&(_.props=a.mergeEvaluated.props(p,(0,a.toHash)(S),_.props));const $=S.filter(c=>!(0,a.alwaysValidSchema)(_,u[c]));if($.length===0)return;const y=p.name("valid");for(const c of $)g(c)?w(c):(p.if((0,t.propertyInData)(p,b,c,_.opts.ownProperties)),w(c),_.allErrors||p.else().var(y,!0),p.endIf()),i.it.definedProperties.add(c),i.ok(y);function g(c){return _.opts.useDefaults&&!_.compositeRule&&u[c].default!==void 0}function w(c){i.subschema({keyword:"properties",schemaProp:c,dataProp:c},y)}}};return st.default=v,st}var ot={},Xr;function bi(){if(Xr)return ot;Xr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=me(),t=J(),a=Y(),n=Y(),v={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,data:m,parentSchema:b,it:_}=i,{opts:S}=_,$=(0,e.allSchemaProperties)(u),y=$.filter(h=>(0,a.alwaysValidSchema)(_,u[h]));if($.length===0||y.length===$.length&&(!_.opts.unevaluated||_.props===!0))return;const g=S.strictSchema&&!S.allowMatchingProperties&&b.properties,w=p.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(p,_.props));const{props:c}=_;d();function d(){for(const h of $)g&&r(h),_.allErrors?o(h):(p.var(w,!0),o(h),p.if(w))}function r(h){for(const s in g)new RegExp(h).test(s)&&(0,a.checkStrictMode)(_,`property ${s} matches pattern ${h} (use allowMatchingProperties)`)}function o(h){p.forIn("key",m,s=>{p.if((0,t._)`${(0,e.usePattern)(i,h)}.test(${s})`,()=>{const f=y.includes(h);f||i.subschema({keyword:"patternProperties",schemaProp:h,dataProp:s,dataPropType:n.Type.Str},w),_.opts.unevaluated&&c!==!0?p.assign((0,t._)`${c}[${s}]`,!0):!f&&!_.allErrors&&p.if((0,t.not)(w),()=>p.break())})})}}};return ot.default=v,ot}var at={},xr;function wi(){if(xr)return at;xr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(a){const{gen:n,schema:v,it:i}=a;if((0,e.alwaysValidSchema)(i,v)){a.fail();return}const p=n.name("valid");a.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),a.failResult(p,()=>a.reset(),()=>a.error())},error:{message:"must NOT be valid"}};return at.default=t,at}var ct={},en;function Pi(){if(en)return ct;en=1,Object.defineProperty(ct,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:me().validateUnion,error:{message:"must match a schema in anyOf"}};return ct.default=t,ct}var dt={},tn;function Ei(){if(tn)return dt;tn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:v})=>(0,e._)`{passingSchemas: ${v.passing}}`},code(v){const{gen:i,schema:p,parentSchema:u,it:m}=v;if(!Array.isArray(p))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const b=p,_=i.let("valid",!1),S=i.let("passing",null),$=i.name("_valid");v.setParams({passing:S}),i.block(y),v.result(_,()=>v.reset(),()=>v.error(!0));function y(){b.forEach((g,w)=>{let c;(0,t.alwaysValidSchema)(m,g)?i.var($,!0):c=v.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&i.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),i.if($,()=>{i.assign(_,!0),i.assign(S,w),c&&v.mergeEvaluated(c,e.Name)})})}}};return dt.default=n,dt}var ut={},rn;function Si(){if(rn)return ut;rn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(a){const{gen:n,schema:v,it:i}=a;if(!Array.isArray(v))throw new Error("ajv implementation error");const p=n.name("valid");v.forEach((u,m)=>{if((0,e.alwaysValidSchema)(i,u))return;const b=a.subschema({keyword:"allOf",schemaProp:m},p);a.ok(p),a.mergeEvaluated(b)})}};return ut.default=t,ut}var lt={},nn;function ji(){if(nn)return lt;nn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:p,parentSchema:u,it:m}=i;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const b=v(m,"then"),_=v(m,"else");if(!b&&!_)return;const S=p.let("valid",!0),$=p.name("_valid");if(y(),i.reset(),b&&_){const w=p.let("ifClause");i.setParams({ifClause:w}),p.if($,g("then",w),g("else",w))}else b?p.if($,g("then")):p.if((0,e.not)($),g("else"));i.pass(S,()=>i.error(!0));function y(){const w=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);i.mergeEvaluated(w)}function g(w,c){return()=>{const d=i.subschema({keyword:w},$);p.assign(S,$),i.mergeValidEvaluated(d,S),c?p.assign(c,(0,e._)`${w}`):i.setParams({ifClause:w})}}}};function v(i,p){const u=i.schema[p];return u!==void 0&&!(0,t.alwaysValidSchema)(i,u)}return lt.default=n,lt}var ft={},sn;function ki(){if(sn)return ft;sn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:a,parentSchema:n,it:v}){n.if===void 0&&(0,e.checkStrictMode)(v,`"${a}" without "if" is ignored`)}};return ft.default=t,ft}var on;function Ii(){if(on)return xe;on=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=Pn(),t=hi(),a=En(),n=yi(),v=gi(),i=vi(),p=_i(),u=Sn(),m=$i(),b=bi(),_=wi(),S=Pi(),$=Ei(),y=Si(),g=ji(),w=ki();function c(d=!1){const r=[_.default,S.default,$.default,y.default,g.default,w.default,p.default,u.default,i.default,m.default,b.default];return d?r.push(t.default,n.default):r.push(e.default,a.default),r.push(v.default),r}return xe.default=c,xe}var pt={},mt={},an;function Ni(){if(an)return mt;an=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=J(),a={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,v){const{gen:i,data:p,$data:u,schema:m,schemaCode:b,it:_}=n,{opts:S,errSchemaPath:$,schemaEnv:y,self:g}=_;if(!S.validateFormats)return;u?w():c();function w(){const d=i.scopeValue("formats",{ref:g.formats,code:S.code.formats}),r=i.const("fDef",(0,e._)`${d}[${b}]`),o=i.let("fType"),h=i.let("format");i.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>i.assign(o,(0,e._)`${r}.type || "string"`).assign(h,(0,e._)`${r}.validate`),()=>i.assign(o,(0,e._)`"string"`).assign(h,r)),n.fail$data((0,e.or)(s(),f()));function s(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${h}`}function f(){const P=y.$async?(0,e._)`(${r}.async ? await ${h}(${p}) : ${h}(${p}))`:(0,e._)`${h}(${p})`,R=(0,e._)`(typeof ${h} == "function" ? ${P} : ${h}.test(${p}))`;return(0,e._)`${h} && ${h} !== true && ${o} === ${v} && !${R}`}}function c(){const d=g.formats[m];if(!d){s();return}if(d===!0)return;const[r,o,h]=f(d);r===v&&n.pass(P());function s(){if(S.strictSchema===!1){g.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function f(R){const D=R instanceof RegExp?(0,e.regexpCode)(R):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(m)}`:void 0,z=i.scopeValue("formats",{key:m,ref:R,code:D});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${z}.validate`]:["string",R,z]}function P(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!y.$async)throw new Error("async format in sync schema");return(0,e._)`await ${h}(${p})`}return typeof o=="function"?(0,e._)`${h}(${p})`:(0,e._)`${h}.test(${p})`}}}};return mt.default=a,mt}var cn;function Ri(){if(cn)return pt;cn=1,Object.defineProperty(pt,"__esModule",{value:!0});const t=[Ni().default];return pt.default=t,pt}var Pe={},dn;function Oi(){return dn||(dn=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.contentVocabulary=Pe.metadataVocabulary=void 0,Pe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Pe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Pe}var un;function qi(){if(un)return Ae;un=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=ri(),t=mi(),a=Ii(),n=Ri(),v=Oi(),i=[e.default,t.default,(0,a.default)(),n.default,v.metadataVocabulary,v.contentVocabulary];return Ae.default=i,Ae}var ht={},Re={},ln;function Ci(){if(ln)return Re;ln=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Re.DiscrError=e={})),Re}var fn;function Ti(){if(fn)return ht;fn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=J(),t=Ci(),a=Yt(),n=qt(),v=Y(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:b}})=>(0,e._)`{error: ${u}, tag: ${b}, tagValue: ${m}}`},code(u){const{gen:m,data:b,schema:_,parentSchema:S,it:$}=u,{oneOf:y}=S;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const g=_.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),c=m.const("tag",(0,e._)`${b}${(0,e.getProperty)(g)}`);m.if((0,e._)`typeof ${c} == "string"`,()=>d(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:g})),u.ok(w);function d(){const h=o();m.if(!1);for(const s in h)m.elseIf((0,e._)`${c} === ${s}`),m.assign(w,r(h[s]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:g}),m.endIf()}function r(h){const s=m.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:h},s);return u.mergeEvaluated(f,e.Name),s}function o(){var h;const s={},f=R(S);let P=!0;for(let q=0;q<y.length;q++){let V=y[q];if(V?.$ref&&!(0,v.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=a.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof a.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default($.opts.uriResolver,$.baseId,L)}const F=(h=V?.properties)===null||h===void 0?void 0:h[g];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);P=P&&(f||R(V)),D(F,q)}if(!P)throw new Error(`discriminator: "${g}" must be required`);return s;function R({required:q}){return Array.isArray(q)&&q.includes(g)}function D(q,V){if(q.const)z(q.const,V);else if(q.enum)for(const F of q.enum)z(F,V);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function z(q,V){if(typeof q!="string"||q in s)throw new Error(`discriminator: "${g}" values must be unique strings`);s[q]=V}}}};return ht.default=p,ht}const Di="http://json-schema.org/draft-07/schema#",Mi="http://json-schema.org/draft-07/schema#",Ai="Core schema meta-schema",Vi={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},zi=["object","boolean"],Fi={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Li={$schema:Di,$id:Mi,title:Ai,definitions:Vi,type:zi,properties:Fi,default:!0};var pn;function jn(){return pn||(pn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const a=xn(),n=qi(),v=Ti(),i=Li,p=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends a.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(v.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(i,p):i;this.addMetaSchema(g,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var b=Ot();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=J();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var S=Bt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var $=qt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(qe,qe.exports)),qe.exports}var Ui=jn();const kn=vn(Ui);var yt={exports:{}},Jt={},mn;function Ki(){return mn||(mn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(q,V){return{validate:q,compare:V}}e.fullFormats={date:t(i,p),time:t(m(!0),b),"date-time":t($(!0),y),"iso-time":t(m(),_),"iso-date-time":t($(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:o,int32:{type:"number",validate:f},int64:{type:"number",validate:P},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,y),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function a(q){return q%4===0&&(q%100!==0||q%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,v=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(q){const V=n.exec(q);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&a(F)?29:v[L])}function p(q,V){if(q&&V)return q>V?1:q<V?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(q){return function(F){const L=u.exec(F);if(!L)return!1;const Q=+L[1],ne=+L[2],ie=+L[3],x=L[4],le=L[5]==="-"?-1:1,M=+(L[6]||0),k=+(L[7]||0);if(M>23||k>59||q&&!x)return!1;if(Q<=23&&ne<=59&&ie<60)return!0;const T=ne-k*le,N=Q-M*le-(T<0?1:0);return(N===23||N===-1)&&(T===59||T===-1)&&ie<61}}function b(q,V){if(!(q&&V))return;const F=new Date("2020-01-01T"+q).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function _(q,V){if(!(q&&V))return;const F=u.exec(q),L=u.exec(V);if(F&&L)return q=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],q>V?1:q<V?-1:0}const S=/t|\s/i;function $(q){const V=m(q);return function(L){const Q=L.split(S);return Q.length===2&&i(Q[0])&&V(Q[1])}}function y(q,V){if(!(q&&V))return;const F=new Date(q).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function g(q,V){if(!(q&&V))return;const[F,L]=q.split(S),[Q,ne]=V.split(S),ie=p(F,Q);if(ie!==void 0)return ie||b(L,ne)}const w=/\/|:/,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function d(q){return w.test(q)&&c.test(q)}const r=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function o(q){return r.lastIndex=0,r.test(q)}const h=-2147483648,s=2**31-1;function f(q){return Number.isInteger(q)&&q<=s&&q>=h}function P(q){return Number.isInteger(q)}function R(){return!0}const D=/[^\\]\\Z/;function z(q){if(D.test(q))return!1;try{return new RegExp(q),!0}catch{return!1}}})(Jt)),Jt}var Wt={},hn;function Hi(){return hn||(hn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=jn(),a=J(),n=a.operators,v={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:u,schemaCode:m})=>(0,a.str)`should be ${v[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,a._)`{comparison: ${v[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(v),type:"string",schemaType:"string",$data:!0,error:i,code(u){const{gen:m,data:b,schemaCode:_,keyword:S,it:$}=u,{opts:y,self:g}=$;if(!y.validateFormats)return;const w=new t.KeywordCxt($,g.RULES.all.format.definition,"format");w.$data?c():d();function c(){const o=m.scopeValue("formats",{ref:g.formats,code:y.code.formats}),h=m.const("fmt",(0,a._)`${o}[${w.schemaCode}]`);u.fail$data((0,a.or)((0,a._)`typeof ${h} != "object"`,(0,a._)`${h} instanceof RegExp`,(0,a._)`typeof ${h}.compare != "function"`,r(h)))}function d(){const o=w.schema,h=g.formats[o];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${S}": format "${o}" does not define "compare" function`);const s=m.scopeValue("formats",{key:o,ref:h,code:y.code.formats?(0,a._)`${y.code.formats}${(0,a.getProperty)(o)}`:void 0});u.fail$data(r(s))}function r(o){return(0,a._)`${o}.compare(${b}, ${_}) ${v[S].fail} 0`}},dependencies:["format"]};const p=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=p})(Wt)),Wt}var yn;function Gi(){return yn||(yn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a=Ki(),n=Hi(),v=J(),i=new v.Name("fullFormats"),p=new v.Name("fastFormats"),u=(b,_={keywords:!0})=>{if(Array.isArray(_))return m(b,_,a.fullFormats,i),b;const[S,$]=_.mode==="fast"?[a.fastFormats,p]:[a.fullFormats,i],y=_.formats||a.formatNames;return m(b,y,S,$),_.keywords&&(0,n.default)(b),b};u.get=(b,_="full")=>{const $=(_==="fast"?a.fastFormats:a.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function m(b,_,S,$){var y,g;(y=(g=b.opts.code).formats)!==null&&y!==void 0||(g.formats=(0,v._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,S[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(yt,yt.exports)),yt.exports}var Ji=Gi();const In=vn(Ji),Wi="http://json-schema.org/draft-07/schema#",Bi="object",Yi={version:{type:"string"},meta:{$ref:"#/definitions/MetaInfo"},pages:{type:"array",items:{$ref:"#/definitions/CICPage"}},registry:{$ref:"#/definitions/Registry"},variables:{$ref:"#/definitions/Variables"},deps:{$ref:"#/definitions/Dependencies"},extensions:{type:"object"}},Zi=["version","meta","pages"],Qi=!1,Xi="CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。",xi=JSON.parse('{"MetaInfo":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/LayoutConfig","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"LayoutConfig":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false},"CICPage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/LayoutConfig"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}]},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}]},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"continueOnError":{"type":"boolean"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"continueOnError":{"type":"boolean"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"continueOnError":{"type":"boolean"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"continueOnError":{"type":"boolean"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。","examples":[{"id":"comp_echarts_line","name":"折线图","description":"用于展示时间序列数据的折线图组件","version":"1.0.0","author":"component_dev","defaultProps":{"title":{"type":"string","default":"折线图标题","description":"图表的标题"},"xAxis":{"type":"array","default":[],"description":"X轴数据"},"yAxis":{"type":"array","default":[],"description":"Y轴数据"},"lineColor":{"type":"string","default":"#5470C6","description":"折线颜色"}},"data":{"x":123,"y":456},"deps":["1","2"]}]},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"required":["global","page","component"],"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependencies":{"type":"array","items":{"$ref":"#/definitions/Dependency"},"description":"依赖数组"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"判别联合"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}'),$t={$schema:Wi,type:Bi,properties:Yi,required:Zi,additionalProperties:Qi,description:Xi,definitions:xi};let gt=null;const es=()=>(gt||(gt=new kn({allErrors:!0,strict:!1}),In(gt)),gt),gn=new Map,ts=JSON.stringify($t.definitions),$e=e=>{const t=es(),a=`${e}::${ts}`,n=gn.get(a);if(n)return n;const v=t.compile({$ref:e,definitions:$t.definitions});return gn.set(a,v),v},Oe=e=>typeof e=="number"&&isFinite(e)&&e>0,Qt=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const a=Array.from(t,n=>n.toString(16).padStart(2,"0"));return`${a[0]}${a[1]}${a[2]}${a[3]}-${a[4]}${a[5]}-${a[6]}${a[7]}-${a[8]}${a[9]}-${a[10]}${a[11]}${a[12]}${a[13]}${a[14]}${a[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const a=Math.random()*16|0;return(t==="x"?a:a&3|8).toString(16)})},rs=(e,t="https://example.com/resource")=>typeof e=="string"&&/^https?:\/\//.test(e)?e:t,ns=(e,t="wss://example.com/socket")=>typeof e=="string"&&/^wss?:\/\//.test(e)?e:t,bt=$e("#/definitions/DataSourceItem"),is=(e,t)=>{const a={...t?.defaults||{}},n={...e};if(t?.generateId&&!n.id&&(n.id=Qt()),!n.type)throw new Error("type is required");return n.continueOnError=typeof n.continueOnError=="boolean"?n.continueOnError:a.continueOnError??!1,n.type==="rest"?(n.url=rs(n.url),n.method=n.method||"GET",n.headers=n.headers||{},n.params=n.params||{},n.body=n.body||{},n.pollInterval=Oe(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3,n.timeout=Oe(n.timeout)?Math.round(n.timeout):a.timeout??1e3):n.type==="websocket"?(n.url=ns(n.url),n.heartbeat&&typeof n.heartbeat=="object"&&(n.heartbeat.interval=Oe(n.heartbeat.interval)?Math.round(n.heartbeat.interval):a.heartbeatInterval??1e3,n.heartbeat.message=n.heartbeat.message??{}),n.pollInterval=Oe(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3):n.type==="static"?n.value=n.value??{}:n.type==="function"&&(n.code=typeof n.code=="string"?n.code:"export default async function(ctx){ return null }",n.timeout=Oe(n.timeout)?Math.round(n.timeout):a.timeout??1e3),n},ss=e=>bt(e)?{ok:!0}:{ok:!1,errors:bt.errors||[]},Nn=(e,t)=>{const a=is(e,t);return bt(a)?{ok:!0,value:a}:{ok:!1,errors:bt.errors||[]}},os=(e,t)=>{const a=Nn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},wt=$e("#/definitions/ComponentInstance"),as=(e,t)=>{const a={...e};if(t?.generateId&&!a.id&&(a.id=Qt()),!a.role)throw new Error("role is required");if(a.role==="view"){if(!a.component)throw new Error("component is required for view");delete a.children}else if(a.role==="container"){if(!Array.isArray(a.children))throw new Error("children is required for container");delete a.component}else if(a.role==="logic"){if(!a.component)throw new Error("component is required for logic");delete a.children}return a},cs=e=>wt(e)?{ok:!0}:{ok:!1,errors:wt.errors||[]},Rn=(e,t)=>{const a=as(e,t);return wt(a)?{ok:!0,value:a}:{ok:!1,errors:wt.errors||[]}},ds=(e,t)=>{const a=Rn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Pt=$e("#/definitions/CICPage"),us=(e,t)=>{const a={...e};return t?.generateId&&!a.id&&(a.id=Qt()),a},ls=e=>Pt(e)?{ok:!0}:{ok:!1,errors:Pt.errors||[]},On=(e,t)=>{const a=us(e,t);return Pt(a)?{ok:!0,value:a}:{ok:!1,errors:Pt.errors||[]}},fs=(e,t)=>{const a=On(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Et=$e("#/definitions/MetaInfo"),St=$e("#/definitions/LayoutConfig"),ps=e=>Et(e)?{ok:!0}:{ok:!1,errors:Et.errors||[]},ms=e=>St(e)?{ok:!0}:{ok:!1,errors:St.errors||[]},qn=e=>Et(e)?{ok:!0,value:e}:{ok:!1,errors:Et.errors||[]},Cn=e=>St(e)?{ok:!0,value:e}:{ok:!1,errors:St.errors||[]},hs=e=>{const t=qn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},ys=e=>{const t=Cn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},jt=$e("#/definitions/Variables"),gs=e=>jt(e)?{ok:!0}:{ok:!1,errors:jt.errors||[]},Tn=e=>jt(e)?{ok:!0,value:e}:{ok:!1,errors:jt.errors||[]},vs=e=>{const t=Tn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},kt=$e("#/definitions/Dependency"),_s=e=>kt(e)?{ok:!0}:{ok:!1,errors:kt.errors||[]},Dn=e=>kt(e)?{ok:!0,value:e}:{ok:!1,errors:kt.errors||[]},$s=e=>{const t=Dn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},It=$e("#/definitions/RegistryComponents"),bs=e=>It(e)?{ok:!0}:{ok:!1,errors:It.errors||[]},Mn=e=>It(e)?{ok:!0,value:e}:{ok:!1,errors:It.errors||[]},ws=e=>{const t=Mn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value};class ce{config;static validator;static validate;static schemaHash;constructor(t){const a=ce.validateConfig(t);if(!a.valid)throw new Error(`Invalid CIC Configuration: ${a.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let a;return this.walkComponents(n=>n.id===t?(a=n,!1):!0),a}findPageByComponent(t){let a;return this.walkComponents((n,v)=>n.id===t?(a=v,!1):!0),a}getVariable(t,a){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const v=n.component[t.componentId][a];if(v)return v.value??v.default}if(t.pageId&&n.page&&n.page[t.pageId]){const v=n.page[t.pageId][a];if(v)return v.value??v.default}if(n.global&&n.global[a]){const v=n.global[a];return v.value??v.default}}}getVariableByRef(t){const a=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!a)return;const[,n,v,i]=a;if(n==="global")return this.getVariable({},i);if(n==="page")return this.getVariable({pageId:v},i);if(n==="component")return this.getVariable({componentId:v},i)}walkComponents(t){if(this.config.pages)for(const a of this.config.pages){const n=[];for(const i of a.components||[])n.push({node:i});let v=!1;for(;n.length>0&&!v;){const{node:i,parent:p}=n.pop();if(t(i,a,p)===!1){v=!0;break}if(i.children&&i.children.length>0)for(let m=i.children.length-1;m>=0;m--)n.push({node:i.children[m],parent:i})}if(v)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const a=JSON.stringify($t);return(!ce.validator||ce.schemaHash!==a)&&(ce.validator=new kn({allErrors:!0,strict:!1}),In(ce.validator),ce.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),ce.validate=ce.validator.compile($t),ce.schemaHash=a),ce.validate(t)?{valid:!0}:{valid:!1,error:ce.validate.errors.map(i=>`${i.instancePath} ${i.message}`).join("; ")}}static getValueByPath(t,a,n){if(t==null||!a)return n;const v=[];a.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&v.push(p.trim())});let i=t;for(const p of v){if(i==null)return n;i=i[p]}return i===void 0?n:i}static traverseTree(t,a,n){const v=Array.isArray(t)?t:[t];for(const i of v)a(i,n)!==!1&&i.children&&i.children.length>0&&ce.traverseTree(i.children,a,i)}static createDataSource=Nn;static validateDataSource=ss;static normalizeDataSource=os;static createComponent=Rn;static validateComponent=cs;static normalizeComponent=ds;static createPage=On;static validatePage=ls;static normalizePage=fs;static createMeta=qn;static createLayout=Cn;static validateMeta=ps;static validateLayout=ms;static normalizeMeta=hs;static normalizeLayout=ys;static createVariables=Tn;static validateVariables=gs;static normalizeVariables=vs;static createDependency=Dn;static validateDependency=_s;static normalizeDependency=$s;static createRegistryComponent=Mn;static validateRegistryComponent=bs;static normalizeRegistryComponent=ws}exports.CICSDK=ce;
|
|
8
|
+
deps: ${_}}`};const y={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[b,_]=i(m);p(m,b),u(m,_)}};function i({schema:m}){const b={},_={};for(const S in m){if(S==="__proto__")continue;const $=Array.isArray(m[S])?b:_;$[S]=m[S]}return[b,_]}function p(m,b=m.schema){const{gen:_,data:S,it:$}=m;if(Object.keys(b).length===0)return;const g=_.let("missing");for(const v in b){const w=b[v];if(w.length===0)continue;const c=(0,n.propertyInData)(_,S,v,$.opts.ownProperties);m.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const d of w)(0,n.checkReportMissingProp)(m,d)}):(_.if((0,t._)`${c} && (${(0,n.checkMissingProp)(m,w,g)})`),(0,n.reportMissingProp)(m,g),_.else())}}e.validatePropertyDeps=p;function u(m,b=m.schema){const{gen:_,data:S,keyword:$,it:g}=m,v=_.name("valid");for(const w in b)(0,a.alwaysValidSchema)(g,b[w])||(_.if((0,n.propertyInData)(_,S,w,g.opts.ownProperties),()=>{const c=m.subschema({keyword:$,schemaProp:w},v);m.mergeValidEvaluated(c,v)},()=>_.var(v,!0)),m.ok(v))}e.validateSchemaDeps=u,e.default=y})(Jt)),Jt}var it={},Zr;function wi(){if(Zr)return it;Zr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:y})=>(0,e._)`{propertyName: ${y.propertyName}}`},code(y){const{gen:i,schema:p,data:u,it:m}=y;if((0,t.alwaysValidSchema)(m,p))return;const b=i.name("valid");i.forIn("key",u,_=>{y.setParams({propertyName:_}),y.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),i.if((0,e.not)(b),()=>{y.error(!0),m.allErrors||i.break()})}),y.ok(b)}};return it.default=n,it}var st={},Qr;function Sn(){if(Qr)return st;Qr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=me(),t=J(),a=_e(),n=Y(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:p})=>(0,t._)`{additionalProperty: ${p.additionalProperty}}`},code(p){const{gen:u,schema:m,parentSchema:b,data:_,errsCount:S,it:$}=p;if(!S)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=$;if($.props=!0,v.removeAdditional!=="all"&&(0,n.alwaysValidSchema)($,m))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);d(),p.ok((0,t._)`${S} === ${a.default.errors}`);function d(){u.forIn("key",_,f=>{!w.length&&!c.length?h(f):u.if(r(f),()=>h(f))})}function r(f){let P;if(w.length>8){const N=(0,n.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(u,N,f)}else w.length?P=(0,t.or)(...w.map(N=>(0,t._)`${f} === ${N}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(N=>(0,t._)`${(0,e.usePattern)(p,N)}.test(${f})`))),(0,t.not)(P)}function o(f){u.code((0,t._)`delete ${_}[${f}]`)}function h(f){if(v.removeAdditional==="all"||v.removeAdditional&&m===!1){o(f);return}if(m===!1){p.setParams({additionalProperty:f}),p.error(),g||u.break();return}if(typeof m=="object"&&!(0,n.alwaysValidSchema)($,m)){const P=u.name("valid");v.removeAdditional==="failing"?(s(f,P,!1),u.if((0,t.not)(P),()=>{p.reset(),o(f)})):(s(f,P),g||u.if((0,t.not)(P),()=>u.break()))}}function s(f,P,N){const D={keyword:"additionalProperties",dataProp:f,dataPropType:n.Type.Str};N===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return st.default=i,st}var ot={},Xr;function Pi(){if(Xr)return ot;Xr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=qt(),t=me(),a=Y(),n=Sn(),y={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,parentSchema:m,data:b,it:_}=i;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(u);for(const c of S)_.definedProperties.add(c);_.opts.unevaluated&&S.length&&_.props!==!0&&(_.props=a.mergeEvaluated.props(p,(0,a.toHash)(S),_.props));const $=S.filter(c=>!(0,a.alwaysValidSchema)(_,u[c]));if($.length===0)return;const g=p.name("valid");for(const c of $)v(c)?w(c):(p.if((0,t.propertyInData)(p,b,c,_.opts.ownProperties)),w(c),_.allErrors||p.else().var(g,!0),p.endIf()),i.it.definedProperties.add(c),i.ok(g);function v(c){return _.opts.useDefaults&&!_.compositeRule&&u[c].default!==void 0}function w(c){i.subschema({keyword:"properties",schemaProp:c,dataProp:c},g)}}};return ot.default=y,ot}var at={},xr;function Ei(){if(xr)return at;xr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=me(),t=J(),a=Y(),n=Y(),y={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,data:m,parentSchema:b,it:_}=i,{opts:S}=_,$=(0,e.allSchemaProperties)(u),g=$.filter(h=>(0,a.alwaysValidSchema)(_,u[h]));if($.length===0||g.length===$.length&&(!_.opts.unevaluated||_.props===!0))return;const v=S.strictSchema&&!S.allowMatchingProperties&&b.properties,w=p.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(p,_.props));const{props:c}=_;d();function d(){for(const h of $)v&&r(h),_.allErrors?o(h):(p.var(w,!0),o(h),p.if(w))}function r(h){for(const s in v)new RegExp(h).test(s)&&(0,a.checkStrictMode)(_,`property ${s} matches pattern ${h} (use allowMatchingProperties)`)}function o(h){p.forIn("key",m,s=>{p.if((0,t._)`${(0,e.usePattern)(i,h)}.test(${s})`,()=>{const f=g.includes(h);f||i.subschema({keyword:"patternProperties",schemaProp:h,dataProp:s,dataPropType:n.Type.Str},w),_.opts.unevaluated&&c!==!0?p.assign((0,t._)`${c}[${s}]`,!0):!f&&!_.allErrors&&p.if((0,t.not)(w),()=>p.break())})})}}};return at.default=y,at}var ct={},en;function Si(){if(en)return ct;en=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(a){const{gen:n,schema:y,it:i}=a;if((0,e.alwaysValidSchema)(i,y)){a.fail();return}const p=n.name("valid");a.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),a.failResult(p,()=>a.reset(),()=>a.error())},error:{message:"must NOT be valid"}};return ct.default=t,ct}var dt={},tn;function ji(){if(tn)return dt;tn=1,Object.defineProperty(dt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:me().validateUnion,error:{message:"must match a schema in anyOf"}};return dt.default=t,dt}var ut={},rn;function ki(){if(rn)return ut;rn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:y})=>(0,e._)`{passingSchemas: ${y.passing}}`},code(y){const{gen:i,schema:p,parentSchema:u,it:m}=y;if(!Array.isArray(p))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const b=p,_=i.let("valid",!1),S=i.let("passing",null),$=i.name("_valid");y.setParams({passing:S}),i.block(g),y.result(_,()=>y.reset(),()=>y.error(!0));function g(){b.forEach((v,w)=>{let c;(0,t.alwaysValidSchema)(m,v)?i.var($,!0):c=y.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&i.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),i.if($,()=>{i.assign(_,!0),i.assign(S,w),c&&y.mergeEvaluated(c,e.Name)})})}}};return ut.default=n,ut}var lt={},nn;function Ii(){if(nn)return lt;nn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(a){const{gen:n,schema:y,it:i}=a;if(!Array.isArray(y))throw new Error("ajv implementation error");const p=n.name("valid");y.forEach((u,m)=>{if((0,e.alwaysValidSchema)(i,u))return;const b=a.subschema({keyword:"allOf",schemaProp:m},p);a.ok(p),a.mergeEvaluated(b)})}};return lt.default=t,lt}var ft={},sn;function Ri(){if(sn)return ft;sn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=J(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:p,parentSchema:u,it:m}=i;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const b=y(m,"then"),_=y(m,"else");if(!b&&!_)return;const S=p.let("valid",!0),$=p.name("_valid");if(g(),i.reset(),b&&_){const w=p.let("ifClause");i.setParams({ifClause:w}),p.if($,v("then",w),v("else",w))}else b?p.if($,v("then")):p.if((0,e.not)($),v("else"));i.pass(S,()=>i.error(!0));function g(){const w=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);i.mergeEvaluated(w)}function v(w,c){return()=>{const d=i.subschema({keyword:w},$);p.assign(S,$),i.mergeValidEvaluated(d,S),c?p.assign(c,(0,e._)`${w}`):i.setParams({ifClause:w})}}}};function y(i,p){const u=i.schema[p];return u!==void 0&&!(0,t.alwaysValidSchema)(i,u)}return ft.default=n,ft}var pt={},on;function Ni(){if(on)return pt;on=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:a,parentSchema:n,it:y}){n.if===void 0&&(0,e.checkStrictMode)(y,`"${a}" without "if" is ignored`)}};return pt.default=t,pt}var an;function Oi(){if(an)return et;an=1,Object.defineProperty(et,"__esModule",{value:!0});const e=Pn(),t=vi(),a=En(),n=_i(),y=$i(),i=bi(),p=wi(),u=Sn(),m=Pi(),b=Ei(),_=Si(),S=ji(),$=ki(),g=Ii(),v=Ri(),w=Ni();function c(d=!1){const r=[_.default,S.default,$.default,g.default,v.default,w.default,p.default,u.default,i.default,m.default,b.default];return d?r.push(t.default,n.default):r.push(e.default,a.default),r.push(y.default),r}return et.default=c,et}var mt={},ht={},cn;function qi(){if(cn)return ht;cn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=J(),a={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,y){const{gen:i,data:p,$data:u,schema:m,schemaCode:b,it:_}=n,{opts:S,errSchemaPath:$,schemaEnv:g,self:v}=_;if(!S.validateFormats)return;u?w():c();function w(){const d=i.scopeValue("formats",{ref:v.formats,code:S.code.formats}),r=i.const("fDef",(0,e._)`${d}[${b}]`),o=i.let("fType"),h=i.let("format");i.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>i.assign(o,(0,e._)`${r}.type || "string"`).assign(h,(0,e._)`${r}.validate`),()=>i.assign(o,(0,e._)`"string"`).assign(h,r)),n.fail$data((0,e.or)(s(),f()));function s(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${h}`}function f(){const P=g.$async?(0,e._)`(${r}.async ? await ${h}(${p}) : ${h}(${p}))`:(0,e._)`${h}(${p})`,N=(0,e._)`(typeof ${h} == "function" ? ${P} : ${h}.test(${p}))`;return(0,e._)`${h} && ${h} !== true && ${o} === ${y} && !${N}`}}function c(){const d=v.formats[m];if(!d){s();return}if(d===!0)return;const[r,o,h]=f(d);r===y&&n.pass(P());function s(){if(S.strictSchema===!1){v.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function f(N){const D=N instanceof RegExp?(0,e.regexpCode)(N):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(m)}`:void 0,z=i.scopeValue("formats",{key:m,ref:N,code:D});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${z}.validate`]:["string",N,z]}function P(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${h}(${p})`}return typeof o=="function"?(0,e._)`${h}(${p})`:(0,e._)`${h}.test(${p})`}}}};return ht.default=a,ht}var dn;function Ci(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const t=[qi().default];return mt.default=t,mt}var we={},un;function Ti(){return un||(un=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var ln;function Di(){if(ln)return Ve;ln=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=si(),t=gi(),a=Oi(),n=Ci(),y=Ti(),i=[e.default,t.default,(0,a.default)(),n.default,y.metadataVocabulary,y.contentVocabulary];return Ve.default=i,Ve}var yt={},Ne={},fn;function Mi(){if(fn)return Ne;fn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Ne.DiscrError=e={})),Ne}var pn;function Ai(){if(pn)return yt;pn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=J(),t=Mi(),a=Zt(),n=Ct(),y=Y(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:b}})=>(0,e._)`{error: ${u}, tag: ${b}, tagValue: ${m}}`},code(u){const{gen:m,data:b,schema:_,parentSchema:S,it:$}=u,{oneOf:g}=S;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=_.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),c=m.const("tag",(0,e._)`${b}${(0,e.getProperty)(v)}`);m.if((0,e._)`typeof ${c} == "string"`,()=>d(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:v})),u.ok(w);function d(){const h=o();m.if(!1);for(const s in h)m.elseIf((0,e._)`${c} === ${s}`),m.assign(w,r(h[s]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:v}),m.endIf()}function r(h){const s=m.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:h},s);return u.mergeEvaluated(f,e.Name),s}function o(){var h;const s={},f=N(S);let P=!0;for(let q=0;q<g.length;q++){let V=g[q];if(V?.$ref&&!(0,y.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=a.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof a.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default($.opts.uriResolver,$.baseId,L)}const F=(h=V?.properties)===null||h===void 0?void 0:h[v];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);P=P&&(f||N(V)),D(F,q)}if(!P)throw new Error(`discriminator: "${v}" must be required`);return s;function N({required:q}){return Array.isArray(q)&&q.includes(v)}function D(q,V){if(q.const)z(q.const,V);else if(q.enum)for(const F of q.enum)z(F,V);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function z(q,V){if(typeof q!="string"||q in s)throw new Error(`discriminator: "${v}" values must be unique strings`);s[q]=V}}}};return yt.default=p,yt}const Vi="http://json-schema.org/draft-07/schema#",zi="http://json-schema.org/draft-07/schema#",Fi="Core schema meta-schema",Li={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ui=["object","boolean"],Ki={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Hi={$schema:Vi,$id:zi,title:Fi,definitions:Li,type:Ui,properties:Ki,default:!0};var mn;function jn(){return mn||(mn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const a=ri(),n=Di(),y=Ai(),i=Hi,p=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends a.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(y.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(i,p):i;this.addMetaSchema(v,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var b=qt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=J();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var S=Yt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var $=Ct();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(Ce,Ce.exports)),Ce.exports}var Gi=jn();const kn=vn(Gi);var gt={exports:{}},Wt={},hn;function Ji(){return hn||(hn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(q,V){return{validate:q,compare:V}}e.fullFormats={date:t(i,p),time:t(m(!0),b),"date-time":t($(!0),g),"iso-time":t(m(),_),"iso-date-time":t($(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:o,int32:{type:"number",validate:f},int64:{type:"number",validate:P},float:{type:"number",validate:N},double:{type:"number",validate:N},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function a(q){return q%4===0&&(q%100!==0||q%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,y=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(q){const V=n.exec(q);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&a(F)?29:y[L])}function p(q,V){if(q&&V)return q>V?1:q<V?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(q){return function(F){const L=u.exec(F);if(!L)return!1;const Q=+L[1],ne=+L[2],ie=+L[3],x=L[4],le=L[5]==="-"?-1:1,M=+(L[6]||0),k=+(L[7]||0);if(M>23||k>59||q&&!x)return!1;if(Q<=23&&ne<=59&&ie<60)return!0;const T=ne-k*le,R=Q-M*le-(T<0?1:0);return(R===23||R===-1)&&(T===59||T===-1)&&ie<61}}function b(q,V){if(!(q&&V))return;const F=new Date("2020-01-01T"+q).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function _(q,V){if(!(q&&V))return;const F=u.exec(q),L=u.exec(V);if(F&&L)return q=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],q>V?1:q<V?-1:0}const S=/t|\s/i;function $(q){const V=m(q);return function(L){const Q=L.split(S);return Q.length===2&&i(Q[0])&&V(Q[1])}}function g(q,V){if(!(q&&V))return;const F=new Date(q).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function v(q,V){if(!(q&&V))return;const[F,L]=q.split(S),[Q,ne]=V.split(S),ie=p(F,Q);if(ie!==void 0)return ie||b(L,ne)}const w=/\/|:/,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function d(q){return w.test(q)&&c.test(q)}const r=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function o(q){return r.lastIndex=0,r.test(q)}const h=-2147483648,s=2**31-1;function f(q){return Number.isInteger(q)&&q<=s&&q>=h}function P(q){return Number.isInteger(q)}function N(){return!0}const D=/[^\\]\\Z/;function z(q){if(D.test(q))return!1;try{return new RegExp(q),!0}catch{return!1}}})(Wt)),Wt}var Bt={},yn;function Wi(){return yn||(yn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=jn(),a=J(),n=a.operators,y={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:u,schemaCode:m})=>(0,a.str)`should be ${y[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,a._)`{comparison: ${y[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(y),type:"string",schemaType:"string",$data:!0,error:i,code(u){const{gen:m,data:b,schemaCode:_,keyword:S,it:$}=u,{opts:g,self:v}=$;if(!g.validateFormats)return;const w=new t.KeywordCxt($,v.RULES.all.format.definition,"format");w.$data?c():d();function c(){const o=m.scopeValue("formats",{ref:v.formats,code:g.code.formats}),h=m.const("fmt",(0,a._)`${o}[${w.schemaCode}]`);u.fail$data((0,a.or)((0,a._)`typeof ${h} != "object"`,(0,a._)`${h} instanceof RegExp`,(0,a._)`typeof ${h}.compare != "function"`,r(h)))}function d(){const o=w.schema,h=v.formats[o];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${S}": format "${o}" does not define "compare" function`);const s=m.scopeValue("formats",{key:o,ref:h,code:g.code.formats?(0,a._)`${g.code.formats}${(0,a.getProperty)(o)}`:void 0});u.fail$data(r(s))}function r(o){return(0,a._)`${o}.compare(${b}, ${_}) ${y[S].fail} 0`}},dependencies:["format"]};const p=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=p})(Bt)),Bt}var gn;function Bi(){return gn||(gn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a=Ji(),n=Wi(),y=J(),i=new y.Name("fullFormats"),p=new y.Name("fastFormats"),u=(b,_={keywords:!0})=>{if(Array.isArray(_))return m(b,_,a.fullFormats,i),b;const[S,$]=_.mode==="fast"?[a.fastFormats,p]:[a.fullFormats,i],g=_.formats||a.formatNames;return m(b,g,S,$),_.keywords&&(0,n.default)(b),b};u.get=(b,_="full")=>{const $=(_==="fast"?a.fastFormats:a.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function m(b,_,S,$){var g,v;(g=(v=b.opts.code).formats)!==null&&g!==void 0||(v.formats=(0,y._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,S[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(gt,gt.exports)),gt.exports}var Yi=Bi();const In=vn(Yi),Zi="http://json-schema.org/draft-07/schema#",Qi="#/definitions/CICConfig",Xi=JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"required":["global","page","component"],"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}'),qe={$schema:Zi,$ref:Qi,definitions:Xi};let vt=null;const Rn=()=>(vt||(vt=new kn({allErrors:!0,strict:!1}),In(vt)),vt),bt=new Map,Nn=JSON.stringify(qe),xi={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},On=(e,t)=>e.compile({$ref:t,definitions:qe.definitions,properties:qe.properties}),es=e=>{const t=Rn(),a=`${e}::${Nn}`,n=bt.get(a);if(n)return n;const y=On(t,e);return bt.set(a,y),y},Pe=e=>{const t=Rn(),a=`type:${e}::${Nn}`,n=bt.get(a);if(n)return n;const y=xi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const i of y)try{const p=On(t,i);return bt.set(a,p),p}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Oe=e=>typeof e=="number"&&isFinite(e)&&e>0,Xt=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const a=Array.from(t,n=>n.toString(16).padStart(2,"0"));return`${a[0]}${a[1]}${a[2]}${a[3]}-${a[4]}${a[5]}-${a[6]}${a[7]}-${a[8]}${a[9]}-${a[10]}${a[11]}${a[12]}${a[13]}${a[14]}${a[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const a=Math.random()*16|0;return(t==="x"?a:a&3|8).toString(16)})},ts=(e,t="https://example.com/resource")=>typeof e=="string"&&/^https?:\/\//.test(e)?e:t,rs=(e,t="wss://example.com/socket")=>typeof e=="string"&&/^wss?:\/\//.test(e)?e:t,wt=Pe("DataSourceItem"),ns=(e,t)=>{const a={...t?.defaults||{}},n={...e};if(t?.generateId&&!n.id&&(n.id=Xt()),!n.type)throw new Error("type is required");return n.continueOnError=typeof n.continueOnError=="boolean"?n.continueOnError:a.continueOnError??!1,n.type==="rest"?(n.url=ts(n.url),n.method=n.method||"GET",n.headers=n.headers||{},n.params=n.params||{},n.body=n.body||{},n.pollInterval=Oe(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3,n.timeout=Oe(n.timeout)?Math.round(n.timeout):a.timeout??1e3):n.type==="websocket"?(n.url=rs(n.url),n.heartbeat&&typeof n.heartbeat=="object"&&(n.heartbeat.interval=Oe(n.heartbeat.interval)?Math.round(n.heartbeat.interval):a.heartbeatInterval??1e3,n.heartbeat.message=n.heartbeat.message??{}),n.pollInterval=Oe(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3):n.type==="static"?n.value=n.value??{}:n.type==="function"&&(n.code=typeof n.code=="string"?n.code:"export default async function(ctx){ return null }",n.timeout=Oe(n.timeout)?Math.round(n.timeout):a.timeout??1e3),n},is=e=>wt(e)?{ok:!0}:{ok:!1,errors:wt.errors||[]},qn=(e,t)=>{const a=ns(e,t);return wt(a)?{ok:!0,value:a}:{ok:!1,errors:wt.errors||[]}},ss=(e,t)=>{const a=qn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Pt=Pe("ComponentInstance"),os=(e,t)=>{const a={...e};if(t?.generateId&&!a.id&&(a.id=Xt()),!a.role)throw new Error("role is required");if(a.role==="view"){if(!a.component)throw new Error("component is required for view");delete a.children}else if(a.role==="container"){if(!Array.isArray(a.children))throw new Error("children is required for container");delete a.component}else if(a.role==="logic"){if(!a.component)throw new Error("component is required for logic");delete a.children}return a},as=e=>Pt(e)?{ok:!0}:{ok:!1,errors:Pt.errors||[]},Cn=(e,t)=>{const a=os(e,t);return Pt(a)?{ok:!0,value:a}:{ok:!1,errors:Pt.errors||[]}},cs=(e,t)=>{const a=Cn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Et=Pe("CICPage"),ds=(e,t)=>{const a={...e};return t?.generateId&&!a.id&&(a.id=Xt()),a},us=e=>Et(e)?{ok:!0}:{ok:!1,errors:Et.errors||[]},Tn=(e,t)=>{const a=ds(e,t);return Et(a)?{ok:!0,value:a}:{ok:!1,errors:Et.errors||[]}},ls=(e,t)=>{const a=Tn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},St=Pe("Meta"),jt=Pe("Layout"),fs=e=>St(e)?{ok:!0}:{ok:!1,errors:St.errors||[]},ps=e=>jt(e)?{ok:!0}:{ok:!1,errors:jt.errors||[]},Dn=e=>St(e)?{ok:!0,value:e}:{ok:!1,errors:St.errors||[]},Mn=e=>jt(e)?{ok:!0,value:e}:{ok:!1,errors:jt.errors||[]},ms=e=>{const t=Dn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},hs=e=>{const t=Mn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},kt=es("#/definitions/Variables"),ys=e=>kt(e)?{ok:!0}:{ok:!1,errors:kt.errors||[]},An=e=>kt(e)?{ok:!0,value:e}:{ok:!1,errors:kt.errors||[]},gs=e=>{const t=An(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},It=Pe("Dependency"),vs=e=>It(e)?{ok:!0}:{ok:!1,errors:It.errors||[]},Vn=e=>It(e)?{ok:!0,value:e}:{ok:!1,errors:It.errors||[]},_s=e=>{const t=Vn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Rt=Pe("RegistryComponents"),$s=e=>Rt(e)?{ok:!0}:{ok:!1,errors:Rt.errors||[]},zn=e=>Rt(e)?{ok:!0,value:e}:{ok:!1,errors:Rt.errors||[]},bs=e=>{const t=zn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value};class ce{config;static validator;static validate;static schemaHash;constructor(t){const a=ce.validateConfig(t);if(!a.valid)throw new Error(`Invalid CIC Configuration: ${a.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let a;return this.walkComponents(n=>n.id===t?(a=n,!1):!0),a}findPageByComponent(t){let a;return this.walkComponents((n,y)=>n.id===t?(a=y,!1):!0),a}getVariable(t,a){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const y=n.component[t.componentId][a];if(y)return y.value??y.default}if(t.pageId&&n.page&&n.page[t.pageId]){const y=n.page[t.pageId][a];if(y)return y.value??y.default}if(n.global&&n.global[a]){const y=n.global[a];return y.value??y.default}}}getVariableByRef(t){const a=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!a)return;const[,n,y,i]=a;if(n==="global")return this.getVariable({},i);if(n==="page")return this.getVariable({pageId:y},i);if(n==="component")return this.getVariable({componentId:y},i)}walkComponents(t){if(this.config.pages)for(const a of this.config.pages){const n=[];for(const i of a.components||[])n.push({node:i});let y=!1;for(;n.length>0&&!y;){const{node:i,parent:p}=n.pop();if(t(i,a,p)===!1){y=!0;break}if(i.children&&i.children.length>0)for(let m=i.children.length-1;m>=0;m--)n.push({node:i.children[m],parent:i})}if(y)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const a=JSON.stringify(qe);return(!ce.validator||ce.schemaHash!==a)&&(ce.validator=new kn({allErrors:!0,strict:!1}),In(ce.validator),ce.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),ce.validate=ce.validator.compile(qe),ce.schemaHash=a),ce.validate(t)?{valid:!0}:{valid:!1,error:ce.validate.errors.map(i=>`${i.instancePath} ${i.message}`).join("; ")}}static getValueByPath(t,a,n){if(t==null||!a)return n;const y=[];a.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&y.push(p.trim())});let i=t;for(const p of y){if(i==null)return n;i=i[p]}return i===void 0?n:i}static traverseTree(t,a,n){const y=Array.isArray(t)?t:[t];for(const i of y)a(i,n)!==!1&&i.children&&i.children.length>0&&ce.traverseTree(i.children,a,i)}static createDataSource=qn;static validateDataSource=is;static normalizeDataSource=ss;static createComponent=Cn;static validateComponent=as;static normalizeComponent=cs;static createPage=Tn;static validatePage=us;static normalizePage=ls;static createMeta=Dn;static createLayout=Mn;static validateMeta=fs;static validateLayout=ps;static normalizeMeta=ms;static normalizeLayout=hs;static createVariables=An;static validateVariables=ys;static normalizeVariables=gs;static createDependency=Vn;static validateDependency=vs;static normalizeDependency=_s;static createRegistryComponent=zn;static validateRegistryComponent=$s;static normalizeRegistryComponent=bs}exports.CICSDK=ce;
|