@anov/cic-standard-sdk 0.0.18 → 0.0.19

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.
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Le={exports:{}},Ut={},ve={},Ee={},Kt={},Jt={},Ht={},lr;function kt(){return lr||(lr=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 r extends t{constructor(o){if(super(),!e.IDENTIFIER.test(o))throw new Error("CodeGen: name must be a valid identifier");this.str=o}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(o){super(),this._items=typeof o=="string"?[o]:o}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const o=this._items[0];return o===""||o==='""'}get str(){var o;return(o=this._str)!==null&&o!==void 0?o:this._str=this._items.reduce((l,y)=>`${l}${y}`,"")}get names(){var o;return(o=this._names)!==null&&o!==void 0?o:this._names=this._items.reduce((l,y)=>(y instanceof r&&(l[y.str]=(l[y.str]||0)+1),l),{})}}e._Code=n,e.nil=new n("");function a(p,...o){const l=[p[0]];let y=0;for(;y<o.length;)i(l,o[y]),l.push(p[++y]);return new n(l)}e._=a;const s=new n("+");function d(p,...o){const l=[g(p[0])];let y=0;for(;y<o.length;)l.push(s),i(l,o[y]),l.push(s,g(p[++y]));return u(l),new n(l)}e.str=d;function i(p,o){o instanceof n?p.push(...o._items):o instanceof r?p.push(o):p.push(E(o))}e.addCodeArg=i;function u(p){let o=1;for(;o<p.length-1;){if(p[o]===s){const l=$(p[o-1],p[o+1]);if(l!==void 0){p.splice(o-1,3,l);continue}p[o++]="+"}o++}}function $(p,o){if(o==='""')return p;if(p==='""')return o;if(typeof p=="string")return o instanceof r||p[p.length-1]!=='"'?void 0:typeof o!="string"?`${p.slice(0,-1)}${o}"`:o[0]==='"'?p.slice(0,-1)+o.slice(1):void 0;if(typeof o=="string"&&o[0]==='"'&&!(p instanceof r))return`"${p}${o.slice(1)}`}function _(p,o){return o.emptyStr()?p:p.emptyStr()?o:d`${p}${o}`}e.strConcat=_;function E(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:g(Array.isArray(p)?p.join(","):p)}function v(p){return new n(g(p))}e.stringify=v;function g(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function b(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):a`[${p}]`}e.getProperty=b;function w(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=w;function f(p){return new n(p.toString())}e.regexpCode=f})(Ht)),Ht}var Gt={},fr;function pr(){return fr||(fr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=kt();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var n;(function(u){u[u.Started=0]="Started",u[u.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 a{constructor({prefixes:$,parent:_}={}){this._names={},this._prefixes=$,this._parent=_}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const _=this._names[$]||this._nameGroup($);return`${$}${_.index++}`}_nameGroup($){var _,E;if(!((E=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||E===void 0)&&E.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=a;class s extends t.Name{constructor($,_){super(_),this.prefix=$}setValue($,{property:_,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(_)}[${E}]`}}e.ValueScopeName=s;const d=(0,t._)`\n`;class i extends a{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?d:t.nil}}get(){return this._scope}name($){return new s($,this._newName($))}value($,_){var E;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:g}=v,b=(E=_.key)!==null&&E!==void 0?E:_.ref;let w=this._values[g];if(w){const o=w.get(b);if(o)return o}else w=this._values[g]=new Map;w.set(b,v);const f=this._scope[g]||(this._scope[g]=[]),p=f.length;return f[p]=_.ref,v.setValue(_,{property:g,itemIndex:p}),v}getValue($,_){const E=this._values[$];if(E)return E.get(_)}scopeRefs($,_=this._values){return this._reduceValues(_,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,_,E){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},_,E)}_reduceValues($,_,E={},v){let g=t.nil;for(const b in $){const w=$[b];if(!w)continue;const f=E[b]=E[b]||new Map;w.forEach(p=>{if(f.has(p))return;f.set(p,n.Started);let o=_(p);if(o){const l=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${l} ${p} = ${o};${this.opts._n}`}else if(o=v?.(p))g=(0,t._)`${g}${o}${this.opts._n}`;else throw new r(p);f.set(p,n.Completed)})}return g}}e.ValueScope=i})(Gt)),Gt}var mr;function G(){return mr||(mr=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=kt(),r=pr();var n=kt();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 a=pr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.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 s{optimizeNodes(){return this}optimizeNames(m,S){return this}}class d extends s{constructor(m,S,N){super(),this.varKind=m,this.name=S,this.rhs=N}render({es5:m,_n:S}){const N=m?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${U};`+S}optimizeNames(m,S){if(m[this.name.str])return this.rhs&&(this.rhs=F(this.rhs,m,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends s{constructor(m,S,N){super(),this.lhs=m,this.rhs=S,this.sideEffects=N}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,S){if(!(this.lhs instanceof t.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=F(this.rhs,m,S),this}get names(){const m=this.lhs instanceof t.Name?{}:{...this.lhs.names};return L(m,this.rhs)}}class u extends i{constructor(m,S,N,U){super(m,N,U),this.op=S}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class $ extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class _ extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class E extends s{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class v extends s{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,S){return this.code=F(this.code,m,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends s{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((S,N)=>S+N.render(m),"")}optimizeNodes(){const{nodes:m}=this;let S=m.length;for(;S--;){const N=m[S].optimizeNodes();Array.isArray(N)?m.splice(S,1,...N):N?m[S]=N:m.splice(S,1)}return m.length>0?this:void 0}optimizeNames(m,S){const{nodes:N}=this;let U=N.length;for(;U--;){const J=N[U];J.optimizeNames(m,S)||(Q(m,J.names),N.splice(U,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((m,S)=>V(m,S.names),{})}}class b extends g{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class w extends g{}class f extends b{}f.kind="else";class p extends b{constructor(m,S){super(S),this.condition=m}render(m){let S=`if(${this.condition})`+super.render(m);return this.else&&(S+="else "+this.else.render(m)),S}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let S=this.else;if(S){const N=S.optimizeNodes();S=this.else=Array.isArray(N)?new f(N):N}if(S)return m===!1?S instanceof p?S:S.nodes:this.nodes.length?this:new p(ie(m),S instanceof p?[S]:S.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,S){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(m,S),!!(super.optimizeNames(m,S)||this.else))return this.condition=F(this.condition,m,S),this}get names(){const m=super.names;return L(m,this.condition),this.else&&V(m,this.else.names),m}}p.kind="if";class o extends b{}o.kind="for";class l extends o{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iteration=F(this.iteration,m,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends o{constructor(m,S,N,U){super(),this.varKind=m,this.name=S,this.from=N,this.to=U}render(m){const S=m.es5?r.varKinds.var:this.varKind,{name:N,from:U,to:J}=this;return`for(${S} ${N}=${U}; ${N}<${J}; ${N}++)`+super.render(m)}get names(){const m=L(super.names,this.from);return L(m,this.to)}}class c extends o{constructor(m,S,N,U){super(),this.loop=m,this.varKind=S,this.name=N,this.iterable=U}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iterable=F(this.iterable,m,S),this}get names(){return V(super.names,this.iterable.names)}}class h extends b{constructor(m,S,N){super(),this.name=m,this.args=S,this.async=N}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}h.kind="func";class P extends g{render(m){return"return "+super.render(m)}}P.kind="return";class O extends b{render(m){let S="try"+super.render(m);return this.catch&&(S+=this.catch.render(m)),this.finally&&(S+=this.finally.render(m)),S}optimizeNodes(){var m,S;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(m,S){var N,U;return super.optimizeNames(m,S),(N=this.catch)===null||N===void 0||N.optimizeNames(m,S),(U=this.finally)===null||U===void 0||U.optimizeNames(m,S),this}get names(){const m=super.names;return this.catch&&V(m,this.catch.names),this.finally&&V(m,this.finally.names),m}}class T extends b{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}T.kind="catch";class z extends b{render(m){return"finally"+super.render(m)}}z.kind="finally";class C{constructor(m,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
2
- `:""},this._extScope=m,this._scope=new r.Scope({parent:m}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,S){const N=this._extScope.value(m,S);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(m,S){return this._extScope.getValue(m,S)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,S,N,U){const J=this._scope.toName(S);return N!==void 0&&U&&(this._constants[J.str]=N),this._leafNode(new d(m,J,N)),J}const(m,S,N){return this._def(r.varKinds.const,m,S,N)}let(m,S,N){return this._def(r.varKinds.let,m,S,N)}var(m,S,N){return this._def(r.varKinds.var,m,S,N)}assign(m,S,N){return this._leafNode(new i(m,S,N))}add(m,S){return this._leafNode(new u(m,e.operators.ADD,S))}code(m){return typeof m=="function"?m():m!==t.nil&&this._leafNode(new v(m)),this}object(...m){const S=["{"];for(const[N,U]of m)S.length>1&&S.push(","),S.push(N),(N!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(m,S,N){if(this._blockNode(new p(m)),S&&N)this.code(S).else().code(N).endIf();else if(S)this.code(S).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new p(m))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(p,f)}_for(m,S){return this._blockNode(m),S&&this.code(S).endFor(),this}for(m,S){return this._for(new l(m),S)}forRange(m,S,N,U,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const x=this._scope.toName(m);return this._for(new y(J,x,S,N),()=>U(x))}forOf(m,S,N,U=r.varKinds.const){const J=this._scope.toName(m);if(this.opts.es5){const x=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${x}.length`,B=>{this.var(J,(0,t._)`${x}[${B}]`),N(J)})}return this._for(new c("of",U,J,S),()=>N(J))}forIn(m,S,N,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,t._)`Object.keys(${S})`,N);const J=this._scope.toName(m);return this._for(new c("in",U,J,S),()=>N(J))}endFor(){return this._endBlockNode(o)}label(m){return this._leafNode(new $(m))}break(m){return this._leafNode(new _(m))}return(m){const S=new P;if(this._blockNode(S),this.code(m),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(m,S,N){if(!S&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(m),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return N&&(this._currNode=U.finally=new z,this.code(N)),this._endBlockNode(T,z)}throw(m){return this._leafNode(new E(m))}block(m,S){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(S),this}endBlock(m){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-S;if(N<0||m!==void 0&&N!==m)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${m} expected`);return this._nodes.length=S,this}func(m,S=t.nil,N,U){return this._blockNode(new h(m,S,N)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(h)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,S){const N=this._currNode;if(N instanceof m||S&&N instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${m.kind}/${S.kind}`:m.kind}"`)}_elseNode(m){const S=this._currNode;if(!(S instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const S=this._nodes;S[S.length-1]=m}}e.CodeGen=C;function V(I,m){for(const S in m)I[S]=(I[S]||0)+(m[S]||0);return I}function L(I,m){return m instanceof t._CodeOrName?V(I,m.names):I}function F(I,m,S){if(I instanceof t.Name)return N(I);if(!U(I))return I;return new t._Code(I._items.reduce((J,x)=>(x instanceof t.Name&&(x=N(x)),x instanceof t._Code?J.push(...x._items):J.push(x),J),[]));function N(J){const x=S[J.str];return x===void 0||m[J.str]!==1?J:(delete m[J.str],x)}function U(J){return J instanceof t._Code&&J._items.some(x=>x instanceof t.Name&&m[x.str]===1&&S[x.str]!==void 0)}}function Q(I,m){for(const S in m)I[S]=(I[S]||0)-(m[S]||0)}function ie(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${D(I)}`}e.not=ie;const oe=j(e.operators.AND);function X(...I){return I.reduce(oe)}e.and=X;const pe=j(e.operators.OR);function A(...I){return I.reduce(pe)}e.or=A;function j(I){return(m,S)=>m===t.nil?S:S===t.nil?m:(0,t._)`${D(m)} ${I} ${D(S)}`}function D(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(Jt)),Jt}var H={},hr;function Y(){if(hr)return H;hr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=G(),t=kt();function r(c){const h={};for(const P of c)h[P]=!0;return h}H.toHash=r;function n(c,h){return typeof h=="boolean"?h:Object.keys(h).length===0?!0:(a(c,h),!s(h,c.self.RULES.all))}H.alwaysValidSchema=n;function a(c,h=c.schema){const{opts:P,self:O}=c;if(!P.strictSchema||typeof h=="boolean")return;const T=O.RULES.keywords;for(const z in h)T[z]||y(c,`unknown keyword: "${z}"`)}H.checkUnknownRules=a;function s(c,h){if(typeof c=="boolean")return!c;for(const P in c)if(h[P])return!0;return!1}H.schemaHasRules=s;function d(c,h){if(typeof c=="boolean")return!c;for(const P in c)if(P!=="$ref"&&h.all[P])return!0;return!1}H.schemaHasRulesButRef=d;function i({topSchemaRef:c,schemaPath:h},P,O,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${c}${h}${(0,e.getProperty)(O)}`}H.schemaRefOrVal=i;function u(c){return E(decodeURIComponent(c))}H.unescapeFragment=u;function $(c){return encodeURIComponent(_(c))}H.escapeFragment=$;function _(c){return typeof c=="number"?`${c}`:c.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=_;function E(c){return c.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function v(c,h){if(Array.isArray(c))for(const P of c)h(P);else h(c)}H.eachItem=v;function g({mergeNames:c,mergeToName:h,mergeValues:P,resultToName:O}){return(T,z,C,V)=>{const L=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?c(T,z,C):h(T,z,C),C):z instanceof e.Name?(h(T,C,z),z):P(z,C);return V===e.Name&&!(L instanceof e.Name)?O(T,L):L}}H.mergeEvaluated={props:g({mergeNames:(c,h,P)=>c.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>{c.if((0,e._)`${h} === true`,()=>c.assign(P,!0),()=>c.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${h})`))}),mergeToName:(c,h,P)=>c.if((0,e._)`${P} !== true`,()=>{h===!0?c.assign(P,!0):(c.assign(P,(0,e._)`${P} || {}`),w(c,P,h))}),mergeValues:(c,h)=>c===!0?!0:{...c,...h},resultToName:b}),items:g({mergeNames:(c,h,P)=>c.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>c.assign(P,(0,e._)`${h} === true ? true : ${P} > ${h} ? ${P} : ${h}`)),mergeToName:(c,h,P)=>c.if((0,e._)`${P} !== true`,()=>c.assign(P,h===!0?!0:(0,e._)`${P} > ${h} ? ${P} : ${h}`)),mergeValues:(c,h)=>c===!0?!0:Math.max(c,h),resultToName:(c,h)=>c.var("items",h)})};function b(c,h){if(h===!0)return c.var("props",!0);const P=c.var("props",(0,e._)`{}`);return h!==void 0&&w(c,P,h),P}H.evaluatedPropsToName=b;function w(c,h,P){Object.keys(P).forEach(O=>c.assign((0,e._)`${h}${(0,e.getProperty)(O)}`,!0))}H.setEvaluated=w;const f={};function p(c,h){return c.scopeValue("func",{ref:h,code:f[h.code]||(f[h.code]=new t._Code(h.code))})}H.useFunc=p;var o;(function(c){c[c.Num=0]="Num",c[c.Str=1]="Str"})(o||(H.Type=o={}));function l(c,h,P){if(c instanceof e.Name){const O=h===o.Num;return P?O?(0,e._)`"[" + ${c} + "]"`:(0,e._)`"['" + ${c} + "']"`:O?(0,e._)`"/" + ${c}`:(0,e._)`"/" + ${c}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(c).toString():"/"+_(c)}H.getErrorPath=l;function y(c,h,P=c.opts.strictSchema){if(P){if(h=`strict mode: ${h}`,P===!0)throw new Error(h);c.self.logger.warn(h)}}return H.checkStrictMode=y,H}var Fe={},yr;function Se(){if(yr)return Fe;yr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=G(),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 Fe.default=t,Fe}var gr;function Tt(){return gr||(gr=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=G(),r=Y(),n=Se();e.keywordError={message:({keyword:f})=>(0,t.str)`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:p})=>p?(0,t.str)`"${f}" keyword must be ${p} ($data)`:(0,t.str)`"${f}" keyword is invalid ($data)`};function a(f,p=e.keywordError,o,l){const{it:y}=f,{gen:c,compositeRule:h,allErrors:P}=y,O=E(f,p,o);l??(h||P)?u(c,O):$(y,(0,t._)`[${O}]`)}e.reportError=a;function s(f,p=e.keywordError,o){const{it:l}=f,{gen:y,compositeRule:c,allErrors:h}=l,P=E(f,p,o);u(y,P),c||h||$(l,n.default.vErrors)}e.reportExtraError=s;function d(f,p){f.assign(n.default.errors,p),f.if((0,t._)`${n.default.vErrors} !== null`,()=>f.if(p,()=>f.assign((0,t._)`${n.default.vErrors}.length`,p),()=>f.assign(n.default.vErrors,null)))}e.resetErrorsCount=d;function i({gen:f,keyword:p,schemaValue:o,data:l,errsCount:y,it:c}){if(y===void 0)throw new Error("ajv implementation error");const h=f.name("err");f.forRange("i",y,n.default.errors,P=>{f.const(h,(0,t._)`${n.default.vErrors}[${P}]`),f.if((0,t._)`${h}.instancePath === undefined`,()=>f.assign((0,t._)`${h}.instancePath`,(0,t.strConcat)(n.default.instancePath,c.errorPath))),f.assign((0,t._)`${h}.schemaPath`,(0,t.str)`${c.errSchemaPath}/${p}`),c.opts.verbose&&(f.assign((0,t._)`${h}.schema`,o),f.assign((0,t._)`${h}.data`,l))})}e.extendErrors=i;function u(f,p){const o=f.const("err",p);f.if((0,t._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,t._)`[${o}]`),(0,t._)`${n.default.vErrors}.push(${o})`),f.code((0,t._)`${n.default.errors}++`)}function $(f,p){const{gen:o,validateName:l,schemaEnv:y}=f;y.$async?o.throw((0,t._)`new ${f.ValidationError}(${p})`):(o.assign((0,t._)`${l}.errors`,p),o.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 E(f,p,o){const{createErrors:l}=f.it;return l===!1?(0,t._)`{}`:v(f,p,o)}function v(f,p,o={}){const{gen:l,it:y}=f,c=[g(y,o),b(f,o)];return w(f,p,c),l.object(...c)}function g({errorPath:f},{instancePath:p}){const o=p?(0,t.str)`${f}${(0,r.getErrorPath)(p,r.Type.Str)}`:f;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function b({keyword:f,it:{errSchemaPath:p}},{schemaPath:o,parentSchema:l}){let y=l?p:(0,t.str)`${p}/${f}`;return o&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(o,r.Type.Str)}`),[_.schemaPath,y]}function w(f,{params:p,message:o},l){const{keyword:y,data:c,schemaValue:h,it:P}=f,{opts:O,propertyName:T,topSchemaRef:z,schemaPath:C}=P;l.push([_.keyword,y],[_.params,typeof p=="function"?p(f):p||(0,t._)`{}`]),O.messages&&l.push([_.message,typeof o=="function"?o(f):o]),O.verbose&&l.push([_.schema,h],[_.parentSchema,(0,t._)`${z}${C}`],[n.default.data,c]),T&&l.push([_.propertyName,T])}})(Kt)),Kt}var vr;function ys(){if(vr)return Ee;vr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.boolOrEmptySchema=Ee.topBoolOrEmptySchema=void 0;const e=Tt(),t=G(),r=Se(),n={message:"boolean schema is false"};function a(i){const{gen:u,schema:$,validateName:_}=i;$===!1?d(i,!1):typeof $=="object"&&$.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${_}.errors`,null),u.return(!0))}Ee.topBoolOrEmptySchema=a;function s(i,u){const{gen:$,schema:_}=i;_===!1?($.var(u,!1),d(i)):$.var(u,!0)}Ee.boolOrEmptySchema=s;function d(i,u){const{gen:$,data:_}=i,E={gen:$,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(E,n,void 0,u)}return Ee}var se={},ke={},_r;function Cn(){if(_r)return ke;_r=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRules=ke.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(a){return typeof a=="string"&&t.has(a)}ke.isJSONType=r;function n(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=n,ke}var _e={},$r;function qn(){if($r)return _e;$r=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:n,self:a},s){const d=a.RULES.types[s];return d&&d!==!0&&t(n,d)}_e.schemaHasRulesForType=e;function t(n,a){return a.rules.some(s=>r(n,s))}_e.shouldUseGroup=t;function r(n,a){var s;return n[a.keyword]!==void 0||((s=a.definition.implements)===null||s===void 0?void 0:s.some(d=>n[d]!==void 0))}return _e.shouldUseRule=r,_e}var br;function jt(){if(br)return se;br=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=Cn(),t=qn(),r=Tt(),n=G(),a=Y();var s;(function(o){o[o.Correct=0]="Correct",o[o.Wrong=1]="Wrong"})(s||(se.DataType=s={}));function d(o){const l=i(o.type);if(l.includes("null")){if(o.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!l.length&&o.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');o.nullable===!0&&l.push("null")}return l}se.getSchemaTypes=d;function i(o){const l=Array.isArray(o)?o:o?[o]:[];if(l.every(e.isJSONType))return l;throw new Error("type must be JSONType or JSONType[]: "+l.join(","))}se.getJSONTypes=i;function u(o,l){const{gen:y,data:c,opts:h}=o,P=_(l,h.coerceTypes),O=l.length>0&&!(P.length===0&&l.length===1&&(0,t.schemaHasRulesForType)(o,l[0]));if(O){const T=b(l,c,h.strictNumbers,s.Wrong);y.if(T,()=>{P.length?E(o,l,P):f(o)})}return O}se.coerceAndCheckDataType=u;const $=new Set(["string","number","integer","boolean","null"]);function _(o,l){return l?o.filter(y=>$.has(y)||l==="array"&&y==="array"):[]}function E(o,l,y){const{gen:c,data:h,opts:P}=o,O=c.let("dataType",(0,n._)`typeof ${h}`),T=c.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&c.if((0,n._)`${O} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>c.assign(h,(0,n._)`${h}[0]`).assign(O,(0,n._)`typeof ${h}`).if(b(l,h,P.strictNumbers),()=>c.assign(T,h))),c.if((0,n._)`${T} !== undefined`);for(const C of y)($.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);c.else(),f(o),c.endIf(),c.if((0,n._)`${T} !== undefined`,()=>{c.assign(h,T),v(o,T)});function z(C){switch(C){case"string":c.elseIf((0,n._)`${O} == "number" || ${O} == "boolean"`).assign(T,(0,n._)`"" + ${h}`).elseIf((0,n._)`${h} === null`).assign(T,(0,n._)`""`);return;case"number":c.elseIf((0,n._)`${O} == "boolean" || ${h} === null
3
- || (${O} == "string" && ${h} && ${h} == +${h})`).assign(T,(0,n._)`+${h}`);return;case"integer":c.elseIf((0,n._)`${O} === "boolean" || ${h} === null
4
- || (${O} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(T,(0,n._)`+${h}`);return;case"boolean":c.elseIf((0,n._)`${h} === "false" || ${h} === 0 || ${h} === null`).assign(T,!1).elseIf((0,n._)`${h} === "true" || ${h} === 1`).assign(T,!0);return;case"null":c.elseIf((0,n._)`${h} === "" || ${h} === 0 || ${h} === false`),c.assign(T,null);return;case"array":c.elseIf((0,n._)`${O} === "string" || ${O} === "number"
5
- || ${O} === "boolean" || ${h} === null`).assign(T,(0,n._)`[${h}]`)}}}function v({gen:o,parentData:l,parentDataProperty:y},c){o.if((0,n._)`${l} !== undefined`,()=>o.assign((0,n._)`${l}[${y}]`,c))}function g(o,l,y,c=s.Correct){const h=c===s.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(o){case"null":return(0,n._)`${l} ${h} null`;case"array":P=(0,n._)`Array.isArray(${l})`;break;case"object":P=(0,n._)`${l} && typeof ${l} == "object" && !Array.isArray(${l})`;break;case"integer":P=O((0,n._)`!(${l} % 1) && !isNaN(${l})`);break;case"number":P=O();break;default:return(0,n._)`typeof ${l} ${h} ${o}`}return c===s.Correct?P:(0,n.not)(P);function O(T=n.nil){return(0,n.and)((0,n._)`typeof ${l} == "number"`,T,y?(0,n._)`isFinite(${l})`:n.nil)}}se.checkDataType=g;function b(o,l,y,c){if(o.length===1)return g(o[0],l,y,c);let h;const P=(0,a.toHash)(o);if(P.array&&P.object){const O=(0,n._)`typeof ${l} != "object"`;h=P.null?O:(0,n._)`!${l} || ${O}`,delete P.null,delete P.array,delete P.object}else h=n.nil;P.number&&delete P.integer;for(const O in P)h=(0,n.and)(h,g(O,l,y,c));return h}se.checkDataTypes=b;const w={message:({schema:o})=>`must be ${o}`,params:({schema:o,schemaValue:l})=>typeof o=="string"?(0,n._)`{type: ${o}}`:(0,n._)`{type: ${l}}`};function f(o){const l=p(o);(0,r.reportError)(l,w)}se.reportTypeError=f;function p(o){const{gen:l,data:y,schema:c}=o,h=(0,a.schemaRefOrVal)(o,c,"type");return{gen:l,keyword:"type",data:y,schema:c.type,schemaCode:h,schemaValue:h,parentSchema:c,params:{},it:o}}return se}var qe={},wr;function gs(){if(wr)return qe;wr=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assignDefaults=void 0;const e=G(),t=Y();function r(a,s){const{properties:d,items:i}=a.schema;if(s==="object"&&d)for(const u in d)n(a,u,d[u].default);else s==="array"&&Array.isArray(i)&&i.forEach((u,$)=>n(a,$,u.default))}qe.assignDefaults=r;function n(a,s,d){const{gen:i,compositeRule:u,data:$,opts:_}=a;if(d===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(s)}`;if(u){(0,t.checkStrictMode)(a,`default is ignored for: ${E}`);return}let v=(0,e._)`${E} === undefined`;_.useDefaults==="empty"&&(v=(0,e._)`${v} || ${E} === null || ${E} === ""`),i.if(v,(0,e._)`${E} = ${(0,e.stringify)(d)}`)}return qe}var he={},Z={},Pr;function ge(){if(Pr)return Z;Pr=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.validateUnion=Z.validateArray=Z.usePattern=Z.callValidateCode=Z.schemaProperties=Z.allSchemaProperties=Z.noPropertyInData=Z.propertyInData=Z.isOwnProperty=Z.hasPropFunc=Z.reportMissingProp=Z.checkMissingProp=Z.checkReportMissingProp=void 0;const e=G(),t=Y(),r=Se(),n=Y();function a(o,l){const{gen:y,data:c,it:h}=o;y.if(_(y,c,l,h.opts.ownProperties),()=>{o.setParams({missingProperty:(0,e._)`${l}`},!0),o.error()})}Z.checkReportMissingProp=a;function s({gen:o,data:l,it:{opts:y}},c,h){return(0,e.or)(...c.map(P=>(0,e.and)(_(o,l,P,y.ownProperties),(0,e._)`${h} = ${P}`)))}Z.checkMissingProp=s;function d(o,l){o.setParams({missingProperty:l},!0),o.error()}Z.reportMissingProp=d;function i(o){return o.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Z.hasPropFunc=i;function u(o,l,y){return(0,e._)`${i(o)}.call(${l}, ${y})`}Z.isOwnProperty=u;function $(o,l,y,c){const h=(0,e._)`${l}${(0,e.getProperty)(y)} !== undefined`;return c?(0,e._)`${h} && ${u(o,l,y)}`:h}Z.propertyInData=$;function _(o,l,y,c){const h=(0,e._)`${l}${(0,e.getProperty)(y)} === undefined`;return c?(0,e.or)(h,(0,e.not)(u(o,l,y))):h}Z.noPropertyInData=_;function E(o){return o?Object.keys(o).filter(l=>l!=="__proto__"):[]}Z.allSchemaProperties=E;function v(o,l){return E(l).filter(y=>!(0,t.alwaysValidSchema)(o,l[y]))}Z.schemaProperties=v;function g({schemaCode:o,data:l,it:{gen:y,topSchemaRef:c,schemaPath:h,errorPath:P},it:O},T,z,C){const V=C?(0,e._)`${o}, ${l}, ${c}${h}`:l,L=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,O.parentData],[r.default.parentDataProperty,O.parentDataProperty],[r.default.rootData,r.default.rootData]];O.opts.dynamicRef&&L.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const F=(0,e._)`${V}, ${y.object(...L)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${F})`:(0,e._)`${T}(${F})`}Z.callValidateCode=g;const b=(0,e._)`new RegExp`;function w({gen:o,it:{opts:l}},y){const c=l.unicodeRegExp?"u":"",{regExp:h}=l.code,P=h(y,c);return o.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${h.code==="new RegExp"?b:(0,n.useFunc)(o,h)}(${y}, ${c})`})}Z.usePattern=w;function f(o){const{gen:l,data:y,keyword:c,it:h}=o,P=l.name("valid");if(h.allErrors){const T=l.let("valid",!0);return O(()=>l.assign(T,!1)),T}return l.var(P,!0),O(()=>l.break()),P;function O(T){const z=l.const("len",(0,e._)`${y}.length`);l.forRange("i",0,z,C=>{o.subschema({keyword:c,dataProp:C,dataPropType:t.Type.Num},P),l.if((0,e.not)(P),T)})}}Z.validateArray=f;function p(o){const{gen:l,schema:y,keyword:c,it:h}=o;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(h,z))&&!h.opts.unevaluated)return;const O=l.let("valid",!1),T=l.name("_valid");l.block(()=>y.forEach((z,C)=>{const V=o.subschema({keyword:c,schemaProp:C,compositeRule:!0},T);l.assign(O,(0,e._)`${O} || ${T}`),o.mergeValidEvaluated(V,T)||l.if((0,e.not)(O))})),o.result(O,()=>o.reset(),()=>o.error(!0))}return Z.validateUnion=p,Z}var Sr;function vs(){if(Sr)return he;Sr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=G(),t=Se(),r=ge(),n=Tt();function a(v,g){const{gen:b,keyword:w,schema:f,parentSchema:p,it:o}=v,l=g.macro.call(o.self,f,p,o),y=$(b,w,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const c=b.name("valid");v.subschema({schema:l,schemaPath:e.nil,errSchemaPath:`${o.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},c),v.pass(c,()=>v.error(!0))}he.macroKeywordCode=a;function s(v,g){var b;const{gen:w,keyword:f,schema:p,parentSchema:o,$data:l,it:y}=v;u(y,g);const c=!l&&g.compile?g.compile.call(y.self,p,o,y):g.validate,h=$(w,f,c),P=w.let("valid");v.block$data(P,O),v.ok((b=g.valid)!==null&&b!==void 0?b:P);function O(){if(g.errors===!1)C(),g.modifying&&d(v),V(()=>v.error());else{const L=g.async?T():z();g.modifying&&d(v),V(()=>i(v,L))}}function T(){const L=w.let("ruleErrs",null);return w.try(()=>C((0,e._)`await `),F=>w.assign(P,!1).if((0,e._)`${F} instanceof ${y.ValidationError}`,()=>w.assign(L,(0,e._)`${F}.errors`),()=>w.throw(F))),L}function z(){const L=(0,e._)`${h}.errors`;return w.assign(L,null),C(e.nil),L}function C(L=g.async?(0,e._)`await `:e.nil){const F=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in g&&!l||g.schema===!1);w.assign(P,(0,e._)`${L}${(0,r.callValidateCode)(v,h,F,Q)}`,g.modifying)}function V(L){var F;w.if((0,e.not)((F=g.valid)!==null&&F!==void 0?F:P),L)}}he.funcKeywordCode=s;function d(v){const{gen:g,data:b,it:w}=v;g.if(w.parentData,()=>g.assign(b,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function i(v,g){const{gen:b}=v;b.if((0,e._)`Array.isArray(${g})`,()=>{b.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)(v)},()=>v.error())}function u({schemaEnv:v},g){if(g.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,g,b){if(b===void 0)throw new Error(`keyword "${g}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function _(v,g,b=!1){return!g.length||g.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||b&&typeof v>"u")}he.validSchemaType=_;function E({schema:v,opts:g,self:b,errSchemaPath:w},f,p){if(Array.isArray(f.keyword)?!f.keyword.includes(p):f.keyword!==p)throw new Error("ajv implementation error");const o=f.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(v,l)))throw new Error(`parent schema must have dependencies of ${p}: ${o.join(",")}`);if(f.validateSchema&&!f.validateSchema(v[p])){const y=`keyword "${p}" value is invalid at path "${w}": `+b.errorsText(f.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return he.validateKeywordUsage=E,he}var $e={},Er;function _s(){if(Er)return $e;Er=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=G(),t=Y();function r(s,{keyword:d,schemaProp:i,schema:u,schemaPath:$,errSchemaPath:_,topSchemaRef:E}){if(d!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(d!==void 0){const v=s.schema[d];return i===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${d}`}:{schema:v[i],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(d)}${(0,e.getProperty)(i)}`,errSchemaPath:`${s.errSchemaPath}/${d}/${(0,t.escapeFragment)(i)}`}}if(u!==void 0){if($===void 0||_===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:$,topSchemaRef:E,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function n(s,d,{dataProp:i,dataPropType:u,data:$,dataTypes:_,propertyName:E}){if($!==void 0&&i!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=d;if(i!==void 0){const{errorPath:b,dataPathArr:w,opts:f}=d,p=v.let("data",(0,e._)`${d.data}${(0,e.getProperty)(i)}`,!0);g(p),s.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(i,u,f.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${i}`,s.dataPathArr=[...w,s.parentDataProperty]}if($!==void 0){const b=$ instanceof e.Name?$:v.let("data",$,!0);g(b),E!==void 0&&(s.propertyName=E)}_&&(s.dataTypes=_);function g(b){s.data=b,s.dataLevel=d.dataLevel+1,s.dataTypes=[],d.definedProperties=new Set,s.parentData=d.data,s.dataNames=[...d.dataNames,b]}}$e.extendSubschemaData=n;function a(s,{jtdDiscriminator:d,jtdMetadata:i,compositeRule:u,createErrors:$,allErrors:_}){u!==void 0&&(s.compositeRule=u),$!==void 0&&(s.createErrors=$),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=d,s.jtdMetadata=i}return $e.extendSubschemaMode=a,$e}var ae={},Wt,kr;function Dn(){return kr||(kr=1,Wt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!==0;){var d=s[a];if(!e(t[d],r[d]))return!1}return!0}return t!==t&&r!==r}),Wt}var Bt={exports:{}},jr;function $s(){if(jr)return Bt.exports;jr=1;var e=Bt.exports=function(n,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var d=typeof s=="function"?s:s.pre||function(){},i=s.post||function(){};t(a,d,i,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,a,s,d,i,u,$,_,E,v){if(d&&typeof d=="object"&&!Array.isArray(d)){a(d,i,u,$,_,E,v);for(var g in d){var b=d[g];if(Array.isArray(b)){if(g in e.arrayKeywords)for(var w=0;w<b.length;w++)t(n,a,s,b[w],i+"/"+g+"/"+w,u,i,g,d,w)}else if(g in e.propsKeywords){if(b&&typeof b=="object")for(var f in b)t(n,a,s,b[f],i+"/"+g+"/"+r(f),u,i,g,d,f)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,a,s,b,i+"/"+g,u,i,g,d)}s(d,i,u,$,_,E,v)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Bt.exports}var Rr;function At(){if(Rr)return ae;Rr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=Dn(),r=$s(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(w,f=!0){return typeof w=="boolean"?!0:f===!0?!d(w):f?i(w)<=f:!1}ae.inlineRef=a;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function d(w){for(const f in w){if(s.has(f))return!0;const p=w[f];if(Array.isArray(p)&&p.some(d)||typeof p=="object"&&d(p))return!0}return!1}function i(w){let f=0;for(const p in w){if(p==="$ref")return 1/0;if(f++,!n.has(p)&&(typeof w[p]=="object"&&(0,e.eachItem)(w[p],o=>f+=i(o)),f===1/0))return 1/0}return f}function u(w,f="",p){p!==!1&&(f=E(f));const o=w.parse(f);return $(w,o)}ae.getFullPath=u;function $(w,f){return w.serialize(f).split("#")[0]+"#"}ae._getFullPath=$;const _=/#\/?$/;function E(w){return w?w.replace(_,""):""}ae.normalizeId=E;function v(w,f,p){return p=E(p),w.resolve(f,p)}ae.resolveUrl=v;const g=/^[a-z_][-a-z0-9._]*$/i;function b(w,f){if(typeof w=="boolean")return{};const{schemaId:p,uriResolver:o}=this.opts,l=E(w[p]||f),y={"":l},c=u(o,l,!1),h={},P=new Set;return r(w,{allKeys:!0},(z,C,V,L)=>{if(L===void 0)return;const F=c+C;let Q=y[L];typeof z[p]=="string"&&(Q=ie.call(this,z[p])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[C]=Q;function ie(X){const pe=this.opts.uriResolver.resolve;if(X=E(Q?pe(Q,X):X),P.has(X))throw T(X);P.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?O(z,A.schema,X):X!==E(F)&&(X[0]==="#"?(O(z,h[X],X),h[X]=z):this.refs[X]=F),X}function oe(X){if(typeof X=="string"){if(!g.test(X))throw new Error(`invalid anchor "${X}"`);ie.call(this,`#${X}`)}}}),h;function O(z,C,V){if(C!==void 0&&!t(z,C))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=b,ae}var Ir;function Mt(){if(Ir)return ve;Ir=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=ys(),t=jt(),r=qn(),n=jt(),a=gs(),s=vs(),d=_s(),i=G(),u=Se(),$=At(),_=Y(),E=Tt();function v(k){if(c(k)&&(P(k),y(k))){f(k);return}g(k,()=>(0,e.topBoolOrEmptySchema)(k))}ve.validateFunctionCode=v;function g({gen:k,validateName:R,schema:q,schemaEnv:M,opts:K},W){K.code.es5?k.func(R,(0,i._)`${u.default.data}, ${u.default.valCxt}`,M.$async,()=>{k.code((0,i._)`"use strict"; ${o(q,K)}`),w(k,K),k.code(W)}):k.func(R,(0,i._)`${u.default.data}, ${b(K)}`,M.$async,()=>k.code(o(q,K)).code(W))}function b(k){return(0,i._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?(0,i._)`, ${u.default.dynamicAnchors}={}`:i.nil}}={}`}function w(k,R){k.if(u.default.valCxt,()=>{k.var(u.default.instancePath,(0,i._)`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,(0,i._)`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,(0,i._)`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,(0,i._)`${u.default.valCxt}.${u.default.rootData}`),R.dynamicRef&&k.var(u.default.dynamicAnchors,(0,i._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{k.var(u.default.instancePath,(0,i._)`""`),k.var(u.default.parentData,(0,i._)`undefined`),k.var(u.default.parentDataProperty,(0,i._)`undefined`),k.var(u.default.rootData,u.default.data),R.dynamicRef&&k.var(u.default.dynamicAnchors,(0,i._)`{}`)})}function f(k){const{schema:R,opts:q,gen:M}=k;g(k,()=>{q.$comment&&R.$comment&&L(k),z(k),M.let(u.default.vErrors,null),M.let(u.default.errors,0),q.unevaluated&&p(k),O(k),F(k)})}function p(k){const{gen:R,validateName:q}=k;k.evaluated=R.const("evaluated",(0,i._)`${q}.evaluated`),R.if((0,i._)`${k.evaluated}.dynamicProps`,()=>R.assign((0,i._)`${k.evaluated}.props`,(0,i._)`undefined`)),R.if((0,i._)`${k.evaluated}.dynamicItems`,()=>R.assign((0,i._)`${k.evaluated}.items`,(0,i._)`undefined`))}function o(k,R){const q=typeof k=="object"&&k[R.schemaId];return q&&(R.code.source||R.code.process)?(0,i._)`/*# sourceURL=${q} */`:i.nil}function l(k,R){if(c(k)&&(P(k),y(k))){h(k,R);return}(0,e.boolOrEmptySchema)(k,R)}function y({schema:k,self:R}){if(typeof k=="boolean")return!k;for(const q in k)if(R.RULES.all[q])return!0;return!1}function c(k){return typeof k.schema!="boolean"}function h(k,R){const{schema:q,gen:M,opts:K}=k;K.$comment&&q.$comment&&L(k),C(k),V(k);const W=M.const("_errs",u.default.errors);O(k,W),M.var(R,(0,i._)`${W} === ${u.default.errors}`)}function P(k){(0,_.checkUnknownRules)(k),T(k)}function O(k,R){if(k.opts.jtd)return ie(k,[],!1,R);const q=(0,t.getSchemaTypes)(k.schema),M=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!M,R)}function T(k){const{schema:R,errSchemaPath:q,opts:M,self:K}=k;R.$ref&&M.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:R,opts:q}=k;R.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(k,"default is ignored in the schema root")}function C(k){const R=k.schema[k.opts.schemaId];R&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,R))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:k,schemaEnv:R,schema:q,errSchemaPath:M,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,i._)`${u.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,i.str)`${M}/$comment`,me=k.scopeValue("root",{ref:R.root});k.code((0,i._)`${u.default.self}.opts.$comment(${W}, ${re}, ${me}.schema)`)}}function F(k){const{gen:R,schemaEnv:q,validateName:M,ValidationError:K,opts:W}=k;q.$async?R.if((0,i._)`${u.default.errors} === 0`,()=>R.return(u.default.data),()=>R.throw((0,i._)`new ${K}(${u.default.vErrors})`)):(R.assign((0,i._)`${M}.errors`,u.default.vErrors),W.unevaluated&&Q(k),R.return((0,i._)`${u.default.errors} === 0`))}function Q({gen:k,evaluated:R,props:q,items:M}){q instanceof i.Name&&k.assign((0,i._)`${R}.props`,q),M instanceof i.Name&&k.assign((0,i._)`${R}.items`,M)}function ie(k,R,q,M){const{gen:K,schema:W,data:re,allErrors:me,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,ne))){K.block(()=>U(k,"$ref",ne.all.$ref.definition));return}ce.jtd||X(k,R),K.block(()=>{for(const fe of ne.rules)Ie(fe);Ie(ne.post)});function Ie(fe){(0,r.shouldUseGroup)(W,fe)&&(fe.type?(K.if((0,n.checkDataType)(fe.type,re,ce.strictNumbers)),oe(k,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,n.reportTypeError)(k)),K.endIf()):oe(k,fe),me||K.if((0,i._)`${u.default.errors} === ${M||0}`))}}function oe(k,R){const{gen:q,schema:M,opts:{useDefaults:K}}=k;K&&(0,a.assignDefaults)(k,R.type),q.block(()=>{for(const W of R.rules)(0,r.shouldUseRule)(M,W)&&U(k,W.keyword,W.definition,R.type)})}function X(k,R){k.schemaEnv.meta||!k.opts.strictTypes||(pe(k,R),k.opts.allowUnionTypes||A(k,R),j(k,k.dataTypes))}function pe(k,R){if(R.length){if(!k.dataTypes.length){k.dataTypes=R;return}R.forEach(q=>{I(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),m(k,R)}}function A(k,R){R.length>1&&!(R.length===2&&R.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,R){const q=k.self.RULES.all;for(const M in q){const K=q[M];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(R,re))&&S(k,`missing type "${W.join(",")}" for keyword "${M}"`)}}}function D(k,R){return k.includes(R)||R==="number"&&k.includes("integer")}function I(k,R){return k.includes(R)||R==="integer"&&k.includes("number")}function m(k,R){const q=[];for(const M of k.dataTypes)I(R,M)?q.push(M):R.includes("integer")&&M==="number"&&q.push("integer");k.dataTypes=q}function S(k,R){const q=k.schemaEnv.baseId+k.errSchemaPath;R+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(k,R,k.opts.strictTypes)}class N{constructor(R,q,M){if((0,s.validateKeywordUsage)(R,q,M),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=M,this.data=R.data,this.schema=R.schema[M],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(R,this.schema,M,this.$data),this.schemaType=q.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=q,this.$data)this.schemaCode=R.gen.const("vSchema",B(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=R.gen.const("_errs",u.default.errors))}result(R,q,M){this.failResult((0,i.not)(R),q,M)}failResult(R,q,M){this.gen.if(R),M?M():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,q){this.failResult((0,i.not)(R),void 0,q)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:q}=this;this.fail((0,i._)`${q} !== undefined && (${(0,i.or)(this.invalid$data(),R)})`)}error(R,q,M){if(q){this.setParams(q),this._error(R,M),this.setParams({});return}this._error(R,M)}_error(R,q){(R?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.resetErrorsCount)(this.gen,this.errsCount)}ok(R){this.allErrors||this.gen.if(R)}setParams(R,q){q?Object.assign(this.params,R):this.params=R}block$data(R,q,M=i.nil){this.gen.block(()=>{this.check$data(R,M),q()})}check$data(R=i.nil,q=i.nil){if(!this.$data)return;const{gen:M,schemaCode:K,schemaType:W,def:re}=this;M.if((0,i.or)((0,i._)`${K} === undefined`,q)),R!==i.nil&&M.assign(R,!0),(W.length||re.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),R!==i.nil&&M.assign(R,!1)),M.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:M,def:K,it:W}=this;return(0,i.or)(re(),me());function re(){if(M.length){if(!(q instanceof i.Name))throw new Error("ajv implementation error");const ce=Array.isArray(M)?M:[M];return(0,i._)`${(0,n.checkDataTypes)(ce,q,W.opts.strictNumbers,n.DataType.Wrong)}`}return i.nil}function me(){if(K.validateSchema){const ce=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,i._)`!${ce}(${q})`}return i.nil}}subschema(R,q){const M=(0,d.getSubschema)(this.it,R);(0,d.extendSubschemaData)(M,this.it,R),(0,d.extendSubschemaMode)(M,R);const K={...this.it,...M,items:void 0,props:void 0};return l(K,q),K}mergeEvaluated(R,q){const{it:M,gen:K}=this;M.opts.unevaluated&&(M.props!==!0&&R.props!==void 0&&(M.props=_.mergeEvaluated.props(K,R.props,M.props,q)),M.items!==!0&&R.items!==void 0&&(M.items=_.mergeEvaluated.items(K,R.items,M.items,q)))}mergeValidEvaluated(R,q){const{it:M,gen:K}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,i.Name)),!0}}ve.KeywordCxt=N;function U(k,R,q,M){const K=new N(k,q,R);"code"in q?q.code(K,M):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:R,dataNames:q,dataPathArr:M}){let K,W;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=u.default.rootData}else{const de=x.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=R)throw new Error(ce("property/index",ne));return M[R-ne]}if(ne>R)throw new Error(ce("data",ne));if(W=q[R-ne],!K)return W}let re=W;const me=K.split("/");for(const de of me)de&&(W=(0,i._)`${W}${(0,i.getProperty)((0,_.unescapeJsonPointer)(de))}`,re=(0,i._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${R}`}}return ve.getData=B,ve}var Ue={},Or;function rr(){if(Or)return Ue;Or=1,Object.defineProperty(Ue,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ue.default=e,Ue}var Ke={},Nr;function Vt(){if(Nr)return Ke;Nr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=At();class t extends Error{constructor(n,a,s,d){super(d||`can't resolve reference ${s} from id ${a}`),this.missingRef=(0,e.resolveUrl)(n,a,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ke.default=t,Ke}var le={},Cr;function nr(){if(Cr)return le;Cr=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=G(),t=rr(),r=Se(),n=At(),a=Y(),s=Mt();class d{constructor(p){var o;this.refs={},this.dynamicAnchors={};let l;typeof p.schema=="object"&&(l=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(o=p.baseId)!==null&&o!==void 0?o:(0,n.normalizeId)(l?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=l?.$async,this.refs={}}}le.SchemaEnv=d;function i(f){const p=_.call(this,f);if(p)return p;const o=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:l,lines:y}=this.opts.code,{ownProperties:c}=this.opts,h=new e.CodeGen(this.scope,{es5:l,lines:y,ownProperties:c});let P;f.$async&&(P=h.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=h.scopeName("validate");f.validateName=O;const T={gen:h,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,e.stringify)(f.schema)}:{ref:f.schema}),validateName:O,ValidationError:P,schema:f.schema,schemaEnv:f,rootId:o,baseId:f.baseId||o,schemaPath:e.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(f),(0,s.validateFunctionCode)(T),h.optimize(this.opts.code.optimize);const C=h.toString();z=`${h.scopeRefs(r.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,f));const L=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(O,{ref:L}),L.errors=null,L.schema=f.schema,L.schemaEnv=f,f.$async&&(L.$async=!0),this.opts.code.source===!0&&(L.source={validateName:O,validateCode:C,scopeValues:h._values}),this.opts.unevaluated){const{props:F,items:Q}=T;L.evaluated={props:F instanceof e.Name?void 0:F,items:Q instanceof e.Name?void 0:Q,dynamicProps:F instanceof e.Name,dynamicItems:Q instanceof e.Name},L.source&&(L.source.evaluated=(0,e.stringify)(L.evaluated))}return f.validate=L,f}catch(C){throw delete f.validate,delete f.validateName,z&&this.logger.error("Error compiling schema, function code:",z),C}finally{this._compilations.delete(f)}}le.compileSchema=i;function u(f,p,o){var l;o=(0,n.resolveUrl)(this.opts.uriResolver,p,o);const y=f.refs[o];if(y)return y;let c=v.call(this,f,o);if(c===void 0){const h=(l=f.localRefs)===null||l===void 0?void 0:l[o],{schemaId:P}=this.opts;h&&(c=new d({schema:h,schemaId:P,root:f,baseId:p}))}if(c!==void 0)return f.refs[o]=$.call(this,c)}le.resolveRef=u;function $(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:i.call(this,f)}function _(f){for(const p of this._compilations)if(E(p,f))return p}le.getCompilingSchema=_;function E(f,p){return f.schema===p.schema&&f.root===p.root&&f.baseId===p.baseId}function v(f,p){let o;for(;typeof(o=this.refs[p])=="string";)p=o;return o||this.schemas[p]||g.call(this,f,p)}function g(f,p){const o=this.opts.uriResolver.parse(p),l=(0,n._getFullPath)(this.opts.uriResolver,o);let y=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&l===y)return w.call(this,o,f);const c=(0,n.normalizeId)(l),h=this.refs[c]||this.schemas[c];if(typeof h=="string"){const P=g.call(this,f,h);return typeof P?.schema!="object"?void 0:w.call(this,o,P)}if(typeof h?.schema=="object"){if(h.validate||i.call(this,h),c===(0,n.normalizeId)(p)){const{schema:P}=h,{schemaId:O}=this.opts,T=P[O];return T&&(y=(0,n.resolveUrl)(this.opts.uriResolver,y,T)),new d({schema:P,schemaId:O,root:f,baseId:y})}return w.call(this,o,h)}}le.resolveSchema=g;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(f,{baseId:p,schema:o,root:l}){var y;if(((y=f.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of f.fragment.slice(1).split("/")){if(typeof o=="boolean")return;const O=o[(0,a.unescapeFragment)(P)];if(O===void 0)return;o=O;const T=typeof o=="object"&&o[this.opts.schemaId];!b.has(P)&&T&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,T))}let c;if(typeof o!="boolean"&&o.$ref&&!(0,a.schemaHasRulesButRef)(o,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,p,o.$ref);c=g.call(this,l,P)}const{schemaId:h}=this.opts;if(c=c||new d({schema:o,schemaId:h,root:l,baseId:p}),c.schema!==c.root.schema)return c}return le}const bs="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ws="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ps="object",Ss=["$data"],Es={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ks=!1,js={$id:bs,description:ws,type:Ps,required:Ss,properties:Es,additionalProperties:ks};var Je={},De={exports:{}},Yt,qr;function Tn(){if(qr)return Yt;qr=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 r(v){let g="",b=0,w=0;for(w=0;w<v.length;w++)if(b=v[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";g+=v[w];break}for(w+=1;w<v.length;w++){if(b=v[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";g+=v[w]}return g}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(v){return v.length=0,!0}function s(v,g,b){if(v.length){const w=r(v);if(w!=="")g.push(w);else return b.error=!0,!1;v.length=0}return!0}function d(v){let g=0;const b={error:!1,address:"",zone:""},w=[],f=[];let p=!1,o=!1,l=s;for(let y=0;y<v.length;y++){const c=v[y];if(!(c==="["||c==="]"))if(c===":"){if(p===!0&&(o=!0),!l(f,w,b))break;if(++g>7){b.error=!0;break}y>0&&v[y-1]===":"&&(p=!0),w.push(":");continue}else if(c==="%"){if(!l(f,w,b))break;l=a}else{f.push(c);continue}}return f.length&&(l===a?b.zone=f.join(""):o?w.push(f.join("")):w.push(r(f))),b.address=w.join(""),b}function i(v){if(u(v,":")<2)return{host:v,isIPV6:!1};const g=d(v);if(g.error)return{host:v,isIPV6:!1};{let b=g.address,w=g.address;return g.zone&&(b+="%"+g.zone,w+="%25"+g.zone),{host:b,isIPV6:!0,escapedHost:w}}}function u(v,g){let b=0;for(let w=0;w<v.length;w++)v[w]===g&&b++;return b}function $(v){let g=v;const b=[];let w=-1,f=0;for(;f=g.length;){if(f===1){if(g===".")break;if(g==="/"){b.push("/");break}else{b.push(g);break}}else if(f===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){b.push("/");break}}else if(f===3&&g==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((w=g.indexOf("/",1))===-1){b.push(g);break}else b.push(g.slice(0,w)),g=g.slice(w)}return b.join("")}function _(v,g){const b=g!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=b(v.scheme)),v.userinfo!==void 0&&(v.userinfo=b(v.userinfo)),v.host!==void 0&&(v.host=b(v.host)),v.path!==void 0&&(v.path=b(v.path)),v.query!==void 0&&(v.query=b(v.query)),v.fragment!==void 0&&(v.fragment=b(v.fragment)),v}function E(v){const g=[];if(v.userinfo!==void 0&&(g.push(v.userinfo),g.push("@")),v.host!==void 0){let b=unescape(v.host);if(!t(b)){const w=i(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=v.host}g.push(b)}return(typeof v.port=="number"||typeof v.port=="string")&&(g.push(":"),g.push(String(v.port))),g.length?g.join(""):void 0}return Yt={nonSimpleDomain:n,recomposeAuthority:E,normalizeComponentEncoding:_,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:r},Yt}var xt,Dr;function Rs(){if(Dr)return xt;Dr=1;const{isUUID:e}=Tn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(c){return r.indexOf(c)!==-1}function a(c){return c.secure===!0?!0:c.secure===!1?!1:c.scheme?c.scheme.length===3&&(c.scheme[0]==="w"||c.scheme[0]==="W")&&(c.scheme[1]==="s"||c.scheme[1]==="S")&&(c.scheme[2]==="s"||c.scheme[2]==="S"):!1}function s(c){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c}function d(c){const h=String(c.scheme).toLowerCase()==="https";return(c.port===(h?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}function i(c){return c.secure=a(c),c.resourceName=(c.path||"/")+(c.query?"?"+c.query:""),c.path=void 0,c.query=void 0,c}function u(c){if((c.port===(a(c)?443:80)||c.port==="")&&(c.port=void 0),typeof c.secure=="boolean"&&(c.scheme=c.secure?"wss":"ws",c.secure=void 0),c.resourceName){const[h,P]=c.resourceName.split("?");c.path=h&&h!=="/"?h:void 0,c.query=P,c.resourceName=void 0}return c.fragment=void 0,c}function $(c,h){if(!c.path)return c.error="URN can not be parsed",c;const P=c.path.match(t);if(P){const O=h.scheme||c.scheme||"urn";c.nid=P[1].toLowerCase(),c.nss=P[2];const T=`${O}:${h.nid||c.nid}`,z=y(T);c.path=void 0,z&&(c=z.parse(c,h))}else c.error=c.error||"URN can not be parsed.";return c}function _(c,h){if(c.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=h.scheme||c.scheme||"urn",O=c.nid.toLowerCase(),T=`${P}:${h.nid||O}`,z=y(T);z&&(c=z.serialize(c,h));const C=c,V=c.nss;return C.path=`${O||h.nid}:${V}`,h.skipEscape=!0,C}function E(c,h){const P=c;return P.uuid=P.nss,P.nss=void 0,!h.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(c){const h=c;return h.nss=(c.uuid||"").toLowerCase(),h}const g={scheme:"http",domainHost:!0,parse:s,serialize:d},b={scheme:"https",domainHost:g.domainHost,parse:s,serialize:d},w={scheme:"ws",domainHost:!0,parse:i,serialize:u},f={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},l={http:g,https:b,ws:w,wss:f,urn:{scheme:"urn",parse:$,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(l,null);function y(c){return c&&(l[c]||l[c.toLowerCase()])||void 0}return xt={wsIsSecure:a,SCHEMES:l,isValidSchemeName:n,getSchemeHandler:y},xt}var Tr;function Is(){if(Tr)return De.exports;Tr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:a,nonSimpleDomain:s}=Tn(),{SCHEMES:d,getSchemeHandler:i}=Rs();function u(f,p){return typeof f=="string"?f=v(b(f,p),p):typeof f=="object"&&(f=b(v(f,p),p)),f}function $(f,p,o){const l=o?Object.assign({scheme:"null"},o):{scheme:"null"},y=_(b(f,l),b(p,l),l,!0);return l.skipEscape=!0,v(y,l)}function _(f,p,o,l){const y={};return l||(f=b(v(f,o),o),p=b(v(p,o),o)),o=o||{},!o.tolerant&&p.scheme?(y.scheme=p.scheme,y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=t(p.path||""),y.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=t(p.path||""),y.query=p.query):(p.path?(p.path[0]==="/"?y.path=t(p.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?y.path="/"+p.path:f.path?y.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+p.path:y.path=p.path,y.path=t(y.path)),y.query=p.query):(y.path=f.path,p.query!==void 0?y.query=p.query:y.query=f.query),y.userinfo=f.userinfo,y.host=f.host,y.port=f.port),y.scheme=f.scheme),y.fragment=p.fragment,y}function E(f,p,o){return typeof f=="string"?(f=unescape(f),f=v(n(b(f,o),!0),{...o,skipEscape:!0})):typeof f=="object"&&(f=v(n(f,!0),{...o,skipEscape:!0})),typeof p=="string"?(p=unescape(p),p=v(n(b(p,o),!0),{...o,skipEscape:!0})):typeof p=="object"&&(p=v(n(p,!0),{...o,skipEscape:!0})),f.toLowerCase()===p.toLowerCase()}function v(f,p){const o={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},l=Object.assign({},p),y=[],c=i(l.scheme||o.scheme);c&&c.serialize&&c.serialize(o,l),o.path!==void 0&&(l.skipEscape?o.path=unescape(o.path):(o.path=escape(o.path),o.scheme!==void 0&&(o.path=o.path.split("%3A").join(":")))),l.reference!=="suffix"&&o.scheme&&y.push(o.scheme,":");const h=r(o);if(h!==void 0&&(l.reference!=="suffix"&&y.push("//"),y.push(h),o.path&&o.path[0]!=="/"&&y.push("/")),o.path!==void 0){let P=o.path;!l.absolutePath&&(!c||!c.absolutePath)&&(P=t(P)),h===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return o.query!==void 0&&y.push("?",o.query),o.fragment!==void 0&&y.push("#",o.fragment),y.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(f,p){const o=Object.assign({},p),l={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;o.reference==="suffix"&&(o.scheme?f=o.scheme+":"+f:f="//"+f);const c=f.match(g);if(c){if(l.scheme=c[1],l.userinfo=c[3],l.host=c[4],l.port=parseInt(c[5],10),l.path=c[6]||"",l.query=c[7],l.fragment=c[8],isNaN(l.port)&&(l.port=c[5]),l.host)if(a(l.host)===!1){const O=e(l.host);l.host=O.host.toLowerCase(),y=O.isIPV6}else y=!0;l.scheme===void 0&&l.userinfo===void 0&&l.host===void 0&&l.port===void 0&&l.query===void 0&&!l.path?l.reference="same-document":l.scheme===void 0?l.reference="relative":l.fragment===void 0?l.reference="absolute":l.reference="uri",o.reference&&o.reference!=="suffix"&&o.reference!==l.reference&&(l.error=l.error||"URI is not a "+o.reference+" reference.");const h=i(o.scheme||l.scheme);if(!o.unicodeSupport&&(!h||!h.unicodeSupport)&&l.host&&(o.domainHost||h&&h.domainHost)&&y===!1&&s(l.host))try{l.host=URL.domainToASCII(l.host.toLowerCase())}catch(P){l.error=l.error||"Host's domain name can not be converted to ASCII: "+P}(!h||h&&!h.skipNormalize)&&(f.indexOf("%")!==-1&&(l.scheme!==void 0&&(l.scheme=unescape(l.scheme)),l.host!==void 0&&(l.host=unescape(l.host))),l.path&&(l.path=escape(unescape(l.path))),l.fragment&&(l.fragment=encodeURI(decodeURIComponent(l.fragment)))),h&&h.parse&&h.parse(l,o)}else l.error=l.error||"URI can not be parsed.";return l}const w={SCHEMES:d,normalize:u,resolve:$,resolveComponent:_,equal:E,serialize:v,parse:b};return De.exports=w,De.exports.default=w,De.exports.fastUri=w,De.exports}var Ar;function Os(){if(Ar)return Je;Ar=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=Is();return e.code='require("ajv/dist/runtime/uri").default',Je.default=e,Je}var Mr;function Ns(){return Mr||(Mr=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=Mt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=rr(),a=Vt(),s=Cn(),d=nr(),i=G(),u=At(),$=jt(),_=Y(),E=js,v=Os(),g=(A,j)=>new RegExp(A,j);g.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={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."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},o=200;function l(A){var j,D,I,m,S,N,U,J,x,B,k,R,q,M,K,W,re,me,ce,de,ne,Ie,fe,zt,Lt;const Ce=A.strict,Ft=(j=A.code)===null||j===void 0?void 0:j.optimize,dr=Ft===!0||Ft===void 0?1:Ft||0,ur=(I=(D=A.code)===null||D===void 0?void 0:D.regExp)!==null&&I!==void 0?I:g,hs=(m=A.uriResolver)!==null&&m!==void 0?m:v.default;return{strictSchema:(N=(S=A.strictSchema)!==null&&S!==void 0?S:Ce)!==null&&N!==void 0?N:!0,strictNumbers:(J=(U=A.strictNumbers)!==null&&U!==void 0?U:Ce)!==null&&J!==void 0?J:!0,strictTypes:(B=(x=A.strictTypes)!==null&&x!==void 0?x:Ce)!==null&&B!==void 0?B:"log",strictTuples:(R=(k=A.strictTuples)!==null&&k!==void 0?k:Ce)!==null&&R!==void 0?R:"log",strictRequired:(M=(q=A.strictRequired)!==null&&q!==void 0?q:Ce)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:dr,regExp:ur}:{optimize:dr,regExp:ur},loopRequired:(K=A.loopRequired)!==null&&K!==void 0?K:o,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:o,meta:(re=A.meta)!==null&&re!==void 0?re:!0,messages:(me=A.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=A.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=A.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=A.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Ie=A.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(fe=A.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(zt=A.unicodeRegExp)!==null&&zt!==void 0?zt:!0,int32range:(Lt=A.int32range)!==null&&Lt!==void 0?Lt:!0,uriResolver:hs}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...l(j)};const{es5:D,lines:I}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:w,es5:D,lines:I}),this.logger=V(j.logger);const m=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),c.call(this,f,j,"NOT SUPPORTED"),c.call(this,p,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=m}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:I}=this.opts;let m=E;I==="id"&&(m={...E},m.id=m.$id,delete m.$id),D&&j&&this.addMetaSchema(m,m[I],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let I;if(typeof j=="string"){if(I=this.getSchema(j),!I)throw new Error(`no schema with key or ref "${j}"`)}else I=this.compile(j);const m=I(D);return"$async"in I||(this.errors=I.errors),m}compile(j,D){const I=this._addSchema(j,D);return I.validate||this._compileSchemaEnv(I)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return m.call(this,j,D);async function m(B,k){await S.call(this,B.$schema);const R=this._addSchema(B,k);return R.validate||N.call(this,R)}async function S(B){B&&!this.getSchema(B)&&await m.call(this,{$ref:B},!0)}async function N(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof a.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),N.call(this,B)}}function U({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await x.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function x(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=I(B))}finally{delete this._loading[B]}}}addSchema(j,D,I,m=this.opts.validateSchema){if(Array.isArray(j)){for(const N of j)this.addSchema(N,void 0,I,m);return this}let S;if(typeof j=="object"){const{schemaId:N}=this.opts;if(S=j[N],S!==void 0&&typeof S!="string")throw new Error(`schema ${N} must be string`)}return D=(0,u.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,I,D,m,!0),this}addMetaSchema(j,D,I=this.opts.validateSchema){return this.addSchema(j,D,!0,I),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let I;if(I=j.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const m=this.validate(I,j);if(!m&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return m}getSchema(j){let D;for(;typeof(D=h.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:I}=this.opts,m=new d.SchemaEnv({schema:{},schemaId:I});if(D=d.resolveSchema.call(this,m,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const D=h.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let I=j[this.opts.schemaId];return I&&(I=(0,u.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let I;if(typeof j=="string")I=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=I);else if(typeof j=="object"&&D===void 0){if(D=j,I=D.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(F.call(this,I,D),!D)return(0,_.eachItem)(I,S=>Q.call(this,S)),this;oe.call(this,D);const m={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,_.eachItem)(I,m.type.length===0?S=>Q.call(this,S,m):S=>m.type.forEach(N=>Q.call(this,S,m,N))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const I of D.rules){const m=I.rules.findIndex(S=>S.keyword===j);m>=0&&I.rules.splice(m,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:I="data"}={}){return!j||j.length===0?"No errors":j.map(m=>`${I}${m.instancePath} ${m.message}`).reduce((m,S)=>m+D+S)}$dataMetaSchema(j,D){const I=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const m of D){const S=m.split("/").slice(1);let N=j;for(const U of S)N=N[U];for(const U in I){const J=I[U];if(typeof J!="object")continue;const{$data:x}=J.definition,B=N[U];x&&B&&(N[U]=pe(B))}}return j}_removeAllSchemas(j,D){for(const I in j){const m=j[I];(!D||D.test(I))&&(typeof m=="string"?delete j[I]:m&&!m.meta&&(this._cache.delete(m.schema),delete j[I]))}}_addSchema(j,D,I,m=this.opts.validateSchema,S=this.opts.addUsedSchema){let N;const{schemaId:U}=this.opts;if(typeof j=="object")N=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(j);if(J!==void 0)return J;I=(0,u.normalizeId)(N||I);const x=u.getSchemaRefs.call(this,j,I);return J=new d.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:I,localRefs:x}),this._cache.set(J.schema,J),S&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=J),m&&this.validateSchema(j,!0),J}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):d.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{d.compileSchema.call(this,j)}finally{this.opts=D}}}y.ValidationError=n.default,y.MissingRefError=a.default,e.default=y;function c(A,j,D,I="error"){for(const m in A){const S=m;S in j&&this.logger[I](`${D}: option ${m}. ${A[S]}`)}}function h(A){return A=(0,u.normalizeId)(A),this.schemas[A]||this.refs[A]}function P(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const j in A)this.addSchema(A[j],j)}function O(){for(const A in this.opts.formats){const j=this.opts.formats[A];j&&this.addFormat(A,j)}}function T(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in A){const D=A[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const A={...this.opts};for(const j of b)delete A[j];return A}const C={log(){},warn(){},error(){}};function V(A){if(A===!1)return C;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function F(A,j){const{RULES:D}=this;if((0,_.eachItem)(A,I=>{if(D.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!L.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(A,j,D){var I;const m=j?.post;if(D&&m)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let N=m?S.post:S.rules.find(({type:J})=>J===D);if(N||(N={type:D,rules:[]},S.rules.push(N)),S.keywords[A]=!0,!j)return;const U={keyword:A,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,N,U,j.before):N.rules.push(U),S.all[A]=U,(I=j.implements)===null||I===void 0||I.forEach(J=>this.addKeyword(J))}function ie(A,j,D){const I=A.rules.findIndex(m=>m.keyword===D);I>=0?A.rules.splice(I,0,j):(A.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(A){let{metaSchema:j}=A;j!==void 0&&(A.$data&&this.opts.$data&&(j=pe(j)),A.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(A){return{anyOf:[A,X]}}})(Ut)),Ut}var He={},Ge={},We={},Vr;function Cs(){if(Vr)return We;Vr=1,Object.defineProperty(We,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return We.default=e,We}var we={},zr;function qs(){if(zr)return we;zr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.callRef=we.getValidate=void 0;const e=Vt(),t=ge(),r=G(),n=Se(),a=nr(),s=Y(),d={keyword:"$ref",schemaType:"string",code($){const{gen:_,schema:E,it:v}=$,{baseId:g,schemaEnv:b,validateName:w,opts:f,self:p}=v,{root:o}=b;if((E==="#"||E==="#/")&&g===o.baseId)return y();const l=a.resolveRef.call(p,o,g,E);if(l===void 0)throw new e.default(v.opts.uriResolver,g,E);if(l instanceof a.SchemaEnv)return c(l);return h(l);function y(){if(b===o)return u($,w,b,b.$async);const P=_.scopeValue("root",{ref:o});return u($,(0,r._)`${P}.validate`,o,o.$async)}function c(P){const O=i($,P);u($,O,P,P.$async)}function h(P){const O=_.scopeValue("schema",f.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=_.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function i($,_){const{gen:E}=$;return _.validate?E.scopeValue("validate",{ref:_.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:_})}.validate`}we.getValidate=i;function u($,_,E,v){const{gen:g,it:b}=$,{allErrors:w,schemaEnv:f,opts:p}=b,o=p.passContext?n.default.this:r.nil;v?l():y();function l(){if(!f.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,r._)`await ${(0,t.callValidateCode)($,_,o)}`),h(_),w||g.assign(P,!0)},O=>{g.if((0,r._)`!(${O} instanceof ${b.ValidationError})`,()=>g.throw(O)),c(O),w||g.assign(P,!1)}),$.ok(P)}function y(){$.result((0,t.callValidateCode)($,_,o),()=>h(_),()=>c(_))}function c(P){const O=(0,r._)`${P}.errors`;g.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${O} : ${n.default.vErrors}.concat(${O})`),g.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function h(P){var O;if(!b.opts.unevaluated)return;const T=(O=E?.validate)===null||O===void 0?void 0:O.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=s.mergeEvaluated.props(g,T.props,b.props));else{const z=g.var("props",(0,r._)`${P}.evaluated.props`);b.props=s.mergeEvaluated.props(g,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=s.mergeEvaluated.items(g,T.items,b.items));else{const z=g.var("items",(0,r._)`${P}.evaluated.items`);b.items=s.mergeEvaluated.items(g,z,b.items,r.Name)}}}return we.callRef=u,we.default=d,we}var Lr;function Ds(){if(Lr)return Ge;Lr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=Cs(),t=qs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ge.default=r,Ge}var Be={},Ye={},Fr;function Ts(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=G(),t=e.operators,r={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:s,schemaCode:d})=>(0,e.str)`must be ${r[s].okStr} ${d}`,params:({keyword:s,schemaCode:d})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${d}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:d,data:i,schemaCode:u}=s;s.fail$data((0,e._)`${i} ${r[d].fail} ${u} || isNaN(${i})`)}};return Ye.default=a,Ye}var xe={},Ur;function As(){if(Ur)return xe;Ur=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),r={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:a,data:s,schemaCode:d,it:i}=n,u=i.opts.multipleOfPrecision,$=a.let("res"),_=u?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${u}`:(0,e._)`${$} !== parseInt(${$})`;n.fail$data((0,e._)`(${d} === 0 || (${$} = ${s}/${d}, ${_}))`)}};return xe.default=r,xe}var Qe={},Ze={},Kr;function Ms(){if(Kr)return Ze;Kr=1,Object.defineProperty(Ze,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,a=0,s;for(;a<r;)n++,s=t.charCodeAt(a++),s>=55296&&s<=56319&&a<r&&(s=t.charCodeAt(a),(s&64512)===56320&&a++);return n}return Ze.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ze}var Jr;function Vs(){if(Jr)return Qe;Jr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=G(),t=Y(),r=Ms(),a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:d}){const i=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${d} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:d,data:i,schemaCode:u,it:$}=s,_=d==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${i}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${i})`;s.fail$data((0,e._)`${E} ${_} ${u}`)}};return Qe.default=a,Qe}var Xe={},Hr;function zs(){if(Hr)return Xe;Hr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=ge(),t=G(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,t.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,t._)`{pattern: ${a}}`},code(a){const{data:s,$data:d,schema:i,schemaCode:u,it:$}=a,_=$.opts.unicodeRegExp?"u":"",E=d?(0,t._)`(new RegExp(${u}, ${_}))`:(0,e.usePattern)(a,i);a.fail$data((0,t._)`!${E}.test(${s})`)}};return Xe.default=n,Xe}var et={},Gr;function Ls(){if(Gr)return et;Gr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:d}=n,i=a==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${i} ${d}`)}};return et.default=r,et}var tt={},Wr;function Fs(){if(Wr)return tt;Wr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:d,schema:i,schemaCode:u,data:$,$data:_,it:E}=s,{opts:v}=E;if(!_&&i.length===0)return;const g=i.length>=v.loopRequired;if(E.allErrors?b():w(),v.strictRequired){const o=s.parentSchema.properties,{definedProperties:l}=s.it;for(const y of i)if(o?.[y]===void 0&&!l.has(y)){const c=E.schemaEnv.baseId+E.errSchemaPath,h=`required property "${y}" is not defined at "${c}" (strictRequired)`;(0,r.checkStrictMode)(E,h,E.opts.strictRequired)}}function b(){if(g||_)s.block$data(t.nil,f);else for(const o of i)(0,e.checkReportMissingProp)(s,o)}function w(){const o=d.let("missing");if(g||_){const l=d.let("valid",!0);s.block$data(l,()=>p(o,l)),s.ok(l)}else d.if((0,e.checkMissingProp)(s,i,o)),(0,e.reportMissingProp)(s,o),d.else()}function f(){d.forOf("prop",u,o=>{s.setParams({missingProperty:o}),d.if((0,e.noPropertyInData)(d,$,o,v.ownProperties),()=>s.error())})}function p(o,l){s.setParams({missingProperty:o}),d.forOf(o,u,()=>{d.assign(l,(0,e.propertyInData)(d,$,o,v.ownProperties)),d.if((0,t.not)(l),()=>{s.error(),d.break()})},t.nil)}}};return tt.default=a,tt}var rt={},Br;function Us(){if(Br)return rt;Br=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:d}=n,i=a==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${i} ${d}`)}};return rt.default=r,rt}var nt={},st={},Yr;function sr(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Dn();return e.code='require("ajv/dist/runtime/equal").default',st.default=e,st}var xr;function Ks(){if(xr)return nt;xr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=jt(),t=G(),r=Y(),n=sr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:d,j:i}})=>(0,t.str)`must NOT have duplicate items (items ## ${i} and ${d} are identical)`,params:({params:{i:d,j:i}})=>(0,t._)`{i: ${d}, j: ${i}}`},code(d){const{gen:i,data:u,$data:$,schema:_,parentSchema:E,schemaCode:v,it:g}=d;if(!$&&!_)return;const b=i.let("valid"),w=E.items?(0,e.getSchemaTypes)(E.items):[];d.block$data(b,f,(0,t._)`${v} === false`),d.ok(b);function f(){const y=i.let("i",(0,t._)`${u}.length`),c=i.let("j");d.setParams({i:y,j:c}),i.assign(b,!0),i.if((0,t._)`${y} > 1`,()=>(p()?o:l)(y,c))}function p(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function o(y,c){const h=i.name("item"),P=(0,e.checkDataTypes)(w,h,g.opts.strictNumbers,e.DataType.Wrong),O=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${y}--;`,()=>{i.let(h,(0,t._)`${u}[${y}]`),i.if(P,(0,t._)`continue`),w.length>1&&i.if((0,t._)`typeof ${h} == "string"`,(0,t._)`${h} += "_"`),i.if((0,t._)`typeof ${O}[${h}] == "number"`,()=>{i.assign(c,(0,t._)`${O}[${h}]`),d.error(),i.assign(b,!1).break()}).code((0,t._)`${O}[${h}] = ${y}`)})}function l(y,c){const h=(0,r.useFunc)(i,n.default),P=i.name("outer");i.label(P).for((0,t._)`;${y}--;`,()=>i.for((0,t._)`${c} = ${y}; ${c}--;`,()=>i.if((0,t._)`${h}(${u}[${y}], ${u}[${c}])`,()=>{d.error(),i.assign(b,!1).break(P)})))}}};return nt.default=s,nt}var it={},Qr;function Js(){if(Qr)return it;Qr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),r=sr(),a={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:d,data:i,$data:u,schemaCode:$,schema:_}=s;u||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(d,r.default)}(${i}, ${$})`):s.fail((0,e._)`${_} !== ${i}`)}};return it.default=a,it}var ot={},Zr;function Hs(){if(Zr)return ot;Zr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),t=Y(),r=sr(),a={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:d,data:i,$data:u,schema:$,schemaCode:_,it:E}=s;if(!u&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=E.opts.loopEnum;let g;const b=()=>g??(g=(0,t.useFunc)(d,r.default));let w;if(v||u)w=d.let("valid"),s.block$data(w,f);else{if(!Array.isArray($))throw new Error("ajv implementation error");const o=d.const("vSchema",_);w=(0,e.or)(...$.map((l,y)=>p(o,y)))}s.pass(w);function f(){d.assign(w,!1),d.forOf("v",_,o=>d.if((0,e._)`${b()}(${i}, ${o})`,()=>d.assign(w,!0).break()))}function p(o,l){const y=$[l];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${i}, ${o}[${l}])`:(0,e._)`${i} === ${y}`}}};return ot.default=a,ot}var Xr;function Gs(){if(Xr)return Be;Xr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=Ts(),t=As(),r=Vs(),n=zs(),a=Ls(),s=Fs(),d=Us(),i=Ks(),u=Js(),$=Hs(),_=[e.default,t.default,r.default,n.default,a.default,s.default,d.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,$.default];return Be.default=_,Be}var at={},Oe={},en;function An(){if(en)return Oe;en=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateAdditionalItems=void 0;const e=G(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:d,it:i}=s,{items:u}=d;if(!Array.isArray(u)){(0,t.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}a(s,u)}};function a(s,d){const{gen:i,schema:u,data:$,keyword:_,it:E}=s;E.items=!0;const v=i.const("len",(0,e._)`${$}.length`);if(u===!1)s.setParams({len:d.length}),s.pass((0,e._)`${v} <= ${d.length}`);else if(typeof u=="object"&&!(0,t.alwaysValidSchema)(E,u)){const b=i.var("valid",(0,e._)`${v} <= ${d.length}`);i.if((0,e.not)(b),()=>g(b)),s.ok(b)}function g(b){i.forRange("i",d.length,v,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},b),E.allErrors||i.if((0,e.not)(b),()=>i.break())})}}return Oe.validateAdditionalItems=a,Oe.default=n,Oe}var ct={},Ne={},tn;function Mn(){if(tn)return Ne;tn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.validateTuple=void 0;const e=G(),t=Y(),r=ge(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:d,it:i}=s;if(Array.isArray(d))return a(s,"additionalItems",d);i.items=!0,!(0,t.alwaysValidSchema)(i,d)&&s.ok((0,r.validateArray)(s))}};function a(s,d,i=s.schema){const{gen:u,parentSchema:$,data:_,keyword:E,it:v}=s;w($),v.opts.unevaluated&&i.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(u,i.length,v.items));const g=u.name("valid"),b=u.const("len",(0,e._)`${_}.length`);i.forEach((f,p)=>{(0,t.alwaysValidSchema)(v,f)||(u.if((0,e._)`${b} > ${p}`,()=>s.subschema({keyword:E,schemaProp:p,dataProp:p},g)),s.ok(g))});function w(f){const{opts:p,errSchemaPath:o}=v,l=i.length,y=l===f.minItems&&(l===f.maxItems||f[d]===!1);if(p.strictTuples&&!y){const c=`"${E}" is ${l}-tuple, but minItems or maxItems/${d} are not specified or different at path "${o}"`;(0,t.checkStrictMode)(v,c,p.strictTuples)}}}return Ne.validateTuple=a,Ne.default=n,Ne}var rn;function Ws(){if(rn)return ct;rn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Mn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ct.default=t,ct}var dt={},nn;function Bs(){if(nn)return dt;nn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=G(),t=Y(),r=ge(),n=An(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:d}})=>(0,e.str)`must NOT have more than ${d} items`,params:({params:{len:d}})=>(0,e._)`{limit: ${d}}`},code(d){const{schema:i,parentSchema:u,it:$}=d,{prefixItems:_}=u;$.items=!0,!(0,t.alwaysValidSchema)($,i)&&(_?(0,n.validateAdditionalItems)(d,_):d.ok((0,r.validateArray)(d)))}};return dt.default=s,dt}var ut={},sn;function Ys(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:a,max:s}})=>s===void 0?(0,e.str)`must contain at least ${a} valid item(s)`:(0,e.str)`must contain at least ${a} and no more than ${s} valid item(s)`,params:({params:{min:a,max:s}})=>s===void 0?(0,e._)`{minContains: ${a}}`:(0,e._)`{minContains: ${a}, maxContains: ${s}}`},code(a){const{gen:s,schema:d,parentSchema:i,data:u,it:$}=a;let _,E;const{minContains:v,maxContains:g}=i;$.opts.next?(_=v===void 0?1:v,E=g):_=1;const b=s.const("len",(0,e._)`${u}.length`);if(a.setParams({min:_,max:E}),E===void 0&&_===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&_>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,t.alwaysValidSchema)($,d)){let l=(0,e._)`${b} >= ${_}`;E!==void 0&&(l=(0,e._)`${l} && ${b} <= ${E}`),a.pass(l);return}$.items=!0;const w=s.name("valid");E===void 0&&_===1?p(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),E!==void 0&&s.if((0,e._)`${u}.length > 0`,f)):(s.let(w,!1),f()),a.result(w,()=>a.reset());function f(){const l=s.name("_valid"),y=s.let("count",0);p(l,()=>s.if(l,()=>o(y)))}function p(l,y){s.forRange("i",0,b,c=>{a.subschema({keyword:"contains",dataProp:c,dataPropType:t.Type.Num,compositeRule:!0},l),y()})}function o(l){s.code((0,e._)`${l}++`),E===void 0?s.if((0,e._)`${l} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${l} > ${E}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${l} >= ${_}`,()=>s.assign(w,!0)))}}};return ut.default=n,ut}var Qt={},on;function xs(){return on||(on=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Y(),n=ge();e.error={message:({params:{property:u,depsCount:$,deps:_}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${_} when property ${u} is present`},params:({params:{property:u,depsCount:$,deps:_,missingProperty:E}})=>(0,t._)`{property: ${u},
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Le={exports:{}},Ut={},ve={},Ee={},Kt={},Jt={},Ht={},lr;function kt(){return lr||(lr=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 r extends t{constructor(o){if(super(),!e.IDENTIFIER.test(o))throw new Error("CodeGen: name must be a valid identifier");this.str=o}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(o){super(),this._items=typeof o=="string"?[o]:o}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const o=this._items[0];return o===""||o==='""'}get str(){var o;return(o=this._str)!==null&&o!==void 0?o:this._str=this._items.reduce((l,y)=>`${l}${y}`,"")}get names(){var o;return(o=this._names)!==null&&o!==void 0?o:this._names=this._items.reduce((l,y)=>(y instanceof r&&(l[y.str]=(l[y.str]||0)+1),l),{})}}e._Code=n,e.nil=new n("");function a(p,...o){const l=[p[0]];let y=0;for(;y<o.length;)i(l,o[y]),l.push(p[++y]);return new n(l)}e._=a;const s=new n("+");function d(p,...o){const l=[g(p[0])];let y=0;for(;y<o.length;)l.push(s),i(l,o[y]),l.push(s,g(p[++y]));return u(l),new n(l)}e.str=d;function i(p,o){o instanceof n?p.push(...o._items):o instanceof r?p.push(o):p.push(E(o))}e.addCodeArg=i;function u(p){let o=1;for(;o<p.length-1;){if(p[o]===s){const l=$(p[o-1],p[o+1]);if(l!==void 0){p.splice(o-1,3,l);continue}p[o++]="+"}o++}}function $(p,o){if(o==='""')return p;if(p==='""')return o;if(typeof p=="string")return o instanceof r||p[p.length-1]!=='"'?void 0:typeof o!="string"?`${p.slice(0,-1)}${o}"`:o[0]==='"'?p.slice(0,-1)+o.slice(1):void 0;if(typeof o=="string"&&o[0]==='"'&&!(p instanceof r))return`"${p}${o.slice(1)}`}function _(p,o){return o.emptyStr()?p:p.emptyStr()?o:d`${p}${o}`}e.strConcat=_;function E(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:g(Array.isArray(p)?p.join(","):p)}function v(p){return new n(g(p))}e.stringify=v;function g(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function b(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):a`[${p}]`}e.getProperty=b;function w(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=w;function f(p){return new n(p.toString())}e.regexpCode=f})(Ht)),Ht}var Gt={},fr;function pr(){return fr||(fr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=kt();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var n;(function(u){u[u.Started=0]="Started",u[u.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 a{constructor({prefixes:$,parent:_}={}){this._names={},this._prefixes=$,this._parent=_}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const _=this._names[$]||this._nameGroup($);return`${$}${_.index++}`}_nameGroup($){var _,E;if(!((E=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||E===void 0)&&E.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=a;class s extends t.Name{constructor($,_){super(_),this.prefix=$}setValue($,{property:_,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(_)}[${E}]`}}e.ValueScopeName=s;const d=(0,t._)`\n`;class i extends a{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?d:t.nil}}get(){return this._scope}name($){return new s($,this._newName($))}value($,_){var E;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:g}=v,b=(E=_.key)!==null&&E!==void 0?E:_.ref;let w=this._values[g];if(w){const o=w.get(b);if(o)return o}else w=this._values[g]=new Map;w.set(b,v);const f=this._scope[g]||(this._scope[g]=[]),p=f.length;return f[p]=_.ref,v.setValue(_,{property:g,itemIndex:p}),v}getValue($,_){const E=this._values[$];if(E)return E.get(_)}scopeRefs($,_=this._values){return this._reduceValues(_,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,_,E){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},_,E)}_reduceValues($,_,E={},v){let g=t.nil;for(const b in $){const w=$[b];if(!w)continue;const f=E[b]=E[b]||new Map;w.forEach(p=>{if(f.has(p))return;f.set(p,n.Started);let o=_(p);if(o){const l=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${l} ${p} = ${o};${this.opts._n}`}else if(o=v?.(p))g=(0,t._)`${g}${o}${this.opts._n}`;else throw new r(p);f.set(p,n.Completed)})}return g}}e.ValueScope=i})(Gt)),Gt}var mr;function G(){return mr||(mr=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=kt(),r=pr();var n=kt();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 a=pr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.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 s{optimizeNodes(){return this}optimizeNames(m,S){return this}}class d extends s{constructor(m,S,C){super(),this.varKind=m,this.name=S,this.rhs=C}render({es5:m,_n:S}){const C=m?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${U};`+S}optimizeNames(m,S){if(m[this.name.str])return this.rhs&&(this.rhs=F(this.rhs,m,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends s{constructor(m,S,C){super(),this.lhs=m,this.rhs=S,this.sideEffects=C}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,S){if(!(this.lhs instanceof t.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=F(this.rhs,m,S),this}get names(){const m=this.lhs instanceof t.Name?{}:{...this.lhs.names};return L(m,this.rhs)}}class u extends i{constructor(m,S,C,U){super(m,C,U),this.op=S}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class $ extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class _ extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class E extends s{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class v extends s{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,S){return this.code=F(this.code,m,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends s{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((S,C)=>S+C.render(m),"")}optimizeNodes(){const{nodes:m}=this;let S=m.length;for(;S--;){const C=m[S].optimizeNodes();Array.isArray(C)?m.splice(S,1,...C):C?m[S]=C:m.splice(S,1)}return m.length>0?this:void 0}optimizeNames(m,S){const{nodes:C}=this;let U=C.length;for(;U--;){const J=C[U];J.optimizeNames(m,S)||(Q(m,J.names),C.splice(U,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((m,S)=>V(m,S.names),{})}}class b extends g{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class w extends g{}class f extends b{}f.kind="else";class p extends b{constructor(m,S){super(S),this.condition=m}render(m){let S=`if(${this.condition})`+super.render(m);return this.else&&(S+="else "+this.else.render(m)),S}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let S=this.else;if(S){const C=S.optimizeNodes();S=this.else=Array.isArray(C)?new f(C):C}if(S)return m===!1?S instanceof p?S:S.nodes:this.nodes.length?this:new p(ie(m),S instanceof p?[S]:S.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,S){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(m,S),!!(super.optimizeNames(m,S)||this.else))return this.condition=F(this.condition,m,S),this}get names(){const m=super.names;return L(m,this.condition),this.else&&V(m,this.else.names),m}}p.kind="if";class o extends b{}o.kind="for";class l extends o{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iteration=F(this.iteration,m,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends o{constructor(m,S,C,U){super(),this.varKind=m,this.name=S,this.from=C,this.to=U}render(m){const S=m.es5?r.varKinds.var:this.varKind,{name:C,from:U,to:J}=this;return`for(${S} ${C}=${U}; ${C}<${J}; ${C}++)`+super.render(m)}get names(){const m=L(super.names,this.from);return L(m,this.to)}}class c extends o{constructor(m,S,C,U){super(),this.loop=m,this.varKind=S,this.name=C,this.iterable=U}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iterable=F(this.iterable,m,S),this}get names(){return V(super.names,this.iterable.names)}}class h extends b{constructor(m,S,C){super(),this.name=m,this.args=S,this.async=C}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}h.kind="func";class P extends g{render(m){return"return "+super.render(m)}}P.kind="return";class N extends b{render(m){let S="try"+super.render(m);return this.catch&&(S+=this.catch.render(m)),this.finally&&(S+=this.finally.render(m)),S}optimizeNodes(){var m,S;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(m,S){var C,U;return super.optimizeNames(m,S),(C=this.catch)===null||C===void 0||C.optimizeNames(m,S),(U=this.finally)===null||U===void 0||U.optimizeNames(m,S),this}get names(){const m=super.names;return this.catch&&V(m,this.catch.names),this.finally&&V(m,this.finally.names),m}}class T extends b{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}T.kind="catch";class z extends b{render(m){return"finally"+super.render(m)}}z.kind="finally";class O{constructor(m,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
2
+ `:""},this._extScope=m,this._scope=new r.Scope({parent:m}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,S){const C=this._extScope.value(m,S);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(m,S){return this._extScope.getValue(m,S)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,S,C,U){const J=this._scope.toName(S);return C!==void 0&&U&&(this._constants[J.str]=C),this._leafNode(new d(m,J,C)),J}const(m,S,C){return this._def(r.varKinds.const,m,S,C)}let(m,S,C){return this._def(r.varKinds.let,m,S,C)}var(m,S,C){return this._def(r.varKinds.var,m,S,C)}assign(m,S,C){return this._leafNode(new i(m,S,C))}add(m,S){return this._leafNode(new u(m,e.operators.ADD,S))}code(m){return typeof m=="function"?m():m!==t.nil&&this._leafNode(new v(m)),this}object(...m){const S=["{"];for(const[C,U]of m)S.length>1&&S.push(","),S.push(C),(C!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(m,S,C){if(this._blockNode(new p(m)),S&&C)this.code(S).else().code(C).endIf();else if(S)this.code(S).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new p(m))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(p,f)}_for(m,S){return this._blockNode(m),S&&this.code(S).endFor(),this}for(m,S){return this._for(new l(m),S)}forRange(m,S,C,U,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const x=this._scope.toName(m);return this._for(new y(J,x,S,C),()=>U(x))}forOf(m,S,C,U=r.varKinds.const){const J=this._scope.toName(m);if(this.opts.es5){const x=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${x}.length`,B=>{this.var(J,(0,t._)`${x}[${B}]`),C(J)})}return this._for(new c("of",U,J,S),()=>C(J))}forIn(m,S,C,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,t._)`Object.keys(${S})`,C);const J=this._scope.toName(m);return this._for(new c("in",U,J,S),()=>C(J))}endFor(){return this._endBlockNode(o)}label(m){return this._leafNode(new $(m))}break(m){return this._leafNode(new _(m))}return(m){const S=new P;if(this._blockNode(S),this.code(m),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(m,S,C){if(!S&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new N;if(this._blockNode(U),this.code(m),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return C&&(this._currNode=U.finally=new z,this.code(C)),this._endBlockNode(T,z)}throw(m){return this._leafNode(new E(m))}block(m,S){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(S),this}endBlock(m){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-S;if(C<0||m!==void 0&&C!==m)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${m} expected`);return this._nodes.length=S,this}func(m,S=t.nil,C,U){return this._blockNode(new h(m,S,C)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(h)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,S){const C=this._currNode;if(C instanceof m||S&&C instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${m.kind}/${S.kind}`:m.kind}"`)}_elseNode(m){const S=this._currNode;if(!(S instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const S=this._nodes;S[S.length-1]=m}}e.CodeGen=O;function V(I,m){for(const S in m)I[S]=(I[S]||0)+(m[S]||0);return I}function L(I,m){return m instanceof t._CodeOrName?V(I,m.names):I}function F(I,m,S){if(I instanceof t.Name)return C(I);if(!U(I))return I;return new t._Code(I._items.reduce((J,x)=>(x instanceof t.Name&&(x=C(x)),x instanceof t._Code?J.push(...x._items):J.push(x),J),[]));function C(J){const x=S[J.str];return x===void 0||m[J.str]!==1?J:(delete m[J.str],x)}function U(J){return J instanceof t._Code&&J._items.some(x=>x instanceof t.Name&&m[x.str]===1&&S[x.str]!==void 0)}}function Q(I,m){for(const S in m)I[S]=(I[S]||0)-(m[S]||0)}function ie(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${D(I)}`}e.not=ie;const oe=j(e.operators.AND);function X(...I){return I.reduce(oe)}e.and=X;const pe=j(e.operators.OR);function A(...I){return I.reduce(pe)}e.or=A;function j(I){return(m,S)=>m===t.nil?S:S===t.nil?m:(0,t._)`${D(m)} ${I} ${D(S)}`}function D(I){return I instanceof t.Name?I:(0,t._)`(${I})`}})(Jt)),Jt}var H={},hr;function Y(){if(hr)return H;hr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=G(),t=kt();function r(c){const h={};for(const P of c)h[P]=!0;return h}H.toHash=r;function n(c,h){return typeof h=="boolean"?h:Object.keys(h).length===0?!0:(a(c,h),!s(h,c.self.RULES.all))}H.alwaysValidSchema=n;function a(c,h=c.schema){const{opts:P,self:N}=c;if(!P.strictSchema||typeof h=="boolean")return;const T=N.RULES.keywords;for(const z in h)T[z]||y(c,`unknown keyword: "${z}"`)}H.checkUnknownRules=a;function s(c,h){if(typeof c=="boolean")return!c;for(const P in c)if(h[P])return!0;return!1}H.schemaHasRules=s;function d(c,h){if(typeof c=="boolean")return!c;for(const P in c)if(P!=="$ref"&&h.all[P])return!0;return!1}H.schemaHasRulesButRef=d;function i({topSchemaRef:c,schemaPath:h},P,N,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${c}${h}${(0,e.getProperty)(N)}`}H.schemaRefOrVal=i;function u(c){return E(decodeURIComponent(c))}H.unescapeFragment=u;function $(c){return encodeURIComponent(_(c))}H.escapeFragment=$;function _(c){return typeof c=="number"?`${c}`:c.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=_;function E(c){return c.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function v(c,h){if(Array.isArray(c))for(const P of c)h(P);else h(c)}H.eachItem=v;function g({mergeNames:c,mergeToName:h,mergeValues:P,resultToName:N}){return(T,z,O,V)=>{const L=O===void 0?z:O instanceof e.Name?(z instanceof e.Name?c(T,z,O):h(T,z,O),O):z instanceof e.Name?(h(T,O,z),z):P(z,O);return V===e.Name&&!(L instanceof e.Name)?N(T,L):L}}H.mergeEvaluated={props:g({mergeNames:(c,h,P)=>c.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>{c.if((0,e._)`${h} === true`,()=>c.assign(P,!0),()=>c.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${h})`))}),mergeToName:(c,h,P)=>c.if((0,e._)`${P} !== true`,()=>{h===!0?c.assign(P,!0):(c.assign(P,(0,e._)`${P} || {}`),w(c,P,h))}),mergeValues:(c,h)=>c===!0?!0:{...c,...h},resultToName:b}),items:g({mergeNames:(c,h,P)=>c.if((0,e._)`${P} !== true && ${h} !== undefined`,()=>c.assign(P,(0,e._)`${h} === true ? true : ${P} > ${h} ? ${P} : ${h}`)),mergeToName:(c,h,P)=>c.if((0,e._)`${P} !== true`,()=>c.assign(P,h===!0?!0:(0,e._)`${P} > ${h} ? ${P} : ${h}`)),mergeValues:(c,h)=>c===!0?!0:Math.max(c,h),resultToName:(c,h)=>c.var("items",h)})};function b(c,h){if(h===!0)return c.var("props",!0);const P=c.var("props",(0,e._)`{}`);return h!==void 0&&w(c,P,h),P}H.evaluatedPropsToName=b;function w(c,h,P){Object.keys(P).forEach(N=>c.assign((0,e._)`${h}${(0,e.getProperty)(N)}`,!0))}H.setEvaluated=w;const f={};function p(c,h){return c.scopeValue("func",{ref:h,code:f[h.code]||(f[h.code]=new t._Code(h.code))})}H.useFunc=p;var o;(function(c){c[c.Num=0]="Num",c[c.Str=1]="Str"})(o||(H.Type=o={}));function l(c,h,P){if(c instanceof e.Name){const N=h===o.Num;return P?N?(0,e._)`"[" + ${c} + "]"`:(0,e._)`"['" + ${c} + "']"`:N?(0,e._)`"/" + ${c}`:(0,e._)`"/" + ${c}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(c).toString():"/"+_(c)}H.getErrorPath=l;function y(c,h,P=c.opts.strictSchema){if(P){if(h=`strict mode: ${h}`,P===!0)throw new Error(h);c.self.logger.warn(h)}}return H.checkStrictMode=y,H}var Fe={},yr;function Se(){if(yr)return Fe;yr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=G(),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 Fe.default=t,Fe}var gr;function Tt(){return gr||(gr=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=G(),r=Y(),n=Se();e.keywordError={message:({keyword:f})=>(0,t.str)`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:p})=>p?(0,t.str)`"${f}" keyword must be ${p} ($data)`:(0,t.str)`"${f}" keyword is invalid ($data)`};function a(f,p=e.keywordError,o,l){const{it:y}=f,{gen:c,compositeRule:h,allErrors:P}=y,N=E(f,p,o);l??(h||P)?u(c,N):$(y,(0,t._)`[${N}]`)}e.reportError=a;function s(f,p=e.keywordError,o){const{it:l}=f,{gen:y,compositeRule:c,allErrors:h}=l,P=E(f,p,o);u(y,P),c||h||$(l,n.default.vErrors)}e.reportExtraError=s;function d(f,p){f.assign(n.default.errors,p),f.if((0,t._)`${n.default.vErrors} !== null`,()=>f.if(p,()=>f.assign((0,t._)`${n.default.vErrors}.length`,p),()=>f.assign(n.default.vErrors,null)))}e.resetErrorsCount=d;function i({gen:f,keyword:p,schemaValue:o,data:l,errsCount:y,it:c}){if(y===void 0)throw new Error("ajv implementation error");const h=f.name("err");f.forRange("i",y,n.default.errors,P=>{f.const(h,(0,t._)`${n.default.vErrors}[${P}]`),f.if((0,t._)`${h}.instancePath === undefined`,()=>f.assign((0,t._)`${h}.instancePath`,(0,t.strConcat)(n.default.instancePath,c.errorPath))),f.assign((0,t._)`${h}.schemaPath`,(0,t.str)`${c.errSchemaPath}/${p}`),c.opts.verbose&&(f.assign((0,t._)`${h}.schema`,o),f.assign((0,t._)`${h}.data`,l))})}e.extendErrors=i;function u(f,p){const o=f.const("err",p);f.if((0,t._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,t._)`[${o}]`),(0,t._)`${n.default.vErrors}.push(${o})`),f.code((0,t._)`${n.default.errors}++`)}function $(f,p){const{gen:o,validateName:l,schemaEnv:y}=f;y.$async?o.throw((0,t._)`new ${f.ValidationError}(${p})`):(o.assign((0,t._)`${l}.errors`,p),o.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 E(f,p,o){const{createErrors:l}=f.it;return l===!1?(0,t._)`{}`:v(f,p,o)}function v(f,p,o={}){const{gen:l,it:y}=f,c=[g(y,o),b(f,o)];return w(f,p,c),l.object(...c)}function g({errorPath:f},{instancePath:p}){const o=p?(0,t.str)`${f}${(0,r.getErrorPath)(p,r.Type.Str)}`:f;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function b({keyword:f,it:{errSchemaPath:p}},{schemaPath:o,parentSchema:l}){let y=l?p:(0,t.str)`${p}/${f}`;return o&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(o,r.Type.Str)}`),[_.schemaPath,y]}function w(f,{params:p,message:o},l){const{keyword:y,data:c,schemaValue:h,it:P}=f,{opts:N,propertyName:T,topSchemaRef:z,schemaPath:O}=P;l.push([_.keyword,y],[_.params,typeof p=="function"?p(f):p||(0,t._)`{}`]),N.messages&&l.push([_.message,typeof o=="function"?o(f):o]),N.verbose&&l.push([_.schema,h],[_.parentSchema,(0,t._)`${z}${O}`],[n.default.data,c]),T&&l.push([_.propertyName,T])}})(Kt)),Kt}var vr;function ys(){if(vr)return Ee;vr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.boolOrEmptySchema=Ee.topBoolOrEmptySchema=void 0;const e=Tt(),t=G(),r=Se(),n={message:"boolean schema is false"};function a(i){const{gen:u,schema:$,validateName:_}=i;$===!1?d(i,!1):typeof $=="object"&&$.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${_}.errors`,null),u.return(!0))}Ee.topBoolOrEmptySchema=a;function s(i,u){const{gen:$,schema:_}=i;_===!1?($.var(u,!1),d(i)):$.var(u,!0)}Ee.boolOrEmptySchema=s;function d(i,u){const{gen:$,data:_}=i,E={gen:$,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(E,n,void 0,u)}return Ee}var se={},ke={},_r;function On(){if(_r)return ke;_r=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRules=ke.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(a){return typeof a=="string"&&t.has(a)}ke.isJSONType=r;function n(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=n,ke}var _e={},$r;function qn(){if($r)return _e;$r=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:n,self:a},s){const d=a.RULES.types[s];return d&&d!==!0&&t(n,d)}_e.schemaHasRulesForType=e;function t(n,a){return a.rules.some(s=>r(n,s))}_e.shouldUseGroup=t;function r(n,a){var s;return n[a.keyword]!==void 0||((s=a.definition.implements)===null||s===void 0?void 0:s.some(d=>n[d]!==void 0))}return _e.shouldUseRule=r,_e}var br;function jt(){if(br)return se;br=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=On(),t=qn(),r=Tt(),n=G(),a=Y();var s;(function(o){o[o.Correct=0]="Correct",o[o.Wrong=1]="Wrong"})(s||(se.DataType=s={}));function d(o){const l=i(o.type);if(l.includes("null")){if(o.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!l.length&&o.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');o.nullable===!0&&l.push("null")}return l}se.getSchemaTypes=d;function i(o){const l=Array.isArray(o)?o:o?[o]:[];if(l.every(e.isJSONType))return l;throw new Error("type must be JSONType or JSONType[]: "+l.join(","))}se.getJSONTypes=i;function u(o,l){const{gen:y,data:c,opts:h}=o,P=_(l,h.coerceTypes),N=l.length>0&&!(P.length===0&&l.length===1&&(0,t.schemaHasRulesForType)(o,l[0]));if(N){const T=b(l,c,h.strictNumbers,s.Wrong);y.if(T,()=>{P.length?E(o,l,P):f(o)})}return N}se.coerceAndCheckDataType=u;const $=new Set(["string","number","integer","boolean","null"]);function _(o,l){return l?o.filter(y=>$.has(y)||l==="array"&&y==="array"):[]}function E(o,l,y){const{gen:c,data:h,opts:P}=o,N=c.let("dataType",(0,n._)`typeof ${h}`),T=c.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&c.if((0,n._)`${N} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>c.assign(h,(0,n._)`${h}[0]`).assign(N,(0,n._)`typeof ${h}`).if(b(l,h,P.strictNumbers),()=>c.assign(T,h))),c.if((0,n._)`${T} !== undefined`);for(const O of y)($.has(O)||O==="array"&&P.coerceTypes==="array")&&z(O);c.else(),f(o),c.endIf(),c.if((0,n._)`${T} !== undefined`,()=>{c.assign(h,T),v(o,T)});function z(O){switch(O){case"string":c.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(T,(0,n._)`"" + ${h}`).elseIf((0,n._)`${h} === null`).assign(T,(0,n._)`""`);return;case"number":c.elseIf((0,n._)`${N} == "boolean" || ${h} === null
3
+ || (${N} == "string" && ${h} && ${h} == +${h})`).assign(T,(0,n._)`+${h}`);return;case"integer":c.elseIf((0,n._)`${N} === "boolean" || ${h} === null
4
+ || (${N} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(T,(0,n._)`+${h}`);return;case"boolean":c.elseIf((0,n._)`${h} === "false" || ${h} === 0 || ${h} === null`).assign(T,!1).elseIf((0,n._)`${h} === "true" || ${h} === 1`).assign(T,!0);return;case"null":c.elseIf((0,n._)`${h} === "" || ${h} === 0 || ${h} === false`),c.assign(T,null);return;case"array":c.elseIf((0,n._)`${N} === "string" || ${N} === "number"
5
+ || ${N} === "boolean" || ${h} === null`).assign(T,(0,n._)`[${h}]`)}}}function v({gen:o,parentData:l,parentDataProperty:y},c){o.if((0,n._)`${l} !== undefined`,()=>o.assign((0,n._)`${l}[${y}]`,c))}function g(o,l,y,c=s.Correct){const h=c===s.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(o){case"null":return(0,n._)`${l} ${h} null`;case"array":P=(0,n._)`Array.isArray(${l})`;break;case"object":P=(0,n._)`${l} && typeof ${l} == "object" && !Array.isArray(${l})`;break;case"integer":P=N((0,n._)`!(${l} % 1) && !isNaN(${l})`);break;case"number":P=N();break;default:return(0,n._)`typeof ${l} ${h} ${o}`}return c===s.Correct?P:(0,n.not)(P);function N(T=n.nil){return(0,n.and)((0,n._)`typeof ${l} == "number"`,T,y?(0,n._)`isFinite(${l})`:n.nil)}}se.checkDataType=g;function b(o,l,y,c){if(o.length===1)return g(o[0],l,y,c);let h;const P=(0,a.toHash)(o);if(P.array&&P.object){const N=(0,n._)`typeof ${l} != "object"`;h=P.null?N:(0,n._)`!${l} || ${N}`,delete P.null,delete P.array,delete P.object}else h=n.nil;P.number&&delete P.integer;for(const N in P)h=(0,n.and)(h,g(N,l,y,c));return h}se.checkDataTypes=b;const w={message:({schema:o})=>`must be ${o}`,params:({schema:o,schemaValue:l})=>typeof o=="string"?(0,n._)`{type: ${o}}`:(0,n._)`{type: ${l}}`};function f(o){const l=p(o);(0,r.reportError)(l,w)}se.reportTypeError=f;function p(o){const{gen:l,data:y,schema:c}=o,h=(0,a.schemaRefOrVal)(o,c,"type");return{gen:l,keyword:"type",data:y,schema:c.type,schemaCode:h,schemaValue:h,parentSchema:c,params:{},it:o}}return se}var qe={},wr;function gs(){if(wr)return qe;wr=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assignDefaults=void 0;const e=G(),t=Y();function r(a,s){const{properties:d,items:i}=a.schema;if(s==="object"&&d)for(const u in d)n(a,u,d[u].default);else s==="array"&&Array.isArray(i)&&i.forEach((u,$)=>n(a,$,u.default))}qe.assignDefaults=r;function n(a,s,d){const{gen:i,compositeRule:u,data:$,opts:_}=a;if(d===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(s)}`;if(u){(0,t.checkStrictMode)(a,`default is ignored for: ${E}`);return}let v=(0,e._)`${E} === undefined`;_.useDefaults==="empty"&&(v=(0,e._)`${v} || ${E} === null || ${E} === ""`),i.if(v,(0,e._)`${E} = ${(0,e.stringify)(d)}`)}return qe}var he={},Z={},Pr;function ge(){if(Pr)return Z;Pr=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.validateUnion=Z.validateArray=Z.usePattern=Z.callValidateCode=Z.schemaProperties=Z.allSchemaProperties=Z.noPropertyInData=Z.propertyInData=Z.isOwnProperty=Z.hasPropFunc=Z.reportMissingProp=Z.checkMissingProp=Z.checkReportMissingProp=void 0;const e=G(),t=Y(),r=Se(),n=Y();function a(o,l){const{gen:y,data:c,it:h}=o;y.if(_(y,c,l,h.opts.ownProperties),()=>{o.setParams({missingProperty:(0,e._)`${l}`},!0),o.error()})}Z.checkReportMissingProp=a;function s({gen:o,data:l,it:{opts:y}},c,h){return(0,e.or)(...c.map(P=>(0,e.and)(_(o,l,P,y.ownProperties),(0,e._)`${h} = ${P}`)))}Z.checkMissingProp=s;function d(o,l){o.setParams({missingProperty:l},!0),o.error()}Z.reportMissingProp=d;function i(o){return o.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Z.hasPropFunc=i;function u(o,l,y){return(0,e._)`${i(o)}.call(${l}, ${y})`}Z.isOwnProperty=u;function $(o,l,y,c){const h=(0,e._)`${l}${(0,e.getProperty)(y)} !== undefined`;return c?(0,e._)`${h} && ${u(o,l,y)}`:h}Z.propertyInData=$;function _(o,l,y,c){const h=(0,e._)`${l}${(0,e.getProperty)(y)} === undefined`;return c?(0,e.or)(h,(0,e.not)(u(o,l,y))):h}Z.noPropertyInData=_;function E(o){return o?Object.keys(o).filter(l=>l!=="__proto__"):[]}Z.allSchemaProperties=E;function v(o,l){return E(l).filter(y=>!(0,t.alwaysValidSchema)(o,l[y]))}Z.schemaProperties=v;function g({schemaCode:o,data:l,it:{gen:y,topSchemaRef:c,schemaPath:h,errorPath:P},it:N},T,z,O){const V=O?(0,e._)`${o}, ${l}, ${c}${h}`:l,L=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,N.parentData],[r.default.parentDataProperty,N.parentDataProperty],[r.default.rootData,r.default.rootData]];N.opts.dynamicRef&&L.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const F=(0,e._)`${V}, ${y.object(...L)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${F})`:(0,e._)`${T}(${F})`}Z.callValidateCode=g;const b=(0,e._)`new RegExp`;function w({gen:o,it:{opts:l}},y){const c=l.unicodeRegExp?"u":"",{regExp:h}=l.code,P=h(y,c);return o.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${h.code==="new RegExp"?b:(0,n.useFunc)(o,h)}(${y}, ${c})`})}Z.usePattern=w;function f(o){const{gen:l,data:y,keyword:c,it:h}=o,P=l.name("valid");if(h.allErrors){const T=l.let("valid",!0);return N(()=>l.assign(T,!1)),T}return l.var(P,!0),N(()=>l.break()),P;function N(T){const z=l.const("len",(0,e._)`${y}.length`);l.forRange("i",0,z,O=>{o.subschema({keyword:c,dataProp:O,dataPropType:t.Type.Num},P),l.if((0,e.not)(P),T)})}}Z.validateArray=f;function p(o){const{gen:l,schema:y,keyword:c,it:h}=o;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(h,z))&&!h.opts.unevaluated)return;const N=l.let("valid",!1),T=l.name("_valid");l.block(()=>y.forEach((z,O)=>{const V=o.subschema({keyword:c,schemaProp:O,compositeRule:!0},T);l.assign(N,(0,e._)`${N} || ${T}`),o.mergeValidEvaluated(V,T)||l.if((0,e.not)(N))})),o.result(N,()=>o.reset(),()=>o.error(!0))}return Z.validateUnion=p,Z}var Sr;function vs(){if(Sr)return he;Sr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=G(),t=Se(),r=ge(),n=Tt();function a(v,g){const{gen:b,keyword:w,schema:f,parentSchema:p,it:o}=v,l=g.macro.call(o.self,f,p,o),y=$(b,w,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const c=b.name("valid");v.subschema({schema:l,schemaPath:e.nil,errSchemaPath:`${o.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},c),v.pass(c,()=>v.error(!0))}he.macroKeywordCode=a;function s(v,g){var b;const{gen:w,keyword:f,schema:p,parentSchema:o,$data:l,it:y}=v;u(y,g);const c=!l&&g.compile?g.compile.call(y.self,p,o,y):g.validate,h=$(w,f,c),P=w.let("valid");v.block$data(P,N),v.ok((b=g.valid)!==null&&b!==void 0?b:P);function N(){if(g.errors===!1)O(),g.modifying&&d(v),V(()=>v.error());else{const L=g.async?T():z();g.modifying&&d(v),V(()=>i(v,L))}}function T(){const L=w.let("ruleErrs",null);return w.try(()=>O((0,e._)`await `),F=>w.assign(P,!1).if((0,e._)`${F} instanceof ${y.ValidationError}`,()=>w.assign(L,(0,e._)`${F}.errors`),()=>w.throw(F))),L}function z(){const L=(0,e._)`${h}.errors`;return w.assign(L,null),O(e.nil),L}function O(L=g.async?(0,e._)`await `:e.nil){const F=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in g&&!l||g.schema===!1);w.assign(P,(0,e._)`${L}${(0,r.callValidateCode)(v,h,F,Q)}`,g.modifying)}function V(L){var F;w.if((0,e.not)((F=g.valid)!==null&&F!==void 0?F:P),L)}}he.funcKeywordCode=s;function d(v){const{gen:g,data:b,it:w}=v;g.if(w.parentData,()=>g.assign(b,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function i(v,g){const{gen:b}=v;b.if((0,e._)`Array.isArray(${g})`,()=>{b.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)(v)},()=>v.error())}function u({schemaEnv:v},g){if(g.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,g,b){if(b===void 0)throw new Error(`keyword "${g}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function _(v,g,b=!1){return!g.length||g.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||b&&typeof v>"u")}he.validSchemaType=_;function E({schema:v,opts:g,self:b,errSchemaPath:w},f,p){if(Array.isArray(f.keyword)?!f.keyword.includes(p):f.keyword!==p)throw new Error("ajv implementation error");const o=f.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(v,l)))throw new Error(`parent schema must have dependencies of ${p}: ${o.join(",")}`);if(f.validateSchema&&!f.validateSchema(v[p])){const y=`keyword "${p}" value is invalid at path "${w}": `+b.errorsText(f.validateSchema.errors);if(g.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return he.validateKeywordUsage=E,he}var $e={},Er;function _s(){if(Er)return $e;Er=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=G(),t=Y();function r(s,{keyword:d,schemaProp:i,schema:u,schemaPath:$,errSchemaPath:_,topSchemaRef:E}){if(d!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(d!==void 0){const v=s.schema[d];return i===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${d}`}:{schema:v[i],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(d)}${(0,e.getProperty)(i)}`,errSchemaPath:`${s.errSchemaPath}/${d}/${(0,t.escapeFragment)(i)}`}}if(u!==void 0){if($===void 0||_===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:$,topSchemaRef:E,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function n(s,d,{dataProp:i,dataPropType:u,data:$,dataTypes:_,propertyName:E}){if($!==void 0&&i!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=d;if(i!==void 0){const{errorPath:b,dataPathArr:w,opts:f}=d,p=v.let("data",(0,e._)`${d.data}${(0,e.getProperty)(i)}`,!0);g(p),s.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(i,u,f.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${i}`,s.dataPathArr=[...w,s.parentDataProperty]}if($!==void 0){const b=$ instanceof e.Name?$:v.let("data",$,!0);g(b),E!==void 0&&(s.propertyName=E)}_&&(s.dataTypes=_);function g(b){s.data=b,s.dataLevel=d.dataLevel+1,s.dataTypes=[],d.definedProperties=new Set,s.parentData=d.data,s.dataNames=[...d.dataNames,b]}}$e.extendSubschemaData=n;function a(s,{jtdDiscriminator:d,jtdMetadata:i,compositeRule:u,createErrors:$,allErrors:_}){u!==void 0&&(s.compositeRule=u),$!==void 0&&(s.createErrors=$),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=d,s.jtdMetadata=i}return $e.extendSubschemaMode=a,$e}var ae={},Wt,kr;function Dn(){return kr||(kr=1,Wt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!==0;){var d=s[a];if(!e(t[d],r[d]))return!1}return!0}return t!==t&&r!==r}),Wt}var Bt={exports:{}},jr;function $s(){if(jr)return Bt.exports;jr=1;var e=Bt.exports=function(n,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var d=typeof s=="function"?s:s.pre||function(){},i=s.post||function(){};t(a,d,i,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,a,s,d,i,u,$,_,E,v){if(d&&typeof d=="object"&&!Array.isArray(d)){a(d,i,u,$,_,E,v);for(var g in d){var b=d[g];if(Array.isArray(b)){if(g in e.arrayKeywords)for(var w=0;w<b.length;w++)t(n,a,s,b[w],i+"/"+g+"/"+w,u,i,g,d,w)}else if(g in e.propsKeywords){if(b&&typeof b=="object")for(var f in b)t(n,a,s,b[f],i+"/"+g+"/"+r(f),u,i,g,d,f)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,a,s,b,i+"/"+g,u,i,g,d)}s(d,i,u,$,_,E,v)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Bt.exports}var Rr;function At(){if(Rr)return ae;Rr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=Dn(),r=$s(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(w,f=!0){return typeof w=="boolean"?!0:f===!0?!d(w):f?i(w)<=f:!1}ae.inlineRef=a;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function d(w){for(const f in w){if(s.has(f))return!0;const p=w[f];if(Array.isArray(p)&&p.some(d)||typeof p=="object"&&d(p))return!0}return!1}function i(w){let f=0;for(const p in w){if(p==="$ref")return 1/0;if(f++,!n.has(p)&&(typeof w[p]=="object"&&(0,e.eachItem)(w[p],o=>f+=i(o)),f===1/0))return 1/0}return f}function u(w,f="",p){p!==!1&&(f=E(f));const o=w.parse(f);return $(w,o)}ae.getFullPath=u;function $(w,f){return w.serialize(f).split("#")[0]+"#"}ae._getFullPath=$;const _=/#\/?$/;function E(w){return w?w.replace(_,""):""}ae.normalizeId=E;function v(w,f,p){return p=E(p),w.resolve(f,p)}ae.resolveUrl=v;const g=/^[a-z_][-a-z0-9._]*$/i;function b(w,f){if(typeof w=="boolean")return{};const{schemaId:p,uriResolver:o}=this.opts,l=E(w[p]||f),y={"":l},c=u(o,l,!1),h={},P=new Set;return r(w,{allKeys:!0},(z,O,V,L)=>{if(L===void 0)return;const F=c+O;let Q=y[L];typeof z[p]=="string"&&(Q=ie.call(this,z[p])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[O]=Q;function ie(X){const pe=this.opts.uriResolver.resolve;if(X=E(Q?pe(Q,X):X),P.has(X))throw T(X);P.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?N(z,A.schema,X):X!==E(F)&&(X[0]==="#"?(N(z,h[X],X),h[X]=z):this.refs[X]=F),X}function oe(X){if(typeof X=="string"){if(!g.test(X))throw new Error(`invalid anchor "${X}"`);ie.call(this,`#${X}`)}}}),h;function N(z,O,V){if(O!==void 0&&!t(z,O))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=b,ae}var Ir;function Mt(){if(Ir)return ve;Ir=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=ys(),t=jt(),r=qn(),n=jt(),a=gs(),s=vs(),d=_s(),i=G(),u=Se(),$=At(),_=Y(),E=Tt();function v(k){if(c(k)&&(P(k),y(k))){f(k);return}g(k,()=>(0,e.topBoolOrEmptySchema)(k))}ve.validateFunctionCode=v;function g({gen:k,validateName:R,schema:q,schemaEnv:M,opts:K},W){K.code.es5?k.func(R,(0,i._)`${u.default.data}, ${u.default.valCxt}`,M.$async,()=>{k.code((0,i._)`"use strict"; ${o(q,K)}`),w(k,K),k.code(W)}):k.func(R,(0,i._)`${u.default.data}, ${b(K)}`,M.$async,()=>k.code(o(q,K)).code(W))}function b(k){return(0,i._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?(0,i._)`, ${u.default.dynamicAnchors}={}`:i.nil}}={}`}function w(k,R){k.if(u.default.valCxt,()=>{k.var(u.default.instancePath,(0,i._)`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,(0,i._)`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,(0,i._)`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,(0,i._)`${u.default.valCxt}.${u.default.rootData}`),R.dynamicRef&&k.var(u.default.dynamicAnchors,(0,i._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{k.var(u.default.instancePath,(0,i._)`""`),k.var(u.default.parentData,(0,i._)`undefined`),k.var(u.default.parentDataProperty,(0,i._)`undefined`),k.var(u.default.rootData,u.default.data),R.dynamicRef&&k.var(u.default.dynamicAnchors,(0,i._)`{}`)})}function f(k){const{schema:R,opts:q,gen:M}=k;g(k,()=>{q.$comment&&R.$comment&&L(k),z(k),M.let(u.default.vErrors,null),M.let(u.default.errors,0),q.unevaluated&&p(k),N(k),F(k)})}function p(k){const{gen:R,validateName:q}=k;k.evaluated=R.const("evaluated",(0,i._)`${q}.evaluated`),R.if((0,i._)`${k.evaluated}.dynamicProps`,()=>R.assign((0,i._)`${k.evaluated}.props`,(0,i._)`undefined`)),R.if((0,i._)`${k.evaluated}.dynamicItems`,()=>R.assign((0,i._)`${k.evaluated}.items`,(0,i._)`undefined`))}function o(k,R){const q=typeof k=="object"&&k[R.schemaId];return q&&(R.code.source||R.code.process)?(0,i._)`/*# sourceURL=${q} */`:i.nil}function l(k,R){if(c(k)&&(P(k),y(k))){h(k,R);return}(0,e.boolOrEmptySchema)(k,R)}function y({schema:k,self:R}){if(typeof k=="boolean")return!k;for(const q in k)if(R.RULES.all[q])return!0;return!1}function c(k){return typeof k.schema!="boolean"}function h(k,R){const{schema:q,gen:M,opts:K}=k;K.$comment&&q.$comment&&L(k),O(k),V(k);const W=M.const("_errs",u.default.errors);N(k,W),M.var(R,(0,i._)`${W} === ${u.default.errors}`)}function P(k){(0,_.checkUnknownRules)(k),T(k)}function N(k,R){if(k.opts.jtd)return ie(k,[],!1,R);const q=(0,t.getSchemaTypes)(k.schema),M=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!M,R)}function T(k){const{schema:R,errSchemaPath:q,opts:M,self:K}=k;R.$ref&&M.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:R,opts:q}=k;R.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(k,"default is ignored in the schema root")}function O(k){const R=k.schema[k.opts.schemaId];R&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,R))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:k,schemaEnv:R,schema:q,errSchemaPath:M,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,i._)`${u.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,i.str)`${M}/$comment`,me=k.scopeValue("root",{ref:R.root});k.code((0,i._)`${u.default.self}.opts.$comment(${W}, ${re}, ${me}.schema)`)}}function F(k){const{gen:R,schemaEnv:q,validateName:M,ValidationError:K,opts:W}=k;q.$async?R.if((0,i._)`${u.default.errors} === 0`,()=>R.return(u.default.data),()=>R.throw((0,i._)`new ${K}(${u.default.vErrors})`)):(R.assign((0,i._)`${M}.errors`,u.default.vErrors),W.unevaluated&&Q(k),R.return((0,i._)`${u.default.errors} === 0`))}function Q({gen:k,evaluated:R,props:q,items:M}){q instanceof i.Name&&k.assign((0,i._)`${R}.props`,q),M instanceof i.Name&&k.assign((0,i._)`${R}.items`,M)}function ie(k,R,q,M){const{gen:K,schema:W,data:re,allErrors:me,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,ne))){K.block(()=>U(k,"$ref",ne.all.$ref.definition));return}ce.jtd||X(k,R),K.block(()=>{for(const fe of ne.rules)Ie(fe);Ie(ne.post)});function Ie(fe){(0,r.shouldUseGroup)(W,fe)&&(fe.type?(K.if((0,n.checkDataType)(fe.type,re,ce.strictNumbers)),oe(k,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,n.reportTypeError)(k)),K.endIf()):oe(k,fe),me||K.if((0,i._)`${u.default.errors} === ${M||0}`))}}function oe(k,R){const{gen:q,schema:M,opts:{useDefaults:K}}=k;K&&(0,a.assignDefaults)(k,R.type),q.block(()=>{for(const W of R.rules)(0,r.shouldUseRule)(M,W)&&U(k,W.keyword,W.definition,R.type)})}function X(k,R){k.schemaEnv.meta||!k.opts.strictTypes||(pe(k,R),k.opts.allowUnionTypes||A(k,R),j(k,k.dataTypes))}function pe(k,R){if(R.length){if(!k.dataTypes.length){k.dataTypes=R;return}R.forEach(q=>{I(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),m(k,R)}}function A(k,R){R.length>1&&!(R.length===2&&R.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,R){const q=k.self.RULES.all;for(const M in q){const K=q[M];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(R,re))&&S(k,`missing type "${W.join(",")}" for keyword "${M}"`)}}}function D(k,R){return k.includes(R)||R==="number"&&k.includes("integer")}function I(k,R){return k.includes(R)||R==="integer"&&k.includes("number")}function m(k,R){const q=[];for(const M of k.dataTypes)I(R,M)?q.push(M):R.includes("integer")&&M==="number"&&q.push("integer");k.dataTypes=q}function S(k,R){const q=k.schemaEnv.baseId+k.errSchemaPath;R+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(k,R,k.opts.strictTypes)}class C{constructor(R,q,M){if((0,s.validateKeywordUsage)(R,q,M),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=M,this.data=R.data,this.schema=R.schema[M],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(R,this.schema,M,this.$data),this.schemaType=q.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=q,this.$data)this.schemaCode=R.gen.const("vSchema",B(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=R.gen.const("_errs",u.default.errors))}result(R,q,M){this.failResult((0,i.not)(R),q,M)}failResult(R,q,M){this.gen.if(R),M?M():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,q){this.failResult((0,i.not)(R),void 0,q)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:q}=this;this.fail((0,i._)`${q} !== undefined && (${(0,i.or)(this.invalid$data(),R)})`)}error(R,q,M){if(q){this.setParams(q),this._error(R,M),this.setParams({});return}this._error(R,M)}_error(R,q){(R?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.resetErrorsCount)(this.gen,this.errsCount)}ok(R){this.allErrors||this.gen.if(R)}setParams(R,q){q?Object.assign(this.params,R):this.params=R}block$data(R,q,M=i.nil){this.gen.block(()=>{this.check$data(R,M),q()})}check$data(R=i.nil,q=i.nil){if(!this.$data)return;const{gen:M,schemaCode:K,schemaType:W,def:re}=this;M.if((0,i.or)((0,i._)`${K} === undefined`,q)),R!==i.nil&&M.assign(R,!0),(W.length||re.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),R!==i.nil&&M.assign(R,!1)),M.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:M,def:K,it:W}=this;return(0,i.or)(re(),me());function re(){if(M.length){if(!(q instanceof i.Name))throw new Error("ajv implementation error");const ce=Array.isArray(M)?M:[M];return(0,i._)`${(0,n.checkDataTypes)(ce,q,W.opts.strictNumbers,n.DataType.Wrong)}`}return i.nil}function me(){if(K.validateSchema){const ce=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,i._)`!${ce}(${q})`}return i.nil}}subschema(R,q){const M=(0,d.getSubschema)(this.it,R);(0,d.extendSubschemaData)(M,this.it,R),(0,d.extendSubschemaMode)(M,R);const K={...this.it,...M,items:void 0,props:void 0};return l(K,q),K}mergeEvaluated(R,q){const{it:M,gen:K}=this;M.opts.unevaluated&&(M.props!==!0&&R.props!==void 0&&(M.props=_.mergeEvaluated.props(K,R.props,M.props,q)),M.items!==!0&&R.items!==void 0&&(M.items=_.mergeEvaluated.items(K,R.items,M.items,q)))}mergeValidEvaluated(R,q){const{it:M,gen:K}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,i.Name)),!0}}ve.KeywordCxt=C;function U(k,R,q,M){const K=new C(k,q,R);"code"in q?q.code(K,M):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:R,dataNames:q,dataPathArr:M}){let K,W;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=u.default.rootData}else{const de=x.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=R)throw new Error(ce("property/index",ne));return M[R-ne]}if(ne>R)throw new Error(ce("data",ne));if(W=q[R-ne],!K)return W}let re=W;const me=K.split("/");for(const de of me)de&&(W=(0,i._)`${W}${(0,i.getProperty)((0,_.unescapeJsonPointer)(de))}`,re=(0,i._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${R}`}}return ve.getData=B,ve}var Ue={},Nr;function rr(){if(Nr)return Ue;Nr=1,Object.defineProperty(Ue,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ue.default=e,Ue}var Ke={},Cr;function Vt(){if(Cr)return Ke;Cr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=At();class t extends Error{constructor(n,a,s,d){super(d||`can't resolve reference ${s} from id ${a}`),this.missingRef=(0,e.resolveUrl)(n,a,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ke.default=t,Ke}var le={},Or;function nr(){if(Or)return le;Or=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=G(),t=rr(),r=Se(),n=At(),a=Y(),s=Mt();class d{constructor(p){var o;this.refs={},this.dynamicAnchors={};let l;typeof p.schema=="object"&&(l=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(o=p.baseId)!==null&&o!==void 0?o:(0,n.normalizeId)(l?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=l?.$async,this.refs={}}}le.SchemaEnv=d;function i(f){const p=_.call(this,f);if(p)return p;const o=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:l,lines:y}=this.opts.code,{ownProperties:c}=this.opts,h=new e.CodeGen(this.scope,{es5:l,lines:y,ownProperties:c});let P;f.$async&&(P=h.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=h.scopeName("validate");f.validateName=N;const T={gen:h,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,e.stringify)(f.schema)}:{ref:f.schema}),validateName:N,ValidationError:P,schema:f.schema,schemaEnv:f,rootId:o,baseId:f.baseId||o,schemaPath:e.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(f),(0,s.validateFunctionCode)(T),h.optimize(this.opts.code.optimize);const O=h.toString();z=`${h.scopeRefs(r.default.scope)}return ${O}`,this.opts.code.process&&(z=this.opts.code.process(z,f));const L=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(N,{ref:L}),L.errors=null,L.schema=f.schema,L.schemaEnv=f,f.$async&&(L.$async=!0),this.opts.code.source===!0&&(L.source={validateName:N,validateCode:O,scopeValues:h._values}),this.opts.unevaluated){const{props:F,items:Q}=T;L.evaluated={props:F instanceof e.Name?void 0:F,items:Q instanceof e.Name?void 0:Q,dynamicProps:F instanceof e.Name,dynamicItems:Q instanceof e.Name},L.source&&(L.source.evaluated=(0,e.stringify)(L.evaluated))}return f.validate=L,f}catch(O){throw delete f.validate,delete f.validateName,z&&this.logger.error("Error compiling schema, function code:",z),O}finally{this._compilations.delete(f)}}le.compileSchema=i;function u(f,p,o){var l;o=(0,n.resolveUrl)(this.opts.uriResolver,p,o);const y=f.refs[o];if(y)return y;let c=v.call(this,f,o);if(c===void 0){const h=(l=f.localRefs)===null||l===void 0?void 0:l[o],{schemaId:P}=this.opts;h&&(c=new d({schema:h,schemaId:P,root:f,baseId:p}))}if(c!==void 0)return f.refs[o]=$.call(this,c)}le.resolveRef=u;function $(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:i.call(this,f)}function _(f){for(const p of this._compilations)if(E(p,f))return p}le.getCompilingSchema=_;function E(f,p){return f.schema===p.schema&&f.root===p.root&&f.baseId===p.baseId}function v(f,p){let o;for(;typeof(o=this.refs[p])=="string";)p=o;return o||this.schemas[p]||g.call(this,f,p)}function g(f,p){const o=this.opts.uriResolver.parse(p),l=(0,n._getFullPath)(this.opts.uriResolver,o);let y=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&l===y)return w.call(this,o,f);const c=(0,n.normalizeId)(l),h=this.refs[c]||this.schemas[c];if(typeof h=="string"){const P=g.call(this,f,h);return typeof P?.schema!="object"?void 0:w.call(this,o,P)}if(typeof h?.schema=="object"){if(h.validate||i.call(this,h),c===(0,n.normalizeId)(p)){const{schema:P}=h,{schemaId:N}=this.opts,T=P[N];return T&&(y=(0,n.resolveUrl)(this.opts.uriResolver,y,T)),new d({schema:P,schemaId:N,root:f,baseId:y})}return w.call(this,o,h)}}le.resolveSchema=g;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(f,{baseId:p,schema:o,root:l}){var y;if(((y=f.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of f.fragment.slice(1).split("/")){if(typeof o=="boolean")return;const N=o[(0,a.unescapeFragment)(P)];if(N===void 0)return;o=N;const T=typeof o=="object"&&o[this.opts.schemaId];!b.has(P)&&T&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,T))}let c;if(typeof o!="boolean"&&o.$ref&&!(0,a.schemaHasRulesButRef)(o,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,p,o.$ref);c=g.call(this,l,P)}const{schemaId:h}=this.opts;if(c=c||new d({schema:o,schemaId:h,root:l,baseId:p}),c.schema!==c.root.schema)return c}return le}const bs="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ws="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ps="object",Ss=["$data"],Es={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ks=!1,js={$id:bs,description:ws,type:Ps,required:Ss,properties:Es,additionalProperties:ks};var Je={},De={exports:{}},Yt,qr;function Tn(){if(qr)return Yt;qr=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 r(v){let g="",b=0,w=0;for(w=0;w<v.length;w++)if(b=v[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";g+=v[w];break}for(w+=1;w<v.length;w++){if(b=v[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";g+=v[w]}return g}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(v){return v.length=0,!0}function s(v,g,b){if(v.length){const w=r(v);if(w!=="")g.push(w);else return b.error=!0,!1;v.length=0}return!0}function d(v){let g=0;const b={error:!1,address:"",zone:""},w=[],f=[];let p=!1,o=!1,l=s;for(let y=0;y<v.length;y++){const c=v[y];if(!(c==="["||c==="]"))if(c===":"){if(p===!0&&(o=!0),!l(f,w,b))break;if(++g>7){b.error=!0;break}y>0&&v[y-1]===":"&&(p=!0),w.push(":");continue}else if(c==="%"){if(!l(f,w,b))break;l=a}else{f.push(c);continue}}return f.length&&(l===a?b.zone=f.join(""):o?w.push(f.join("")):w.push(r(f))),b.address=w.join(""),b}function i(v){if(u(v,":")<2)return{host:v,isIPV6:!1};const g=d(v);if(g.error)return{host:v,isIPV6:!1};{let b=g.address,w=g.address;return g.zone&&(b+="%"+g.zone,w+="%25"+g.zone),{host:b,isIPV6:!0,escapedHost:w}}}function u(v,g){let b=0;for(let w=0;w<v.length;w++)v[w]===g&&b++;return b}function $(v){let g=v;const b=[];let w=-1,f=0;for(;f=g.length;){if(f===1){if(g===".")break;if(g==="/"){b.push("/");break}else{b.push(g);break}}else if(f===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){b.push("/");break}}else if(f===3&&g==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((w=g.indexOf("/",1))===-1){b.push(g);break}else b.push(g.slice(0,w)),g=g.slice(w)}return b.join("")}function _(v,g){const b=g!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=b(v.scheme)),v.userinfo!==void 0&&(v.userinfo=b(v.userinfo)),v.host!==void 0&&(v.host=b(v.host)),v.path!==void 0&&(v.path=b(v.path)),v.query!==void 0&&(v.query=b(v.query)),v.fragment!==void 0&&(v.fragment=b(v.fragment)),v}function E(v){const g=[];if(v.userinfo!==void 0&&(g.push(v.userinfo),g.push("@")),v.host!==void 0){let b=unescape(v.host);if(!t(b)){const w=i(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=v.host}g.push(b)}return(typeof v.port=="number"||typeof v.port=="string")&&(g.push(":"),g.push(String(v.port))),g.length?g.join(""):void 0}return Yt={nonSimpleDomain:n,recomposeAuthority:E,normalizeComponentEncoding:_,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:r},Yt}var xt,Dr;function Rs(){if(Dr)return xt;Dr=1;const{isUUID:e}=Tn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(c){return r.indexOf(c)!==-1}function a(c){return c.secure===!0?!0:c.secure===!1?!1:c.scheme?c.scheme.length===3&&(c.scheme[0]==="w"||c.scheme[0]==="W")&&(c.scheme[1]==="s"||c.scheme[1]==="S")&&(c.scheme[2]==="s"||c.scheme[2]==="S"):!1}function s(c){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c}function d(c){const h=String(c.scheme).toLowerCase()==="https";return(c.port===(h?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}function i(c){return c.secure=a(c),c.resourceName=(c.path||"/")+(c.query?"?"+c.query:""),c.path=void 0,c.query=void 0,c}function u(c){if((c.port===(a(c)?443:80)||c.port==="")&&(c.port=void 0),typeof c.secure=="boolean"&&(c.scheme=c.secure?"wss":"ws",c.secure=void 0),c.resourceName){const[h,P]=c.resourceName.split("?");c.path=h&&h!=="/"?h:void 0,c.query=P,c.resourceName=void 0}return c.fragment=void 0,c}function $(c,h){if(!c.path)return c.error="URN can not be parsed",c;const P=c.path.match(t);if(P){const N=h.scheme||c.scheme||"urn";c.nid=P[1].toLowerCase(),c.nss=P[2];const T=`${N}:${h.nid||c.nid}`,z=y(T);c.path=void 0,z&&(c=z.parse(c,h))}else c.error=c.error||"URN can not be parsed.";return c}function _(c,h){if(c.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=h.scheme||c.scheme||"urn",N=c.nid.toLowerCase(),T=`${P}:${h.nid||N}`,z=y(T);z&&(c=z.serialize(c,h));const O=c,V=c.nss;return O.path=`${N||h.nid}:${V}`,h.skipEscape=!0,O}function E(c,h){const P=c;return P.uuid=P.nss,P.nss=void 0,!h.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(c){const h=c;return h.nss=(c.uuid||"").toLowerCase(),h}const g={scheme:"http",domainHost:!0,parse:s,serialize:d},b={scheme:"https",domainHost:g.domainHost,parse:s,serialize:d},w={scheme:"ws",domainHost:!0,parse:i,serialize:u},f={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},l={http:g,https:b,ws:w,wss:f,urn:{scheme:"urn",parse:$,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(l,null);function y(c){return c&&(l[c]||l[c.toLowerCase()])||void 0}return xt={wsIsSecure:a,SCHEMES:l,isValidSchemeName:n,getSchemeHandler:y},xt}var Tr;function Is(){if(Tr)return De.exports;Tr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:a,nonSimpleDomain:s}=Tn(),{SCHEMES:d,getSchemeHandler:i}=Rs();function u(f,p){return typeof f=="string"?f=v(b(f,p),p):typeof f=="object"&&(f=b(v(f,p),p)),f}function $(f,p,o){const l=o?Object.assign({scheme:"null"},o):{scheme:"null"},y=_(b(f,l),b(p,l),l,!0);return l.skipEscape=!0,v(y,l)}function _(f,p,o,l){const y={};return l||(f=b(v(f,o),o),p=b(v(p,o),o)),o=o||{},!o.tolerant&&p.scheme?(y.scheme=p.scheme,y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=t(p.path||""),y.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=t(p.path||""),y.query=p.query):(p.path?(p.path[0]==="/"?y.path=t(p.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?y.path="/"+p.path:f.path?y.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+p.path:y.path=p.path,y.path=t(y.path)),y.query=p.query):(y.path=f.path,p.query!==void 0?y.query=p.query:y.query=f.query),y.userinfo=f.userinfo,y.host=f.host,y.port=f.port),y.scheme=f.scheme),y.fragment=p.fragment,y}function E(f,p,o){return typeof f=="string"?(f=unescape(f),f=v(n(b(f,o),!0),{...o,skipEscape:!0})):typeof f=="object"&&(f=v(n(f,!0),{...o,skipEscape:!0})),typeof p=="string"?(p=unescape(p),p=v(n(b(p,o),!0),{...o,skipEscape:!0})):typeof p=="object"&&(p=v(n(p,!0),{...o,skipEscape:!0})),f.toLowerCase()===p.toLowerCase()}function v(f,p){const o={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},l=Object.assign({},p),y=[],c=i(l.scheme||o.scheme);c&&c.serialize&&c.serialize(o,l),o.path!==void 0&&(l.skipEscape?o.path=unescape(o.path):(o.path=escape(o.path),o.scheme!==void 0&&(o.path=o.path.split("%3A").join(":")))),l.reference!=="suffix"&&o.scheme&&y.push(o.scheme,":");const h=r(o);if(h!==void 0&&(l.reference!=="suffix"&&y.push("//"),y.push(h),o.path&&o.path[0]!=="/"&&y.push("/")),o.path!==void 0){let P=o.path;!l.absolutePath&&(!c||!c.absolutePath)&&(P=t(P)),h===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return o.query!==void 0&&y.push("?",o.query),o.fragment!==void 0&&y.push("#",o.fragment),y.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(f,p){const o=Object.assign({},p),l={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;o.reference==="suffix"&&(o.scheme?f=o.scheme+":"+f:f="//"+f);const c=f.match(g);if(c){if(l.scheme=c[1],l.userinfo=c[3],l.host=c[4],l.port=parseInt(c[5],10),l.path=c[6]||"",l.query=c[7],l.fragment=c[8],isNaN(l.port)&&(l.port=c[5]),l.host)if(a(l.host)===!1){const N=e(l.host);l.host=N.host.toLowerCase(),y=N.isIPV6}else y=!0;l.scheme===void 0&&l.userinfo===void 0&&l.host===void 0&&l.port===void 0&&l.query===void 0&&!l.path?l.reference="same-document":l.scheme===void 0?l.reference="relative":l.fragment===void 0?l.reference="absolute":l.reference="uri",o.reference&&o.reference!=="suffix"&&o.reference!==l.reference&&(l.error=l.error||"URI is not a "+o.reference+" reference.");const h=i(o.scheme||l.scheme);if(!o.unicodeSupport&&(!h||!h.unicodeSupport)&&l.host&&(o.domainHost||h&&h.domainHost)&&y===!1&&s(l.host))try{l.host=URL.domainToASCII(l.host.toLowerCase())}catch(P){l.error=l.error||"Host's domain name can not be converted to ASCII: "+P}(!h||h&&!h.skipNormalize)&&(f.indexOf("%")!==-1&&(l.scheme!==void 0&&(l.scheme=unescape(l.scheme)),l.host!==void 0&&(l.host=unescape(l.host))),l.path&&(l.path=escape(unescape(l.path))),l.fragment&&(l.fragment=encodeURI(decodeURIComponent(l.fragment)))),h&&h.parse&&h.parse(l,o)}else l.error=l.error||"URI can not be parsed.";return l}const w={SCHEMES:d,normalize:u,resolve:$,resolveComponent:_,equal:E,serialize:v,parse:b};return De.exports=w,De.exports.default=w,De.exports.fastUri=w,De.exports}var Ar;function Ns(){if(Ar)return Je;Ar=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=Is();return e.code='require("ajv/dist/runtime/uri").default',Je.default=e,Je}var Mr;function Cs(){return Mr||(Mr=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=Mt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=rr(),a=Vt(),s=On(),d=nr(),i=G(),u=At(),$=jt(),_=Y(),E=js,v=Ns(),g=(A,j)=>new RegExp(A,j);g.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={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."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},o=200;function l(A){var j,D,I,m,S,C,U,J,x,B,k,R,q,M,K,W,re,me,ce,de,ne,Ie,fe,zt,Lt;const Oe=A.strict,Ft=(j=A.code)===null||j===void 0?void 0:j.optimize,dr=Ft===!0||Ft===void 0?1:Ft||0,ur=(I=(D=A.code)===null||D===void 0?void 0:D.regExp)!==null&&I!==void 0?I:g,hs=(m=A.uriResolver)!==null&&m!==void 0?m:v.default;return{strictSchema:(C=(S=A.strictSchema)!==null&&S!==void 0?S:Oe)!==null&&C!==void 0?C:!0,strictNumbers:(J=(U=A.strictNumbers)!==null&&U!==void 0?U:Oe)!==null&&J!==void 0?J:!0,strictTypes:(B=(x=A.strictTypes)!==null&&x!==void 0?x:Oe)!==null&&B!==void 0?B:"log",strictTuples:(R=(k=A.strictTuples)!==null&&k!==void 0?k:Oe)!==null&&R!==void 0?R:"log",strictRequired:(M=(q=A.strictRequired)!==null&&q!==void 0?q:Oe)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:dr,regExp:ur}:{optimize:dr,regExp:ur},loopRequired:(K=A.loopRequired)!==null&&K!==void 0?K:o,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:o,meta:(re=A.meta)!==null&&re!==void 0?re:!0,messages:(me=A.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=A.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=A.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=A.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Ie=A.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(fe=A.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(zt=A.unicodeRegExp)!==null&&zt!==void 0?zt:!0,int32range:(Lt=A.int32range)!==null&&Lt!==void 0?Lt:!0,uriResolver:hs}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...l(j)};const{es5:D,lines:I}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:w,es5:D,lines:I}),this.logger=V(j.logger);const m=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),c.call(this,f,j,"NOT SUPPORTED"),c.call(this,p,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=m}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:I}=this.opts;let m=E;I==="id"&&(m={...E},m.id=m.$id,delete m.$id),D&&j&&this.addMetaSchema(m,m[I],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let I;if(typeof j=="string"){if(I=this.getSchema(j),!I)throw new Error(`no schema with key or ref "${j}"`)}else I=this.compile(j);const m=I(D);return"$async"in I||(this.errors=I.errors),m}compile(j,D){const I=this._addSchema(j,D);return I.validate||this._compileSchemaEnv(I)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return m.call(this,j,D);async function m(B,k){await S.call(this,B.$schema);const R=this._addSchema(B,k);return R.validate||C.call(this,R)}async function S(B){B&&!this.getSchema(B)&&await m.call(this,{$ref:B},!0)}async function C(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof a.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),C.call(this,B)}}function U({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await x.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function x(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=I(B))}finally{delete this._loading[B]}}}addSchema(j,D,I,m=this.opts.validateSchema){if(Array.isArray(j)){for(const C of j)this.addSchema(C,void 0,I,m);return this}let S;if(typeof j=="object"){const{schemaId:C}=this.opts;if(S=j[C],S!==void 0&&typeof S!="string")throw new Error(`schema ${C} must be string`)}return D=(0,u.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,I,D,m,!0),this}addMetaSchema(j,D,I=this.opts.validateSchema){return this.addSchema(j,D,!0,I),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let I;if(I=j.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const m=this.validate(I,j);if(!m&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return m}getSchema(j){let D;for(;typeof(D=h.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:I}=this.opts,m=new d.SchemaEnv({schema:{},schemaId:I});if(D=d.resolveSchema.call(this,m,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const D=h.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let I=j[this.opts.schemaId];return I&&(I=(0,u.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let I;if(typeof j=="string")I=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=I);else if(typeof j=="object"&&D===void 0){if(D=j,I=D.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(F.call(this,I,D),!D)return(0,_.eachItem)(I,S=>Q.call(this,S)),this;oe.call(this,D);const m={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,_.eachItem)(I,m.type.length===0?S=>Q.call(this,S,m):S=>m.type.forEach(C=>Q.call(this,S,m,C))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const I of D.rules){const m=I.rules.findIndex(S=>S.keyword===j);m>=0&&I.rules.splice(m,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:I="data"}={}){return!j||j.length===0?"No errors":j.map(m=>`${I}${m.instancePath} ${m.message}`).reduce((m,S)=>m+D+S)}$dataMetaSchema(j,D){const I=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const m of D){const S=m.split("/").slice(1);let C=j;for(const U of S)C=C[U];for(const U in I){const J=I[U];if(typeof J!="object")continue;const{$data:x}=J.definition,B=C[U];x&&B&&(C[U]=pe(B))}}return j}_removeAllSchemas(j,D){for(const I in j){const m=j[I];(!D||D.test(I))&&(typeof m=="string"?delete j[I]:m&&!m.meta&&(this._cache.delete(m.schema),delete j[I]))}}_addSchema(j,D,I,m=this.opts.validateSchema,S=this.opts.addUsedSchema){let C;const{schemaId:U}=this.opts;if(typeof j=="object")C=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(j);if(J!==void 0)return J;I=(0,u.normalizeId)(C||I);const x=u.getSchemaRefs.call(this,j,I);return J=new d.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:I,localRefs:x}),this._cache.set(J.schema,J),S&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=J),m&&this.validateSchema(j,!0),J}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):d.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{d.compileSchema.call(this,j)}finally{this.opts=D}}}y.ValidationError=n.default,y.MissingRefError=a.default,e.default=y;function c(A,j,D,I="error"){for(const m in A){const S=m;S in j&&this.logger[I](`${D}: option ${m}. ${A[S]}`)}}function h(A){return A=(0,u.normalizeId)(A),this.schemas[A]||this.refs[A]}function P(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const j in A)this.addSchema(A[j],j)}function N(){for(const A in this.opts.formats){const j=this.opts.formats[A];j&&this.addFormat(A,j)}}function T(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in A){const D=A[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const A={...this.opts};for(const j of b)delete A[j];return A}const O={log(){},warn(){},error(){}};function V(A){if(A===!1)return O;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function F(A,j){const{RULES:D}=this;if((0,_.eachItem)(A,I=>{if(D.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!L.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(A,j,D){var I;const m=j?.post;if(D&&m)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let C=m?S.post:S.rules.find(({type:J})=>J===D);if(C||(C={type:D,rules:[]},S.rules.push(C)),S.keywords[A]=!0,!j)return;const U={keyword:A,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,C,U,j.before):C.rules.push(U),S.all[A]=U,(I=j.implements)===null||I===void 0||I.forEach(J=>this.addKeyword(J))}function ie(A,j,D){const I=A.rules.findIndex(m=>m.keyword===D);I>=0?A.rules.splice(I,0,j):(A.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(A){let{metaSchema:j}=A;j!==void 0&&(A.$data&&this.opts.$data&&(j=pe(j)),A.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(A){return{anyOf:[A,X]}}})(Ut)),Ut}var He={},Ge={},We={},Vr;function Os(){if(Vr)return We;Vr=1,Object.defineProperty(We,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return We.default=e,We}var we={},zr;function qs(){if(zr)return we;zr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.callRef=we.getValidate=void 0;const e=Vt(),t=ge(),r=G(),n=Se(),a=nr(),s=Y(),d={keyword:"$ref",schemaType:"string",code($){const{gen:_,schema:E,it:v}=$,{baseId:g,schemaEnv:b,validateName:w,opts:f,self:p}=v,{root:o}=b;if((E==="#"||E==="#/")&&g===o.baseId)return y();const l=a.resolveRef.call(p,o,g,E);if(l===void 0)throw new e.default(v.opts.uriResolver,g,E);if(l instanceof a.SchemaEnv)return c(l);return h(l);function y(){if(b===o)return u($,w,b,b.$async);const P=_.scopeValue("root",{ref:o});return u($,(0,r._)`${P}.validate`,o,o.$async)}function c(P){const N=i($,P);u($,N,P,P.$async)}function h(P){const N=_.scopeValue("schema",f.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=_.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:N,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function i($,_){const{gen:E}=$;return _.validate?E.scopeValue("validate",{ref:_.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:_})}.validate`}we.getValidate=i;function u($,_,E,v){const{gen:g,it:b}=$,{allErrors:w,schemaEnv:f,opts:p}=b,o=p.passContext?n.default.this:r.nil;v?l():y();function l(){if(!f.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,r._)`await ${(0,t.callValidateCode)($,_,o)}`),h(_),w||g.assign(P,!0)},N=>{g.if((0,r._)`!(${N} instanceof ${b.ValidationError})`,()=>g.throw(N)),c(N),w||g.assign(P,!1)}),$.ok(P)}function y(){$.result((0,t.callValidateCode)($,_,o),()=>h(_),()=>c(_))}function c(P){const N=(0,r._)`${P}.errors`;g.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),g.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function h(P){var N;if(!b.opts.unevaluated)return;const T=(N=E?.validate)===null||N===void 0?void 0:N.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=s.mergeEvaluated.props(g,T.props,b.props));else{const z=g.var("props",(0,r._)`${P}.evaluated.props`);b.props=s.mergeEvaluated.props(g,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=s.mergeEvaluated.items(g,T.items,b.items));else{const z=g.var("items",(0,r._)`${P}.evaluated.items`);b.items=s.mergeEvaluated.items(g,z,b.items,r.Name)}}}return we.callRef=u,we.default=d,we}var Lr;function Ds(){if(Lr)return Ge;Lr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=Os(),t=qs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ge.default=r,Ge}var Be={},Ye={},Fr;function Ts(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=G(),t=e.operators,r={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:s,schemaCode:d})=>(0,e.str)`must be ${r[s].okStr} ${d}`,params:({keyword:s,schemaCode:d})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${d}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:d,data:i,schemaCode:u}=s;s.fail$data((0,e._)`${i} ${r[d].fail} ${u} || isNaN(${i})`)}};return Ye.default=a,Ye}var xe={},Ur;function As(){if(Ur)return xe;Ur=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),r={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:a,data:s,schemaCode:d,it:i}=n,u=i.opts.multipleOfPrecision,$=a.let("res"),_=u?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${u}`:(0,e._)`${$} !== parseInt(${$})`;n.fail$data((0,e._)`(${d} === 0 || (${$} = ${s}/${d}, ${_}))`)}};return xe.default=r,xe}var Qe={},Ze={},Kr;function Ms(){if(Kr)return Ze;Kr=1,Object.defineProperty(Ze,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,a=0,s;for(;a<r;)n++,s=t.charCodeAt(a++),s>=55296&&s<=56319&&a<r&&(s=t.charCodeAt(a),(s&64512)===56320&&a++);return n}return Ze.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ze}var Jr;function Vs(){if(Jr)return Qe;Jr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=G(),t=Y(),r=Ms(),a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:d}){const i=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${d} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:d,data:i,schemaCode:u,it:$}=s,_=d==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${i}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${i})`;s.fail$data((0,e._)`${E} ${_} ${u}`)}};return Qe.default=a,Qe}var Xe={},Hr;function zs(){if(Hr)return Xe;Hr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=ge(),t=G(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,t.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,t._)`{pattern: ${a}}`},code(a){const{data:s,$data:d,schema:i,schemaCode:u,it:$}=a,_=$.opts.unicodeRegExp?"u":"",E=d?(0,t._)`(new RegExp(${u}, ${_}))`:(0,e.usePattern)(a,i);a.fail$data((0,t._)`!${E}.test(${s})`)}};return Xe.default=n,Xe}var et={},Gr;function Ls(){if(Gr)return et;Gr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:d}=n,i=a==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${i} ${d}`)}};return et.default=r,et}var tt={},Wr;function Fs(){if(Wr)return tt;Wr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:d,schema:i,schemaCode:u,data:$,$data:_,it:E}=s,{opts:v}=E;if(!_&&i.length===0)return;const g=i.length>=v.loopRequired;if(E.allErrors?b():w(),v.strictRequired){const o=s.parentSchema.properties,{definedProperties:l}=s.it;for(const y of i)if(o?.[y]===void 0&&!l.has(y)){const c=E.schemaEnv.baseId+E.errSchemaPath,h=`required property "${y}" is not defined at "${c}" (strictRequired)`;(0,r.checkStrictMode)(E,h,E.opts.strictRequired)}}function b(){if(g||_)s.block$data(t.nil,f);else for(const o of i)(0,e.checkReportMissingProp)(s,o)}function w(){const o=d.let("missing");if(g||_){const l=d.let("valid",!0);s.block$data(l,()=>p(o,l)),s.ok(l)}else d.if((0,e.checkMissingProp)(s,i,o)),(0,e.reportMissingProp)(s,o),d.else()}function f(){d.forOf("prop",u,o=>{s.setParams({missingProperty:o}),d.if((0,e.noPropertyInData)(d,$,o,v.ownProperties),()=>s.error())})}function p(o,l){s.setParams({missingProperty:o}),d.forOf(o,u,()=>{d.assign(l,(0,e.propertyInData)(d,$,o,v.ownProperties)),d.if((0,t.not)(l),()=>{s.error(),d.break()})},t.nil)}}};return tt.default=a,tt}var rt={},Br;function Us(){if(Br)return rt;Br=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:d}=n,i=a==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${i} ${d}`)}};return rt.default=r,rt}var nt={},st={},Yr;function sr(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Dn();return e.code='require("ajv/dist/runtime/equal").default',st.default=e,st}var xr;function Ks(){if(xr)return nt;xr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=jt(),t=G(),r=Y(),n=sr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:d,j:i}})=>(0,t.str)`must NOT have duplicate items (items ## ${i} and ${d} are identical)`,params:({params:{i:d,j:i}})=>(0,t._)`{i: ${d}, j: ${i}}`},code(d){const{gen:i,data:u,$data:$,schema:_,parentSchema:E,schemaCode:v,it:g}=d;if(!$&&!_)return;const b=i.let("valid"),w=E.items?(0,e.getSchemaTypes)(E.items):[];d.block$data(b,f,(0,t._)`${v} === false`),d.ok(b);function f(){const y=i.let("i",(0,t._)`${u}.length`),c=i.let("j");d.setParams({i:y,j:c}),i.assign(b,!0),i.if((0,t._)`${y} > 1`,()=>(p()?o:l)(y,c))}function p(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function o(y,c){const h=i.name("item"),P=(0,e.checkDataTypes)(w,h,g.opts.strictNumbers,e.DataType.Wrong),N=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${y}--;`,()=>{i.let(h,(0,t._)`${u}[${y}]`),i.if(P,(0,t._)`continue`),w.length>1&&i.if((0,t._)`typeof ${h} == "string"`,(0,t._)`${h} += "_"`),i.if((0,t._)`typeof ${N}[${h}] == "number"`,()=>{i.assign(c,(0,t._)`${N}[${h}]`),d.error(),i.assign(b,!1).break()}).code((0,t._)`${N}[${h}] = ${y}`)})}function l(y,c){const h=(0,r.useFunc)(i,n.default),P=i.name("outer");i.label(P).for((0,t._)`;${y}--;`,()=>i.for((0,t._)`${c} = ${y}; ${c}--;`,()=>i.if((0,t._)`${h}(${u}[${y}], ${u}[${c}])`,()=>{d.error(),i.assign(b,!1).break(P)})))}}};return nt.default=s,nt}var it={},Qr;function Js(){if(Qr)return it;Qr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),r=sr(),a={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:d,data:i,$data:u,schemaCode:$,schema:_}=s;u||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(d,r.default)}(${i}, ${$})`):s.fail((0,e._)`${_} !== ${i}`)}};return it.default=a,it}var ot={},Zr;function Hs(){if(Zr)return ot;Zr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),t=Y(),r=sr(),a={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:d,data:i,$data:u,schema:$,schemaCode:_,it:E}=s;if(!u&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=E.opts.loopEnum;let g;const b=()=>g??(g=(0,t.useFunc)(d,r.default));let w;if(v||u)w=d.let("valid"),s.block$data(w,f);else{if(!Array.isArray($))throw new Error("ajv implementation error");const o=d.const("vSchema",_);w=(0,e.or)(...$.map((l,y)=>p(o,y)))}s.pass(w);function f(){d.assign(w,!1),d.forOf("v",_,o=>d.if((0,e._)`${b()}(${i}, ${o})`,()=>d.assign(w,!0).break()))}function p(o,l){const y=$[l];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${i}, ${o}[${l}])`:(0,e._)`${i} === ${y}`}}};return ot.default=a,ot}var Xr;function Gs(){if(Xr)return Be;Xr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=Ts(),t=As(),r=Vs(),n=zs(),a=Ls(),s=Fs(),d=Us(),i=Ks(),u=Js(),$=Hs(),_=[e.default,t.default,r.default,n.default,a.default,s.default,d.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,$.default];return Be.default=_,Be}var at={},Ne={},en;function An(){if(en)return Ne;en=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.validateAdditionalItems=void 0;const e=G(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:d,it:i}=s,{items:u}=d;if(!Array.isArray(u)){(0,t.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}a(s,u)}};function a(s,d){const{gen:i,schema:u,data:$,keyword:_,it:E}=s;E.items=!0;const v=i.const("len",(0,e._)`${$}.length`);if(u===!1)s.setParams({len:d.length}),s.pass((0,e._)`${v} <= ${d.length}`);else if(typeof u=="object"&&!(0,t.alwaysValidSchema)(E,u)){const b=i.var("valid",(0,e._)`${v} <= ${d.length}`);i.if((0,e.not)(b),()=>g(b)),s.ok(b)}function g(b){i.forRange("i",d.length,v,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},b),E.allErrors||i.if((0,e.not)(b),()=>i.break())})}}return Ne.validateAdditionalItems=a,Ne.default=n,Ne}var ct={},Ce={},tn;function Mn(){if(tn)return Ce;tn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.validateTuple=void 0;const e=G(),t=Y(),r=ge(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:d,it:i}=s;if(Array.isArray(d))return a(s,"additionalItems",d);i.items=!0,!(0,t.alwaysValidSchema)(i,d)&&s.ok((0,r.validateArray)(s))}};function a(s,d,i=s.schema){const{gen:u,parentSchema:$,data:_,keyword:E,it:v}=s;w($),v.opts.unevaluated&&i.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(u,i.length,v.items));const g=u.name("valid"),b=u.const("len",(0,e._)`${_}.length`);i.forEach((f,p)=>{(0,t.alwaysValidSchema)(v,f)||(u.if((0,e._)`${b} > ${p}`,()=>s.subschema({keyword:E,schemaProp:p,dataProp:p},g)),s.ok(g))});function w(f){const{opts:p,errSchemaPath:o}=v,l=i.length,y=l===f.minItems&&(l===f.maxItems||f[d]===!1);if(p.strictTuples&&!y){const c=`"${E}" is ${l}-tuple, but minItems or maxItems/${d} are not specified or different at path "${o}"`;(0,t.checkStrictMode)(v,c,p.strictTuples)}}}return Ce.validateTuple=a,Ce.default=n,Ce}var rn;function Ws(){if(rn)return ct;rn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Mn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ct.default=t,ct}var dt={},nn;function Bs(){if(nn)return dt;nn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=G(),t=Y(),r=ge(),n=An(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:d}})=>(0,e.str)`must NOT have more than ${d} items`,params:({params:{len:d}})=>(0,e._)`{limit: ${d}}`},code(d){const{schema:i,parentSchema:u,it:$}=d,{prefixItems:_}=u;$.items=!0,!(0,t.alwaysValidSchema)($,i)&&(_?(0,n.validateAdditionalItems)(d,_):d.ok((0,r.validateArray)(d)))}};return dt.default=s,dt}var ut={},sn;function Ys(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:a,max:s}})=>s===void 0?(0,e.str)`must contain at least ${a} valid item(s)`:(0,e.str)`must contain at least ${a} and no more than ${s} valid item(s)`,params:({params:{min:a,max:s}})=>s===void 0?(0,e._)`{minContains: ${a}}`:(0,e._)`{minContains: ${a}, maxContains: ${s}}`},code(a){const{gen:s,schema:d,parentSchema:i,data:u,it:$}=a;let _,E;const{minContains:v,maxContains:g}=i;$.opts.next?(_=v===void 0?1:v,E=g):_=1;const b=s.const("len",(0,e._)`${u}.length`);if(a.setParams({min:_,max:E}),E===void 0&&_===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&_>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,t.alwaysValidSchema)($,d)){let l=(0,e._)`${b} >= ${_}`;E!==void 0&&(l=(0,e._)`${l} && ${b} <= ${E}`),a.pass(l);return}$.items=!0;const w=s.name("valid");E===void 0&&_===1?p(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),E!==void 0&&s.if((0,e._)`${u}.length > 0`,f)):(s.let(w,!1),f()),a.result(w,()=>a.reset());function f(){const l=s.name("_valid"),y=s.let("count",0);p(l,()=>s.if(l,()=>o(y)))}function p(l,y){s.forRange("i",0,b,c=>{a.subschema({keyword:"contains",dataProp:c,dataPropType:t.Type.Num,compositeRule:!0},l),y()})}function o(l){s.code((0,e._)`${l}++`),E===void 0?s.if((0,e._)`${l} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${l} > ${E}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${l} >= ${_}`,()=>s.assign(w,!0)))}}};return ut.default=n,ut}var Qt={},on;function xs(){return on||(on=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Y(),n=ge();e.error={message:({params:{property:u,depsCount:$,deps:_}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${_} when property ${u} is present`},params:({params:{property:u,depsCount:$,deps:_,missingProperty:E}})=>(0,t._)`{property: ${u},
6
6
  missingProperty: ${E},
7
7
  depsCount: ${$},
8
- deps: ${_}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[$,_]=s(u);d(u,$),i(u,_)}};function s({schema:u}){const $={},_={};for(const E in u){if(E==="__proto__")continue;const v=Array.isArray(u[E])?$:_;v[E]=u[E]}return[$,_]}function d(u,$=u.schema){const{gen:_,data:E,it:v}=u;if(Object.keys($).length===0)return;const g=_.let("missing");for(const b in $){const w=$[b];if(w.length===0)continue;const f=(0,n.propertyInData)(_,E,b,v.opts.ownProperties);u.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),v.allErrors?_.if(f,()=>{for(const p of w)(0,n.checkReportMissingProp)(u,p)}):(_.if((0,t._)`${f} && (${(0,n.checkMissingProp)(u,w,g)})`),(0,n.reportMissingProp)(u,g),_.else())}}e.validatePropertyDeps=d;function i(u,$=u.schema){const{gen:_,data:E,keyword:v,it:g}=u,b=_.name("valid");for(const w in $)(0,r.alwaysValidSchema)(g,$[w])||(_.if((0,n.propertyInData)(_,E,w,g.opts.ownProperties),()=>{const f=u.subschema({keyword:v,schemaProp:w},b);u.mergeValidEvaluated(f,b)},()=>_.var(b,!0)),u.ok(b))}e.validateSchemaDeps=i,e.default=a})(Qt)),Qt}var lt={},an;function Qs(){if(an)return lt;an=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,e._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:s,schema:d,data:i,it:u}=a;if((0,t.alwaysValidSchema)(u,d))return;const $=s.name("valid");s.forIn("key",i,_=>{a.setParams({propertyName:_}),a.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),s.if((0,e.not)($),()=>{a.error(!0),u.allErrors||s.break()})}),a.ok($)}};return lt.default=n,lt}var ft={},cn;function Vn(){if(cn)return ft;cn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=ge(),t=G(),r=Se(),n=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:d})=>(0,t._)`{additionalProperty: ${d.additionalProperty}}`},code(d){const{gen:i,schema:u,parentSchema:$,data:_,errsCount:E,it:v}=d;if(!E)throw new Error("ajv implementation error");const{allErrors:g,opts:b}=v;if(v.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(v,u))return;const w=(0,e.allSchemaProperties)($.properties),f=(0,e.allSchemaProperties)($.patternProperties);p(),d.ok((0,t._)`${E} === ${r.default.errors}`);function p(){i.forIn("key",_,h=>{!w.length&&!f.length?y(h):i.if(o(h),()=>y(h))})}function o(h){let P;if(w.length>8){const O=(0,n.schemaRefOrVal)(v,$.properties,"properties");P=(0,e.isOwnProperty)(i,O,h)}else w.length?P=(0,t.or)(...w.map(O=>(0,t._)`${h} === ${O}`)):P=t.nil;return f.length&&(P=(0,t.or)(P,...f.map(O=>(0,t._)`${(0,e.usePattern)(d,O)}.test(${h})`))),(0,t.not)(P)}function l(h){i.code((0,t._)`delete ${_}[${h}]`)}function y(h){if(b.removeAdditional==="all"||b.removeAdditional&&u===!1){l(h);return}if(u===!1){d.setParams({additionalProperty:h}),d.error(),g||i.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(v,u)){const P=i.name("valid");b.removeAdditional==="failing"?(c(h,P,!1),i.if((0,t.not)(P),()=>{d.reset(),l(h)})):(c(h,P),g||i.if((0,t.not)(P),()=>i.break()))}}function c(h,P,O){const T={keyword:"additionalProperties",dataProp:h,dataPropType:n.Type.Str};O===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),d.subschema(T,P)}}};return ft.default=s,ft}var pt={},dn;function Zs(){if(dn)return pt;dn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=Mt(),t=ge(),r=Y(),n=Vn(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:d,schema:i,parentSchema:u,data:$,it:_}=s;_.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(i);for(const f of E)_.definedProperties.add(f);_.opts.unevaluated&&E.length&&_.props!==!0&&(_.props=r.mergeEvaluated.props(d,(0,r.toHash)(E),_.props));const v=E.filter(f=>!(0,r.alwaysValidSchema)(_,i[f]));if(v.length===0)return;const g=d.name("valid");for(const f of v)b(f)?w(f):(d.if((0,t.propertyInData)(d,$,f,_.opts.ownProperties)),w(f),_.allErrors||d.else().var(g,!0),d.endIf()),s.it.definedProperties.add(f),s.ok(g);function b(f){return _.opts.useDefaults&&!_.compositeRule&&i[f].default!==void 0}function w(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},g)}}};return pt.default=a,pt}var mt={},un;function Xs(){if(un)return mt;un=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),n=Y(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:d,schema:i,data:u,parentSchema:$,it:_}=s,{opts:E}=_,v=(0,e.allSchemaProperties)(i),g=v.filter(y=>(0,r.alwaysValidSchema)(_,i[y]));if(v.length===0||g.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&$.properties,w=d.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(d,_.props));const{props:f}=_;p();function p(){for(const y of v)b&&o(y),_.allErrors?l(y):(d.var(w,!0),l(y),d.if(w))}function o(y){for(const c in b)new RegExp(y).test(c)&&(0,r.checkStrictMode)(_,`property ${c} matches pattern ${y} (use allowMatchingProperties)`)}function l(y){d.forIn("key",u,c=>{d.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${c})`,()=>{const h=g.includes(y);h||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:c,dataPropType:n.Type.Str},w),_.opts.unevaluated&&f!==!0?d.assign((0,t._)`${f}[${c}]`,!0):!h&&!_.allErrors&&d.if((0,t.not)(w),()=>d.break())})})}}};return mt.default=a,mt}var ht={},ln;function ei(){if(ln)return ht;ln=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:a,it:s}=r;if((0,e.alwaysValidSchema)(s,a)){r.fail();return}const d=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),r.failResult(d,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return ht.default=t,ht}var yt={},fn;function ti(){if(fn)return yt;fn=1,Object.defineProperty(yt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return yt.default=t,yt}var gt={},pn;function ri(){if(pn)return gt;pn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:a})=>(0,e._)`{passingSchemas: ${a.passing}}`},code(a){const{gen:s,schema:d,parentSchema:i,it:u}=a;if(!Array.isArray(d))throw new Error("ajv implementation error");if(u.opts.discriminator&&i.discriminator)return;const $=d,_=s.let("valid",!1),E=s.let("passing",null),v=s.name("_valid");a.setParams({passing:E}),s.block(g),a.result(_,()=>a.reset(),()=>a.error(!0));function g(){$.forEach((b,w)=>{let f;(0,t.alwaysValidSchema)(u,b)?s.var(v,!0):f=a.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(E,(0,e._)`[${E}, ${w}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(E,w),f&&a.mergeEvaluated(f,e.Name)})})}}};return gt.default=n,gt}var vt={},mn;function ni(){if(mn)return vt;mn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:a,it:s}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");const d=n.name("valid");a.forEach((i,u)=>{if((0,e.alwaysValidSchema)(s,i))return;const $=r.subschema({keyword:"allOf",schemaProp:u},d);r.ok(d),r.mergeEvaluated($)})}};return vt.default=t,vt}var _t={},hn;function si(){if(hn)return _t;hn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:d,parentSchema:i,it:u}=s;i.then===void 0&&i.else===void 0&&(0,t.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const $=a(u,"then"),_=a(u,"else");if(!$&&!_)return;const E=d.let("valid",!0),v=d.name("_valid");if(g(),s.reset(),$&&_){const w=d.let("ifClause");s.setParams({ifClause:w}),d.if(v,b("then",w),b("else",w))}else $?d.if(v,b("then")):d.if((0,e.not)(v),b("else"));s.pass(E,()=>s.error(!0));function g(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function b(w,f){return()=>{const p=s.subschema({keyword:w},v);d.assign(E,v),s.mergeValidEvaluated(p,E),f?d.assign(f,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function a(s,d){const i=s.schema[d];return i!==void 0&&!(0,t.alwaysValidSchema)(s,i)}return _t.default=n,_t}var $t={},yn;function ii(){if(yn)return $t;yn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:a}){n.if===void 0&&(0,e.checkStrictMode)(a,`"${r}" without "if" is ignored`)}};return $t.default=t,$t}var gn;function oi(){if(gn)return at;gn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=An(),t=Ws(),r=Mn(),n=Bs(),a=Ys(),s=xs(),d=Qs(),i=Vn(),u=Zs(),$=Xs(),_=ei(),E=ti(),v=ri(),g=ni(),b=si(),w=ii();function f(p=!1){const o=[_.default,E.default,v.default,g.default,b.default,w.default,d.default,i.default,s.default,u.default,$.default];return p?o.push(t.default,n.default):o.push(e.default,r.default),o.push(a.default),o}return at.default=f,at}var bt={},wt={},vn;function ai(){if(vn)return wt;vn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=G(),r={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,a){const{gen:s,data:d,$data:i,schema:u,schemaCode:$,it:_}=n,{opts:E,errSchemaPath:v,schemaEnv:g,self:b}=_;if(!E.validateFormats)return;i?w():f();function w(){const p=s.scopeValue("formats",{ref:b.formats,code:E.code.formats}),o=s.const("fDef",(0,e._)`${p}[${$}]`),l=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>s.assign(l,(0,e._)`${o}.type || "string"`).assign(y,(0,e._)`${o}.validate`),()=>s.assign(l,(0,e._)`"string"`).assign(y,o)),n.fail$data((0,e.or)(c(),h()));function c(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${y}`}function h(){const P=g.$async?(0,e._)`(${o}.async ? await ${y}(${d}) : ${y}(${d}))`:(0,e._)`${y}(${d})`,O=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${d}))`;return(0,e._)`${y} && ${y} !== true && ${l} === ${a} && !${O}`}}function f(){const p=b.formats[u];if(!p){c();return}if(p===!0)return;const[o,l,y]=h(p);o===a&&n.pass(P());function c(){if(E.strictSchema===!1){b.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${u}" ignored in schema at path "${v}"`}}function h(O){const T=O instanceof RegExp?(0,e.regexpCode)(O):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(u)}`:void 0,z=s.scopeValue("formats",{key:u,ref:O,code:T});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${d})`}return typeof l=="function"?(0,e._)`${y}(${d})`:(0,e._)`${y}.test(${d})`}}}};return wt.default=r,wt}var _n;function ci(){if(_n)return bt;_n=1,Object.defineProperty(bt,"__esModule",{value:!0});const t=[ai().default];return bt.default=t,bt}var je={},$n;function di(){return $n||($n=1,Object.defineProperty(je,"__esModule",{value:!0}),je.contentVocabulary=je.metadataVocabulary=void 0,je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),je}var bn;function ui(){if(bn)return He;bn=1,Object.defineProperty(He,"__esModule",{value:!0});const e=Ds(),t=Gs(),r=oi(),n=ci(),a=di(),s=[e.default,t.default,(0,r.default)(),n.default,a.metadataVocabulary,a.contentVocabulary];return He.default=s,He}var Pt={},Te={},wn;function li(){if(wn)return Te;wn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Te.DiscrError=e={})),Te}var Pn;function fi(){if(Pn)return Pt;Pn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=G(),t=li(),r=nr(),n=Vt(),a=Y(),d={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:u}})=>i===t.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:i,tag:u,tagName:$}})=>(0,e._)`{error: ${i}, tag: ${$}, tagValue: ${u}}`},code(i){const{gen:u,data:$,schema:_,parentSchema:E,it:v}=i,{oneOf:g}=E;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=_.propertyName;if(typeof b!="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=u.let("valid",!1),f=u.const("tag",(0,e._)`${$}${(0,e.getProperty)(b)}`);u.if((0,e._)`typeof ${f} == "string"`,()=>p(),()=>i.error(!1,{discrError:t.DiscrError.Tag,tag:f,tagName:b})),i.ok(w);function p(){const y=l();u.if(!1);for(const c in y)u.elseIf((0,e._)`${f} === ${c}`),u.assign(w,o(y[c]));u.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:f,tagName:b}),u.endIf()}function o(y){const c=u.name("valid"),h=i.subschema({keyword:"oneOf",schemaProp:y},c);return i.mergeEvaluated(h,e.Name),c}function l(){var y;const c={},h=O(E);let P=!0;for(let C=0;C<g.length;C++){let V=g[C];if(V?.$ref&&!(0,a.schemaHasRulesButRef)(V,v.self.RULES)){const F=V.$ref;if(V=r.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,F),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(v.opts.uriResolver,v.baseId,F)}const L=(y=V?.properties)===null||y===void 0?void 0:y[b];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(h||O(V)),T(L,C)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return c;function O({required:C}){return Array.isArray(C)&&C.includes(b)}function T(C,V){if(C.const)z(C.const,V);else if(C.enum)for(const L of C.enum)z(L,V);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function z(C,V){if(typeof C!="string"||C in c)throw new Error(`discriminator: "${b}" values must be unique strings`);c[C]=V}}}};return Pt.default=d,Pt}const pi="http://json-schema.org/draft-07/schema#",mi="http://json-schema.org/draft-07/schema#",hi="Core schema meta-schema",yi={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:[]}},gi=["object","boolean"],vi={$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:"#"}},_i={$schema:pi,$id:mi,title:hi,definitions:yi,type:gi,properties:vi,default:!0};var Sn;function zn(){return Sn||(Sn=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 r=Ns(),n=ui(),a=fi(),s=_i,d=["/properties"],i="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(s,d):s;this.addMetaSchema(b,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var $=Mt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var _=G();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 E=rr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var v=Vt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Le,Le.exports)),Le.exports}var $i=zn();const bi=Nn($i);var St={exports:{}},Zt={},En;function wi(){return En||(En=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(C,V){return{validate:C,compare:V}}e.fullFormats={date:t(s,d),time:t(u(!0),$),"date-time":t(v(!0),g),"iso-time":t(u(),_),"iso-date-time":t(v(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"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:l,int32:{type:"number",validate:h},int64:{type:"number",validate:P},float:{type:"number",validate:O},double:{type:"number",validate:O},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,d),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"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,b),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 r(C){return C%4===0&&(C%100!==0||C%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const V=n.exec(C);if(!V)return!1;const L=+V[1],F=+V[2],Q=+V[3];return F>=1&&F<=12&&Q>=1&&Q<=(F===2&&r(L)?29:a[F])}function d(C,V){if(C&&V)return C>V?1:C<V?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function u(C){return function(L){const F=i.exec(L);if(!F)return!1;const Q=+F[1],ie=+F[2],oe=+F[3],X=F[4],pe=F[5]==="-"?-1:1,A=+(F[6]||0),j=+(F[7]||0);if(A>23||j>59||C&&!X)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*pe,I=Q-A*pe-(D<0?1:0);return(I===23||I===-1)&&(D===59||D===-1)&&oe<61}}function $(C,V){if(!(C&&V))return;const L=new Date("2020-01-01T"+C).valueOf(),F=new Date("2020-01-01T"+V).valueOf();if(L&&F)return L-F}function _(C,V){if(!(C&&V))return;const L=i.exec(C),F=i.exec(V);if(L&&F)return C=L[1]+L[2]+L[3],V=F[1]+F[2]+F[3],C>V?1:C<V?-1:0}const E=/t|\s/i;function v(C){const V=u(C);return function(F){const Q=F.split(E);return Q.length===2&&s(Q[0])&&V(Q[1])}}function g(C,V){if(!(C&&V))return;const L=new Date(C).valueOf(),F=new Date(V).valueOf();if(L&&F)return L-F}function b(C,V){if(!(C&&V))return;const[L,F]=C.split(E),[Q,ie]=V.split(E),oe=d(L,Q);if(oe!==void 0)return oe||$(F,ie)}const w=/\/|:/,f=/^(?:[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 p(C){return w.test(C)&&f.test(C)}const o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function l(C){return o.lastIndex=0,o.test(C)}const y=-2147483648,c=2**31-1;function h(C){return Number.isInteger(C)&&C<=c&&C>=y}function P(C){return Number.isInteger(C)}function O(){return!0}const T=/[^\\]\\Z/;function z(C){if(T.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(Zt)),Zt}var Xt={},kn;function Pi(){return kn||(kn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=zn(),r=G(),n=r.operators,a={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}},s={message:({keyword:i,schemaCode:u})=>(0,r.str)`should be ${a[i].okStr} ${u}`,params:({keyword:i,schemaCode:u})=>(0,r._)`{comparison: ${a[i].okStr}, limit: ${u}}`};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:s,code(i){const{gen:u,data:$,schemaCode:_,keyword:E,it:v}=i,{opts:g,self:b}=v;if(!g.validateFormats)return;const w=new t.KeywordCxt(v,b.RULES.all.format.definition,"format");w.$data?f():p();function f(){const l=u.scopeValue("formats",{ref:b.formats,code:g.code.formats}),y=u.const("fmt",(0,r._)`${l}[${w.schemaCode}]`);i.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,o(y)))}function p(){const l=w.schema,y=b.formats[l];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${l}" does not define "compare" function`);const c=u.scopeValue("formats",{key:l,ref:y,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(l)}`:void 0});i.fail$data(o(c))}function o(l){return(0,r._)`${l}.compare(${$}, ${_}) ${a[E].fail} 0`}},dependencies:["format"]};const d=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=d})(Xt)),Xt}var jn;function Si(){return jn||(jn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=wi(),n=Pi(),a=G(),s=new a.Name("fullFormats"),d=new a.Name("fastFormats"),i=($,_={keywords:!0})=>{if(Array.isArray(_))return u($,_,r.fullFormats,s),$;const[E,v]=_.mode==="fast"?[r.fastFormats,d]:[r.fullFormats,s],g=_.formats||r.formatNames;return u($,g,E,v),_.keywords&&(0,n.default)($),$};i.get=($,_="full")=>{const v=(_==="fast"?r.fastFormats:r.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function u($,_,E,v){var g,b;(g=(b=$.opts.code).formats)!==null&&g!==void 0||(b.formats=(0,a._)`require("ajv-formats/dist/formats").${v}`);for(const w of _)$.addFormat(w,E[w])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(St,St.exports)),St.exports}var Ei=Si();const ki=Nn(Ei),ji="http://json-schema.org/draft-07/schema#",Ri="#/definitions/CICConfig",Ii=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","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,值为该组件的变量映射。"}},"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":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"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":"其他"}}'),Ve={$schema:ji,$ref:Ri,definitions:Ii},ue={REQUIRED:"required",TYPE:"type",ENUM:"enum",CONST:"const",ADDITIONAL:"additionalProperties",ANY_OF:"anyOf"},ze={TYPE:"/type",VALUE:"/value",DEFAULT:"/default",ARGS:"/args"},Re={missing:e=>`缺少必填字段:${e}`,type:e=>`类型必须为:${e}`,enum:e=>`取值必须为枚举之一:${e.join(", ")}`,const:e=>`取值必须为:${JSON.stringify(e)}`,additionalProp:e=>`不允许额外字段:${e}`,constDefault:"必须等于常量"},Oi=[{rootPattern:/(\/|^)components\/\d+/,discriminator:"role",keepRequired:["role","id"]},{rootPattern:/(\/|^)global\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)page\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)component\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)dataSources\/\d+/,discriminator:"type",keepRequired:["type","id"]}];function Ni(e){const t=e.instancePath||e.path||"",r=e.keyword,n=e.params||{};let a=e.message||"";switch(r){case ue.REQUIRED:n.missingProperty&&(a=Re.missing(n.missingProperty));break;case ue.TYPE:e.schema&&(a=Re.type(e.schema));break;case ue.ENUM:Array.isArray(n.allowedValues)&&(a=Re.enum(n.allowedValues));break;case ue.CONST:a=n.allowedValue!==void 0?Re.const(n.allowedValue):Re.constDefault;break;case ue.ADDITIONAL:n.additionalProperty&&(a=Re.additionalProp(n.additionalProperty));break}return{path:t,message:a,keyword:r,params:n}}function Ci(e){return e.map(Ni)}function qi(e){const t=[],r=new Map,n=new Set;for(const a of e)if(a.keyword===ue.CONST&&a.path.endsWith(ze.TYPE)){const d=a.path,i=r.get(d)||{path:a.path,values:[]},u=a.params?.allowedValue;u!==void 0&&!i.values.includes(u)&&i.values.push(u),r.set(d,i)}else t.push(a);for(const[,a]of r)if(a.values.length!==0)if(a.values.length===1)t.push({path:a.path,keyword:ue.CONST,params:{allowedValue:a.values[0]},message:Re.const(a.values[0])});else{const s=a.path.replace(new RegExp(`${ze.TYPE}$`),"");n.add(s)}return{merged:t,multiConstRoots:n}}function Di(e){return`${e.keyword}|${e.path}|${JSON.stringify(e.params??{})}`}function Ti(e){const t=new Set,r=[];for(const n of e){const a=Di(n);t.has(a)||(t.add(a),r.push(n))}return r}function Ai(e){if(!e)return"";const t=Object.values(ze).join("|"),r=new RegExp(`^(.*?)(?:${t})(?:$|\\/)`),n=e.match(r);return n?n[1]:e}function Mi(e){const t=new Map;for(const r of e){const n=Ai(r.path),a=t.get(n)||[];a.push(r),t.set(n,a)}return t}function Vi(e,t){return e.keyword===ue.REQUIRED&&t.keepRequired.includes(e.params?.missingProperty)}function zi(e,t){const r=e.keyword===ue.TYPE,n=e.path===`${t}${ze.VALUE}`||e.path===`${t}${ze.DEFAULT}`;return r&&n}function Li(e,t){return e.keyword===ue.ADDITIONAL&&e.path===t}function Fi(e,t){const r=[];for(const[n,a]of e.entries()){const s=Oi.find(i=>i.rootPattern.test(n));if(s&&a.some(u=>u.keyword===ue.REQUIRED&&u.params?.missingProperty===s.discriminator)){for(const u of a)Vi(u,s)&&r.push(u);continue}if(!t.has(n)){r.push(...a);continue}for(const i of a)zi(i,n)||Li(i,n)||r.push(i)}return r}function Ui(e){return e.some(r=>r.keyword!==ue.ANY_OF)?e.filter(r=>r.keyword!==ue.ANY_OF):e}function Rn(e){if(e.keyword===ue.REQUIRED){const t=e.params?.missingProperty;return t==="type"||t==="role"?0:t==="id"?1:2}return 3}function Ki(e){return e.sort((t,r)=>Rn(t)-Rn(r))}function ee(e){if(!Array.isArray(e)||e.length===0)return[];const t=Ci(e),{merged:r,multiConstRoots:n}=qi(t),a=Ti(r),s=Mi(a),d=Fi(s,n),i=Ui(d);return Ki(i)}function Pe(e,t){return t?.length?t.map(r=>({...r,path:`${e}${r.path?`.${r.path}`:""}`})):[]}let Et=null;const Ln=()=>(Et||(Et=new bi({allErrors:!0,strict:!1}),ki(Et)),Et),In=new Map,Ji=JSON.stringify(Ve),Hi={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"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Gi=(e,t)=>e.compile({$ref:t,definitions:Ve.definitions,properties:Ve.properties}),te=e=>{const t=Ln(),r=`type:${e}::${Ji}`,n=In.get(r);if(n)return n;const a=Hi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of a)try{const d=Gi(t,s);return In.set(r,d),d}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Ae=e=>typeof e=="number"&&Number.isFinite(e)&&e>0,ir=()=>{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 r=Array.from(t,n=>n.toString(16).padStart(2,"0"));return`${r.slice(0,4).join("")}-${r.slice(4,6).join("")}-${r.slice(6,8).join("")}-${r.slice(8,10).join("")}-${r.slice(10).join("")}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},ye=(e,t)=>{if(!t||typeof t!="object")return e;const r=e??{};for(const n of Object.keys(t))(!(n in r)||r[n]===void 0)&&(r[n]=t[n]);return r},tr=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",keyword:"type",message:`JSON 解析失败:${t?.message??String(t)}`}]}}},Wi=e=>e.map(t=>({path:"",keyword:"required",params:{missingProperty:t},message:`缺少必填字段:${t}`})),Fn=({input:e,normalize:t,base:r,branches:n,key:a,missingKeys:s,onSuccess:d})=>{const i=t?t(e):e,u=i;if(u&&typeof u=="object"&&typeof u[a]=="string"){const $=n[u[a]];if($)return $(u)?d(u):{ok:!1,errors:ee($.errors)}}return r(i)?d(i):!u||typeof u[a]!="string"?{ok:!1,errors:Wi(s)}:{ok:!1,errors:ee(r.errors)}},or=(e,t,r,n)=>Fn({input:e,base:t,branches:r,key:n,missingKeys:[n,"id"],onSuccess:()=>({ok:!0,value:null})}),ar=(e,t,r,n,a,s,d=[s,"id"])=>Fn({input:e,normalize:i=>r(i,t),base:n,branches:a,key:s,missingKeys:d,onSuccess:i=>({ok:!0,value:i})}),Un=te("DataSourceItem"),Kn=te("DataSourceRest"),Jn=te("DataSourceWebSocket"),Hn=te("DataSourceStatic"),Gn=te("DataSourceFunction"),Bi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=ir()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&Ae(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&Ae(r.timeout)&&(r.timeout=Math.round(r.timeout))),ye(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&Ae(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&Ae(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),ye(r,t?.defaults)):r.type==="static"?t?.strict||ye(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Ae(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||ye(r,t?.defaults))),r},Yi=e=>or(e,Un,{rest:Kn,websocket:Jn,static:Hn,function:Gn},"type"),Wn=(e,t)=>ar(e,t,Bi,Un,{rest:Kn,websocket:Jn,static:Hn,function:Gn},"type",["type","id"]),Bn=te("ComponentInstance"),Yn=te("ViewComponentInstance"),xn=te("ContainerComponentInstance"),Qn=te("LogicComponentInstanceRef"),xi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=ir()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),ye(r,t?.defaults),r},Qi=e=>or(e,Bn,{view:Yn,container:xn,logic:Qn},"role"),Zn=(e,t)=>ar(e,t,xi,Bn,{view:Yn,container:xn,logic:Qn},"role",["role","id"]),Rt=te("CICPage"),Zi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=ir()),t?.strict||ye(r,t?.defaults),r},Xi=e=>Rt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Rt.errors||[])},Xn=(e,t)=>{const r=Zi(e,t);return Rt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Rt.errors||[])}},It=te("Meta"),Ot=te("Layout"),eo=e=>It(e)?{ok:!0,value:null}:{ok:!1,errors:ee(It.errors||[])},to=e=>Ot(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Ot.errors||[])},es=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return It(r)?{ok:!0,value:r}:{ok:!1,errors:ee(It.errors||[])}},ts=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ot.errors||[])}},Nt=te("Variables"),ro=e=>Nt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Nt.errors||[])},rs=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Nt.errors||[])}},ns=te("Dependency"),ss=te("JSDependency"),is=te("CSSDependency"),os=te("FontDependency"),as=te("ImageDependency"),cs=te("JSONDependency"),ds=te("WasmDependency"),us=te("OtherDependency"),no=e=>or(e,ns,{js:ss,css:is,font:os,image:as,json:cs,wasm:ds,other:us},"type"),ls=(e,t)=>ar(e,t,(n,a)=>a?.strict?n:ye(n,a?.defaults),ns,{js:ss,css:is,font:os,image:as,json:cs,wasm:ds,other:us},"type",["type","id"]),Ct=te("RegistryComponents"),so=e=>Ct(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Ct.errors||[])},fs=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Ct(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ct.errors||[])}},io=e=>typeof e=="number"?`[${e}]`:`/${e}`,oo=()=>{const e=new Map,t=[],r=(...s)=>s.reduce((d,i,u)=>{const $=io(i);return u===0&&typeof i=="string"&&!i.startsWith("/")?`/${i}`:`${d}${$}`},"");return{pathJoin:r,ensureUnique:(s,d)=>{const i=e.get(s)||new Set;return i.has(d)?(e.set(s,i),!0):(i.add(d),e.set(s,i),!1)},pushError:(s,d,i,u="error")=>{const $={path:r(...s),message:d,keyword:"rule",params:{ruleId:i,level:u}};return t.push($),$},errors:t}},ao=(e,t)=>{const r=oo();for(const n of t){const a=n.validate(e,r);Array.isArray(a)&&a.length&&r.errors.push(...a)}return{ok:r.errors.length===0,errors:r.errors}},co=(e,t)=>{const r=ao(e,t);return r.ok?{ok:!0,value:null}:{ok:!1,errors:ee(r.errors)}},uo={id:"components.id.unique",scope:"component",path:"pages[].components[].id",title:"组件 id 必须唯一",description:"组件 id 不允许重复",example:"comp_01",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=Array.isArray(n[a]?.components)?n[a].components:[];for(let d=0;d<s.length;d++){const i=s[d]?.id;if(typeof i!="string")continue;if(t.ensureUnique("components.id",i.trim())){const $=t.pushError(["pages",a,"components",d,"id"],`组件 id 重复:"${i.trim()}"`,"components.id.unique","error");r.push($)}}}return r}},lo={id:"datasources.id.unique",scope:"dataSource",path:"pages[].dataSources[].id",title:"数据源 id 必须唯一",description:"数据源 id 不允许重复",example:"ds_user_list",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=Array.isArray(n[a]?.dataSources)?n[a].dataSources:[];for(let d=0;d<s.length;d++){const i=s[d]?.id;if(typeof i!="string")continue;if(t.ensureUnique("dataSources.id",i.trim())){const $=t.pushError(["pages",a,"dataSources",d,"id"],`数据源 id 重复:"${i.trim()}"`,"datasources.id.unique","error");r.push($)}}}return r}},fo={id:"pages.name.unique",scope:"page",path:"pages[].name",title:"页面 name 必须唯一",description:"页面 name 不允许重复",example:"首页",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=n[a]?.name;if(typeof s!="string")continue;const d=s.trim();if(!d)continue;if(t.ensureUnique("pages.name",d)){const u=t.pushError(["pages",a,"name"],`页面name重复:"${d}"`,"pages.name.unique","error");r.push(u)}}return r}},po={id:"pages.path.unique",scope:"page",path:"pages[].path",title:"页面 path 必须唯一",description:"页面 path 不允许重复",example:"/home",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=n[a]?.path;if(typeof s!="string")continue;const d=s.trim();if(!d)continue;if(t.ensureUnique("pages.path",d)){const u=t.pushError(["pages",a,"path"],`页面path重复:"${d}"`,"pages.path.unique","error");r.push(u)}}return r}},mo=[fo,po,uo,lo];let qt,On;const ho=()=>{const e=Ln(),t=JSON.stringify(Ve);(!qt||On!==t)&&(qt=e.compile(Ve),On=t)},Dt=e=>{try{return ho(),qt(e)?co(e,mo):{ok:!1,errors:ee(qt.errors||[])}}catch(t){return{ok:!1,errors:ee([{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}])}}},yo=(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(!(r.startsWith("{")||r.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const a=tr(r);return a.ok?Me(a.value,t):{ok:!1,errors:a.errors}},go=async(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const s=tr(r);return s.ok?Me(s.value,t):{ok:!1,errors:s.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(r))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const s=await globalThis.fetch(r);if(!s||!s.ok){const u=[{path:"",message:`网络或资源错误:${s?.status} ${s?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(u)}}const d=await s.text(),i=tr(d);return i.ok?Me(i.value,t):{ok:!1,errors:i.errors}}catch(s){const d=[{path:"",message:`请求失败:${s?.message||s}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(d)}}},vo=e=>{const t=Dt(e);if(!t.ok)return{ok:!1,errors:t.errors};const r={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(r,null,2)}},Me=(e,t)=>{const r=typeof e=="object"?{...e}:e,n=[];if(!r||typeof r!="object")return n.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(n)};if(r.version||n.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||n.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||n.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),n.length)return{ok:!1,errors:ee(n)};const a=es(r.meta,t?.meta);if(a.ok||n.push(...Pe("/meta",a.errors)),r.meta?.layout){const d=ts(r.meta.layout,t?.layout);d.ok?r.meta.layout=d.value:n.push(...Pe("/meta/layout",d.errors))}if(a.ok&&(r.meta=a.value),r.variables){const d=rs(r.variables,t?.variables);d.ok?r.variables=d.value:n.push(...Pe("/variables",d.errors))}if(r.registry?.components){const d=[];for(let i=0;i<r.registry.components.length;i++){const u=fs(r.registry.components[i],t?.registry);u.ok?d.push(u.value):n.push(...Pe(`/registry/components[${i}]`,u.errors))}r.registry.components=d}if(r.deps){const d=[];for(let i=0;i<r.deps.length;i++){const u=ls(r.deps[i],t?.dependency);u.ok?d.push(u.value):n.push(...Pe(`/deps[${i}]`,u.errors))}r.deps=d}if(Array.isArray(r.pages)){const d=[];for(let i=0;i<r.pages.length;i++){const u=r.pages[i],$=Xn(u,t?.page);if(!$.ok){n.push(...Pe(`/pages[${i}]`,$.errors));continue}const _=$.value;if(Array.isArray(u.components)){const E=[];for(let v=0;v<u.components.length;v++){const g=Zn(u.components[v],t?.component);g.ok?E.push(g.value):n.push(...Pe(`/pages[${i}]/components[${v}]`,g.errors))}_.components=E}if(Array.isArray(u.dataSources)){const E=[];for(let v=0;v<u.dataSources.length;v++){const g=Wn(u.dataSources[v],t?.dataSource);g.ok?E.push(g.value):n.push(...Pe(`/pages[${i}]/dataSources[${v}]`,g.errors))}_.dataSources=E}d.push(_)}r.pages=d}if(n.length)return{ok:!1,errors:ee(n)};const s=Dt(r);return s.ok?{ok:!0,value:r}:{ok:!1,errors:s.errors}};var be=(e=>(e.Pending="pending",e.Loading="loading",e.Loaded="loaded",e.Failed="failed",e))(be||{});function _o(e,t){return Promise.race([e,new Promise((r,n)=>setTimeout(()=>n(new Error("Load timeout")),t))])}function $o(e){return new Promise(t=>setTimeout(t,e))}function bo(e){try{return new Function("return "+e)()}catch{return!1}}function wo(e){const t=new Map;return e.forEach(r=>{const n=r.group||"default";t.has(n)||t.set(n,[]),t.get(n).push(r)}),t}class ps{cache=new Map;loaders=new Map;loading=new Map;options;dependencies=new Map;constructor(t={}){this.options={timeout:3e4,retry:3,concurrency:6,onBeforeLoad:()=>{},onAfterLoad:()=>{},onProgress:()=>{},...t}}registerLoader(t,r){return this.loaders.set(t,r),this}registerDependencies(t){return t.forEach(r=>{this.dependencies.set(r.id,r)}),this}async load(t,r){const n={...this.options,...r};if(this.dependencies.set(t.id,t),this.cache.has(t.id)){const s=this.cache.get(t.id);if(s.status===be.Loaded)return s}if(this.loading.has(t.id))return this.loading.get(t.id);if(t.strategy?.when&&!bo(t.strategy.when))return{id:t.id,status:be.Loaded,data:null};const a=this.doLoad(t,n);this.loading.set(t.id,a);try{const s=await a;return this.cache.set(t.id,s),s}finally{this.loading.delete(t.id)}}async doLoad(t,r){const n=Date.now();let a;await r.onBeforeLoad(t);const s=this.loaders.get(t.type);if(!s)throw new Error(`No loader found for type: ${t.type}`);for(let i=0;i<=r.retry;i++)try{const u=await _o(s.load(t,r),r.timeout);return u.duration=Date.now()-n,await r.onAfterLoad(u),u}catch(u){a=u,i<r.retry&&await $o(Math.pow(2,i)*1e3)}const d={id:t.id,status:be.Failed,error:a,duration:Date.now()-n};return await r.onAfterLoad(d),d}async loadAll(t,r){const n={...this.options,...r},a=[];let s=0;this.registerDependencies(t);const d=wo(t);for(const[,i]of d){const u=await this.loadConcurrent(i,n.concurrency,n);a.push(...u),s+=i.length,n.onProgress(s,t.length)}return a}async loadConcurrent(t,r,n){const a=[],s=[...t],d=Array.from({length:Math.min(r,t.length)},async()=>{for(;s.length>0;){const i=s.shift();if(i){const u=await this.load(i,n);a.push(u)}}});return await Promise.all(d),a}async preload(t){const r=t.filter(n=>n.strategy?.preload||n.strategy?.prefetch);await this.loadAll(r,{...this.options,retry:1})}async unload(t){if(!this.cache.get(t))return;const n=this.dependencies.get(t);if(!n)return;const a=this.loaders.get(n.type);a?.unload&&await a.unload(n),this.cache.delete(t)}clear(){this.cache.clear(),this.loading.clear()}getStatus(t){return this.cache.get(t)?.status??be.Pending}getResult(t){return this.cache.get(t)}getAllResults(){return new Map(this.cache)}}class Po{async load(t){return new Promise((r,n)=>{const a=document.createElement("script");a.id=t.id,a.src=t.url||t.localPath||"",(t.module||t.format==="esm")&&(a.type="module"),t.strategy?.async&&(a.async=!0),t.crossOrigin&&(a.crossOrigin=t.crossOrigin),a.onload=()=>{r({id:t.id,status:be.Loaded,data:window[t.name||t.id]})},a.onerror=()=>{n(new Error(`Failed to load JS: ${t.url||t.localPath}`))},document.head.appendChild(a)})}async unload(t){const r=document.getElementById(t.id);r&&r.remove(),t.name&&window[t.name]&&delete window[t.name]}}class So{async load(t){return new Promise((r,n)=>{const a=document.createElement("link");a.id=t.id,a.rel="stylesheet",a.href=t.url||t.localPath||"",t.media&&(a.media=t.media),a.onload=()=>{r({id:t.id,status:be.Loaded})},a.onerror=()=>{n(new Error(`Failed to load CSS: ${t.url||t.localPath}`))},document.head.appendChild(a)})}async unload(t){const r=document.getElementById(t.id);r&&r.remove()}}class Eo{async load(t){return new Promise((r,n)=>{const a=new Image;a.onload=()=>{r({id:t.id,status:be.Loaded,data:a})},a.onerror=()=>{n(new Error(`Failed to load image: ${t.url||t.localPath}`))},a.src=t.url||t.localPath||""})}}class ko{async load(t){try{const r=await fetch(t.url||t.localPath||"");if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);const n=await r.json();return{id:t.id,status:be.Loaded,data:n}}catch{throw new Error(`Failed to load JSON: ${t.url||t.localPath}`)}}}function ms(e){const t=new ps(e);return t.registerLoader("js",new Po),t.registerLoader("css",new So),t.registerLoader("image",new Eo),t.registerLoader("json",new ko),t}function jo(e){return new ps(e)}let er=null;function Ro(e){return er||(er=ms(e)),er}class cr{config;constructor(t){const r=Dt(t);if(!r.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(n=>n.id===t?(r=n,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((n,a)=>n.id===t?(r=a,!1):!0),r}getVariable(t,r){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const a=n.component[t.componentId][r];if(a)return a.value??a.default}if(t.pageId&&n.page&&n.page[t.pageId]){const a=n.page[t.pageId][r];if(a)return a.value??a.default}if(n.global&&n.global[r]){const a=n.global[r];return a.value??a.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,n,a,s]=r;if(n==="global")return this.getVariable({},s);if(n==="page")return this.getVariable({pageId:a},s);if(n==="component")return this.getVariable({componentId:a},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const n=[];for(const s of r.components||[])n.push({node:s});let a=!1;for(;n.length>0&&!a;){const{node:s,parent:d}=n.pop();if(t(s,r,d)===!1){a=!0;break}if(s.children&&s.children.length>0)for(let u=s.children.length-1;u>=0;u--)n.push({node:s.children[u],parent:s})}if(a)break}}static getValueByPath(t,r,n){if(t==null||!r)return n;const a=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(d=>{d.trim()&&a.push(d.trim())});let s=t;for(const d of a){if(s==null)return n;s=s[d]}return s===void 0?n:s}static traverseTree(t,r,n){const a=Array.isArray(t)?t:[t];for(const s of a)r(s,n)!==!1&&s.children&&s.children.length>0&&cr.traverseTree(s.children,r,s)}static createDataSource=Wn;static validateDataSource=Yi;static createComponent=Zn;static validateComponent=Qi;static createPage=Xn;static validatePage=Xi;static createMeta=es;static createLayout=ts;static validateMeta=eo;static validateLayout=to;static createVariables=rs;static validateVariables=ro;static createDependency=ls;static validateDependency=no;static createRegistryComponent=fs;static validateRegistryComponent=so;static importCIC=yo;static exportCIC=vo;static validateCIC=Dt;static importCICAsync=go;static createDependencyLoader=ms;static createBareLoader=jo;static getDependencyLoaderSingleton=Ro}exports.CICSDK=cr;
8
+ deps: ${_}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[$,_]=s(u);d(u,$),i(u,_)}};function s({schema:u}){const $={},_={};for(const E in u){if(E==="__proto__")continue;const v=Array.isArray(u[E])?$:_;v[E]=u[E]}return[$,_]}function d(u,$=u.schema){const{gen:_,data:E,it:v}=u;if(Object.keys($).length===0)return;const g=_.let("missing");for(const b in $){const w=$[b];if(w.length===0)continue;const f=(0,n.propertyInData)(_,E,b,v.opts.ownProperties);u.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),v.allErrors?_.if(f,()=>{for(const p of w)(0,n.checkReportMissingProp)(u,p)}):(_.if((0,t._)`${f} && (${(0,n.checkMissingProp)(u,w,g)})`),(0,n.reportMissingProp)(u,g),_.else())}}e.validatePropertyDeps=d;function i(u,$=u.schema){const{gen:_,data:E,keyword:v,it:g}=u,b=_.name("valid");for(const w in $)(0,r.alwaysValidSchema)(g,$[w])||(_.if((0,n.propertyInData)(_,E,w,g.opts.ownProperties),()=>{const f=u.subschema({keyword:v,schemaProp:w},b);u.mergeValidEvaluated(f,b)},()=>_.var(b,!0)),u.ok(b))}e.validateSchemaDeps=i,e.default=a})(Qt)),Qt}var lt={},an;function Qs(){if(an)return lt;an=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,e._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:s,schema:d,data:i,it:u}=a;if((0,t.alwaysValidSchema)(u,d))return;const $=s.name("valid");s.forIn("key",i,_=>{a.setParams({propertyName:_}),a.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),s.if((0,e.not)($),()=>{a.error(!0),u.allErrors||s.break()})}),a.ok($)}};return lt.default=n,lt}var ft={},cn;function Vn(){if(cn)return ft;cn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=ge(),t=G(),r=Se(),n=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:d})=>(0,t._)`{additionalProperty: ${d.additionalProperty}}`},code(d){const{gen:i,schema:u,parentSchema:$,data:_,errsCount:E,it:v}=d;if(!E)throw new Error("ajv implementation error");const{allErrors:g,opts:b}=v;if(v.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(v,u))return;const w=(0,e.allSchemaProperties)($.properties),f=(0,e.allSchemaProperties)($.patternProperties);p(),d.ok((0,t._)`${E} === ${r.default.errors}`);function p(){i.forIn("key",_,h=>{!w.length&&!f.length?y(h):i.if(o(h),()=>y(h))})}function o(h){let P;if(w.length>8){const N=(0,n.schemaRefOrVal)(v,$.properties,"properties");P=(0,e.isOwnProperty)(i,N,h)}else w.length?P=(0,t.or)(...w.map(N=>(0,t._)`${h} === ${N}`)):P=t.nil;return f.length&&(P=(0,t.or)(P,...f.map(N=>(0,t._)`${(0,e.usePattern)(d,N)}.test(${h})`))),(0,t.not)(P)}function l(h){i.code((0,t._)`delete ${_}[${h}]`)}function y(h){if(b.removeAdditional==="all"||b.removeAdditional&&u===!1){l(h);return}if(u===!1){d.setParams({additionalProperty:h}),d.error(),g||i.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(v,u)){const P=i.name("valid");b.removeAdditional==="failing"?(c(h,P,!1),i.if((0,t.not)(P),()=>{d.reset(),l(h)})):(c(h,P),g||i.if((0,t.not)(P),()=>i.break()))}}function c(h,P,N){const T={keyword:"additionalProperties",dataProp:h,dataPropType:n.Type.Str};N===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),d.subschema(T,P)}}};return ft.default=s,ft}var pt={},dn;function Zs(){if(dn)return pt;dn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=Mt(),t=ge(),r=Y(),n=Vn(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:d,schema:i,parentSchema:u,data:$,it:_}=s;_.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(i);for(const f of E)_.definedProperties.add(f);_.opts.unevaluated&&E.length&&_.props!==!0&&(_.props=r.mergeEvaluated.props(d,(0,r.toHash)(E),_.props));const v=E.filter(f=>!(0,r.alwaysValidSchema)(_,i[f]));if(v.length===0)return;const g=d.name("valid");for(const f of v)b(f)?w(f):(d.if((0,t.propertyInData)(d,$,f,_.opts.ownProperties)),w(f),_.allErrors||d.else().var(g,!0),d.endIf()),s.it.definedProperties.add(f),s.ok(g);function b(f){return _.opts.useDefaults&&!_.compositeRule&&i[f].default!==void 0}function w(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},g)}}};return pt.default=a,pt}var mt={},un;function Xs(){if(un)return mt;un=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=ge(),t=G(),r=Y(),n=Y(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:d,schema:i,data:u,parentSchema:$,it:_}=s,{opts:E}=_,v=(0,e.allSchemaProperties)(i),g=v.filter(y=>(0,r.alwaysValidSchema)(_,i[y]));if(v.length===0||g.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&$.properties,w=d.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(d,_.props));const{props:f}=_;p();function p(){for(const y of v)b&&o(y),_.allErrors?l(y):(d.var(w,!0),l(y),d.if(w))}function o(y){for(const c in b)new RegExp(y).test(c)&&(0,r.checkStrictMode)(_,`property ${c} matches pattern ${y} (use allowMatchingProperties)`)}function l(y){d.forIn("key",u,c=>{d.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${c})`,()=>{const h=g.includes(y);h||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:c,dataPropType:n.Type.Str},w),_.opts.unevaluated&&f!==!0?d.assign((0,t._)`${f}[${c}]`,!0):!h&&!_.allErrors&&d.if((0,t.not)(w),()=>d.break())})})}}};return mt.default=a,mt}var ht={},ln;function ei(){if(ln)return ht;ln=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:a,it:s}=r;if((0,e.alwaysValidSchema)(s,a)){r.fail();return}const d=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),r.failResult(d,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return ht.default=t,ht}var yt={},fn;function ti(){if(fn)return yt;fn=1,Object.defineProperty(yt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return yt.default=t,yt}var gt={},pn;function ri(){if(pn)return gt;pn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:a})=>(0,e._)`{passingSchemas: ${a.passing}}`},code(a){const{gen:s,schema:d,parentSchema:i,it:u}=a;if(!Array.isArray(d))throw new Error("ajv implementation error");if(u.opts.discriminator&&i.discriminator)return;const $=d,_=s.let("valid",!1),E=s.let("passing",null),v=s.name("_valid");a.setParams({passing:E}),s.block(g),a.result(_,()=>a.reset(),()=>a.error(!0));function g(){$.forEach((b,w)=>{let f;(0,t.alwaysValidSchema)(u,b)?s.var(v,!0):f=a.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(E,(0,e._)`[${E}, ${w}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(E,w),f&&a.mergeEvaluated(f,e.Name)})})}}};return gt.default=n,gt}var vt={},mn;function ni(){if(mn)return vt;mn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:a,it:s}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");const d=n.name("valid");a.forEach((i,u)=>{if((0,e.alwaysValidSchema)(s,i))return;const $=r.subschema({keyword:"allOf",schemaProp:u},d);r.ok(d),r.mergeEvaluated($)})}};return vt.default=t,vt}var _t={},hn;function si(){if(hn)return _t;hn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:d,parentSchema:i,it:u}=s;i.then===void 0&&i.else===void 0&&(0,t.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const $=a(u,"then"),_=a(u,"else");if(!$&&!_)return;const E=d.let("valid",!0),v=d.name("_valid");if(g(),s.reset(),$&&_){const w=d.let("ifClause");s.setParams({ifClause:w}),d.if(v,b("then",w),b("else",w))}else $?d.if(v,b("then")):d.if((0,e.not)(v),b("else"));s.pass(E,()=>s.error(!0));function g(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function b(w,f){return()=>{const p=s.subschema({keyword:w},v);d.assign(E,v),s.mergeValidEvaluated(p,E),f?d.assign(f,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function a(s,d){const i=s.schema[d];return i!==void 0&&!(0,t.alwaysValidSchema)(s,i)}return _t.default=n,_t}var $t={},yn;function ii(){if(yn)return $t;yn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:a}){n.if===void 0&&(0,e.checkStrictMode)(a,`"${r}" without "if" is ignored`)}};return $t.default=t,$t}var gn;function oi(){if(gn)return at;gn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=An(),t=Ws(),r=Mn(),n=Bs(),a=Ys(),s=xs(),d=Qs(),i=Vn(),u=Zs(),$=Xs(),_=ei(),E=ti(),v=ri(),g=ni(),b=si(),w=ii();function f(p=!1){const o=[_.default,E.default,v.default,g.default,b.default,w.default,d.default,i.default,s.default,u.default,$.default];return p?o.push(t.default,n.default):o.push(e.default,r.default),o.push(a.default),o}return at.default=f,at}var bt={},wt={},vn;function ai(){if(vn)return wt;vn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=G(),r={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,a){const{gen:s,data:d,$data:i,schema:u,schemaCode:$,it:_}=n,{opts:E,errSchemaPath:v,schemaEnv:g,self:b}=_;if(!E.validateFormats)return;i?w():f();function w(){const p=s.scopeValue("formats",{ref:b.formats,code:E.code.formats}),o=s.const("fDef",(0,e._)`${p}[${$}]`),l=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>s.assign(l,(0,e._)`${o}.type || "string"`).assign(y,(0,e._)`${o}.validate`),()=>s.assign(l,(0,e._)`"string"`).assign(y,o)),n.fail$data((0,e.or)(c(),h()));function c(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${y}`}function h(){const P=g.$async?(0,e._)`(${o}.async ? await ${y}(${d}) : ${y}(${d}))`:(0,e._)`${y}(${d})`,N=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${d}))`;return(0,e._)`${y} && ${y} !== true && ${l} === ${a} && !${N}`}}function f(){const p=b.formats[u];if(!p){c();return}if(p===!0)return;const[o,l,y]=h(p);o===a&&n.pass(P());function c(){if(E.strictSchema===!1){b.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${u}" ignored in schema at path "${v}"`}}function h(N){const T=N instanceof RegExp?(0,e.regexpCode)(N):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(u)}`:void 0,z=s.scopeValue("formats",{key:u,ref:N,code:T});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${z}.validate`]:["string",N,z]}function P(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${d})`}return typeof l=="function"?(0,e._)`${y}(${d})`:(0,e._)`${y}.test(${d})`}}}};return wt.default=r,wt}var _n;function ci(){if(_n)return bt;_n=1,Object.defineProperty(bt,"__esModule",{value:!0});const t=[ai().default];return bt.default=t,bt}var je={},$n;function di(){return $n||($n=1,Object.defineProperty(je,"__esModule",{value:!0}),je.contentVocabulary=je.metadataVocabulary=void 0,je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),je}var bn;function ui(){if(bn)return He;bn=1,Object.defineProperty(He,"__esModule",{value:!0});const e=Ds(),t=Gs(),r=oi(),n=ci(),a=di(),s=[e.default,t.default,(0,r.default)(),n.default,a.metadataVocabulary,a.contentVocabulary];return He.default=s,He}var Pt={},Te={},wn;function li(){if(wn)return Te;wn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Te.DiscrError=e={})),Te}var Pn;function fi(){if(Pn)return Pt;Pn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=G(),t=li(),r=nr(),n=Vt(),a=Y(),d={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:u}})=>i===t.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:i,tag:u,tagName:$}})=>(0,e._)`{error: ${i}, tag: ${$}, tagValue: ${u}}`},code(i){const{gen:u,data:$,schema:_,parentSchema:E,it:v}=i,{oneOf:g}=E;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=_.propertyName;if(typeof b!="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=u.let("valid",!1),f=u.const("tag",(0,e._)`${$}${(0,e.getProperty)(b)}`);u.if((0,e._)`typeof ${f} == "string"`,()=>p(),()=>i.error(!1,{discrError:t.DiscrError.Tag,tag:f,tagName:b})),i.ok(w);function p(){const y=l();u.if(!1);for(const c in y)u.elseIf((0,e._)`${f} === ${c}`),u.assign(w,o(y[c]));u.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:f,tagName:b}),u.endIf()}function o(y){const c=u.name("valid"),h=i.subschema({keyword:"oneOf",schemaProp:y},c);return i.mergeEvaluated(h,e.Name),c}function l(){var y;const c={},h=N(E);let P=!0;for(let O=0;O<g.length;O++){let V=g[O];if(V?.$ref&&!(0,a.schemaHasRulesButRef)(V,v.self.RULES)){const F=V.$ref;if(V=r.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,F),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(v.opts.uriResolver,v.baseId,F)}const L=(y=V?.properties)===null||y===void 0?void 0:y[b];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(h||N(V)),T(L,O)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return c;function N({required:O}){return Array.isArray(O)&&O.includes(b)}function T(O,V){if(O.const)z(O.const,V);else if(O.enum)for(const L of O.enum)z(L,V);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function z(O,V){if(typeof O!="string"||O in c)throw new Error(`discriminator: "${b}" values must be unique strings`);c[O]=V}}}};return Pt.default=d,Pt}const pi="http://json-schema.org/draft-07/schema#",mi="http://json-schema.org/draft-07/schema#",hi="Core schema meta-schema",yi={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:[]}},gi=["object","boolean"],vi={$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:"#"}},_i={$schema:pi,$id:mi,title:hi,definitions:yi,type:gi,properties:vi,default:!0};var Sn;function zn(){return Sn||(Sn=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 r=Cs(),n=ui(),a=fi(),s=_i,d=["/properties"],i="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(s,d):s;this.addMetaSchema(b,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var $=Mt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var _=G();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 E=rr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var v=Vt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Le,Le.exports)),Le.exports}var $i=zn();const bi=Cn($i);var St={exports:{}},Zt={},En;function wi(){return En||(En=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(O,V){return{validate:O,compare:V}}e.fullFormats={date:t(s,d),time:t(u(!0),$),"date-time":t(v(!0),g),"iso-time":t(u(),_),"iso-date-time":t(v(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"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:l,int32:{type:"number",validate:h},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$/,d),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"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,b),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 r(O){return O%4===0&&(O%100!==0||O%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){const V=n.exec(O);if(!V)return!1;const L=+V[1],F=+V[2],Q=+V[3];return F>=1&&F<=12&&Q>=1&&Q<=(F===2&&r(L)?29:a[F])}function d(O,V){if(O&&V)return O>V?1:O<V?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function u(O){return function(L){const F=i.exec(L);if(!F)return!1;const Q=+F[1],ie=+F[2],oe=+F[3],X=F[4],pe=F[5]==="-"?-1:1,A=+(F[6]||0),j=+(F[7]||0);if(A>23||j>59||O&&!X)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*pe,I=Q-A*pe-(D<0?1:0);return(I===23||I===-1)&&(D===59||D===-1)&&oe<61}}function $(O,V){if(!(O&&V))return;const L=new Date("2020-01-01T"+O).valueOf(),F=new Date("2020-01-01T"+V).valueOf();if(L&&F)return L-F}function _(O,V){if(!(O&&V))return;const L=i.exec(O),F=i.exec(V);if(L&&F)return O=L[1]+L[2]+L[3],V=F[1]+F[2]+F[3],O>V?1:O<V?-1:0}const E=/t|\s/i;function v(O){const V=u(O);return function(F){const Q=F.split(E);return Q.length===2&&s(Q[0])&&V(Q[1])}}function g(O,V){if(!(O&&V))return;const L=new Date(O).valueOf(),F=new Date(V).valueOf();if(L&&F)return L-F}function b(O,V){if(!(O&&V))return;const[L,F]=O.split(E),[Q,ie]=V.split(E),oe=d(L,Q);if(oe!==void 0)return oe||$(F,ie)}const w=/\/|:/,f=/^(?:[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 p(O){return w.test(O)&&f.test(O)}const o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function l(O){return o.lastIndex=0,o.test(O)}const y=-2147483648,c=2**31-1;function h(O){return Number.isInteger(O)&&O<=c&&O>=y}function P(O){return Number.isInteger(O)}function N(){return!0}const T=/[^\\]\\Z/;function z(O){if(T.test(O))return!1;try{return new RegExp(O),!0}catch{return!1}}})(Zt)),Zt}var Xt={},kn;function Pi(){return kn||(kn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=zn(),r=G(),n=r.operators,a={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}},s={message:({keyword:i,schemaCode:u})=>(0,r.str)`should be ${a[i].okStr} ${u}`,params:({keyword:i,schemaCode:u})=>(0,r._)`{comparison: ${a[i].okStr}, limit: ${u}}`};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:s,code(i){const{gen:u,data:$,schemaCode:_,keyword:E,it:v}=i,{opts:g,self:b}=v;if(!g.validateFormats)return;const w=new t.KeywordCxt(v,b.RULES.all.format.definition,"format");w.$data?f():p();function f(){const l=u.scopeValue("formats",{ref:b.formats,code:g.code.formats}),y=u.const("fmt",(0,r._)`${l}[${w.schemaCode}]`);i.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,o(y)))}function p(){const l=w.schema,y=b.formats[l];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${l}" does not define "compare" function`);const c=u.scopeValue("formats",{key:l,ref:y,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(l)}`:void 0});i.fail$data(o(c))}function o(l){return(0,r._)`${l}.compare(${$}, ${_}) ${a[E].fail} 0`}},dependencies:["format"]};const d=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=d})(Xt)),Xt}var jn;function Si(){return jn||(jn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=wi(),n=Pi(),a=G(),s=new a.Name("fullFormats"),d=new a.Name("fastFormats"),i=($,_={keywords:!0})=>{if(Array.isArray(_))return u($,_,r.fullFormats,s),$;const[E,v]=_.mode==="fast"?[r.fastFormats,d]:[r.fullFormats,s],g=_.formats||r.formatNames;return u($,g,E,v),_.keywords&&(0,n.default)($),$};i.get=($,_="full")=>{const v=(_==="fast"?r.fastFormats:r.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function u($,_,E,v){var g,b;(g=(b=$.opts.code).formats)!==null&&g!==void 0||(b.formats=(0,a._)`require("ajv-formats/dist/formats").${v}`);for(const w of _)$.addFormat(w,E[w])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})(St,St.exports)),St.exports}var Ei=Si();const ki=Cn(Ei),ji="http://json-schema.org/draft-07/schema#",Ri="#/definitions/CICConfig",Ii=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","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":{"name":{"type":"string"},"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,值为该组件的变量映射。"}},"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":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"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":{"type":"boolean","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":{"type":"boolean","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":{"type":"boolean","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":{"type":"boolean","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":{"type":"boolean","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":{"type":"boolean","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":{"type":"boolean","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":"其他"}}'),Ve={$schema:ji,$ref:Ri,definitions:Ii},ue={REQUIRED:"required",TYPE:"type",ENUM:"enum",CONST:"const",ADDITIONAL:"additionalProperties",ANY_OF:"anyOf"},ze={TYPE:"/type",VALUE:"/value",DEFAULT:"/default",ARGS:"/args"},Re={missing:e=>`缺少必填字段:${e}`,type:e=>`类型必须为:${e}`,enum:e=>`取值必须为枚举之一:${e.join(", ")}`,const:e=>`取值必须为:${JSON.stringify(e)}`,additionalProp:e=>`不允许额外字段:${e}`,constDefault:"必须等于常量"},Ni=[{rootPattern:/(\/|^)components\/\d+/,discriminator:"role",keepRequired:["role","id"]},{rootPattern:/(\/|^)global\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)page\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)component\/[^\/]+\/[^\/]+$/,discriminator:"type",keepRequired:["type"]},{rootPattern:/(\/|^)dataSources\/\d+/,discriminator:"type",keepRequired:["type","id"]}];function Ci(e){const t=e.instancePath||e.path||"",r=e.keyword,n=e.params||{};let a=e.message||"";switch(r){case ue.REQUIRED:n.missingProperty&&(a=Re.missing(n.missingProperty));break;case ue.TYPE:e.schema&&(a=Re.type(e.schema));break;case ue.ENUM:Array.isArray(n.allowedValues)&&(a=Re.enum(n.allowedValues));break;case ue.CONST:a=n.allowedValue!==void 0?Re.const(n.allowedValue):Re.constDefault;break;case ue.ADDITIONAL:n.additionalProperty&&(a=Re.additionalProp(n.additionalProperty));break}return{path:t,message:a,keyword:r,params:n}}function Oi(e){return e.map(Ci)}function qi(e){const t=[],r=new Map,n=new Set;for(const a of e)if(a.keyword===ue.CONST&&a.path.endsWith(ze.TYPE)){const d=a.path,i=r.get(d)||{path:a.path,values:[]},u=a.params?.allowedValue;u!==void 0&&!i.values.includes(u)&&i.values.push(u),r.set(d,i)}else t.push(a);for(const[,a]of r)if(a.values.length!==0)if(a.values.length===1)t.push({path:a.path,keyword:ue.CONST,params:{allowedValue:a.values[0]},message:Re.const(a.values[0])});else{const s=a.path.replace(new RegExp(`${ze.TYPE}$`),"");n.add(s)}return{merged:t,multiConstRoots:n}}function Di(e){return`${e.keyword}|${e.path}|${JSON.stringify(e.params??{})}`}function Ti(e){const t=new Set,r=[];for(const n of e){const a=Di(n);t.has(a)||(t.add(a),r.push(n))}return r}function Ai(e){if(!e)return"";const t=Object.values(ze).join("|"),r=new RegExp(`^(.*?)(?:${t})(?:$|\\/)`),n=e.match(r);return n?n[1]:e}function Mi(e){const t=new Map;for(const r of e){const n=Ai(r.path),a=t.get(n)||[];a.push(r),t.set(n,a)}return t}function Vi(e,t){return e.keyword===ue.REQUIRED&&t.keepRequired.includes(e.params?.missingProperty)}function zi(e,t){const r=e.keyword===ue.TYPE,n=e.path===`${t}${ze.VALUE}`||e.path===`${t}${ze.DEFAULT}`;return r&&n}function Li(e,t){return e.keyword===ue.ADDITIONAL&&e.path===t}function Fi(e,t){const r=[];for(const[n,a]of e.entries()){const s=Ni.find(i=>i.rootPattern.test(n));if(s&&a.some(u=>u.keyword===ue.REQUIRED&&u.params?.missingProperty===s.discriminator)){for(const u of a)Vi(u,s)&&r.push(u);continue}if(!t.has(n)){r.push(...a);continue}for(const i of a)zi(i,n)||Li(i,n)||r.push(i)}return r}function Ui(e){return e.some(r=>r.keyword!==ue.ANY_OF)?e.filter(r=>r.keyword!==ue.ANY_OF):e}function Rn(e){if(e.keyword===ue.REQUIRED){const t=e.params?.missingProperty;return t==="type"||t==="role"?0:t==="id"?1:2}return 3}function Ki(e){return e.sort((t,r)=>Rn(t)-Rn(r))}function ee(e){if(!Array.isArray(e)||e.length===0)return[];const t=Oi(e),{merged:r,multiConstRoots:n}=qi(t),a=Ti(r),s=Mi(a),d=Fi(s,n),i=Ui(d);return Ki(i)}function Pe(e,t){return t?.length?t.map(r=>({...r,path:`${e}${r.path?`.${r.path}`:""}`})):[]}let Et=null;const Ln=()=>(Et||(Et=new bi({allErrors:!0,strict:!1}),ki(Et)),Et),In=new Map,Ji=JSON.stringify(Ve),Hi={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"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Gi=(e,t)=>e.compile({$ref:t,definitions:Ve.definitions,properties:Ve.properties}),te=e=>{const t=Ln(),r=`type:${e}::${Ji}`,n=In.get(r);if(n)return n;const a=Hi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of a)try{const d=Gi(t,s);return In.set(r,d),d}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Ae=e=>typeof e=="number"&&Number.isFinite(e)&&e>0,ir=()=>{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 r=Array.from(t,n=>n.toString(16).padStart(2,"0"));return`${r.slice(0,4).join("")}-${r.slice(4,6).join("")}-${r.slice(6,8).join("")}-${r.slice(8,10).join("")}-${r.slice(10).join("")}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},ye=(e,t)=>{if(!t||typeof t!="object")return e;const r=e??{};for(const n of Object.keys(t))(!(n in r)||r[n]===void 0)&&(r[n]=t[n]);return r},tr=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",keyword:"type",message:`JSON 解析失败:${t?.message??String(t)}`}]}}},Wi=e=>e.map(t=>({path:"",keyword:"required",params:{missingProperty:t},message:`缺少必填字段:${t}`})),Fn=({input:e,normalize:t,base:r,branches:n,key:a,missingKeys:s,onSuccess:d})=>{const i=t?t(e):e,u=i;if(u&&typeof u=="object"&&typeof u[a]=="string"){const $=n[u[a]];if($)return $(u)?d(u):{ok:!1,errors:ee($.errors)}}return r(i)?d(i):!u||typeof u[a]!="string"?{ok:!1,errors:Wi(s)}:{ok:!1,errors:ee(r.errors)}},or=(e,t,r,n)=>Fn({input:e,base:t,branches:r,key:n,missingKeys:[n,"id"],onSuccess:()=>({ok:!0,value:null})}),ar=(e,t,r,n,a,s,d=[s,"id"])=>Fn({input:e,normalize:i=>r(i,t),base:n,branches:a,key:s,missingKeys:d,onSuccess:i=>({ok:!0,value:i})}),Un=te("DataSourceItem"),Kn=te("DataSourceRest"),Jn=te("DataSourceWebSocket"),Hn=te("DataSourceStatic"),Gn=te("DataSourceFunction"),Bi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=ir()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&Ae(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&Ae(r.timeout)&&(r.timeout=Math.round(r.timeout))),ye(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&Ae(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&Ae(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),ye(r,t?.defaults)):r.type==="static"?t?.strict||ye(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Ae(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||ye(r,t?.defaults))),r},Yi=e=>or(e,Un,{rest:Kn,websocket:Jn,static:Hn,function:Gn},"type"),Wn=(e,t)=>ar(e,t,Bi,Un,{rest:Kn,websocket:Jn,static:Hn,function:Gn},"type",["type","id"]),Bn=te("ComponentInstance"),Yn=te("ViewComponentInstance"),xn=te("ContainerComponentInstance"),Qn=te("LogicComponentInstanceRef"),xi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=ir()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),ye(r,t?.defaults),r},Qi=e=>or(e,Bn,{view:Yn,container:xn,logic:Qn},"role"),Zn=(e,t)=>ar(e,t,xi,Bn,{view:Yn,container:xn,logic:Qn},"role",["role","id"]),Rt=te("CICPage"),Zi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=ir()),t?.strict||ye(r,t?.defaults),r},Xi=e=>Rt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Rt.errors||[])},Xn=(e,t)=>{const r=Zi(e,t);return Rt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Rt.errors||[])}},It=te("Meta"),Nt=te("Layout"),eo=e=>It(e)?{ok:!0,value:null}:{ok:!1,errors:ee(It.errors||[])},to=e=>Nt(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Nt.errors||[])},es=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return It(r)?{ok:!0,value:r}:{ok:!1,errors:ee(It.errors||[])}},ts=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Nt.errors||[])}},Ct=te("Variables"),ro=e=>Ct(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Ct.errors||[])},rs=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Ct(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ct.errors||[])}},ns=te("Dependency"),ss=te("JSDependency"),is=te("CSSDependency"),os=te("FontDependency"),as=te("ImageDependency"),cs=te("JSONDependency"),ds=te("WasmDependency"),us=te("OtherDependency"),no=e=>or(e,ns,{js:ss,css:is,font:os,image:as,json:cs,wasm:ds,other:us},"type"),ls=(e,t)=>ar(e,t,(n,a)=>a?.strict?n:ye(n,a?.defaults),ns,{js:ss,css:is,font:os,image:as,json:cs,wasm:ds,other:us},"type",["type","id"]),Ot=te("RegistryComponents"),so=e=>Ot(e)?{ok:!0,value:null}:{ok:!1,errors:ee(Ot.errors||[])},fs=(e,t)=>{const r=t?.strict?e:ye(e,t?.defaults);return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Ot.errors||[])}},io=e=>typeof e=="number"?`[${e}]`:`/${e}`,oo=()=>{const e=new Map,t=[],r=(...s)=>s.reduce((d,i,u)=>{const $=io(i);return u===0&&typeof i=="string"&&!i.startsWith("/")?`/${i}`:`${d}${$}`},"");return{pathJoin:r,ensureUnique:(s,d)=>{const i=e.get(s)||new Set;return i.has(d)?(e.set(s,i),!0):(i.add(d),e.set(s,i),!1)},pushError:(s,d,i,u="error")=>{const $={path:r(...s),message:d,keyword:"rule",params:{ruleId:i,level:u}};return t.push($),$},errors:t}},ao=(e,t)=>{const r=oo();for(const n of t){const a=n.validate(e,r);Array.isArray(a)&&a.length&&r.errors.push(...a)}return{ok:r.errors.length===0,errors:r.errors}},co=(e,t)=>{const r=ao(e,t);return r.ok?{ok:!0,value:null}:{ok:!1,errors:ee(r.errors)}},uo={id:"components.id.unique",scope:"component",path:"pages[].components[].id",title:"组件 id 必须唯一",description:"组件 id 不允许重复",example:"comp_01",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=Array.isArray(n[a]?.components)?n[a].components:[];for(let d=0;d<s.length;d++){const i=s[d]?.id;if(typeof i!="string")continue;if(t.ensureUnique("components.id",i.trim())){const $=t.pushError(["pages",a,"components",d,"id"],`组件 id 重复:"${i.trim()}"`,"components.id.unique","error");r.push($)}}}return r}},lo={id:"datasources.id.unique",scope:"dataSource",path:"pages[].dataSources[].id",title:"数据源 id 必须唯一",description:"数据源 id 不允许重复",example:"ds_user_list",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=Array.isArray(n[a]?.dataSources)?n[a].dataSources:[];for(let d=0;d<s.length;d++){const i=s[d]?.id;if(typeof i!="string")continue;if(t.ensureUnique("dataSources.id",i.trim())){const $=t.pushError(["pages",a,"dataSources",d,"id"],`数据源 id 重复:"${i.trim()}"`,"datasources.id.unique","error");r.push($)}}}return r}},fo={id:"pages.name.unique",scope:"page",path:"pages[].name",title:"页面 name 必须唯一",description:"页面 name 不允许重复",example:"首页",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=n[a]?.name;if(typeof s!="string")continue;const d=s.trim();if(!d)continue;if(t.ensureUnique("pages.name",d)){const u=t.pushError(["pages",a,"name"],`页面name重复:"${d}"`,"pages.name.unique","error");r.push(u)}}return r}},po={id:"pages.path.unique",scope:"page",path:"pages[].path",title:"页面 path 必须唯一",description:"页面 path 不允许重复",example:"/home",level:"error",validate:(e,t)=>{const r=[],n=Array.isArray(e.pages)?e.pages:[];for(let a=0;a<n.length;a++){const s=n[a]?.path;if(typeof s!="string")continue;const d=s.trim();if(!d)continue;if(t.ensureUnique("pages.path",d)){const u=t.pushError(["pages",a,"path"],`页面path重复:"${d}"`,"pages.path.unique","error");r.push(u)}}return r}},mo=[fo,po,uo,lo];let qt,Nn;const ho=()=>{const e=Ln(),t=JSON.stringify(Ve);(!qt||Nn!==t)&&(qt=e.compile(Ve),Nn=t)},Dt=e=>{try{return ho(),qt(e)?co(e,mo):{ok:!1,errors:ee(qt.errors||[])}}catch(t){return{ok:!1,errors:ee([{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}])}}},yo=(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(!(r.startsWith("{")||r.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const a=tr(r);return a.ok?Me(a.value,t):{ok:!1,errors:a.errors}},go=async(e,t)=>{if(e&&typeof e=="object")return Me(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const s=tr(r);return s.ok?Me(s.value,t):{ok:!1,errors:s.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(r))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const s=await globalThis.fetch(r);if(!s||!s.ok){const u=[{path:"",message:`网络或资源错误:${s?.status} ${s?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(u)}}const d=await s.text(),i=tr(d);return i.ok?Me(i.value,t):{ok:!1,errors:i.errors}}catch(s){const d=[{path:"",message:`请求失败:${s?.message||s}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(d)}}},vo=e=>{const t=Dt(e);if(!t.ok)return{ok:!1,errors:t.errors};const r={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(r,null,2)}},Me=(e,t)=>{const r=typeof e=="object"?{...e}:e,n=[];if(!r||typeof r!="object")return n.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(n)};if(r.version||n.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||n.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||n.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),n.length)return{ok:!1,errors:ee(n)};const a=es(r.meta,t?.meta);if(a.ok||n.push(...Pe("/meta",a.errors)),r.meta?.layout){const d=ts(r.meta.layout,t?.layout);d.ok?r.meta.layout=d.value:n.push(...Pe("/meta/layout",d.errors))}if(a.ok&&(r.meta=a.value),r.variables){const d=rs(r.variables,t?.variables);d.ok?r.variables=d.value:n.push(...Pe("/variables",d.errors))}if(r.registry?.components){const d=[];for(let i=0;i<r.registry.components.length;i++){const u=fs(r.registry.components[i],t?.registry);u.ok?d.push(u.value):n.push(...Pe(`/registry/components[${i}]`,u.errors))}r.registry.components=d}if(r.deps){const d=[];for(let i=0;i<r.deps.length;i++){const u=ls(r.deps[i],t?.dependency);u.ok?d.push(u.value):n.push(...Pe(`/deps[${i}]`,u.errors))}r.deps=d}if(Array.isArray(r.pages)){const d=[];for(let i=0;i<r.pages.length;i++){const u=r.pages[i],$=Xn(u,t?.page);if(!$.ok){n.push(...Pe(`/pages[${i}]`,$.errors));continue}const _=$.value;if(Array.isArray(u.components)){const E=[];for(let v=0;v<u.components.length;v++){const g=Zn(u.components[v],t?.component);g.ok?E.push(g.value):n.push(...Pe(`/pages[${i}]/components[${v}]`,g.errors))}_.components=E}if(Array.isArray(u.dataSources)){const E=[];for(let v=0;v<u.dataSources.length;v++){const g=Wn(u.dataSources[v],t?.dataSource);g.ok?E.push(g.value):n.push(...Pe(`/pages[${i}]/dataSources[${v}]`,g.errors))}_.dataSources=E}d.push(_)}r.pages=d}if(n.length)return{ok:!1,errors:ee(n)};const s=Dt(r);return s.ok?{ok:!0,value:r}:{ok:!1,errors:s.errors}};var be=(e=>(e.Pending="pending",e.Loading="loading",e.Loaded="loaded",e.Failed="failed",e))(be||{});function _o(e,t){return Promise.race([e,new Promise((r,n)=>setTimeout(()=>n(new Error("Load timeout")),t))])}function $o(e){return new Promise(t=>setTimeout(t,e))}function bo(e){try{return new Function("return "+e)()}catch{return!1}}function wo(e){const t=new Map;return e.forEach(r=>{const n=r.group||"default";t.has(n)||t.set(n,[]),t.get(n).push(r)}),t}class ps{cache=new Map;loaders=new Map;loading=new Map;options;dependencies=new Map;constructor(t={}){this.options={timeout:3e4,retry:3,concurrency:6,onBeforeLoad:()=>{},onAfterLoad:()=>{},onProgress:()=>{},...t}}registerLoader(t,r){return this.loaders.set(t,r),this}registerDependencies(t){return t.forEach(r=>{this.dependencies.set(r.id,r)}),this}async load(t,r){const n={...this.options,...r};if(this.dependencies.set(t.id,t),this.cache.has(t.id)){const s=this.cache.get(t.id);if(s.status===be.Loaded)return s}if(this.loading.has(t.id))return this.loading.get(t.id);if(t.strategy?.when&&!bo(t.strategy.when))return{id:t.id,status:be.Loaded,data:null};const a=this.doLoad(t,n);this.loading.set(t.id,a);try{const s=await a;return this.cache.set(t.id,s),s}finally{this.loading.delete(t.id)}}async doLoad(t,r){const n=Date.now();let a;await r.onBeforeLoad(t);const s=this.loaders.get(t.type);if(!s)throw new Error(`No loader found for type: ${t.type}`);for(let i=0;i<=r.retry;i++)try{const u=await _o(s.load(t,r),r.timeout);return u.duration=Date.now()-n,await r.onAfterLoad(u),u}catch(u){a=u,i<r.retry&&await $o(Math.pow(2,i)*1e3)}const d={id:t.id,status:be.Failed,error:a,duration:Date.now()-n};return await r.onAfterLoad(d),d}async loadAll(t,r){const n={...this.options,...r},a=[];let s=0;this.registerDependencies(t);const d=wo(t);for(const[,i]of d){const u=await this.loadConcurrent(i,n.concurrency,n);a.push(...u),s+=i.length,n.onProgress(s,t.length)}return a}async loadConcurrent(t,r,n){const a=[],s=[...t],d=Array.from({length:Math.min(r,t.length)},async()=>{for(;s.length>0;){const i=s.shift();if(i){const u=await this.load(i,n);a.push(u)}}});return await Promise.all(d),a}async preload(t){const r=t.filter(n=>n.strategy?.preload||n.strategy?.prefetch);await this.loadAll(r,{...this.options,retry:1})}async unload(t){if(!this.cache.get(t))return;const n=this.dependencies.get(t);if(!n)return;const a=this.loaders.get(n.type);a?.unload&&await a.unload(n),this.cache.delete(t)}clear(){this.cache.clear(),this.loading.clear()}getStatus(t){return this.cache.get(t)?.status??be.Pending}getResult(t){return this.cache.get(t)}getAllResults(){return new Map(this.cache)}}class Po{async load(t){return new Promise((r,n)=>{const a=document.createElement("script");a.id=t.id,a.src=t.url||t.localPath||"",(t.module||t.format==="esm")&&(a.type="module"),t.strategy?.async&&(a.async=!0),t.crossOrigin&&(a.crossOrigin=t.crossOrigin),a.onload=()=>{r({id:t.id,status:be.Loaded,data:window[t.name||t.id]})},a.onerror=()=>{n(new Error(`Failed to load JS: ${t.url||t.localPath}`))},document.head.appendChild(a)})}async unload(t){const r=document.getElementById(t.id);r&&r.remove(),t.name&&window[t.name]&&delete window[t.name]}}class So{async load(t){return new Promise((r,n)=>{const a=document.createElement("link");a.id=t.id,a.rel="stylesheet",a.href=t.url||t.localPath||"",t.media&&(a.media=t.media),a.onload=()=>{r({id:t.id,status:be.Loaded})},a.onerror=()=>{n(new Error(`Failed to load CSS: ${t.url||t.localPath}`))},document.head.appendChild(a)})}async unload(t){const r=document.getElementById(t.id);r&&r.remove()}}class Eo{async load(t){return new Promise((r,n)=>{const a=new Image;a.onload=()=>{r({id:t.id,status:be.Loaded,data:a})},a.onerror=()=>{n(new Error(`Failed to load image: ${t.url||t.localPath}`))},a.src=t.url||t.localPath||""})}}class ko{async load(t){try{const r=await fetch(t.url||t.localPath||"");if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);const n=await r.json();return{id:t.id,status:be.Loaded,data:n}}catch{throw new Error(`Failed to load JSON: ${t.url||t.localPath}`)}}}function ms(e){const t=new ps(e);return t.registerLoader("js",new Po),t.registerLoader("css",new So),t.registerLoader("image",new Eo),t.registerLoader("json",new ko),t}function jo(e){return new ps(e)}let er=null;function Ro(e){return er||(er=ms(e)),er}class cr{config;constructor(t){const r=Dt(t);if(!r.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(n=>n.id===t?(r=n,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((n,a)=>n.id===t?(r=a,!1):!0),r}getVariable(t,r){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const a=n.component[t.componentId][r];if(a)return a.value??a.default}if(t.pageId&&n.page&&n.page[t.pageId]){const a=n.page[t.pageId][r];if(a)return a.value??a.default}if(n.global&&n.global[r]){const a=n.global[r];return a.value??a.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,n,a,s]=r;if(n==="global")return this.getVariable({},s);if(n==="page")return this.getVariable({pageId:a},s);if(n==="component")return this.getVariable({componentId:a},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const n=[];for(const s of r.components||[])n.push({node:s});let a=!1;for(;n.length>0&&!a;){const{node:s,parent:d}=n.pop();if(t(s,r,d)===!1){a=!0;break}if(s.children&&s.children.length>0)for(let u=s.children.length-1;u>=0;u--)n.push({node:s.children[u],parent:s})}if(a)break}}static getValueByPath(t,r,n){if(t==null||!r)return n;const a=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(d=>{d.trim()&&a.push(d.trim())});let s=t;for(const d of a){if(s==null)return n;s=s[d]}return s===void 0?n:s}static traverseTree(t,r,n){const a=Array.isArray(t)?t:[t];for(const s of a)r(s,n)!==!1&&s.children&&s.children.length>0&&cr.traverseTree(s.children,r,s)}static createDataSource=Wn;static validateDataSource=Yi;static createComponent=Zn;static validateComponent=Qi;static createPage=Xn;static validatePage=Xi;static createMeta=es;static createLayout=ts;static validateMeta=eo;static validateLayout=to;static createVariables=rs;static validateVariables=ro;static createDependency=ls;static validateDependency=no;static createRegistryComponent=fs;static validateRegistryComponent=so;static importCIC=yo;static exportCIC=vo;static validateCIC=Dt;static importCICAsync=go;static createDependencyLoader=ms;static createBareLoader=jo;static getDependencyLoaderSingleton=Ro}exports.CICSDK=cr;