homebridge-config-ui-x
Version:
A web based management, configuration and control platform for Homebridge.
5 lines • 842 kB
JavaScript
import{a as uu,b as eb}from"./chunk-KUFAY5CP.js";import{a as A1}from"./chunk-XJY7A24W.js";import{a as en,b as tn}from"./chunk-TIE2WSHM.js";import{a as O1}from"./chunk-6SEBWKRM.js";import{a as j1}from"./chunk-S5L52QFG.js";import{a as M1}from"./chunk-ZCCLGLMW.js";import{a as of}from"./chunk-77GWB2NW.js";import{a as $1,b as T1}from"./chunk-P5DRV4DP.js";import{a as ss}from"./chunk-HHPGR3HF.js";import{a as P1}from"./chunk-6M524CF7.js";import{a as Ur,b as Wr,c as Gr,d as Kr,e as Jr,f as Xr,g as Zi,m as ve,n as it,o as Qi}from"./chunk-OHFVMRCL.js";import{A as as,a as y1,b as Ki,c as Ji,e as vt,f as v1,h as B1,i as x1,k as w1,l as Yu,m as S1,o as Xi,r as Yi,s as vi,t as Bi,y as I1,z as tu}from"./chunk-MMYB2ZMV.js";import{a as Qu}from"./chunk-2QXNFD4L.js";import{d as cu}from"./chunk-QY7HUYL5.js";import{a as k1}from"./chunk-7LZPZXYJ.js";import{b as Le}from"./chunk-3P637DAY.js";import{h as _e,j as Zu,k as he}from"./chunk-SXUVUFAV.js";import{e as _1}from"./chunk-R3JWGCC5.js";import{a as Ee,b as Be}from"./chunk-KPKQNEWS.js";import{$a as l,Ac as y,Bc as B,Ca as Hu,Cc as je,D as r1,Da as D1,Fa as Uu,Gb as K,Hb as x,Ib as w,Jc as gt,Kb as nt,Kc as U,Lb as ft,Lc as Xu,M as Vr,Mb as rt,Nb as b,Nc as g1,Ob as c,Pb as p,Qb as S,Rb as p1,Sb as m1,Ub as H,Xa as de,Xb as O,Yb as C,Z as ns,_a as l1,a as X,aa as rf,ac as fs,b as Se,bc as rs,bd as zt,cc as os,cd as yi,dc as Wu,dd as bt,e as F,eb as Lr,ec as Gu,fa as o1,fb as yu,g as Ue,ga as Ot,gc as Qt,gd as b1,h as G,ha as Ui,hb as _i,hc as Ku,ic as Z,ja as a1,jc as E,k as u1,ka as s1,kc as L,kd as Hr,la as I,lb as Y,lc as q,mb as Wi,mc as Bu,n as Pt,nb as vu,nc as F1,o as is,ob as d1,q as i1,qc as Te,ra as j,rb as ce,rc as Pe,sa as N,sc as Oe,sd as E1,tb as c1,tc as C1,ub as zr,uc as h1,v as n1,vc as Me,w as ae,wc as eu,x as f1,xc as Ju,yc as xu,za as Rr,zc as Gi}from"./chunk-QSPBB6EE.js";var Df=F(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var af=class{};be._CodeOrName=af;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var xi=class extends af{constructor(u){if(super(),!be.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=xi;var Ht=class extends af{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof xi&&(t[i.str]=(t[i.str]||0)+1),t),{})}};be._Code=Ht;be.nil=new Ht("");function N1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ls(t,u[i]),t.push(e[++i]);return new Ht(t)}be._=N1;var Ds=new Ht("+");function q1(e,...u){let t=[sf(e[0])],i=0;for(;i<u.length;)t.push(Ds),ls(t,u[i]),t.push(Ds,sf(e[++i]));return ub(t),new Ht(t)}be.str=q1;function ls(e,u){u instanceof Ht?e.push(...u._items):u instanceof xi?e.push(u):e.push(fb(u))}be.addCodeArg=ls;function ub(e){let u=1;for(;u<e.length-1;){if(e[u]===Ds){let t=ib(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function ib(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof xi||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof xi))return`"${e}${u.slice(1)}`}function nb(e,u){return u.emptyStr()?e:e.emptyStr()?u:q1`${e}${u}`}be.strConcat=nb;function fb(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:sf(Array.isArray(e)?e.join(","):e)}function rb(e){return new Ht(sf(e))}be.stringify=rb;function sf(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=sf;function ob(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Ht(`.${e}`):N1`[${e}]`}be.getProperty=ob;function ab(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=ab;function sb(e){return new Ht(e.toString())}be.regexpCode=sb});var ps=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=Df(),ds=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var Db=(0,Bt._)`\n`,cs=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=Se(X({},u),{_n:u.lines?Db:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new ds(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=cs});var ee=F(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.or=se.and=se.not=se.CodeGen=se.operators=se.varKinds=se.ValueScopeName=se.ValueScope=se.Scope=se.Name=se.regexpCode=se.stringify=se.getProperty=se.nil=se.strConcat=se.str=se._=void 0;var Fe=Df(),iu=ps(),ei=Df();Object.defineProperty(se,"_",{enumerable:!0,get:function(){return ei._}});Object.defineProperty(se,"str",{enumerable:!0,get:function(){return ei.str}});Object.defineProperty(se,"strConcat",{enumerable:!0,get:function(){return ei.strConcat}});Object.defineProperty(se,"nil",{enumerable:!0,get:function(){return ei.nil}});Object.defineProperty(se,"getProperty",{enumerable:!0,get:function(){return ei.getProperty}});Object.defineProperty(se,"stringify",{enumerable:!0,get:function(){return ei.stringify}});Object.defineProperty(se,"regexpCode",{enumerable:!0,get:function(){return ei.regexpCode}});Object.defineProperty(se,"Name",{enumerable:!0,get:function(){return ei.Name}});var no=ps();Object.defineProperty(se,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(se,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(se,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(se,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});se.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var wu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},ms=class extends wu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=nn(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends wu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=nn(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Fs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},Cs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},hs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},gs=class extends wu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},bs=class extends wu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=nn(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},lf=class extends wu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(lb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>wi(u,t.names),{})}},Su=class extends lf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},Es=class extends lf{},_s=(()=>{class e extends Su{}return e.kind="else",e})(),eo=(()=>{class e extends Su{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new _s(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(H1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=nn(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&wi(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends Su{}return e.kind="for",e})(),ys=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=nn(this.iteration,u,t),this}get names(){return wi(super.names,this.iteration.names)}},vs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=nn(this.iterable,u,t),this}get names(){return wi(super.names,this.iterable.names)}},V1=(()=>{class e extends Su{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),R1=(()=>{class e extends lf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Bs=class extends Su{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&wi(u,this.catch.names),this.finally&&wi(u,this.finally.names),u}},L1=(()=>{class e extends Su{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),z1=(()=>{class e extends Su{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),xs=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Se(X({},t),{_n:t.lines?`
`:""}),this._extScope=u,this._scope=new iu.Scope({parent:u}),this._nodes=[new Es]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,t){let i=this._extScope.value(u,t);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(u,t){return this._extScope.getValue(u,t)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,t,i,n){let f=this._scope.toName(t);return i!==void 0&&n&&(this._constants[f.str]=i),this._leafNode(new ms(u,f,i)),f}const(u,t,i){return this._def(iu.varKinds.const,u,t,i)}let(u,t,i){return this._def(iu.varKinds.let,u,t,i)}var(u,t,i){return this._def(iu.varKinds.var,u,t,i)}assign(u,t,i){return this._leafNode(new to(u,t,i))}add(u,t){return this._leafNode(new Fs(u,se.operators.ADD,t))}code(u){return typeof u=="function"?u():u!==Fe.nil&&this._leafNode(new bs(u)),this}object(...u){let t=["{"];for(let[i,n]of u)t.length>1&&t.push(","),t.push(i),(i!==n||this.opts.es5)&&(t.push(":"),(0,Fe.addCodeArg)(t,n));return t.push("}"),new Fe._Code(t)}if(u,t,i){if(this._blockNode(new eo(u)),t&&i)this.code(t).else().code(i).endIf();else if(t)this.code(t).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new eo(u))}else(){return this._elseNode(new _s)}endIf(){return this._endBlockNode(eo,_s)}_for(u,t){return this._blockNode(u),t&&this.code(t).endFor(),this}for(u,t){return this._for(new ys(u),t)}forRange(u,t,i,n,f=this.opts.es5?iu.varKinds.var:iu.varKinds.let){let r=this._scope.toName(u);return this._for(new vs(f,r,t,i),()=>n(r))}forOf(u,t,i,n=iu.varKinds.const){let f=this._scope.toName(u);if(this.opts.es5){let r=t instanceof Fe.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Fe._)`${r}.length`,o=>{this.var(f,(0,Fe._)`${r}[${o}]`),i(f)})}return this._for(new uo("of",n,f,t),()=>i(f))}forIn(u,t,i,n=this.opts.es5?iu.varKinds.var:iu.varKinds.const){if(this.opts.ownProperties)return this.forOf(u,(0,Fe._)`Object.keys(${t})`,i);let f=this._scope.toName(u);return this._for(new uo("in",n,f,t),()=>i(f))}endFor(){return this._endBlockNode(fo)}label(u){return this._leafNode(new Cs(u))}break(u){return this._leafNode(new hs(u))}return(u){let t=new R1;if(this._blockNode(t),this.code(u),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(R1)}try(u,t,i){if(!t&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Bs;if(this._blockNode(n),this.code(u),t){let f=this.name("e");this._currNode=n.catch=new L1(f),t(f)}return i&&(this._currNode=n.finally=new z1,this.code(i)),this._endBlockNode(L1,z1)}throw(u){return this._leafNode(new gs(u))}block(u,t){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(t),this}endBlock(u){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-t;if(i<0||u!==void 0&&i!==u)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${u} expected`);return this._nodes.length=t,this}func(u,t=Fe.nil,i,n){return this._blockNode(new V1(u,t,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(V1)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,t){let i=this._currNode;if(i instanceof u||t&&i instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${u.kind}/${t.kind}`:u.kind}"`)}_elseNode(u){let t=this._currNode;if(!(t instanceof eo))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=u,this}get _root(){return this._nodes[0]}get _currNode(){let u=this._nodes;return u[u.length-1]}set _currNode(u){let t=this._nodes;t[t.length-1]=u}};se.CodeGen=xs;function wi(e,u){for(let t in u)e[t]=(e[t]||0)+(u[t]||0);return e}function io(e,u){return u instanceof Fe._CodeOrName?wi(e,u.names):e}function nn(e,u,t){if(e instanceof Fe.Name)return i(e);if(!n(e))return e;return new Fe._Code(e._items.reduce((f,r)=>(r instanceof Fe.Name&&(r=i(r)),r instanceof Fe._Code?f.push(...r._items):f.push(r),f),[]));function i(f){let r=t[f.str];return r===void 0||u[f.str]!==1?f:(delete u[f.str],r)}function n(f){return f instanceof Fe._Code&&f._items.some(r=>r instanceof Fe.Name&&u[r.str]===1&&t[r.str]!==void 0)}}function lb(e,u){for(let t in u)e[t]=(e[t]||0)-(u[t]||0)}function H1(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Fe._)`!${ws(e)}`}se.not=H1;var db=U1(se.operators.AND);function cb(...e){return e.reduce(db)}se.and=cb;var pb=U1(se.operators.OR);function mb(...e){return e.reduce(pb)}se.or=mb;function U1(e){return(u,t)=>u===Fe.nil?t:t===Fe.nil?u:(0,Fe._)`${ws(u)} ${e} ${ws(t)}`}function ws(e){return e instanceof Fe.Name?e:(0,Fe._)`(${e})`}});var le=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var Ie=ee(),Fb=Df();function Cb(e){let u={};for(let t of e)u[t]=!0;return u}De.toHash=Cb;function hb(e,u){return typeof u=="boolean"?u:Object.keys(u).length===0?!0:(K1(e,u),!J1(u,e.self.RULES.all))}De.alwaysValidSchema=hb;function K1(e,u=e.schema){let{opts:t,self:i}=e;if(!t.strictSchema||typeof u=="boolean")return;let n=i.RULES.keywords;for(let f in u)n[f]||Z1(e,`unknown keyword: "${f}"`)}De.checkUnknownRules=K1;function J1(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(u[t])return!0;return!1}De.schemaHasRules=J1;function gb(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&u.all[t])return!0;return!1}De.schemaHasRulesButRef=gb;function bb({topSchemaRef:e,schemaPath:u},t,i,n){if(!n){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ie._)`${t}`}return(0,Ie._)`${e}${u}${(0,Ie.getProperty)(i)}`}De.schemaRefOrVal=bb;function Eb(e){return X1(decodeURIComponent(e))}De.unescapeFragment=Eb;function _b(e){return encodeURIComponent(Is(e))}De.escapeFragment=_b;function Is(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Is;function X1(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=X1;function yb(e,u){if(Array.isArray(e))for(let t of e)u(t);else u(e)}De.eachItem=yb;function W1({mergeNames:e,mergeToName:u,mergeValues:t,resultToName:i}){return(n,f,r,o)=>{let a=r===void 0?f:r instanceof Ie.Name?(f instanceof Ie.Name?e(n,f,r):u(n,f,r),r):f instanceof Ie.Name?(u(n,r,f),f):t(f,r);return o===Ie.Name&&!(a instanceof Ie.Name)?i(n,a):a}}De.mergeEvaluated={props:W1({mergeNames:(e,u,t)=>e.if((0,Ie._)`${t} !== true && ${u} !== undefined`,()=>{e.if((0,Ie._)`${u} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,Ie._)`${t} || {}`).code((0,Ie._)`Object.assign(${t}, ${u})`))}),mergeToName:(e,u,t)=>e.if((0,Ie._)`${t} !== true`,()=>{u===!0?e.assign(t,!0):(e.assign(t,(0,Ie._)`${t} || {}`),As(e,t,u))}),mergeValues:(e,u)=>e===!0?!0:X(X({},e),u),resultToName:Y1}),items:W1({mergeNames:(e,u,t)=>e.if((0,Ie._)`${t} !== true && ${u} !== undefined`,()=>e.assign(t,(0,Ie._)`${u} === true ? true : ${t} > ${u} ? ${t} : ${u}`)),mergeToName:(e,u,t)=>e.if((0,Ie._)`${t} !== true`,()=>e.assign(t,u===!0?!0:(0,Ie._)`${t} > ${u} ? ${t} : ${u}`)),mergeValues:(e,u)=>e===!0?!0:Math.max(e,u),resultToName:(e,u)=>e.var("items",u)})};function Y1(e,u){if(u===!0)return e.var("props",!0);let t=e.var("props",(0,Ie._)`{}`);return u!==void 0&&As(e,t,u),t}De.evaluatedPropsToName=Y1;function As(e,u,t){Object.keys(t).forEach(i=>e.assign((0,Ie._)`${u}${(0,Ie.getProperty)(i)}`,!0))}De.setEvaluated=As;var G1={};function vb(e,u){return e.scopeValue("func",{ref:u,code:G1[u.code]||(G1[u.code]=new Fb._Code(u.code))})}De.useFunc=vb;var Ss=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(Ss||(De.Type=Ss={}));function Bb(e,u,t){if(e instanceof Ie.Name){let i=u===Ss.Num;return t?i?(0,Ie._)`"[" + ${e} + "]"`:(0,Ie._)`"['" + ${e} + "']"`:i?(0,Ie._)`"/" + ${e}`:(0,Ie._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ie.getProperty)(e).toString():"/"+Is(e)}De.getErrorPath=Bb;function Z1(e,u,t=e.opts.strictSchema){if(t){if(u=`strict mode: ${u}`,t===!0)throw new Error(u);e.self.logger.warn(u)}}De.checkStrictMode=Z1});var Ut=F(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var lt=ee(),xb={data:new lt.Name("data"),valCxt:new lt.Name("valCxt"),instancePath:new lt.Name("instancePath"),parentData:new lt.Name("parentData"),parentDataProperty:new lt.Name("parentDataProperty"),rootData:new lt.Name("rootData"),dynamicAnchors:new lt.Name("dynamicAnchors"),vErrors:new lt.Name("vErrors"),errors:new lt.Name("errors"),this:new lt.Name("this"),self:new lt.Name("self"),scope:new lt.Name("scope"),json:new lt.Name("json"),jsonPos:new lt.Name("jsonPos"),jsonLen:new lt.Name("jsonLen"),jsonPart:new lt.Name("jsonPart")};ks.default=xb});var df=F(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.extendErrors=dt.resetErrorsCount=dt.reportExtraError=dt.reportError=dt.keyword$DataError=dt.keywordError=void 0;var ge=ee(),ro=le(),Et=Ut();dt.keywordError={message:({keyword:e})=>(0,ge.str)`must pass "${e}" keyword validation`};dt.keyword$DataError={message:({keyword:e,schemaType:u})=>u?(0,ge.str)`"${e}" keyword must be ${u} ($data)`:(0,ge.str)`"${e}" keyword is invalid ($data)`};function wb(e,u=dt.keywordError,t,i){let{it:n}=e,{gen:f,compositeRule:r,allErrors:o}=n,a=td(e,u,t);i??(r||o)?Q1(f,a):ed(n,(0,ge._)`[${a}]`)}dt.reportError=wb;function Sb(e,u=dt.keywordError,t){let{it:i}=e,{gen:n,compositeRule:f,allErrors:r}=i,o=td(e,u,t);Q1(n,o),f||r||ed(i,Et.default.vErrors)}dt.reportExtraError=Sb;function Ib(e,u){e.assign(Et.default.errors,u),e.if((0,ge._)`${Et.default.vErrors} !== null`,()=>e.if(u,()=>e.assign((0,ge._)`${Et.default.vErrors}.length`,u),()=>e.assign(Et.default.vErrors,null)))}dt.resetErrorsCount=Ib;function Ab({gen:e,keyword:u,schemaValue:t,data:i,errsCount:n,it:f}){if(n===void 0)throw new Error("ajv implementation error");let r=e.name("err");e.forRange("i",n,Et.default.errors,o=>{e.const(r,(0,ge._)`${Et.default.vErrors}[${o}]`),e.if((0,ge._)`${r}.instancePath === undefined`,()=>e.assign((0,ge._)`${r}.instancePath`,(0,ge.strConcat)(Et.default.instancePath,f.errorPath))),e.assign((0,ge._)`${r}.schemaPath`,(0,ge.str)`${f.errSchemaPath}/${u}`),f.opts.verbose&&(e.assign((0,ge._)`${r}.schema`,t),e.assign((0,ge._)`${r}.data`,i))})}dt.extendErrors=Ab;function Q1(e,u){let t=e.const("err",u);e.if((0,ge._)`${Et.default.vErrors} === null`,()=>e.assign(Et.default.vErrors,(0,ge._)`[${t}]`),(0,ge._)`${Et.default.vErrors}.push(${t})`),e.code((0,ge._)`${Et.default.errors}++`)}function ed(e,u){let{gen:t,validateName:i,schemaEnv:n}=e;n.$async?t.throw((0,ge._)`new ${e.ValidationError}(${u})`):(t.assign((0,ge._)`${i}.errors`,u),t.return(!1))}var Si={keyword:new ge.Name("keyword"),schemaPath:new ge.Name("schemaPath"),params:new ge.Name("params"),propertyName:new ge.Name("propertyName"),message:new ge.Name("message"),schema:new ge.Name("schema"),parentSchema:new ge.Name("parentSchema")};function td(e,u,t){let{createErrors:i}=e.it;return i===!1?(0,ge._)`{}`:kb(e,u,t)}function kb(e,u,t={}){let{gen:i,it:n}=e,f=[$b(n,t),Tb(e,t)];return Pb(e,u,f),i.object(...f)}function $b({errorPath:e},{instancePath:u}){let t=u?(0,ge.str)`${e}${(0,ro.getErrorPath)(u,ro.Type.Str)}`:e;return[Et.default.instancePath,(0,ge.strConcat)(Et.default.instancePath,t)]}function Tb({keyword:e,it:{errSchemaPath:u}},{schemaPath:t,parentSchema:i}){let n=i?u:(0,ge.str)`${u}/${e}`;return t&&(n=(0,ge.str)`${n}${(0,ro.getErrorPath)(t,ro.Type.Str)}`),[Si.schemaPath,n]}function Pb(e,{params:u,message:t},i){let{keyword:n,data:f,schemaValue:r,it:o}=e,{opts:a,propertyName:s,topSchemaRef:D,schemaPath:d}=o;i.push([Si.keyword,n],[Si.params,typeof u=="function"?u(e):u||(0,ge._)`{}`]),a.messages&&i.push([Si.message,typeof t=="function"?t(e):t]),a.verbose&&i.push([Si.schema,r],[Si.parentSchema,(0,ge._)`${D}${d}`],[Et.default.data,f]),s&&i.push([Si.propertyName,s])}});var id=F(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.boolOrEmptySchema=fn.topBoolOrEmptySchema=void 0;var Ob=df(),Mb=ee(),jb=Ut(),Nb={message:"boolean schema is false"};function qb(e){let{gen:u,schema:t,validateName:i}=e;t===!1?ud(e,!1):typeof t=="object"&&t.$async===!0?u.return(jb.default.data):(u.assign((0,Mb._)`${i}.errors`,null),u.return(!0))}fn.topBoolOrEmptySchema=qb;function Vb(e,u){let{gen:t,schema:i}=e;i===!1?(t.var(u,!1),ud(e)):t.var(u,!0)}fn.boolOrEmptySchema=Vb;function ud(e,u){let{gen:t,data:i}=e,n={gen:t,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Ob.reportError)(n,Nb,void 0,u)}});var $s=F(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.getRules=rn.isJSONType=void 0;var Rb=["string","number","integer","boolean","null","object","array"],Lb=new Set(Rb);function zb(e){return typeof e=="string"&&Lb.has(e)}rn.isJSONType=zb;function Hb(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:Se(X({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rn.getRules=Hb});var Ts=F(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.shouldUseRule=ti.shouldUseGroup=ti.schemaHasRulesForType=void 0;function Ub({schema:e,self:u},t){let i=u.RULES.types[t];return i&&i!==!0&&nd(e,i)}ti.schemaHasRulesForType=Ub;function nd(e,u){return u.rules.some(t=>fd(e,t))}ti.shouldUseGroup=nd;function fd(e,u){var t;return e[u.keyword]!==void 0||((t=u.definition.implements)===null||t===void 0?void 0:t.some(i=>e[i]!==void 0))}ti.shouldUseRule=fd});var cf=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.reportTypeError=ct.checkDataTypes=ct.checkDataType=ct.coerceAndCheckDataType=ct.getJSONTypes=ct.getSchemaTypes=ct.DataType=void 0;var Wb=$s(),Gb=Ts(),Kb=df(),re=ee(),rd=le(),on=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(on||(ct.DataType=on={}));function Jb(e){let u=od(e.type);if(u.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!u.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&u.push("null")}return u}ct.getSchemaTypes=Jb;function od(e){let u=Array.isArray(e)?e:e?[e]:[];if(u.every(Wb.isJSONType))return u;throw new Error("type must be JSONType or JSONType[]: "+u.join(","))}ct.getJSONTypes=od;function Xb(e,u){let{gen:t,data:i,opts:n}=e,f=Yb(u,n.coerceTypes),r=u.length>0&&!(f.length===0&&u.length===1&&(0,Gb.schemaHasRulesForType)(e,u[0]));if(r){let o=Os(u,i,n.strictNumbers,on.Wrong);t.if(o,()=>{f.length?Zb(e,u,f):Ms(e)})}return r}ct.coerceAndCheckDataType=Xb;var ad=new Set(["string","number","integer","boolean","null"]);function Yb(e,u){return u?e.filter(t=>ad.has(t)||u==="array"&&t==="array"):[]}function Zb(e,u,t){let{gen:i,data:n,opts:f}=e,r=i.let("dataType",(0,re._)`typeof ${n}`),o=i.let("coerced",(0,re._)`undefined`);f.coerceTypes==="array"&&i.if((0,re._)`${r} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,re._)`${n}[0]`).assign(r,(0,re._)`typeof ${n}`).if(Os(u,n,f.strictNumbers),()=>i.assign(o,n))),i.if((0,re._)`${o} !== undefined`);for(let s of t)(ad.has(s)||s==="array"&&f.coerceTypes==="array")&&a(s);i.else(),Ms(e),i.endIf(),i.if((0,re._)`${o} !== undefined`,()=>{i.assign(n,o),Qb(e,o)});function a(s){switch(s){case"string":i.elseIf((0,re._)`${r} == "number" || ${r} == "boolean"`).assign(o,(0,re._)`"" + ${n}`).elseIf((0,re._)`${n} === null`).assign(o,(0,re._)`""`);return;case"number":i.elseIf((0,re._)`${r} == "boolean" || ${n} === null
|| (${r} == "string" && ${n} && ${n} == +${n})`).assign(o,(0,re._)`+${n}`);return;case"integer":i.elseIf((0,re._)`${r} === "boolean" || ${n} === null
|| (${r} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(o,(0,re._)`+${n}`);return;case"boolean":i.elseIf((0,re._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(o,!1).elseIf((0,re._)`${n} === "true" || ${n} === 1`).assign(o,!0);return;case"null":i.elseIf((0,re._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(o,null);return;case"array":i.elseIf((0,re._)`${r} === "string" || ${r} === "number"
|| ${r} === "boolean" || ${n} === null`).assign(o,(0,re._)`[${n}]`)}}}function Qb({gen:e,parentData:u,parentDataProperty:t},i){e.if((0,re._)`${u} !== undefined`,()=>e.assign((0,re._)`${u}[${t}]`,i))}function Ps(e,u,t,i=on.Correct){let n=i===on.Correct?re.operators.EQ:re.operators.NEQ,f;switch(e){case"null":return(0,re._)`${u} ${n} null`;case"array":f=(0,re._)`Array.isArray(${u})`;break;case"object":f=(0,re._)`${u} && typeof ${u} == "object" && !Array.isArray(${u})`;break;case"integer":f=r((0,re._)`!(${u} % 1) && !isNaN(${u})`);break;case"number":f=r();break;default:return(0,re._)`typeof ${u} ${n} ${e}`}return i===on.Correct?f:(0,re.not)(f);function r(o=re.nil){return(0,re.and)((0,re._)`typeof ${u} == "number"`,o,t?(0,re._)`isFinite(${u})`:re.nil)}}ct.checkDataType=Ps;function Os(e,u,t,i){if(e.length===1)return Ps(e[0],u,t,i);let n,f=(0,rd.toHash)(e);if(f.array&&f.object){let r=(0,re._)`typeof ${u} != "object"`;n=f.null?r:(0,re._)`!${u} || ${r}`,delete f.null,delete f.array,delete f.object}else n=re.nil;f.number&&delete f.integer;for(let r in f)n=(0,re.and)(n,Ps(r,u,t,i));return n}ct.checkDataTypes=Os;var eE={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:u})=>typeof e=="string"?(0,re._)`{type: ${e}}`:(0,re._)`{type: ${u}}`};function Ms(e){let u=tE(e);(0,Kb.reportError)(u,eE)}ct.reportTypeError=Ms;function tE(e){let{gen:u,data:t,schema:i}=e,n=(0,rd.schemaRefOrVal)(e,i,"type");return{gen:u,keyword:"type",data:t,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}});var Dd=F(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.assignDefaults=void 0;var an=ee(),uE=le();function iE(e,u){let{properties:t,items:i}=e.schema;if(u==="object"&&t)for(let n in t)sd(e,n,t[n].default);else u==="array"&&Array.isArray(i)&&i.forEach((n,f)=>sd(e,f,n.default))}oo.assignDefaults=iE;function sd(e,u,t){let{gen:i,compositeRule:n,data:f,opts:r}=e;if(t===void 0)return;let o=(0,an._)`${f}${(0,an.getProperty)(u)}`;if(n){(0,uE.checkStrictMode)(e,`default is ignored for: ${o}`);return}let a=(0,an._)`${o} === undefined`;r.useDefaults==="empty"&&(a=(0,an._)`${a} || ${o} === null || ${o} === ""`),i.if(a,(0,an._)`${o} = ${(0,an.stringify)(t)}`)}});var Wt=F(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.validateUnion=xe.validateArray=xe.usePattern=xe.callValidateCode=xe.schemaProperties=xe.allSchemaProperties=xe.noPropertyInData=xe.propertyInData=xe.isOwnProperty=xe.hasPropFunc=xe.reportMissingProp=xe.checkMissingProp=xe.checkReportMissingProp=void 0;var Ne=ee(),js=le(),ui=Ut(),nE=le();function fE(e,u){let{gen:t,data:i,it:n}=e;t.if(qs(t,i,u,n.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Ne._)`${u}`},!0),e.error()})}xe.checkReportMissingProp=fE;function rE({gen:e,data:u,it:{opts:t}},i,n){return(0,Ne.or)(...i.map(f=>(0,Ne.and)(qs(e,u,f,t.ownProperties),(0,Ne._)`${n} = ${f}`)))}xe.checkMissingProp=rE;function oE(e,u){e.setParams({missingProperty:u},!0),e.error()}xe.reportMissingProp=oE;function ld(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ne._)`Object.prototype.hasOwnProperty`})}xe.hasPropFunc=ld;function Ns(e,u,t){return(0,Ne._)`${ld(e)}.call(${u}, ${t})`}xe.isOwnProperty=Ns;function aE(e,u,t,i){let n=(0,Ne._)`${u}${(0,Ne.getProperty)(t)} !== undefined`;return i?(0,Ne._)`${n} && ${Ns(e,u,t)}`:n}xe.propertyInData=aE;function qs(e,u,t,i){let n=(0,Ne._)`${u}${(0,Ne.getProperty)(t)} === undefined`;return i?(0,Ne.or)(n,(0,Ne.not)(Ns(e,u,t))):n}xe.noPropertyInData=qs;function dd(e){return e?Object.keys(e).filter(u=>u!=="__proto__"):[]}xe.allSchemaProperties=dd;function sE(e,u){return dd(u).filter(t=>!(0,js.alwaysValidSchema)(e,u[t]))}xe.schemaProperties=sE;function DE({schemaCode:e,data:u,it:{gen:t,topSchemaRef:i,schemaPath:n,errorPath:f},it:r},o,a,s){let D=s?(0,Ne._)`${e}, ${u}, ${i}${n}`:u,d=[[ui.default.instancePath,(0,Ne.strConcat)(ui.default.instancePath,f)],[ui.default.parentData,r.parentData],[ui.default.parentDataProperty,r.parentDataProperty],[ui.default.rootData,ui.default.rootData]];r.opts.dynamicRef&&d.push([ui.default.dynamicAnchors,ui.default.dynamicAnchors]);let m=(0,Ne._)`${D}, ${t.object(...d)}`;return a!==Ne.nil?(0,Ne._)`${o}.call(${a}, ${m})`:(0,Ne._)`${o}(${m})`}xe.callValidateCode=DE;var lE=(0,Ne._)`new RegExp`;function dE({gen:e,it:{opts:u}},t){let i=u.unicodeRegExp?"u":"",{regExp:n}=u.code,f=n(t,i);return e.scopeValue("pattern",{key:f.toString(),ref:f,code:(0,Ne._)`${n.code==="new RegExp"?lE:(0,nE.useFunc)(e,n)}(${t}, ${i})`})}xe.usePattern=dE;function cE(e){let{gen:u,data:t,keyword:i,it:n}=e,f=u.name("valid");if(n.allErrors){let o=u.let("valid",!0);return r(()=>u.assign(o,!1)),o}return u.var(f,!0),r(()=>u.break()),f;function r(o){let a=u.const("len",(0,Ne._)`${t}.length`);u.forRange("i",0,a,s=>{e.subschema({keyword:i,dataProp:s,dataPropType:js.Type.Num},f),u.if((0,Ne.not)(f),o)})}}xe.validateArray=cE;function pE(e){let{gen:u,schema:t,keyword:i,it:n}=e;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(a=>(0,js.alwaysValidSchema)(n,a))&&!n.opts.unevaluated)return;let r=u.let("valid",!1),o=u.name("_valid");u.block(()=>t.forEach((a,s)=>{let D=e.subschema({keyword:i,schemaProp:s,compositeRule:!0},o);u.assign(r,(0,Ne._)`${r} || ${o}`),e.mergeValidEvaluated(D,o)||u.if((0,Ne.not)(r))})),e.result(r,()=>e.reset(),()=>e.error(!0))}xe.validateUnion=pE});var md=F(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.validateKeywordUsage=pu.validSchemaType=pu.funcKeywordCode=pu.macroKeywordCode=void 0;var _t=ee(),Ii=Ut(),mE=Wt(),FE=df();function CE(e,u){let{gen:t,keyword:i,schema:n,parentSchema:f,it:r}=e,o=u.macro.call(r.self,n,f,r),a=pd(t,i,o);r.opts.validateSchema!==!1&&r.self.validateSchema(o,!0);let s=t.name("valid");e.subschema({schema:o,schemaPath:_t.nil,errSchemaPath:`${r.errSchemaPath}/${i}`,topSchemaRef:a,compositeRule:!0},s),e.pass(s,()=>e.error(!0))}pu.macroKeywordCode=CE;function hE(e,u){var t;let{gen:i,keyword:n,schema:f,parentSchema:r,$data:o,it:a}=e;bE(a,u);let s=!o&&u.compile?u.compile.call(a.self,f,r,a):u.validate,D=pd(i,n,s),d=i.let("valid");e.block$data(d,m),e.ok((t=u.valid)!==null&&t!==void 0?t:d);function m(){if(u.errors===!1)_(),u.modifying&&cd(e),v(()=>e.error());else{let k=u.async?g():h();u.modifying&&cd(e),v(()=>gE(e,k))}}function g(){let k=i.let("ruleErrs",null);return i.try(()=>_((0,_t._)`await `),$=>i.assign(d,!1).if((0,_t._)`${$} instanceof ${a.ValidationError}`,()=>i.assign(k,(0,_t._)`${$}.errors`),()=>i.throw($))),k}function h(){let k=(0,_t._)`${D}.errors`;return i.assign(k,null),_(_t.nil),k}function _(k=u.async?(0,_t._)`await `:_t.nil){let $=a.opts.passContext?Ii.default.this:Ii.default.self,R=!("compile"in u&&!o||u.schema===!1);i.assign(d,(0,_t._)`${k}${(0,mE.callValidateCode)(e,D,$,R)}`,u.modifying)}function v(k){var $;i.if((0,_t.not)(($=u.valid)!==null&&$!==void 0?$:d),k)}}pu.funcKeywordCode=hE;function cd(e){let{gen:u,data:t,it:i}=e;u.if(i.parentData,()=>u.assign(t,(0,_t._)`${i.parentData}[${i.parentDataProperty}]`))}function gE(e,u){let{gen:t}=e;t.if((0,_t._)`Array.isArray(${u})`,()=>{t.assign(Ii.default.vErrors,(0,_t._)`${Ii.default.vErrors} === null ? ${u} : ${Ii.default.vErrors}.concat(${u})`).assign(Ii.default.errors,(0,_t._)`${Ii.default.vErrors}.length`),(0,FE.extendErrors)(e)},()=>e.error())}function bE({schemaEnv:e},u){if(u.async&&!e.$async)throw new Error("async keyword in sync schema")}function pd(e,u,t){if(t===void 0)throw new Error(`keyword "${u}" failed to compile`);return e.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,_t.stringify)(t)})}function EE(e,u,t=!1){return!u.length||u.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||t&&typeof e>"u")}pu.validSchemaType=EE;function _E({schema:e,opts:u,self:t,errSchemaPath:i},n,f){if(Array.isArray(n.keyword)?!n.keyword.includes(f):n.keyword!==f)throw new Error("ajv implementation error");let r=n.dependencies;if(r?.some(o=>!Object.prototype.hasOwnProperty.call(e,o)))throw new Error(`parent schema must have dependencies of ${f}: ${r.join(",")}`);if(n.validateSchema&&!n.validateSchema(e[f])){let a=`keyword "${f}" value is invalid at path "${i}": `+t.errorsText(n.validateSchema.errors);if(u.validateSchema==="log")t.logger.error(a);else throw new Error(a)}}pu.validateKeywordUsage=_E});var Cd=F(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.extendSubschemaMode=ii.extendSubschemaData=ii.getSubschema=void 0;var mu=ee(),Fd=le();function yE(e,{keyword:u,schemaProp:t,schema:i,schemaPath:n,errSchemaPath:f,topSchemaRef:r}){if(u!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(u!==void 0){let o=e.schema[u];return t===void 0?{schema:o,schemaPath:(0,mu._)`${e.schemaPath}${(0,mu.getProperty)(u)}`,errSchemaPath:`${e.errSchemaPath}/${u}`}:{schema:o[t],schemaPath:(0,mu._)`${e.schemaPath}${(0,mu.getProperty)(u)}${(0,mu.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${u}/${(0,Fd.escapeFragment)(t)}`}}if(i!==void 0){if(n===void 0||f===void 0||r===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:r,errSchemaPath:f}}throw new Error('either "keyword" or "schema" must be passed')}ii.getSubschema=yE;function vE(e,u,{dataProp:t,dataPropType:i,data:n,dataTypes:f,propertyName:r}){if(n!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=u;if(t!==void 0){let{errorPath:s,dataPathArr:D,opts:d}=u,m=o.let("data",(0,mu._)`${u.data}${(0,mu.getProperty)(t)}`,!0);a(m),e.errorPath=(0,mu.str)`${s}${(0,Fd.getErrorPath)(t,i,d.jsPropertySyntax)}`,e.parentDataProperty=(0,mu._)`${t}`,e.dataPathArr=[...D,e.parentDataProperty]}if(n!==void 0){let s=n instanceof mu.Name?n:o.let("data",n,!0);a(s),r!==void 0&&(e.propertyName=r)}f&&(e.dataTypes=f);function a(s){e.data=s,e.dataLevel=u.dataLevel+1,e.dataTypes=[],u.definedProperties=new Set,e.parentData=u.data,e.dataNames=[...u.dataNames,s]}}ii.extendSubschemaData=vE;function BE(e,{jtdDiscriminator:u,jtdMetadata:t,compositeRule:i,createErrors:n,allErrors:f}){i!==void 0&&(e.compositeRule=i),n!==void 0&&(e.createErrors=n),f!==void 0&&(e.allErrors=f),e.jtdDiscriminator=u,e.jtdMetadata=t}ii.extendSubschemaMode=BE});var ao=F((DK,hd)=>{"use strict";hd.exports=function e(u,t){if(u===t)return!0;if(u&&t&&typeof u=="object"&&typeof t=="object"){if(u.constructor!==t.constructor)return!1;var i,n,f;if(Array.isArray(u)){if(i=u.length,i!=t.length)return!1;for(n=i;n--!==0;)if(!e(u[n],t[n]))return!1;return!0}if(u.constructor===RegExp)return u.source===t.source&&u.flags===t.flags;if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===t.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===t.toString();if(f=Object.keys(u),i=f.length,i!==Object.keys(t).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,f[n]))return!1;for(n=i;n--!==0;){var r=f[n];if(!e(u[r],t[r]))return!1}return!0}return u!==u&&t!==t}});var bd=F((lK,gd)=>{"use strict";var ni=gd.exports=function(e,u,t){typeof u=="function"&&(t=u,u={}),t=u.cb||t;var i=typeof t=="function"?t:t.pre||function(){},n=t.post||function(){};so(u,i,n,e,"",e)};ni.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ni.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ni.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ni.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 so(e,u,t,i,n,f,r,o,a,s){if(i&&typeof i=="object"&&!Array.isArray(i)){u(i,n,f,r,o,a,s);for(var D in i){var d=i[D];if(Array.isArray(d)){if(D in ni.arrayKeywords)for(var m=0;m<d.length;m++)so(e,u,t,d[m],n+"/"+D+"/"+m,f,n,D,i,m)}else if(D in ni.propsKeywords){if(d&&typeof d=="object")for(var g in d)so(e,u,t,d[g],n+"/"+D+"/"+xE(g),f,n,D,i,g)}else(D in ni.keywords||e.allKeys&&!(D in ni.skipKeywords))&&so(e,u,t,d,n+"/"+D,f,n,D,i)}t(i,n,f,r,o,a,s)}}function xE(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var pf=F(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.getSchemaRefs=wt.resolveUrl=wt.normalizeId=wt._getFullPath=wt.getFullPath=wt.inlineRef=void 0;var wE=le(),SE=ao(),IE=bd(),AE=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function kE(e,u=!0){return typeof e=="boolean"?!0:u===!0?!Vs(e):u?Ed(e)<=u:!1}wt.inlineRef=kE;var $E=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Vs(e){for(let u in e){if($E.has(u))return!0;let t=e[u];if(Array.isArray(t)&&t.some(Vs)||typeof t=="object"&&Vs(t))return!0}return!1}function Ed(e){let u=0;for(let t in e){if(t==="$ref")return 1/0;if(u++,!AE.has(t)&&(typeof e[t]=="object"&&(0,wE.eachItem)(e[t],i=>u+=Ed(i)),u===1/0))return 1/0}return u}function _d(e,u="",t){t!==!1&&(u=sn(u));let i=e.parse(u);return yd(e,i)}wt.getFullPath=_d;function yd(e,u){return e.serialize(u).split("#")[0]+"#"}wt._getFullPath=yd;var TE=/#\/?$/;function sn(e){return e?e.replace(TE,""):""}wt.normalizeId=sn;function PE(e,u,t){return t=sn(t),e.resolve(u,t)}wt.resolveUrl=PE;var OE=/^[a-z_][-a-z0-9._]*$/i;function ME(e,u){if(typeof e=="boolean")return{};let{schemaId:t,uriResolver:i}=this.opts,n=sn(e[t]||u),f={"":n},r=_d(i,n,!1),o={},a=new Set;return IE(e,{allKeys:!0},(d,m,g,h)=>{if(h===void 0)return;let _=r+m,v=f[h];typeof d[t]=="string"&&(v=k.call(this,d[t])),$.call(this,d.$anchor),$.call(this,d.$dynamicAnchor),f[m]=v;function k(R){let z=this.opts.uriResolver.resolve;if(R=sn(v?z(v,R):R),a.has(R))throw D(R);a.add(R);let M=this.refs[R];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?s(d,M.schema,R):R!==sn(_)&&(R[0]==="#"?(s(d,o[R],R),o[R]=d):this.refs[R]=_),R}function $(R){if(typeof R=="string"){if(!OE.test(R))throw new Error(`invalid anchor "${R}"`);k.call(this,`#${R}`)}}}),o;function s(d,m,g){if(m!==void 0&&!SE(d,m))throw D(g)}function D(d){return new Error(`reference "${d}" resolves to more than one schema`)}}wt.getSchemaRefs=ME});var Cf=F(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.getData=fi.KeywordCxt=fi.validateFunctionCode=void 0;var Sd=id(),vd=cf(),Ls=Ts(),Do=cf(),jE=Dd(),Ff=md(),Rs=Cd(),J=ee(),ie=Ut(),NE=pf(),Iu=le(),mf=df();function qE(e){if(kd(e)&&($d(e),Ad(e))){LE(e);return}Id(e,()=>(0,Sd.topBoolOrEmptySchema)(e))}fi.validateFunctionCode=qE;function Id({gen:e,validateName:u,schema:t,schemaEnv:i,opts:n},f){n.code.es5?e.func(u,(0,J._)`${ie.default.data}, ${ie.default.valCxt}`,i.$async,()=>{e.code((0,J._)`"use strict"; ${Bd(t,n)}`),RE(e,n),e.code(f)}):e.func(u,(0,J._)`${ie.default.data}, ${VE(n)}`,i.$async,()=>e.code(Bd(t,n)).code(f))}function VE(e){return(0,J._)`{${ie.default.instancePath}="", ${ie.default.parentData}, ${ie.default.parentDataProperty}, ${ie.default.rootData}=${ie.default.data}${e.dynamicRef?(0,J._)`, ${ie.default.dynamicAnchors}={}`:J.nil}}={}`}function RE(e,u){e.if(ie.default.valCxt,()=>{e.var(ie.default.instancePath,(0,J._)`${ie.default.valCxt}.${ie.default.instancePath}`),e.var(ie.default.parentData,(0,J._)`${ie.default.valCxt}.${ie.default.parentData}`),e.var(ie.default.parentDataProperty,(0,J._)`${ie.default.valCxt}.${ie.default.parentDataProperty}`),e.var(ie.default.rootData,(0,J._)`${ie.default.valCxt}.${ie.default.rootData}`),u.dynamicRef&&e.var(ie.default.dynamicAnchors,(0,J._)`${ie.default.valCxt}.${ie.default.dynamicAnchors}`)},()=>{e.var(ie.default.instancePath,(0,J._)`""`),e.var(ie.default.parentData,(0,J._)`undefined`),e.var(ie.default.parentDataProperty,(0,J._)`undefined`),e.var(ie.default.rootData,ie.default.data),u.dynamicRef&&e.var(ie.default.dynamicAnchors,(0,J._)`{}`)})}function LE(e){let{schema:u,opts:t,gen:i}=e;Id(e,()=>{t.$comment&&u.$comment&&Pd(e),GE(e),i.let(ie.default.vErrors,null),i.let(ie.default.errors,0),t.unevaluated&&zE(e),Td(e),XE(e)})}function zE(e){let{gen:u,validateName:t}=e;e.evaluated=u.const("evaluated",(0,J._)`${t}.evaluated`),u.if((0,J._)`${e.evaluated}.dynamicProps`,()=>u.assign((0,J._)`${e.evaluated}.props`,(0,J._)`undefined`)),u.if((0,J._)`${e.evaluated}.dynamicItems`,()=>u.assign((0,J._)`${e.evaluated}.items`,(0,J._)`undefined`))}function Bd(e,u){let t=typeof e=="object"&&e[u.schemaId];return t&&(u.code.source||u.code.process)?(0,J._)`/*# sourceURL=${t} */`:J.nil}function HE(e,u){if(kd(e)&&($d(e),Ad(e))){UE(e,u);return}(0,Sd.boolOrEmptySchema)(e,u)}function Ad({schema:e,self:u}){if(typeof e=="boolean")return!e;for(let t in e)if(u.RULES.all[t])return!0;return!1}function kd(e){return typeof e.schema!="boolean"}function UE(e,u){let{schema:t,gen:i,opts:n}=e;n.$comment&&t.$comment&&Pd(e),KE(e),JE(e);let f=i.const("_errs",ie.default.errors);Td(e,f),i.var(u,(0,J._)`${f} === ${ie.default.errors}`)}function $d(e){(0,Iu.checkUnknownRules)(e),WE(e)}function Td(e,u){if(e.opts.jtd)return xd(e,[],!1,u);let t=(0,vd.getSchemaTypes)(e.schema),i=(0,vd.coerceAndCheckDataType)(e,t);xd(e,t,!i,u)}function WE(e){let{schema:u,errSchemaPath:t,opts:i,self:n}=e;u.$ref&&i.ignoreKeywordsWithRef&&(0,Iu.schemaHasRulesButRef)(u,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function GE(e){let{schema:u,opts:t}=e;u.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Iu.checkStrictMode)(e,"default is ignored in the schema root")}function KE(e){let u=e.schema[e.opts.schemaId];u&&(e.baseId=(0,NE.resolveUrl)(e.opts.uriResolver,e.baseId,u))}function JE(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Pd({gen:e,schemaEnv:u,schema:t,errSchemaPath:i,opts:n}){let f=t.$comment;if(n.$comment===!0)e.code((0,J._)`${ie.default.self}.logger.log(${f})`);else if(typeof n.$comment=="function"){let r=(0,J.str)`${i}/$comment`,o=e.scopeValue("root",{ref:u.root});e.code((0,J._)`${ie.default.self}.opts.$comment(${f}, ${r}, ${o}.schema)`)}}function XE(e){let{gen:u,schemaEnv:t,validateName:i,ValidationError:n,opts:f}=e;t.$async?u.if((0,J._)`${ie.default.errors} === 0`,()=>u.return(ie.default.data),()=>u.throw((0,J._)`new ${n}(${ie.default.vErrors})`)):(u.assign((0,J._)`${i}.errors`,ie.default.vErrors),f.unevaluated&&YE(e),u.return((0,J._)`${ie.default.errors} === 0`))}function YE({gen:e,evaluated:u,props:t,items:i}){t instanceof J.Name&&e.assign((0,J._)`${u}.props`,t),i instanceof J.Name&&e.assign((0,J._)`${u}.items`,i)}function xd(e,u,t,i){let{gen:n,schema:f,data:r,allErrors:o,opts:a,self:s}=e,{RULES:D}=s;if(f.$ref&&(a.ignoreKeywordsWithRef||!(0,Iu.schemaHasRulesButRef)(f,D))){n.block(()=>Md(e,"$ref",D.all.$ref.definition));return}a.jtd||ZE(e,u),n.block(()=>{for(let m of D.rules)d(m);d(D.post)});function d(m){(0,Ls.shouldUseGroup)(f,m)&&(m.type?(n.if((0,Do.checkDataType)(m.type,r,a.strictNumbers)),wd(e,m),u.length===1&&u[0]===m.type&&t&&(n.else(),(0,Do.reportTypeError)(e)),n.endIf()):wd(e,m),o||n.if((0,J._)`${ie.default.errors} === ${i||0}`))}}function wd(e,u){let{gen:t,schema:i