@faulpeltz/dertunnel 0.7.14 → 0.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dertunnel-client.js +76 -76
- package/index.js +4 -4
- package/package.json +1 -1
package/dertunnel-client.js
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var wv=Object.create;var fl=Object.defineProperty;var $v=Object.getOwnPropertyDescriptor;var Ev=Object.getOwnPropertyNames;var Sv=Object.getPrototypeOf,Ov=Object.prototype.hasOwnProperty;var d=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var xv=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ev(e))!Ov.call(r,i)&&i!==t&&fl(r,i,{get:()=>e[i],enumerable:!(s=$v(e,i))||s.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?wv(Sv(r)):{},xv(e||!r||!r.__esModule?fl(t,"default",{value:r,enumerable:!0}):t,r));var Yr=d(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.regexpCode=D.getEsmExportName=D.getProperty=D.safeStringify=D.stringify=D.strConcat=D.addCodeArg=D.str=D._=D.nil=D._Code=D.Name=D.IDENTIFIER=D._CodeOrName=void 0;var Kr=class{};D._CodeOrName=Kr;D.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ut=class extends Kr{constructor(e){if(super(),!D.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};D.Name=Ut;var Pe=class extends Kr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,s)=>`${t}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,s)=>(s instanceof Ut&&(t[s.str]=(t[s.str]||0)+1),t),{})}};D._Code=Pe;D.nil=new Pe("");function Nl(r,...e){let t=[r[0]],s=0;for(;s<e.length;)Hn(t,e[s]),t.push(r[++s]);return new Pe(t)}D._=Nl;var Un=new Pe("+");function ql(r,...e){let t=[Wr(r[0])],s=0;for(;s<e.length;)t.push(Un),Hn(t,e[s]),t.push(Un,Wr(r[++s]));return Lv(t),new Pe(t)}D.str=ql;function Hn(r,e){e instanceof Pe?r.push(...e._items):e instanceof Ut?r.push(e):r.push(Uv(e))}D.addCodeArg=Hn;function Lv(r){let e=1;for(;e<r.length-1;){if(r[e]===Un){let t=Vv(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Vv(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof Ut||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof Ut))return`"${r}${e.slice(1)}`}function Fv(r,e){return e.emptyStr()?r:r.emptyStr()?e:ql`${r}${e}`}D.strConcat=Fv;function Uv(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:Wr(Array.isArray(r)?r.join(","):r)}function Hv(r){return new Pe(Wr(r))}D.stringify=Hv;function Wr(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}D.safeStringify=Wr;function Gv(r){return typeof r=="string"&&D.IDENTIFIER.test(r)?new Pe(`.${r}`):Nl`[${r}]`}D.getProperty=Gv;function zv(r){if(typeof r=="string"&&D.IDENTIFIER.test(r))return new Pe(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}D.getEsmExportName=zv;function Bv(r){return new Pe(r.toString())}D.regexpCode=Bv});var Bn=d(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ValueScope=we.ValueScopeName=we.Scope=we.varKinds=we.UsedValueState=void 0;var be=Yr(),Gn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},si;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(si||(we.UsedValueState=si={}));we.varKinds={const:new be.Name("const"),let:new be.Name("let"),var:new be.Name("var")};var ii=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof be.Name?e:this.name(e)}name(e){return new be.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,s;if(!((s=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};we.Scope=ii;var ni=class extends be.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:s}){this.value=e,this.scopePath=(0,be._)`.${new be.Name(t)}[${s}]`}};we.ValueScopeName=ni;var Kv=(0,be._)`\n`,zn=class extends ii{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Kv:be.nil}}get(){return this._scope}name(e){return new ni(e,this._newName(e))}value(e,t){var s;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:n}=i,o=(s=t.key)!==null&&s!==void 0?s:t.ref,a=this._values[n];if(a){let l=a.get(o);if(l)return l}else a=this._values[n]=new Map;a.set(o,i);let u=this._scope[n]||(this._scope[n]=[]),c=u.length;return u[c]=t.ref,i.setValue(t,{property:n,itemIndex:c}),i}getValue(e,t){let s=this._values[e];if(s)return s.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,be._)`${e}${s.scopePath}`})}scopeCode(e=this._values,t,s){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},t,s)}_reduceValues(e,t,s={},i){let n=be.nil;for(let o in e){let a=e[o];if(!a)continue;let u=s[o]=s[o]||new Map;a.forEach(c=>{if(u.has(c))return;u.set(c,si.Started);let l=t(c);if(l){let h=this.opts.es5?we.varKinds.var:we.varKinds.const;n=(0,be._)`${n}${h} ${c} = ${l};${this.opts._n}`}else if(l=i?.(c))n=(0,be._)`${n}${l}${this.opts._n}`;else throw new Gn(c);u.set(c,si.Completed)})}return n}};we.ValueScope=zn});var T=d(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.or=I.and=I.not=I.CodeGen=I.operators=I.varKinds=I.ValueScopeName=I.ValueScope=I.Scope=I.Name=I.regexpCode=I.stringify=I.getProperty=I.nil=I.strConcat=I.str=I._=void 0;var q=Yr(),Ve=Bn(),Ot=Yr();Object.defineProperty(I,"_",{enumerable:!0,get:function(){return Ot._}});Object.defineProperty(I,"str",{enumerable:!0,get:function(){return Ot.str}});Object.defineProperty(I,"strConcat",{enumerable:!0,get:function(){return Ot.strConcat}});Object.defineProperty(I,"nil",{enumerable:!0,get:function(){return Ot.nil}});Object.defineProperty(I,"getProperty",{enumerable:!0,get:function(){return Ot.getProperty}});Object.defineProperty(I,"stringify",{enumerable:!0,get:function(){return Ot.stringify}});Object.defineProperty(I,"regexpCode",{enumerable:!0,get:function(){return Ot.regexpCode}});Object.defineProperty(I,"Name",{enumerable:!0,get:function(){return Ot.Name}});var ci=Bn();Object.defineProperty(I,"Scope",{enumerable:!0,get:function(){return ci.Scope}});Object.defineProperty(I,"ValueScope",{enumerable:!0,get:function(){return ci.ValueScope}});Object.defineProperty(I,"ValueScopeName",{enumerable:!0,get:function(){return ci.ValueScopeName}});Object.defineProperty(I,"varKinds",{enumerable:!0,get:function(){return ci.varKinds}});I.operators={GT:new q._Code(">"),GTE:new q._Code(">="),LT:new q._Code("<"),LTE:new q._Code("<="),EQ:new q._Code("==="),NEQ:new q._Code("!=="),NOT:new q._Code("!"),OR:new q._Code("||"),AND:new q._Code("&&"),ADD:new q._Code("+")};var lt=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Kn=class extends lt{constructor(e,t,s){super(),this.varKind=e,this.name=t,this.rhs=s}render({es5:e,_n:t}){let s=e?Ve.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=or(this.rhs,e,t)),this}get names(){return this.rhs instanceof q._CodeOrName?this.rhs.names:{}}},oi=class extends lt{constructor(e,t,s){super(),this.lhs=e,this.rhs=t,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof q.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=or(this.rhs,e,t),this}get names(){let e=this.lhs instanceof q.Name?{}:{...this.lhs.names};return ui(e,this.rhs)}},Wn=class extends oi{constructor(e,t,s,i){super(e,s,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Yn=class extends lt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Xn=class extends lt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Jn=class extends lt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Zn=class extends lt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=or(this.code,e,t),this}get names(){return this.code instanceof q._CodeOrName?this.code.names:{}}},Xr=class extends lt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,s)=>t+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let s=e[t].optimizeNodes();Array.isArray(s)?e.splice(t,1,...s):s?e[t]=s:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:s}=this,i=s.length;for(;i--;){let n=s[i];n.optimizeNames(e,t)||(Wv(e,n.names),s.splice(i,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>zt(e,t.names),{})}},ht=class extends Xr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qn=class extends Xr{},nr=class extends ht{};nr.kind="else";var Ht=class r extends ht{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let s=t.optimizeNodes();t=this.else=Array.isArray(s)?new nr(s):s}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(jl(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=or(this.condition,e,t),this}get names(){let e=super.names;return ui(e,this.condition),this.else&&zt(e,this.else.names),e}};Ht.kind="if";var Gt=class extends ht{};Gt.kind="for";var eo=class extends Gt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=or(this.iteration,e,t),this}get names(){return zt(super.names,this.iteration.names)}},to=class extends Gt{constructor(e,t,s,i){super(),this.varKind=e,this.name=t,this.from=s,this.to=i}render(e){let t=e.es5?Ve.varKinds.var:this.varKind,{name:s,from:i,to:n}=this;return`for(${t} ${s}=${i}; ${s}<${n}; ${s}++)`+super.render(e)}get names(){let e=ui(super.names,this.from);return ui(e,this.to)}},ai=class extends Gt{constructor(e,t,s,i){super(),this.loop=e,this.varKind=t,this.name=s,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=or(this.iterable,e,t),this}get names(){return zt(super.names,this.iterable.names)}},Jr=class extends ht{constructor(e,t,s){super(),this.name=e,this.args=t,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Jr.kind="func";var Zr=class extends Xr{render(e){return"return "+super.render(e)}};Zr.kind="return";var ro=class extends ht{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var s,i;return super.optimizeNames(e,t),(s=this.catch)===null||s===void 0||s.optimizeNames(e,t),(i=this.finally)===null||i===void 0||i.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&zt(e,this.catch.names),this.finally&&zt(e,this.finally.names),e}},Qr=class extends ht{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Qr.kind="catch";var es=class extends ht{render(e){return"finally"+super.render(e)}};es.kind="finally";var so=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
3
|
-
`:""},this._extScope=e,this._scope=new Ve.Scope({parent:e}),this._nodes=[new Qn]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let s=this._extScope.value(e,t);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,s,i){let n=this._scope.toName(t);return s!==void 0&&i&&(this._constants[n.str]=s),this._leafNode(new Kn(e,n,s)),n}const(e,t,s){return this._def(Ve.varKinds.const,e,t,s)}let(e,t,s){return this._def(Ve.varKinds.let,e,t,s)}var(e,t,s){return this._def(Ve.varKinds.var,e,t,s)}assign(e,t,s){return this._leafNode(new oi(e,t,s))}add(e,t){return this._leafNode(new Wn(e,I.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==q.nil&&this._leafNode(new Zn(e)),this}object(...e){let t=["{"];for(let[s,i]of e)t.length>1&&t.push(","),t.push(s),(s!==i||this.opts.es5)&&(t.push(":"),(0,q.addCodeArg)(t,i));return t.push("}"),new q._Code(t)}if(e,t,s){if(this._blockNode(new Ht(e)),t&&s)this.code(t).else().code(s).endIf();else if(t)this.code(t).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ht(e))}else(){return this._elseNode(new nr)}endIf(){return this._endBlockNode(Ht,nr)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new eo(e),t)}forRange(e,t,s,i,n=this.opts.es5?Ve.varKinds.var:Ve.varKinds.let){let o=this._scope.toName(e);return this._for(new to(n,o,t,s),()=>i(o))}forOf(e,t,s,i=Ve.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let o=t instanceof q.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,q._)`${o}.length`,a=>{this.var(n,(0,q._)`${o}[${a}]`),s(n)})}return this._for(new ai("of",i,n,t),()=>s(n))}forIn(e,t,s,i=this.opts.es5?Ve.varKinds.var:Ve.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,q._)`Object.keys(${t})`,s);let n=this._scope.toName(e);return this._for(new ai("in",i,n,t),()=>s(n))}endFor(){return this._endBlockNode(Gt)}label(e){return this._leafNode(new Yn(e))}break(e){return this._leafNode(new Xn(e))}return(e){let t=new Zr;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Zr)}try(e,t,s){if(!t&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new ro;if(this._blockNode(i),this.code(e),t){let n=this.name("e");this._currNode=i.catch=new Qr(n),t(n)}return s&&(this._currNode=i.finally=new es,this.code(s)),this._endBlockNode(Qr,es)}throw(e){return this._leafNode(new Jn(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-t;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=q.nil,s,i){return this._blockNode(new Jr(e,t,s)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Jr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let s=this._currNode;if(s instanceof e||t&&s instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Ht))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};I.CodeGen=so;function zt(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function ui(r,e){return e instanceof q._CodeOrName?zt(r,e.names):r}function or(r,e,t){if(r instanceof q.Name)return s(r);if(!i(r))return r;return new q._Code(r._items.reduce((n,o)=>(o instanceof q.Name&&(o=s(o)),o instanceof q._Code?n.push(...o._items):n.push(o),n),[]));function s(n){let o=t[n.str];return o===void 0||e[n.str]!==1?n:(delete e[n.str],o)}function i(n){return n instanceof q._Code&&n._items.some(o=>o instanceof q.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function Wv(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function jl(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,q._)`!${io(r)}`}I.not=jl;var Yv=kl(I.operators.AND);function Xv(...r){return r.reduce(Yv)}I.and=Xv;var Jv=kl(I.operators.OR);function Zv(...r){return r.reduce(Jv)}I.or=Zv;function kl(r){return(e,t)=>e===q.nil?t:t===q.nil?e:(0,q._)`${io(e)} ${r} ${io(t)}`}function io(r){return r instanceof q.Name?r:(0,q._)`(${r})`}});var R=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.checkStrictMode=C.getErrorPath=C.Type=C.useFunc=C.setEvaluated=C.evaluatedPropsToName=C.mergeEvaluated=C.eachItem=C.unescapeJsonPointer=C.escapeJsonPointer=C.escapeFragment=C.unescapeFragment=C.schemaRefOrVal=C.schemaHasRulesButRef=C.schemaHasRules=C.checkUnknownRules=C.alwaysValidSchema=C.toHash=void 0;var F=T(),Qv=Yr();function eb(r){let e={};for(let t of r)e[t]=!0;return e}C.toHash=eb;function tb(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Ll(r,e),!Vl(e,r.self.RULES.all))}C.alwaysValidSchema=tb;function Ll(r,e=r.schema){let{opts:t,self:s}=r;if(!t.strictSchema||typeof e=="boolean")return;let i=s.RULES.keywords;for(let n in e)i[n]||Hl(r,`unknown keyword: "${n}"`)}C.checkUnknownRules=Ll;function Vl(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}C.schemaHasRules=Vl;function rb(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}C.schemaHasRulesButRef=rb;function sb({topSchemaRef:r,schemaPath:e},t,s,i){if(!i){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,F._)`${t}`}return(0,F._)`${r}${e}${(0,F.getProperty)(s)}`}C.schemaRefOrVal=sb;function ib(r){return Fl(decodeURIComponent(r))}C.unescapeFragment=ib;function nb(r){return encodeURIComponent(oo(r))}C.escapeFragment=nb;function oo(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}C.escapeJsonPointer=oo;function Fl(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}C.unescapeJsonPointer=Fl;function ob(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}C.eachItem=ob;function Dl({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:s}){return(i,n,o,a)=>{let u=o===void 0?n:o instanceof F.Name?(n instanceof F.Name?r(i,n,o):e(i,n,o),o):n instanceof F.Name?(e(i,o,n),n):t(n,o);return a===F.Name&&!(u instanceof F.Name)?s(i,u):u}}C.mergeEvaluated={props:Dl({mergeNames:(r,e,t)=>r.if((0,F._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,F._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,F._)`${t} || {}`).code((0,F._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,F._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,F._)`${t} || {}`),ao(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:Ul}),items:Dl({mergeNames:(r,e,t)=>r.if((0,F._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,F._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,F._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,F._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function Ul(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,F._)`{}`);return e!==void 0&&ao(r,t,e),t}C.evaluatedPropsToName=Ul;function ao(r,e,t){Object.keys(t).forEach(s=>r.assign((0,F._)`${e}${(0,F.getProperty)(s)}`,!0))}C.setEvaluated=ao;var Ml={};function ab(r,e){return r.scopeValue("func",{ref:e,code:Ml[e.code]||(Ml[e.code]=new Qv._Code(e.code))})}C.useFunc=ab;var no;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(no||(C.Type=no={}));function ub(r,e,t){if(r instanceof F.Name){let s=e===no.Num;return t?s?(0,F._)`"[" + ${r} + "]"`:(0,F._)`"['" + ${r} + "']"`:s?(0,F._)`"/" + ${r}`:(0,F._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,F.getProperty)(r).toString():"/"+oo(r)}C.getErrorPath=ub;function Hl(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}C.checkStrictMode=Hl});var Ae=d(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});var de=T(),cb={data:new de.Name("data"),valCxt:new de.Name("valCxt"),instancePath:new de.Name("instancePath"),parentData:new de.Name("parentData"),parentDataProperty:new de.Name("parentDataProperty"),rootData:new de.Name("rootData"),dynamicAnchors:new de.Name("dynamicAnchors"),vErrors:new de.Name("vErrors"),errors:new de.Name("errors"),this:new de.Name("this"),self:new de.Name("self"),scope:new de.Name("scope"),json:new de.Name("json"),jsonPos:new de.Name("jsonPos"),jsonLen:new de.Name("jsonLen"),jsonPart:new de.Name("jsonPart")};uo.default=cb});var ts=d(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.extendErrors=fe.resetErrorsCount=fe.reportExtraError=fe.reportError=fe.keyword$DataError=fe.keywordError=void 0;var k=T(),li=R(),me=Ae();fe.keywordError={message:({keyword:r})=>(0,k.str)`must pass "${r}" keyword validation`};fe.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,k.str)`"${r}" keyword must be ${e} ($data)`:(0,k.str)`"${r}" keyword is invalid ($data)`};function lb(r,e=fe.keywordError,t,s){let{it:i}=r,{gen:n,compositeRule:o,allErrors:a}=i,u=Bl(r,e,t);s??(o||a)?Gl(n,u):zl(i,(0,k._)`[${u}]`)}fe.reportError=lb;function hb(r,e=fe.keywordError,t){let{it:s}=r,{gen:i,compositeRule:n,allErrors:o}=s,a=Bl(r,e,t);Gl(i,a),n||o||zl(s,me.default.vErrors)}fe.reportExtraError=hb;function db(r,e){r.assign(me.default.errors,e),r.if((0,k._)`${me.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,k._)`${me.default.vErrors}.length`,e),()=>r.assign(me.default.vErrors,null)))}fe.resetErrorsCount=db;function fb({gen:r,keyword:e,schemaValue:t,data:s,errsCount:i,it:n}){if(i===void 0)throw new Error("ajv implementation error");let o=r.name("err");r.forRange("i",i,me.default.errors,a=>{r.const(o,(0,k._)`${me.default.vErrors}[${a}]`),r.if((0,k._)`${o}.instancePath === undefined`,()=>r.assign((0,k._)`${o}.instancePath`,(0,k.strConcat)(me.default.instancePath,n.errorPath))),r.assign((0,k._)`${o}.schemaPath`,(0,k.str)`${n.errSchemaPath}/${e}`),n.opts.verbose&&(r.assign((0,k._)`${o}.schema`,t),r.assign((0,k._)`${o}.data`,s))})}fe.extendErrors=fb;function Gl(r,e){let t=r.const("err",e);r.if((0,k._)`${me.default.vErrors} === null`,()=>r.assign(me.default.vErrors,(0,k._)`[${t}]`),(0,k._)`${me.default.vErrors}.push(${t})`),r.code((0,k._)`${me.default.errors}++`)}function zl(r,e){let{gen:t,validateName:s,schemaEnv:i}=r;i.$async?t.throw((0,k._)`new ${r.ValidationError}(${e})`):(t.assign((0,k._)`${s}.errors`,e),t.return(!1))}var Bt={keyword:new k.Name("keyword"),schemaPath:new k.Name("schemaPath"),params:new k.Name("params"),propertyName:new k.Name("propertyName"),message:new k.Name("message"),schema:new k.Name("schema"),parentSchema:new k.Name("parentSchema")};function Bl(r,e,t){let{createErrors:s}=r.it;return s===!1?(0,k._)`{}`:pb(r,e,t)}function pb(r,e,t={}){let{gen:s,it:i}=r,n=[mb(i,t),gb(r,t)];return yb(r,e,n),s.object(...n)}function mb({errorPath:r},{instancePath:e}){let t=e?(0,k.str)`${r}${(0,li.getErrorPath)(e,li.Type.Str)}`:r;return[me.default.instancePath,(0,k.strConcat)(me.default.instancePath,t)]}function gb({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:s}){let i=s?e:(0,k.str)`${e}/${r}`;return t&&(i=(0,k.str)`${i}${(0,li.getErrorPath)(t,li.Type.Str)}`),[Bt.schemaPath,i]}function yb(r,{params:e,message:t},s){let{keyword:i,data:n,schemaValue:o,it:a}=r,{opts:u,propertyName:c,topSchemaRef:l,schemaPath:h}=a;s.push([Bt.keyword,i],[Bt.params,typeof e=="function"?e(r):e||(0,k._)`{}`]),u.messages&&s.push([Bt.message,typeof t=="function"?t(r):t]),u.verbose&&s.push([Bt.schema,o],[Bt.parentSchema,(0,k._)`${l}${h}`],[me.default.data,n]),c&&s.push([Bt.propertyName,c])}});var Wl=d(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.boolOrEmptySchema=ar.topBoolOrEmptySchema=void 0;var _b=ts(),vb=T(),bb=Ae(),wb={message:"boolean schema is false"};function $b(r){let{gen:e,schema:t,validateName:s}=r;t===!1?Kl(r,!1):typeof t=="object"&&t.$async===!0?e.return(bb.default.data):(e.assign((0,vb._)`${s}.errors`,null),e.return(!0))}ar.topBoolOrEmptySchema=$b;function Eb(r,e){let{gen:t,schema:s}=r;s===!1?(t.var(e,!1),Kl(r)):t.var(e,!0)}ar.boolOrEmptySchema=Eb;function Kl(r,e){let{gen:t,data:s}=r,i={gen:t,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,_b.reportError)(i,wb,void 0,e)}});var co=d(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.getRules=ur.isJSONType=void 0;var Sb=["string","number","integer","boolean","null","object","array"],Ob=new Set(Sb);function xb(r){return typeof r=="string"&&Ob.has(r)}ur.isJSONType=xb;function Tb(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}ur.getRules=Tb});var lo=d(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.shouldUseRule=xt.shouldUseGroup=xt.schemaHasRulesForType=void 0;function Pb({schema:r,self:e},t){let s=e.RULES.types[t];return s&&s!==!0&&Yl(r,s)}xt.schemaHasRulesForType=Pb;function Yl(r,e){return e.rules.some(t=>Xl(r,t))}xt.shouldUseGroup=Yl;function Xl(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(s=>r[s]!==void 0))}xt.shouldUseRule=Xl});var rs=d(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.reportTypeError=pe.checkDataTypes=pe.checkDataType=pe.coerceAndCheckDataType=pe.getJSONTypes=pe.getSchemaTypes=pe.DataType=void 0;var Ab=co(),Ib=lo(),Cb=ts(),A=T(),Jl=R(),cr;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(cr||(pe.DataType=cr={}));function Rb(r){let e=Zl(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}pe.getSchemaTypes=Rb;function Zl(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(Ab.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}pe.getJSONTypes=Zl;function Nb(r,e){let{gen:t,data:s,opts:i}=r,n=qb(e,i.coerceTypes),o=e.length>0&&!(n.length===0&&e.length===1&&(0,Ib.schemaHasRulesForType)(r,e[0]));if(o){let a=fo(e,s,i.strictNumbers,cr.Wrong);t.if(a,()=>{n.length?jb(r,e,n):po(r)})}return o}pe.coerceAndCheckDataType=Nb;var Ql=new Set(["string","number","integer","boolean","null"]);function qb(r,e){return e?r.filter(t=>Ql.has(t)||e==="array"&&t==="array"):[]}function jb(r,e,t){let{gen:s,data:i,opts:n}=r,o=s.let("dataType",(0,A._)`typeof ${i}`),a=s.let("coerced",(0,A._)`undefined`);n.coerceTypes==="array"&&s.if((0,A._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>s.assign(i,(0,A._)`${i}[0]`).assign(o,(0,A._)`typeof ${i}`).if(fo(e,i,n.strictNumbers),()=>s.assign(a,i))),s.if((0,A._)`${a} !== undefined`);for(let c of t)(Ql.has(c)||c==="array"&&n.coerceTypes==="array")&&u(c);s.else(),po(r),s.endIf(),s.if((0,A._)`${a} !== undefined`,()=>{s.assign(i,a),kb(r,a)});function u(c){switch(c){case"string":s.elseIf((0,A._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,A._)`"" + ${i}`).elseIf((0,A._)`${i} === null`).assign(a,(0,A._)`""`);return;case"number":s.elseIf((0,A._)`${o} == "boolean" || ${i} === null
|
|
2
|
+
"use strict";var Fv=Object.create;var Sl=Object.defineProperty;var Vv=Object.getOwnPropertyDescriptor;var Uv=Object.getOwnPropertyNames;var Hv=Object.getPrototypeOf,Gv=Object.prototype.hasOwnProperty;var d=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var zv=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Uv(e))!Gv.call(r,i)&&i!==t&&Sl(r,i,{get:()=>e[i],enumerable:!(s=Vv(e,i))||s.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?Fv(Hv(r)):{},zv(e||!r||!r.__esModule?Sl(t,"default",{value:r,enumerable:!0}):t,r));var Jr=d(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.regexpCode=k.getEsmExportName=k.getProperty=k.safeStringify=k.stringify=k.strConcat=k.addCodeArg=k.str=k._=k.nil=k._Code=k.Name=k.IDENTIFIER=k._CodeOrName=void 0;var Yr=class{};k._CodeOrName=Yr;k.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var zt=class extends Yr{constructor(e){if(super(),!k.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};k.Name=zt;var Ie=class extends Yr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,s)=>`${t}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,s)=>(s instanceof zt&&(t[s.str]=(t[s.str]||0)+1),t),{})}};k._Code=Ie;k.nil=new Ie("");function Gl(r,...e){let t=[r[0]],s=0;for(;s<e.length;)Wn(t,e[s]),t.push(r[++s]);return new Ie(t)}k._=Gl;var Kn=new Ie("+");function zl(r,...e){let t=[Xr(r[0])],s=0;for(;s<e.length;)t.push(Kn),Wn(t,e[s]),t.push(Kn,Xr(r[++s]));return ib(t),new Ie(t)}k.str=zl;function Wn(r,e){e instanceof Ie?r.push(...e._items):e instanceof zt?r.push(e):r.push(ab(e))}k.addCodeArg=Wn;function ib(r){let e=1;for(;e<r.length-1;){if(r[e]===Kn){let t=nb(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function nb(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof zt||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof zt))return`"${r}${e.slice(1)}`}function ob(r,e){return e.emptyStr()?r:r.emptyStr()?e:zl`${r}${e}`}k.strConcat=ob;function ab(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:Xr(Array.isArray(r)?r.join(","):r)}function ub(r){return new Ie(Xr(r))}k.stringify=ub;function Xr(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}k.safeStringify=Xr;function cb(r){return typeof r=="string"&&k.IDENTIFIER.test(r)?new Ie(`.${r}`):Gl`[${r}]`}k.getProperty=cb;function lb(r){if(typeof r=="string"&&k.IDENTIFIER.test(r))return new Ie(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}k.getEsmExportName=lb;function hb(r){return new Ie(r.toString())}k.regexpCode=hb});var Jn=d($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.ValueScope=$e.ValueScopeName=$e.Scope=$e.varKinds=$e.UsedValueState=void 0;var we=Jr(),Yn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},oi;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(oi||($e.UsedValueState=oi={}));$e.varKinds={const:new we.Name("const"),let:new we.Name("let"),var:new we.Name("var")};var ai=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof we.Name?e:this.name(e)}name(e){return new we.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,s;if(!((s=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};$e.Scope=ai;var ui=class extends we.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:s}){this.value=e,this.scopePath=(0,we._)`.${new we.Name(t)}[${s}]`}};$e.ValueScopeName=ui;var db=(0,we._)`\n`,Xn=class extends ai{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?db:we.nil}}get(){return this._scope}name(e){return new ui(e,this._newName(e))}value(e,t){var s;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:n}=i,o=(s=t.key)!==null&&s!==void 0?s:t.ref,a=this._values[n];if(a){let l=a.get(o);if(l)return l}else a=this._values[n]=new Map;a.set(o,i);let u=this._scope[n]||(this._scope[n]=[]),c=u.length;return u[c]=t.ref,i.setValue(t,{property:n,itemIndex:c}),i}getValue(e,t){let s=this._values[e];if(s)return s.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,we._)`${e}${s.scopePath}`})}scopeCode(e=this._values,t,s){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},t,s)}_reduceValues(e,t,s={},i){let n=we.nil;for(let o in e){let a=e[o];if(!a)continue;let u=s[o]=s[o]||new Map;a.forEach(c=>{if(u.has(c))return;u.set(c,oi.Started);let l=t(c);if(l){let h=this.opts.es5?$e.varKinds.var:$e.varKinds.const;n=(0,we._)`${n}${h} ${c} = ${l};${this.opts._n}`}else if(l=i?.(c))n=(0,we._)`${n}${l}${this.opts._n}`;else throw new Yn(c);u.set(c,oi.Completed)})}return n}};$e.ValueScope=Xn});var T=d(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.or=I.and=I.not=I.CodeGen=I.operators=I.varKinds=I.ValueScopeName=I.ValueScope=I.Scope=I.Name=I.regexpCode=I.stringify=I.getProperty=I.nil=I.strConcat=I.str=I._=void 0;var q=Jr(),Ue=Jn(),Tt=Jr();Object.defineProperty(I,"_",{enumerable:!0,get:function(){return Tt._}});Object.defineProperty(I,"str",{enumerable:!0,get:function(){return Tt.str}});Object.defineProperty(I,"strConcat",{enumerable:!0,get:function(){return Tt.strConcat}});Object.defineProperty(I,"nil",{enumerable:!0,get:function(){return Tt.nil}});Object.defineProperty(I,"getProperty",{enumerable:!0,get:function(){return Tt.getProperty}});Object.defineProperty(I,"stringify",{enumerable:!0,get:function(){return Tt.stringify}});Object.defineProperty(I,"regexpCode",{enumerable:!0,get:function(){return Tt.regexpCode}});Object.defineProperty(I,"Name",{enumerable:!0,get:function(){return Tt.Name}});var di=Jn();Object.defineProperty(I,"Scope",{enumerable:!0,get:function(){return di.Scope}});Object.defineProperty(I,"ValueScope",{enumerable:!0,get:function(){return di.ValueScope}});Object.defineProperty(I,"ValueScopeName",{enumerable:!0,get:function(){return di.ValueScopeName}});Object.defineProperty(I,"varKinds",{enumerable:!0,get:function(){return di.varKinds}});I.operators={GT:new q._Code(">"),GTE:new q._Code(">="),LT:new q._Code("<"),LTE:new q._Code("<="),EQ:new q._Code("==="),NEQ:new q._Code("!=="),NOT:new q._Code("!"),OR:new q._Code("||"),AND:new q._Code("&&"),ADD:new q._Code("+")};var dt=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Zn=class extends dt{constructor(e,t,s){super(),this.varKind=e,this.name=t,this.rhs=s}render({es5:e,_n:t}){let s=e?Ue.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=cr(this.rhs,e,t)),this}get names(){return this.rhs instanceof q._CodeOrName?this.rhs.names:{}}},ci=class extends dt{constructor(e,t,s){super(),this.lhs=e,this.rhs=t,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof q.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=cr(this.rhs,e,t),this}get names(){let e=this.lhs instanceof q.Name?{}:{...this.lhs.names};return hi(e,this.rhs)}},Qn=class extends ci{constructor(e,t,s,i){super(e,s,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},eo=class extends dt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},to=class extends dt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},ro=class extends dt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},so=class extends dt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=cr(this.code,e,t),this}get names(){return this.code instanceof q._CodeOrName?this.code.names:{}}},Zr=class extends dt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,s)=>t+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let s=e[t].optimizeNodes();Array.isArray(s)?e.splice(t,1,...s):s?e[t]=s:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:s}=this,i=s.length;for(;i--;){let n=s[i];n.optimizeNames(e,t)||(fb(e,n.names),s.splice(i,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Wt(e,t.names),{})}},ft=class extends Zr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},io=class extends Zr{},ur=class extends ft{};ur.kind="else";var Bt=class r extends ft{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let s=t.optimizeNodes();t=this.else=Array.isArray(s)?new ur(s):s}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(Bl(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=cr(this.condition,e,t),this}get names(){let e=super.names;return hi(e,this.condition),this.else&&Wt(e,this.else.names),e}};Bt.kind="if";var Kt=class extends ft{};Kt.kind="for";var no=class extends Kt{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=cr(this.iteration,e,t),this}get names(){return Wt(super.names,this.iteration.names)}},oo=class extends Kt{constructor(e,t,s,i){super(),this.varKind=e,this.name=t,this.from=s,this.to=i}render(e){let t=e.es5?Ue.varKinds.var:this.varKind,{name:s,from:i,to:n}=this;return`for(${t} ${s}=${i}; ${s}<${n}; ${s}++)`+super.render(e)}get names(){let e=hi(super.names,this.from);return hi(e,this.to)}},li=class extends Kt{constructor(e,t,s,i){super(),this.loop=e,this.varKind=t,this.name=s,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=cr(this.iterable,e,t),this}get names(){return Wt(super.names,this.iterable.names)}},Qr=class extends ft{constructor(e,t,s){super(),this.name=e,this.args=t,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Qr.kind="func";var es=class extends Zr{render(e){return"return "+super.render(e)}};es.kind="return";var ao=class extends ft{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var s,i;return super.optimizeNames(e,t),(s=this.catch)===null||s===void 0||s.optimizeNames(e,t),(i=this.finally)===null||i===void 0||i.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&Wt(e,this.catch.names),this.finally&&Wt(e,this.finally.names),e}},ts=class extends ft{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ts.kind="catch";var rs=class extends ft{render(e){return"finally"+super.render(e)}};rs.kind="finally";var uo=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
3
|
+
`:""},this._extScope=e,this._scope=new Ue.Scope({parent:e}),this._nodes=[new io]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let s=this._extScope.value(e,t);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,s,i){let n=this._scope.toName(t);return s!==void 0&&i&&(this._constants[n.str]=s),this._leafNode(new Zn(e,n,s)),n}const(e,t,s){return this._def(Ue.varKinds.const,e,t,s)}let(e,t,s){return this._def(Ue.varKinds.let,e,t,s)}var(e,t,s){return this._def(Ue.varKinds.var,e,t,s)}assign(e,t,s){return this._leafNode(new ci(e,t,s))}add(e,t){return this._leafNode(new Qn(e,I.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==q.nil&&this._leafNode(new so(e)),this}object(...e){let t=["{"];for(let[s,i]of e)t.length>1&&t.push(","),t.push(s),(s!==i||this.opts.es5)&&(t.push(":"),(0,q.addCodeArg)(t,i));return t.push("}"),new q._Code(t)}if(e,t,s){if(this._blockNode(new Bt(e)),t&&s)this.code(t).else().code(s).endIf();else if(t)this.code(t).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Bt(e))}else(){return this._elseNode(new ur)}endIf(){return this._endBlockNode(Bt,ur)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new no(e),t)}forRange(e,t,s,i,n=this.opts.es5?Ue.varKinds.var:Ue.varKinds.let){let o=this._scope.toName(e);return this._for(new oo(n,o,t,s),()=>i(o))}forOf(e,t,s,i=Ue.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let o=t instanceof q.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,q._)`${o}.length`,a=>{this.var(n,(0,q._)`${o}[${a}]`),s(n)})}return this._for(new li("of",i,n,t),()=>s(n))}forIn(e,t,s,i=this.opts.es5?Ue.varKinds.var:Ue.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,q._)`Object.keys(${t})`,s);let n=this._scope.toName(e);return this._for(new li("in",i,n,t),()=>s(n))}endFor(){return this._endBlockNode(Kt)}label(e){return this._leafNode(new eo(e))}break(e){return this._leafNode(new to(e))}return(e){let t=new es;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(es)}try(e,t,s){if(!t&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new ao;if(this._blockNode(i),this.code(e),t){let n=this.name("e");this._currNode=i.catch=new ts(n),t(n)}return s&&(this._currNode=i.finally=new rs,this.code(s)),this._endBlockNode(ts,rs)}throw(e){return this._leafNode(new ro(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-t;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=q.nil,s,i){return this._blockNode(new Qr(e,t,s)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Qr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let s=this._currNode;if(s instanceof e||t&&s instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Bt))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};I.CodeGen=uo;function Wt(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function hi(r,e){return e instanceof q._CodeOrName?Wt(r,e.names):r}function cr(r,e,t){if(r instanceof q.Name)return s(r);if(!i(r))return r;return new q._Code(r._items.reduce((n,o)=>(o instanceof q.Name&&(o=s(o)),o instanceof q._Code?n.push(...o._items):n.push(o),n),[]));function s(n){let o=t[n.str];return o===void 0||e[n.str]!==1?n:(delete e[n.str],o)}function i(n){return n instanceof q._Code&&n._items.some(o=>o instanceof q.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function fb(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function Bl(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,q._)`!${co(r)}`}I.not=Bl;var pb=Kl(I.operators.AND);function mb(...r){return r.reduce(pb)}I.and=mb;var gb=Kl(I.operators.OR);function yb(...r){return r.reduce(gb)}I.or=yb;function Kl(r){return(e,t)=>e===q.nil?t:t===q.nil?e:(0,q._)`${co(e)} ${r} ${co(t)}`}function co(r){return r instanceof q.Name?r:(0,q._)`(${r})`}});var R=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.checkStrictMode=C.getErrorPath=C.Type=C.useFunc=C.setEvaluated=C.evaluatedPropsToName=C.mergeEvaluated=C.eachItem=C.unescapeJsonPointer=C.escapeJsonPointer=C.escapeFragment=C.unescapeFragment=C.schemaRefOrVal=C.schemaHasRulesButRef=C.schemaHasRules=C.checkUnknownRules=C.alwaysValidSchema=C.toHash=void 0;var V=T(),_b=Jr();function vb(r){let e={};for(let t of r)e[t]=!0;return e}C.toHash=vb;function bb(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Xl(r,e),!Jl(e,r.self.RULES.all))}C.alwaysValidSchema=bb;function Xl(r,e=r.schema){let{opts:t,self:s}=r;if(!t.strictSchema||typeof e=="boolean")return;let i=s.RULES.keywords;for(let n in e)i[n]||eh(r,`unknown keyword: "${n}"`)}C.checkUnknownRules=Xl;function Jl(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}C.schemaHasRules=Jl;function wb(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}C.schemaHasRulesButRef=wb;function $b({topSchemaRef:r,schemaPath:e},t,s,i){if(!i){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,V._)`${t}`}return(0,V._)`${r}${e}${(0,V.getProperty)(s)}`}C.schemaRefOrVal=$b;function Eb(r){return Zl(decodeURIComponent(r))}C.unescapeFragment=Eb;function Sb(r){return encodeURIComponent(ho(r))}C.escapeFragment=Sb;function ho(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}C.escapeJsonPointer=ho;function Zl(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}C.unescapeJsonPointer=Zl;function Ob(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}C.eachItem=Ob;function Wl({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:s}){return(i,n,o,a)=>{let u=o===void 0?n:o instanceof V.Name?(n instanceof V.Name?r(i,n,o):e(i,n,o),o):n instanceof V.Name?(e(i,o,n),n):t(n,o);return a===V.Name&&!(u instanceof V.Name)?s(i,u):u}}C.mergeEvaluated={props:Wl({mergeNames:(r,e,t)=>r.if((0,V._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,V._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,V._)`${t} || {}`).code((0,V._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,V._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,V._)`${t} || {}`),fo(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:Ql}),items:Wl({mergeNames:(r,e,t)=>r.if((0,V._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,V._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,V._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,V._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function Ql(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,V._)`{}`);return e!==void 0&&fo(r,t,e),t}C.evaluatedPropsToName=Ql;function fo(r,e,t){Object.keys(t).forEach(s=>r.assign((0,V._)`${e}${(0,V.getProperty)(s)}`,!0))}C.setEvaluated=fo;var Yl={};function xb(r,e){return r.scopeValue("func",{ref:e,code:Yl[e.code]||(Yl[e.code]=new _b._Code(e.code))})}C.useFunc=xb;var lo;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(lo||(C.Type=lo={}));function Tb(r,e,t){if(r instanceof V.Name){let s=e===lo.Num;return t?s?(0,V._)`"[" + ${r} + "]"`:(0,V._)`"['" + ${r} + "']"`:s?(0,V._)`"/" + ${r}`:(0,V._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,V.getProperty)(r).toString():"/"+ho(r)}C.getErrorPath=Tb;function eh(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}C.checkStrictMode=eh});var Ce=d(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});var de=T(),Pb={data:new de.Name("data"),valCxt:new de.Name("valCxt"),instancePath:new de.Name("instancePath"),parentData:new de.Name("parentData"),parentDataProperty:new de.Name("parentDataProperty"),rootData:new de.Name("rootData"),dynamicAnchors:new de.Name("dynamicAnchors"),vErrors:new de.Name("vErrors"),errors:new de.Name("errors"),this:new de.Name("this"),self:new de.Name("self"),scope:new de.Name("scope"),json:new de.Name("json"),jsonPos:new de.Name("jsonPos"),jsonLen:new de.Name("jsonLen"),jsonPart:new de.Name("jsonPart")};po.default=Pb});var ss=d(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.extendErrors=fe.resetErrorsCount=fe.reportExtraError=fe.reportError=fe.keyword$DataError=fe.keywordError=void 0;var j=T(),fi=R(),ge=Ce();fe.keywordError={message:({keyword:r})=>(0,j.str)`must pass "${r}" keyword validation`};fe.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,j.str)`"${r}" keyword must be ${e} ($data)`:(0,j.str)`"${r}" keyword is invalid ($data)`};function Ab(r,e=fe.keywordError,t,s){let{it:i}=r,{gen:n,compositeRule:o,allErrors:a}=i,u=sh(r,e,t);s??(o||a)?th(n,u):rh(i,(0,j._)`[${u}]`)}fe.reportError=Ab;function Ib(r,e=fe.keywordError,t){let{it:s}=r,{gen:i,compositeRule:n,allErrors:o}=s,a=sh(r,e,t);th(i,a),n||o||rh(s,ge.default.vErrors)}fe.reportExtraError=Ib;function Cb(r,e){r.assign(ge.default.errors,e),r.if((0,j._)`${ge.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,j._)`${ge.default.vErrors}.length`,e),()=>r.assign(ge.default.vErrors,null)))}fe.resetErrorsCount=Cb;function Rb({gen:r,keyword:e,schemaValue:t,data:s,errsCount:i,it:n}){if(i===void 0)throw new Error("ajv implementation error");let o=r.name("err");r.forRange("i",i,ge.default.errors,a=>{r.const(o,(0,j._)`${ge.default.vErrors}[${a}]`),r.if((0,j._)`${o}.instancePath === undefined`,()=>r.assign((0,j._)`${o}.instancePath`,(0,j.strConcat)(ge.default.instancePath,n.errorPath))),r.assign((0,j._)`${o}.schemaPath`,(0,j.str)`${n.errSchemaPath}/${e}`),n.opts.verbose&&(r.assign((0,j._)`${o}.schema`,t),r.assign((0,j._)`${o}.data`,s))})}fe.extendErrors=Rb;function th(r,e){let t=r.const("err",e);r.if((0,j._)`${ge.default.vErrors} === null`,()=>r.assign(ge.default.vErrors,(0,j._)`[${t}]`),(0,j._)`${ge.default.vErrors}.push(${t})`),r.code((0,j._)`${ge.default.errors}++`)}function rh(r,e){let{gen:t,validateName:s,schemaEnv:i}=r;i.$async?t.throw((0,j._)`new ${r.ValidationError}(${e})`):(t.assign((0,j._)`${s}.errors`,e),t.return(!1))}var Yt={keyword:new j.Name("keyword"),schemaPath:new j.Name("schemaPath"),params:new j.Name("params"),propertyName:new j.Name("propertyName"),message:new j.Name("message"),schema:new j.Name("schema"),parentSchema:new j.Name("parentSchema")};function sh(r,e,t){let{createErrors:s}=r.it;return s===!1?(0,j._)`{}`:Nb(r,e,t)}function Nb(r,e,t={}){let{gen:s,it:i}=r,n=[qb(i,t),Db(r,t)];return jb(r,e,n),s.object(...n)}function qb({errorPath:r},{instancePath:e}){let t=e?(0,j.str)`${r}${(0,fi.getErrorPath)(e,fi.Type.Str)}`:r;return[ge.default.instancePath,(0,j.strConcat)(ge.default.instancePath,t)]}function Db({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:s}){let i=s?e:(0,j.str)`${e}/${r}`;return t&&(i=(0,j.str)`${i}${(0,fi.getErrorPath)(t,fi.Type.Str)}`),[Yt.schemaPath,i]}function jb(r,{params:e,message:t},s){let{keyword:i,data:n,schemaValue:o,it:a}=r,{opts:u,propertyName:c,topSchemaRef:l,schemaPath:h}=a;s.push([Yt.keyword,i],[Yt.params,typeof e=="function"?e(r):e||(0,j._)`{}`]),u.messages&&s.push([Yt.message,typeof t=="function"?t(r):t]),u.verbose&&s.push([Yt.schema,o],[Yt.parentSchema,(0,j._)`${l}${h}`],[ge.default.data,n]),c&&s.push([Yt.propertyName,c])}});var nh=d(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.boolOrEmptySchema=lr.topBoolOrEmptySchema=void 0;var kb=ss(),Mb=T(),Lb=Ce(),Fb={message:"boolean schema is false"};function Vb(r){let{gen:e,schema:t,validateName:s}=r;t===!1?ih(r,!1):typeof t=="object"&&t.$async===!0?e.return(Lb.default.data):(e.assign((0,Mb._)`${s}.errors`,null),e.return(!0))}lr.topBoolOrEmptySchema=Vb;function Ub(r,e){let{gen:t,schema:s}=r;s===!1?(t.var(e,!1),ih(r)):t.var(e,!0)}lr.boolOrEmptySchema=Ub;function ih(r,e){let{gen:t,data:s}=r,i={gen:t,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,kb.reportError)(i,Fb,void 0,e)}});var mo=d(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.getRules=hr.isJSONType=void 0;var Hb=["string","number","integer","boolean","null","object","array"],Gb=new Set(Hb);function zb(r){return typeof r=="string"&&Gb.has(r)}hr.isJSONType=zb;function Bb(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}hr.getRules=Bb});var go=d(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.shouldUseRule=Pt.shouldUseGroup=Pt.schemaHasRulesForType=void 0;function Kb({schema:r,self:e},t){let s=e.RULES.types[t];return s&&s!==!0&&oh(r,s)}Pt.schemaHasRulesForType=Kb;function oh(r,e){return e.rules.some(t=>ah(r,t))}Pt.shouldUseGroup=oh;function ah(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(s=>r[s]!==void 0))}Pt.shouldUseRule=ah});var is=d(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.reportTypeError=pe.checkDataTypes=pe.checkDataType=pe.coerceAndCheckDataType=pe.getJSONTypes=pe.getSchemaTypes=pe.DataType=void 0;var Wb=mo(),Yb=go(),Xb=ss(),A=T(),uh=R(),dr;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(dr||(pe.DataType=dr={}));function Jb(r){let e=ch(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}pe.getSchemaTypes=Jb;function ch(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(Wb.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}pe.getJSONTypes=ch;function Zb(r,e){let{gen:t,data:s,opts:i}=r,n=Qb(e,i.coerceTypes),o=e.length>0&&!(n.length===0&&e.length===1&&(0,Yb.schemaHasRulesForType)(r,e[0]));if(o){let a=_o(e,s,i.strictNumbers,dr.Wrong);t.if(a,()=>{n.length?ew(r,e,n):vo(r)})}return o}pe.coerceAndCheckDataType=Zb;var lh=new Set(["string","number","integer","boolean","null"]);function Qb(r,e){return e?r.filter(t=>lh.has(t)||e==="array"&&t==="array"):[]}function ew(r,e,t){let{gen:s,data:i,opts:n}=r,o=s.let("dataType",(0,A._)`typeof ${i}`),a=s.let("coerced",(0,A._)`undefined`);n.coerceTypes==="array"&&s.if((0,A._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>s.assign(i,(0,A._)`${i}[0]`).assign(o,(0,A._)`typeof ${i}`).if(_o(e,i,n.strictNumbers),()=>s.assign(a,i))),s.if((0,A._)`${a} !== undefined`);for(let c of t)(lh.has(c)||c==="array"&&n.coerceTypes==="array")&&u(c);s.else(),vo(r),s.endIf(),s.if((0,A._)`${a} !== undefined`,()=>{s.assign(i,a),tw(r,a)});function u(c){switch(c){case"string":s.elseIf((0,A._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,A._)`"" + ${i}`).elseIf((0,A._)`${i} === null`).assign(a,(0,A._)`""`);return;case"number":s.elseIf((0,A._)`${o} == "boolean" || ${i} === null
|
|
4
4
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,A._)`+${i}`);return;case"integer":s.elseIf((0,A._)`${o} === "boolean" || ${i} === null
|
|
5
5
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,A._)`+${i}`);return;case"boolean":s.elseIf((0,A._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,A._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":s.elseIf((0,A._)`${i} === "" || ${i} === 0 || ${i} === false`),s.assign(a,null);return;case"array":s.elseIf((0,A._)`${o} === "string" || ${o} === "number"
|
|
6
|
-
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,A._)`[${i}]`)}}}function kb({gen:r,parentData:e,parentDataProperty:t},s){r.if((0,A._)`${e} !== undefined`,()=>r.assign((0,A._)`${e}[${t}]`,s))}function ho(r,e,t,s=cr.Correct){let i=s===cr.Correct?A.operators.EQ:A.operators.NEQ,n;switch(r){case"null":return(0,A._)`${e} ${i} null`;case"array":n=(0,A._)`Array.isArray(${e})`;break;case"object":n=(0,A._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":n=o((0,A._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":n=o();break;default:return(0,A._)`typeof ${e} ${i} ${r}`}return s===cr.Correct?n:(0,A.not)(n);function o(a=A.nil){return(0,A.and)((0,A._)`typeof ${e} == "number"`,a,t?(0,A._)`isFinite(${e})`:A.nil)}}pe.checkDataType=ho;function fo(r,e,t,s){if(r.length===1)return ho(r[0],e,t,s);let i,n=(0,Jl.toHash)(r);if(n.array&&n.object){let o=(0,A._)`typeof ${e} != "object"`;i=n.null?o:(0,A._)`!${e} || ${o}`,delete n.null,delete n.array,delete n.object}else i=A.nil;n.number&&delete n.integer;for(let o in n)i=(0,A.and)(i,ho(o,e,t,s));return i}pe.checkDataTypes=fo;var Db={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,A._)`{type: ${r}}`:(0,A._)`{type: ${e}}`};function po(r){let e=Mb(r);(0,Cb.reportError)(e,Db)}pe.reportTypeError=po;function Mb(r){let{gen:e,data:t,schema:s}=r,i=(0,Jl.schemaRefOrVal)(r,s,"type");return{gen:e,keyword:"type",data:t,schema:s.type,schemaCode:i,schemaValue:i,parentSchema:s,params:{},it:r}}});var th=d(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.assignDefaults=void 0;var lr=T(),Lb=R();function Vb(r,e){let{properties:t,items:s}=r.schema;if(e==="object"&&t)for(let i in t)eh(r,i,t[i].default);else e==="array"&&Array.isArray(s)&&s.forEach((i,n)=>eh(r,n,i.default))}hi.assignDefaults=Vb;function eh(r,e,t){let{gen:s,compositeRule:i,data:n,opts:o}=r;if(t===void 0)return;let a=(0,lr._)`${n}${(0,lr.getProperty)(e)}`;if(i){(0,Lb.checkStrictMode)(r,`default is ignored for: ${a}`);return}let u=(0,lr._)`${a} === undefined`;o.useDefaults==="empty"&&(u=(0,lr._)`${u} || ${a} === null || ${a} === ""`),s.if(u,(0,lr._)`${a} = ${(0,lr.stringify)(t)}`)}});var Ie=d(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.validateUnion=V.validateArray=V.usePattern=V.callValidateCode=V.schemaProperties=V.allSchemaProperties=V.noPropertyInData=V.propertyInData=V.isOwnProperty=V.hasPropFunc=V.reportMissingProp=V.checkMissingProp=V.checkReportMissingProp=void 0;var z=T(),mo=R(),Tt=Ae(),Fb=R();function Ub(r,e){let{gen:t,data:s,it:i}=r;t.if(yo(t,s,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,z._)`${e}`},!0),r.error()})}V.checkReportMissingProp=Ub;function Hb({gen:r,data:e,it:{opts:t}},s,i){return(0,z.or)(...s.map(n=>(0,z.and)(yo(r,e,n,t.ownProperties),(0,z._)`${i} = ${n}`)))}V.checkMissingProp=Hb;function Gb(r,e){r.setParams({missingProperty:e},!0),r.error()}V.reportMissingProp=Gb;function rh(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,z._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=rh;function go(r,e,t){return(0,z._)`${rh(r)}.call(${e}, ${t})`}V.isOwnProperty=go;function zb(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} !== undefined`;return s?(0,z._)`${i} && ${go(r,e,t)}`:i}V.propertyInData=zb;function yo(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} === undefined`;return s?(0,z.or)(i,(0,z.not)(go(r,e,t))):i}V.noPropertyInData=yo;function sh(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=sh;function Bb(r,e){return sh(e).filter(t=>!(0,mo.alwaysValidSchema)(r,e[t]))}V.schemaProperties=Bb;function Kb({schemaCode:r,data:e,it:{gen:t,topSchemaRef:s,schemaPath:i,errorPath:n},it:o},a,u,c){let l=c?(0,z._)`${r}, ${e}, ${s}${i}`:e,h=[[Tt.default.instancePath,(0,z.strConcat)(Tt.default.instancePath,n)],[Tt.default.parentData,o.parentData],[Tt.default.parentDataProperty,o.parentDataProperty],[Tt.default.rootData,Tt.default.rootData]];o.opts.dynamicRef&&h.push([Tt.default.dynamicAnchors,Tt.default.dynamicAnchors]);let f=(0,z._)`${l}, ${t.object(...h)}`;return u!==z.nil?(0,z._)`${a}.call(${u}, ${f})`:(0,z._)`${a}(${f})`}V.callValidateCode=Kb;var Wb=(0,z._)`new RegExp`;function Yb({gen:r,it:{opts:e}},t){let s=e.unicodeRegExp?"u":"",{regExp:i}=e.code,n=i(t,s);return r.scopeValue("pattern",{key:n.toString(),ref:n,code:(0,z._)`${i.code==="new RegExp"?Wb:(0,Fb.useFunc)(r,i)}(${t}, ${s})`})}V.usePattern=Yb;function Xb(r){let{gen:e,data:t,keyword:s,it:i}=r,n=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(n,!0),o(()=>e.break()),n;function o(a){let u=e.const("len",(0,z._)`${t}.length`);e.forRange("i",0,u,c=>{r.subschema({keyword:s,dataProp:c,dataPropType:mo.Type.Num},n),e.if((0,z.not)(n),a)})}}V.validateArray=Xb;function Jb(r){let{gen:e,schema:t,keyword:s,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(u=>(0,mo.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((u,c)=>{let l=r.subschema({keyword:s,schemaProp:c,compositeRule:!0},a);e.assign(o,(0,z._)`${o} || ${a}`),r.mergeValidEvaluated(l,a)||e.if((0,z.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}V.validateUnion=Jb});var oh=d(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.validateKeywordUsage=Je.validSchemaType=Je.funcKeywordCode=Je.macroKeywordCode=void 0;var ge=T(),Kt=Ae(),Zb=Ie(),Qb=ts();function ew(r,e){let{gen:t,keyword:s,schema:i,parentSchema:n,it:o}=r,a=e.macro.call(o.self,i,n,o),u=nh(t,s,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let c=t.name("valid");r.subschema({schema:a,schemaPath:ge.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},c),r.pass(c,()=>r.error(!0))}Je.macroKeywordCode=ew;function tw(r,e){var t;let{gen:s,keyword:i,schema:n,parentSchema:o,$data:a,it:u}=r;sw(u,e);let c=!a&&e.compile?e.compile.call(u.self,n,o,u):e.validate,l=nh(s,i,c),h=s.let("valid");r.block$data(h,f),r.ok((t=e.valid)!==null&&t!==void 0?t:h);function f(){if(e.errors===!1)g(),e.modifying&&ih(r),y(()=>r.error());else{let _=e.async?p():m();e.modifying&&ih(r),y(()=>rw(r,_))}}function p(){let _=s.let("ruleErrs",null);return s.try(()=>g((0,ge._)`await `),S=>s.assign(h,!1).if((0,ge._)`${S} instanceof ${u.ValidationError}`,()=>s.assign(_,(0,ge._)`${S}.errors`),()=>s.throw(S))),_}function m(){let _=(0,ge._)`${l}.errors`;return s.assign(_,null),g(ge.nil),_}function g(_=e.async?(0,ge._)`await `:ge.nil){let S=u.opts.passContext?Kt.default.this:Kt.default.self,O=!("compile"in e&&!a||e.schema===!1);s.assign(h,(0,ge._)`${_}${(0,Zb.callValidateCode)(r,l,S,O)}`,e.modifying)}function y(_){var S;s.if((0,ge.not)((S=e.valid)!==null&&S!==void 0?S:h),_)}}Je.funcKeywordCode=tw;function ih(r){let{gen:e,data:t,it:s}=r;e.if(s.parentData,()=>e.assign(t,(0,ge._)`${s.parentData}[${s.parentDataProperty}]`))}function rw(r,e){let{gen:t}=r;t.if((0,ge._)`Array.isArray(${e})`,()=>{t.assign(Kt.default.vErrors,(0,ge._)`${Kt.default.vErrors} === null ? ${e} : ${Kt.default.vErrors}.concat(${e})`).assign(Kt.default.errors,(0,ge._)`${Kt.default.vErrors}.length`),(0,Qb.extendErrors)(r)},()=>r.error())}function sw({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function nh(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,ge.stringify)(t)})}function iw(r,e,t=!1){return!e.length||e.some(s=>s==="array"?Array.isArray(r):s==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==s||t&&typeof r>"u")}Je.validSchemaType=iw;function nw({schema:r,opts:e,self:t,errSchemaPath:s},i,n){if(Array.isArray(i.keyword)?!i.keyword.includes(n):i.keyword!==n)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(r,a)))throw new Error(`parent schema must have dependencies of ${n}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(r[n])){let u=`keyword "${n}" value is invalid at path "${s}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(u);else throw new Error(u)}}Je.validateKeywordUsage=nw});var uh=d(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.extendSubschemaMode=Pt.extendSubschemaData=Pt.getSubschema=void 0;var Ze=T(),ah=R();function ow(r,{keyword:e,schemaProp:t,schema:s,schemaPath:i,errSchemaPath:n,topSchemaRef:o}){if(e!==void 0&&s!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=r.schema[e];return t===void 0?{schema:a,schemaPath:(0,Ze._)`${r.schemaPath}${(0,Ze.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,Ze._)`${r.schemaPath}${(0,Ze.getProperty)(e)}${(0,Ze.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,ah.escapeFragment)(t)}`}}if(s!==void 0){if(i===void 0||n===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:i,topSchemaRef:o,errSchemaPath:n}}throw new Error('either "keyword" or "schema" must be passed')}Pt.getSubschema=ow;function aw(r,e,{dataProp:t,dataPropType:s,data:i,dataTypes:n,propertyName:o}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:c,dataPathArr:l,opts:h}=e,f=a.let("data",(0,Ze._)`${e.data}${(0,Ze.getProperty)(t)}`,!0);u(f),r.errorPath=(0,Ze.str)`${c}${(0,ah.getErrorPath)(t,s,h.jsPropertySyntax)}`,r.parentDataProperty=(0,Ze._)`${t}`,r.dataPathArr=[...l,r.parentDataProperty]}if(i!==void 0){let c=i instanceof Ze.Name?i:a.let("data",i,!0);u(c),o!==void 0&&(r.propertyName=o)}n&&(r.dataTypes=n);function u(c){r.data=c,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,c]}}Pt.extendSubschemaData=aw;function uw(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:s,createErrors:i,allErrors:n}){s!==void 0&&(r.compositeRule=s),i!==void 0&&(r.createErrors=i),n!==void 0&&(r.allErrors=n),r.jtdDiscriminator=e,r.jtdMetadata=t}Pt.extendSubschemaMode=uw});var _o=d((bq,ch)=>{"use strict";ch.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,i,n;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(n=Object.keys(e),s=n.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(i=s;i--!==0;){var o=n[i];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var hh=d((wq,lh)=>{"use strict";var At=lh.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var s=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};di(e,s,i,r,"",r)};At.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};At.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};At.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};At.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function di(r,e,t,s,i,n,o,a,u,c){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,i,n,o,a,u,c);for(var l in s){var h=s[l];if(Array.isArray(h)){if(l in At.arrayKeywords)for(var f=0;f<h.length;f++)di(r,e,t,h[f],i+"/"+l+"/"+f,n,i,l,s,f)}else if(l in At.propsKeywords){if(h&&typeof h=="object")for(var p in h)di(r,e,t,h[p],i+"/"+l+"/"+cw(p),n,i,l,s,p)}else(l in At.keywords||r.allKeys&&!(l in At.skipKeywords))&&di(r,e,t,h,i+"/"+l,n,i,l,s)}t(s,i,n,o,a,u,c)}}function cw(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var ss=d($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.getSchemaRefs=$e.resolveUrl=$e.normalizeId=$e._getFullPath=$e.getFullPath=$e.inlineRef=void 0;var lw=R(),hw=_o(),dw=hh(),fw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pw(r,e=!0){return typeof r=="boolean"?!0:e===!0?!vo(r):e?dh(r)<=e:!1}$e.inlineRef=pw;var mw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function vo(r){for(let e in r){if(mw.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(vo)||typeof t=="object"&&vo(t))return!0}return!1}function dh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!fw.has(t)&&(typeof r[t]=="object"&&(0,lw.eachItem)(r[t],s=>e+=dh(s)),e===1/0))return 1/0}return e}function fh(r,e="",t){t!==!1&&(e=hr(e));let s=r.parse(e);return ph(r,s)}$e.getFullPath=fh;function ph(r,e){return r.serialize(e).split("#")[0]+"#"}$e._getFullPath=ph;var gw=/#\/?$/;function hr(r){return r?r.replace(gw,""):""}$e.normalizeId=hr;function yw(r,e,t){return t=hr(t),r.resolve(e,t)}$e.resolveUrl=yw;var _w=/^[a-z_][-a-z0-9._]*$/i;function vw(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:s}=this.opts,i=hr(r[t]||e),n={"":i},o=fh(s,i,!1),a={},u=new Set;return dw(r,{allKeys:!0},(h,f,p,m)=>{if(m===void 0)return;let g=o+f,y=n[m];typeof h[t]=="string"&&(y=_.call(this,h[t])),S.call(this,h.$anchor),S.call(this,h.$dynamicAnchor),n[f]=y;function _(O){let E=this.opts.uriResolver.resolve;if(O=hr(y?E(y,O):O),u.has(O))throw l(O);u.add(O);let $=this.refs[O];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?c(h,$.schema,O):O!==hr(g)&&(O[0]==="#"?(c(h,a[O],O),a[O]=h):this.refs[O]=g),O}function S(O){if(typeof O=="string"){if(!_w.test(O))throw new Error(`invalid anchor "${O}"`);_.call(this,`#${O}`)}}}),a;function c(h,f,p){if(f!==void 0&&!hw(h,f))throw l(p)}function l(h){return new Error(`reference "${h}" resolves to more than one schema`)}}$e.getSchemaRefs=vw});var dr=d(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.getData=It.KeywordCxt=It.validateFunctionCode=void 0;var vh=Wl(),mh=rs(),wo=lo(),fi=rs(),bw=th(),ns=oh(),bo=uh(),w=T(),x=Ae(),ww=ss(),dt=R(),is=ts();function $w(r){if($h(r)&&(Eh(r),wh(r))){Ow(r);return}bh(r,()=>(0,vh.topBoolOrEmptySchema)(r))}It.validateFunctionCode=$w;function bh({gen:r,validateName:e,schema:t,schemaEnv:s,opts:i},n){i.code.es5?r.func(e,(0,w._)`${x.default.data}, ${x.default.valCxt}`,s.$async,()=>{r.code((0,w._)`"use strict"; ${gh(t,i)}`),Sw(r,i),r.code(n)}):r.func(e,(0,w._)`${x.default.data}, ${Ew(i)}`,s.$async,()=>r.code(gh(t,i)).code(n))}function Ew(r){return(0,w._)`{${x.default.instancePath}="", ${x.default.parentData}, ${x.default.parentDataProperty}, ${x.default.rootData}=${x.default.data}${r.dynamicRef?(0,w._)`, ${x.default.dynamicAnchors}={}`:w.nil}}={}`}function Sw(r,e){r.if(x.default.valCxt,()=>{r.var(x.default.instancePath,(0,w._)`${x.default.valCxt}.${x.default.instancePath}`),r.var(x.default.parentData,(0,w._)`${x.default.valCxt}.${x.default.parentData}`),r.var(x.default.parentDataProperty,(0,w._)`${x.default.valCxt}.${x.default.parentDataProperty}`),r.var(x.default.rootData,(0,w._)`${x.default.valCxt}.${x.default.rootData}`),e.dynamicRef&&r.var(x.default.dynamicAnchors,(0,w._)`${x.default.valCxt}.${x.default.dynamicAnchors}`)},()=>{r.var(x.default.instancePath,(0,w._)`""`),r.var(x.default.parentData,(0,w._)`undefined`),r.var(x.default.parentDataProperty,(0,w._)`undefined`),r.var(x.default.rootData,x.default.data),e.dynamicRef&&r.var(x.default.dynamicAnchors,(0,w._)`{}`)})}function Ow(r){let{schema:e,opts:t,gen:s}=r;bh(r,()=>{t.$comment&&e.$comment&&Oh(r),Iw(r),s.let(x.default.vErrors,null),s.let(x.default.errors,0),t.unevaluated&&xw(r),Sh(r),Nw(r)})}function xw(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,w._)`${t}.evaluated`),e.if((0,w._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,w._)`${r.evaluated}.props`,(0,w._)`undefined`)),e.if((0,w._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,w._)`${r.evaluated}.items`,(0,w._)`undefined`))}function gh(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,w._)`/*# sourceURL=${t} */`:w.nil}function Tw(r,e){if($h(r)&&(Eh(r),wh(r))){Pw(r,e);return}(0,vh.boolOrEmptySchema)(r,e)}function wh({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function $h(r){return typeof r.schema!="boolean"}function Pw(r,e){let{schema:t,gen:s,opts:i}=r;i.$comment&&t.$comment&&Oh(r),Cw(r),Rw(r);let n=s.const("_errs",x.default.errors);Sh(r,n),s.var(e,(0,w._)`${n} === ${x.default.errors}`)}function Eh(r){(0,dt.checkUnknownRules)(r),Aw(r)}function Sh(r,e){if(r.opts.jtd)return yh(r,[],!1,e);let t=(0,mh.getSchemaTypes)(r.schema),s=(0,mh.coerceAndCheckDataType)(r,t);yh(r,t,!s,e)}function Aw(r){let{schema:e,errSchemaPath:t,opts:s,self:i}=r;e.$ref&&s.ignoreKeywordsWithRef&&(0,dt.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function Iw(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,dt.checkStrictMode)(r,"default is ignored in the schema root")}function Cw(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,ww.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function Rw(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function Oh({gen:r,schemaEnv:e,schema:t,errSchemaPath:s,opts:i}){let n=t.$comment;if(i.$comment===!0)r.code((0,w._)`${x.default.self}.logger.log(${n})`);else if(typeof i.$comment=="function"){let o=(0,w.str)`${s}/$comment`,a=r.scopeValue("root",{ref:e.root});r.code((0,w._)`${x.default.self}.opts.$comment(${n}, ${o}, ${a}.schema)`)}}function Nw(r){let{gen:e,schemaEnv:t,validateName:s,ValidationError:i,opts:n}=r;t.$async?e.if((0,w._)`${x.default.errors} === 0`,()=>e.return(x.default.data),()=>e.throw((0,w._)`new ${i}(${x.default.vErrors})`)):(e.assign((0,w._)`${s}.errors`,x.default.vErrors),n.unevaluated&&qw(r),e.return((0,w._)`${x.default.errors} === 0`))}function qw({gen:r,evaluated:e,props:t,items:s}){t instanceof w.Name&&r.assign((0,w._)`${e}.props`,t),s instanceof w.Name&&r.assign((0,w._)`${e}.items`,s)}function yh(r,e,t,s){let{gen:i,schema:n,data:o,allErrors:a,opts:u,self:c}=r,{RULES:l}=c;if(n.$ref&&(u.ignoreKeywordsWithRef||!(0,dt.schemaHasRulesButRef)(n,l))){i.block(()=>Th(r,"$ref",l.all.$ref.definition));return}u.jtd||jw(r,e),i.block(()=>{for(let f of l.rules)h(f);h(l.post)});function h(f){(0,wo.shouldUseGroup)(n,f)&&(f.type?(i.if((0,fi.checkDataType)(f.type,o,u.strictNumbers)),_h(r,f),e.length===1&&e[0]===f.type&&t&&(i.else(),(0,fi.reportTypeError)(r)),i.endIf()):_h(r,f),a||i.if((0,w._)`${x.default.errors} === ${s||0}`))}}function _h(r,e){let{gen:t,schema:s,opts:{useDefaults:i}}=r;i&&(0,bw.assignDefaults)(r,e.type),t.block(()=>{for(let n of e.rules)(0,wo.shouldUseRule)(s,n)&&Th(r,n.keyword,n.definition,e.type)})}function jw(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(kw(r,e),r.opts.allowUnionTypes||Dw(r,e),Mw(r,r.dataTypes))}function kw(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{xh(r.dataTypes,t)||$o(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),Vw(r,e)}}function Dw(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&$o(r,"use allowUnionTypes to allow union type keyword")}function Mw(r,e){let t=r.self.RULES.all;for(let s in t){let i=t[s];if(typeof i=="object"&&(0,wo.shouldUseRule)(r.schema,i)){let{type:n}=i.definition;n.length&&!n.some(o=>Lw(e,o))&&$o(r,`missing type "${n.join(",")}" for keyword "${s}"`)}}}function Lw(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function xh(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function Vw(r,e){let t=[];for(let s of r.dataTypes)xh(e,s)?t.push(s):e.includes("integer")&&s==="number"&&t.push("integer");r.dataTypes=t}function $o(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,dt.checkStrictMode)(r,e,r.opts.strictTypes)}var pi=class{constructor(e,t,s){if((0,ns.validateKeywordUsage)(e,t,s),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=s,this.data=e.data,this.schema=e.schema[s],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,dt.schemaRefOrVal)(e,this.schema,s,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Ph(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ns.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${s} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",x.default.errors))}result(e,t,s){this.failResult((0,w.not)(e),t,s)}failResult(e,t,s){this.gen.if(e),s?s():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,w.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,w._)`${t} !== undefined && (${(0,w.or)(this.invalid$data(),e)})`)}error(e,t,s){if(t){this.setParams(t),this._error(e,s),this.setParams({});return}this._error(e,s)}_error(e,t){(e?is.reportExtraError:is.reportError)(this,this.def.error,t)}$dataError(){(0,is.reportError)(this,this.def.$dataError||is.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,is.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,s=w.nil){this.gen.block(()=>{this.check$data(e,s),t()})}check$data(e=w.nil,t=w.nil){if(!this.$data)return;let{gen:s,schemaCode:i,schemaType:n,def:o}=this;s.if((0,w.or)((0,w._)`${i} === undefined`,t)),e!==w.nil&&s.assign(e,!0),(n.length||o.validateSchema)&&(s.elseIf(this.invalid$data()),this.$dataError(),e!==w.nil&&s.assign(e,!1)),s.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:s,def:i,it:n}=this;return(0,w.or)(o(),a());function o(){if(s.length){if(!(t instanceof w.Name))throw new Error("ajv implementation error");let u=Array.isArray(s)?s:[s];return(0,w._)`${(0,fi.checkDataTypes)(u,t,n.opts.strictNumbers,fi.DataType.Wrong)}`}return w.nil}function a(){if(i.validateSchema){let u=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,w._)`!${u}(${t})`}return w.nil}}subschema(e,t){let s=(0,bo.getSubschema)(this.it,e);(0,bo.extendSubschemaData)(s,this.it,e),(0,bo.extendSubschemaMode)(s,e);let i={...this.it,...s,items:void 0,props:void 0};return Tw(i,t),i}mergeEvaluated(e,t){let{it:s,gen:i}=this;s.opts.unevaluated&&(s.props!==!0&&e.props!==void 0&&(s.props=dt.mergeEvaluated.props(i,e.props,s.props,t)),s.items!==!0&&e.items!==void 0&&(s.items=dt.mergeEvaluated.items(i,e.items,s.items,t)))}mergeValidEvaluated(e,t){let{it:s,gen:i}=this;if(s.opts.unevaluated&&(s.props!==!0||s.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,w.Name)),!0}};It.KeywordCxt=pi;function Th(r,e,t,s){let i=new pi(r,t,e);"code"in t?t.code(i,s):i.$data&&t.validate?(0,ns.funcKeywordCode)(i,t):"macro"in t?(0,ns.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,ns.funcKeywordCode)(i,t)}var Fw=/^\/(?:[^~]|~0|~1)*$/,Uw=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Ph(r,{dataLevel:e,dataNames:t,dataPathArr:s}){let i,n;if(r==="")return x.default.rootData;if(r[0]==="/"){if(!Fw.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,n=x.default.rootData}else{let c=Uw.exec(r);if(!c)throw new Error(`Invalid JSON-pointer: ${r}`);let l=+c[1];if(i=c[2],i==="#"){if(l>=e)throw new Error(u("property/index",l));return s[e-l]}if(l>e)throw new Error(u("data",l));if(n=t[e-l],!i)return n}let o=n,a=i.split("/");for(let c of a)c&&(n=(0,w._)`${n}${(0,w.getProperty)((0,dt.unescapeJsonPointer)(c))}`,o=(0,w._)`${o} && ${n}`);return o;function u(c,l){return`Cannot access ${c} ${l} levels up, current level is ${e}`}}It.getData=Ph});var os=d(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});var Eo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};So.default=Eo});var fr=d(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});var Oo=ss(),xo=class extends Error{constructor(e,t,s,i){super(i||`can't resolve reference ${s} from id ${t}`),this.missingRef=(0,Oo.resolveUrl)(e,t,s),this.missingSchema=(0,Oo.normalizeId)((0,Oo.getFullPath)(e,this.missingRef))}};To.default=xo});var as=d(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.resolveSchema=Ce.getCompilingSchema=Ce.resolveRef=Ce.compileSchema=Ce.SchemaEnv=void 0;var Fe=T(),Hw=os(),Wt=Ae(),Ue=ss(),Ah=R(),Gw=dr(),pr=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let s;typeof e.schema=="object"&&(s=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Ue.normalizeId)(s?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=s?.$async,this.refs={}}};Ce.SchemaEnv=pr;function Ao(r){let e=Ih.call(this,r);if(e)return e;let t=(0,Ue.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:s,lines:i}=this.opts.code,{ownProperties:n}=this.opts,o=new Fe.CodeGen(this.scope,{es5:s,lines:i,ownProperties:n}),a;r.$async&&(a=o.scopeValue("Error",{ref:Hw.default,code:(0,Fe._)`require("ajv/dist/runtime/validation_error").default`}));let u=o.scopeName("validate");r.validateName=u;let c={gen:o,allErrors:this.opts.allErrors,data:Wt.default.data,parentData:Wt.default.parentData,parentDataProperty:Wt.default.parentDataProperty,dataNames:[Wt.default.data],dataPathArr:[Fe.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,Fe.stringify)(r.schema)}:{ref:r.schema}),validateName:u,ValidationError:a,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:Fe.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Fe._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(r),(0,Gw.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();l=`${o.scopeRefs(Wt.default.scope)}return ${h}`,this.opts.code.process&&(l=this.opts.code.process(l,r));let p=new Function(`${Wt.default.self}`,`${Wt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:p}),p.errors=null,p.schema=r.schema,p.schemaEnv=r,r.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:u,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:m,items:g}=c;p.evaluated={props:m instanceof Fe.Name?void 0:m,items:g instanceof Fe.Name?void 0:g,dynamicProps:m instanceof Fe.Name,dynamicItems:g instanceof Fe.Name},p.source&&(p.source.evaluated=(0,Fe.stringify)(p.evaluated))}return r.validate=p,r}catch(h){throw delete r.validate,delete r.validateName,l&&this.logger.error("Error compiling schema, function code:",l),h}finally{this._compilations.delete(r)}}Ce.compileSchema=Ao;function zw(r,e,t){var s;t=(0,Ue.resolveUrl)(this.opts.uriResolver,e,t);let i=r.refs[t];if(i)return i;let n=Ww.call(this,r,t);if(n===void 0){let o=(s=r.localRefs)===null||s===void 0?void 0:s[t],{schemaId:a}=this.opts;o&&(n=new pr({schema:o,schemaId:a,root:r,baseId:e}))}if(n!==void 0)return r.refs[t]=Bw.call(this,n)}Ce.resolveRef=zw;function Bw(r){return(0,Ue.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:Ao.call(this,r)}function Ih(r){for(let e of this._compilations)if(Kw(e,r))return e}Ce.getCompilingSchema=Ih;function Kw(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function Ww(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||mi.call(this,r,e)}function mi(r,e){let t=this.opts.uriResolver.parse(e),s=(0,Ue._getFullPath)(this.opts.uriResolver,t),i=(0,Ue.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&s===i)return Po.call(this,t,r);let n=(0,Ue.normalizeId)(s),o=this.refs[n]||this.schemas[n];if(typeof o=="string"){let a=mi.call(this,r,o);return typeof a?.schema!="object"?void 0:Po.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Ao.call(this,o),n===(0,Ue.normalizeId)(e)){let{schema:a}=o,{schemaId:u}=this.opts,c=a[u];return c&&(i=(0,Ue.resolveUrl)(this.opts.uriResolver,i,c)),new pr({schema:a,schemaId:u,root:r,baseId:i})}return Po.call(this,t,o)}}Ce.resolveSchema=mi;var Yw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Po(r,{baseId:e,schema:t,root:s}){var i;if(((i=r.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let u=t[(0,Ah.unescapeFragment)(a)];if(u===void 0)return;t=u;let c=typeof t=="object"&&t[this.opts.schemaId];!Yw.has(a)&&c&&(e=(0,Ue.resolveUrl)(this.opts.uriResolver,e,c))}let n;if(typeof t!="boolean"&&t.$ref&&!(0,Ah.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Ue.resolveUrl)(this.opts.uriResolver,e,t.$ref);n=mi.call(this,s,a)}let{schemaId:o}=this.opts;if(n=n||new pr({schema:t,schemaId:o,root:s,baseId:e}),n.schema!==n.root.schema)return n}});var Ch=d((Tq,Xw)=>{Xw.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ro=d((Pq,Dh)=>{"use strict";var Jw=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Nh=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),Io=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),qh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Zw=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Co(r){let e="",t=0,s=0;for(s=0;s<r.length;s++)if(t=r[s].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[s];break}for(s+=1;s<r.length;s++){if(t=r[s].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[s]}return e}var Qw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Rh(r){return r.length=0,!0}function e$(r,e,t){if(r.length){let s=Co(r);if(s!=="")e.push(s);else return t.error=!0,!1;r.length=0}return!0}function t$(r){let e=0,t={error:!1,address:"",zone:""},s=[],i=[],n=!1,o=!1,a=e$;for(let u=0;u<r.length;u++){let c=r[u];if(!(c==="["||c==="]"))if(c===":"){if(n===!0&&(o=!0),!a(i,s,t))break;if(++e>7){t.error=!0;break}u>0&&r[u-1]===":"&&(n=!0),s.push(":");continue}else if(c==="%"){if(!a(i,s,t))break;a=Rh}else{i.push(c);continue}}return i.length&&(a===Rh?t.zone=i.join(""):o?s.push(i.join("")):s.push(Co(i))),t.address=s.join(""),t}function jh(r){if(r$(r,":")<2)return{host:r,isIPV6:!1};let e=t$(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,s=e.address;return e.zone&&(t+="%"+e.zone,s+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:s}}}function r$(r,e){let t=0;for(let s=0;s<r.length;s++)r[s]===e&&t++;return t}function s$(r){let e=r,t=[],s=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){t.push("/");break}}else if(i===3&&e==="/.."){t.length!==0&&t.pop(),t.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),t.length!==0&&t.pop();continue}}if((s=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,s)),e=e.slice(s)}return t.join("")}var i$={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},n$=/[@/?#:]/g,o$=/[@/?#]/g;function kh(r,e){let t=e?o$:n$;return t.lastIndex=0,r.replace(t,s=>i$[s])}function a$(r,e=!1){if(r.indexOf("%")===-1)return r;let t="";for(let s=0;s<r.length;s++){if(r[s]==="%"&&s+2<r.length){let i=r.slice(s+1,s+3);if(Io(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));e&&qh(o)?t+=o:t+="%"+n,s+=2;continue}}t+=r[s]}return t}function u$(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let s=r.slice(t+1,t+3);if(Io(s)){let i=s.toUpperCase(),n=String.fromCharCode(parseInt(i,16));n!=="."&&qh(n)?e+=n:e+="%"+i,t+=2;continue}}Zw(r[t])?e+=r[t]:e+=escape(r[t])}return e}function c$(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let s=r.slice(t+1,t+3);if(Io(s)){e+="%"+s.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function l$(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!Nh(t)){let s=jh(t);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=kh(t,!1)}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}Dh.exports={nonSimpleDomain:Qw,recomposeAuthority:l$,reescapeHostDelimiters:kh,normalizePercentEncoding:a$,normalizePathEncoding:u$,escapePreservingEscapes:c$,removeDotSegments:s$,isIPv4:Nh,isUUID:Jw,normalizeIPv6:jh,stringArrayToHexStripped:Co}});var Uh=d((Aq,Fh)=>{"use strict";var{isUUID:h$}=Ro(),d$=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,f$=["http","https","ws","wss","urn","urn:uuid"];function p$(r){return f$.indexOf(r)!==-1}function No(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function Mh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function Lh(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function m$(r){return r.secure=No(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function g$(r){if((r.port===(No(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function y$(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(d$);if(t){let s=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let i=`${s}:${e.nid||r.nid}`,n=qo(i);r.path=void 0,n&&(r=n.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function _$(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",s=r.nid.toLowerCase(),i=`${t}:${e.nid||s}`,n=qo(i);n&&(r=n.serialize(r,e));let o=r,a=r.nss;return o.path=`${s||e.nid}:${a}`,e.skipEscape=!0,o}function v$(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!h$(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function b$(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var Vh={scheme:"http",domainHost:!0,parse:Mh,serialize:Lh},w$={scheme:"https",domainHost:Vh.domainHost,parse:Mh,serialize:Lh},gi={scheme:"ws",domainHost:!0,parse:m$,serialize:g$},$$={scheme:"wss",domainHost:gi.domainHost,parse:gi.parse,serialize:gi.serialize},E$={scheme:"urn",parse:y$,serialize:_$,skipNormalize:!0},S$={scheme:"urn:uuid",parse:v$,serialize:b$,skipNormalize:!0},yi={http:Vh,https:w$,ws:gi,wss:$$,urn:E$,"urn:uuid":S$};Object.setPrototypeOf(yi,null);function qo(r){return r&&(yi[r]||yi[r.toLowerCase()])||void 0}Fh.exports={wsIsSecure:No,SCHEMES:yi,isValidSchemeName:p$,getSchemeHandler:qo}});var Wh=d((Iq,_i)=>{"use strict";var{normalizeIPv6:O$,removeDotSegments:us,recomposeAuthority:x$,normalizePercentEncoding:T$,normalizePathEncoding:P$,escapePreservingEscapes:A$,reescapeHostDelimiters:I$,isIPv4:C$,nonSimpleDomain:R$}=Ro(),{SCHEMES:N$,getSchemeHandler:Gh}=Uh();function q$(r,e){return typeof r=="string"?r=L$(r,e):typeof r=="object"&&(r=mr(Yt(r,e),e)),r}function j$(r,e,t){let s=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=zh(mr(r,s),mr(e,s),s,!0);return s.skipEscape=!0,Yt(i,s)}function zh(r,e,t,s){let i={};return s||(r=mr(Yt(r,t),t),e=mr(Yt(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=us(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=us(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=us(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+e.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=us(i.path)),i.query=e.query):(i.path=r.path,e.query!==void 0?i.query=e.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=e.fragment,i}function k$(r,e,t){let s=Hh(r,t),i=Hh(e,t);return s!==void 0&&i!==void 0&&s.toLowerCase()===i.toLowerCase()}function Yt(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},s=Object.assign({},e),i=[],n=Gh(s.scheme||t.scheme);n&&n.serialize&&n.serialize(t,s),t.path!==void 0&&(s.skipEscape?t.path=T$(t.path):(t.path=A$(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),s.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let o=x$(t);if(o!==void 0&&(s.reference!=="suffix"&&i.push("//"),i.push(o),t.path&&t.path[0]!=="/"&&i.push("/")),t.path!==void 0){let a=t.path;!s.absolutePath&&(!n||!n.absolutePath)&&(a=us(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return t.query!==void 0&&i.push("?",t.query),t.fragment!==void 0&&i.push("#",t.fragment),i.join("")}var D$=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function M$(r,e){if(e[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function Bh(r,e){let t=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,n=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let o=r.match(D$);if(o){s.scheme=o[1],s.userinfo=o[3],s.host=o[4],s.port=parseInt(o[5],10),s.path=o[6]||"",s.query=o[7],s.fragment=o[8],isNaN(s.port)&&(s.port=o[5]);let a=M$(s,o);if(a!==void 0&&(s.error=s.error||a,i=!0),s.host)if(C$(s.host)===!1){let l=O$(s.host);s.host=l.host.toLowerCase(),n=l.isIPV6}else n=!0;s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference="same-document":s.scheme===void 0?s.reference="relative":s.fragment===void 0?s.reference="absolute":s.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==s.reference&&(s.error=s.error||"URI is not a "+t.reference+" reference.");let u=Gh(t.scheme||s.scheme);if(!t.unicodeSupport&&(!u||!u.unicodeSupport)&&s.host&&(t.domainHost||u&&u.domainHost)&&n===!1&&R$(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(c){s.error=s.error||"Host's domain name can not be converted to ASCII: "+c}if((!u||u&&!u.skipNormalize)&&(r.indexOf("%")!==-1&&(s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),s.host!==void 0&&(s.host=I$(unescape(s.host),n))),s.path&&(s.path=P$(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||"URI malformed"}u&&u.parse&&u.parse(s,t)}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:i}}function mr(r,e){return Bh(r,e).parsed}function L$(r,e){return Kh(r,e).normalized}function Kh(r,e){let{parsed:t,malformedAuthorityOrPort:s}=Bh(r,e);return{normalized:s?r:Yt(t,e),malformedAuthorityOrPort:s}}function Hh(r,e){if(typeof r=="string"){let{normalized:t,malformedAuthorityOrPort:s}=Kh(r,e);return s?void 0:t}if(typeof r=="object")return Yt(r,e)}var jo={SCHEMES:N$,normalize:q$,resolve:j$,resolveComponent:zh,equal:k$,serialize:Yt,parse:mr};_i.exports=jo;_i.exports.default=jo;_i.exports.fastUri=jo});var Xh=d(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});var Yh=Wh();Yh.code='require("ajv/dist/runtime/uri").default';ko.default=Yh});var Lo=d(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.CodeGen=oe.Name=oe.nil=oe.stringify=oe.str=oe._=oe.KeywordCxt=void 0;var V$=dr();Object.defineProperty(oe,"KeywordCxt",{enumerable:!0,get:function(){return V$.KeywordCxt}});var gr=T();Object.defineProperty(oe,"_",{enumerable:!0,get:function(){return gr._}});Object.defineProperty(oe,"str",{enumerable:!0,get:function(){return gr.str}});Object.defineProperty(oe,"stringify",{enumerable:!0,get:function(){return gr.stringify}});Object.defineProperty(oe,"nil",{enumerable:!0,get:function(){return gr.nil}});Object.defineProperty(oe,"Name",{enumerable:!0,get:function(){return gr.Name}});Object.defineProperty(oe,"CodeGen",{enumerable:!0,get:function(){return gr.CodeGen}});var F$=os(),td=fr(),U$=co(),cs=as(),H$=T(),ls=ss(),vi=rs(),Mo=R(),Jh=Ch(),G$=Xh(),rd=(r,e)=>new RegExp(r,e);rd.code="new RegExp";var z$=["removeAdditional","useDefaults","coerceTypes"],B$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),K$={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."},W$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Zh=200;function Y$(r){var e,t,s,i,n,o,a,u,c,l,h,f,p,m,g,y,_,S,O,E,$,he,U,De,xe;let G=r.strict,N=(e=r.code)===null||e===void 0?void 0:e.optimize,Js=N===!0||N===void 0?1:N||0,Ur=(s=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&s!==void 0?s:rd,Me=(i=r.uriResolver)!==null&&i!==void 0?i:G$.default;return{strictSchema:(o=(n=r.strictSchema)!==null&&n!==void 0?n:G)!==null&&o!==void 0?o:!0,strictNumbers:(u=(a=r.strictNumbers)!==null&&a!==void 0?a:G)!==null&&u!==void 0?u:!0,strictTypes:(l=(c=r.strictTypes)!==null&&c!==void 0?c:G)!==null&&l!==void 0?l:"log",strictTuples:(f=(h=r.strictTuples)!==null&&h!==void 0?h:G)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=r.strictRequired)!==null&&p!==void 0?p:G)!==null&&m!==void 0?m:!1,code:r.code?{...r.code,optimize:Js,regExp:Ur}:{optimize:Js,regExp:Ur},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:Zh,loopEnum:(y=r.loopEnum)!==null&&y!==void 0?y:Zh,meta:(_=r.meta)!==null&&_!==void 0?_:!0,messages:(S=r.messages)!==null&&S!==void 0?S:!0,inlineRefs:(O=r.inlineRefs)!==null&&O!==void 0?O:!0,schemaId:(E=r.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:($=r.addUsedSchema)!==null&&$!==void 0?$:!0,validateSchema:(he=r.validateSchema)!==null&&he!==void 0?he:!0,validateFormats:(U=r.validateFormats)!==null&&U!==void 0?U:!0,unicodeRegExp:(De=r.unicodeRegExp)!==null&&De!==void 0?De:!0,int32range:(xe=r.int32range)!==null&&xe!==void 0?xe:!0,uriResolver:Me}}var hs=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Y$(e)};let{es5:t,lines:s}=this.opts.code;this.scope=new H$.ValueScope({scope:{},prefixes:B$,es5:t,lines:s}),this.logger=tE(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,U$.getRules)(),Qh.call(this,K$,e,"NOT SUPPORTED"),Qh.call(this,W$,e,"DEPRECATED","warn"),this._metaOpts=Q$.call(this),e.formats&&J$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Z$.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),X$.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:s}=this.opts,i=Jh;s==="id"&&(i={...Jh},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[s],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let s;if(typeof e=="string"){if(s=this.getSchema(e),!s)throw new Error(`no schema with key or ref "${e}"`)}else s=this.compile(e);let i=s(t);return"$async"in s||(this.errors=s.errors),i}compile(e,t){let s=this._addSchema(e,t);return s.validate||this._compileSchemaEnv(s)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:s}=this.opts;return i.call(this,e,t);async function i(l,h){await n.call(this,l.$schema);let f=this._addSchema(l,h);return f.validate||o.call(this,f)}async function n(l){l&&!this.getSchema(l)&&await i.call(this,{$ref:l},!0)}async function o(l){try{return this._compileSchemaEnv(l)}catch(h){if(!(h instanceof td.default))throw h;return a.call(this,h),await u.call(this,h.missingSchema),o.call(this,l)}}function a({missingSchema:l,missingRef:h}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${h} cannot be resolved`)}async function u(l){let h=await c.call(this,l);this.refs[l]||await n.call(this,h.$schema),this.refs[l]||this.addSchema(h,l,t)}async function c(l){let h=this._loading[l];if(h)return h;try{return await(this._loading[l]=s(l))}finally{delete this._loading[l]}}}addSchema(e,t,s,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,s,i);return this}let n;if(typeof e=="object"){let{schemaId:o}=this.opts;if(n=e[o],n!==void 0&&typeof n!="string")throw new Error(`schema ${o} must be string`)}return t=(0,ls.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,s,t,i,!0),this}addMetaSchema(e,t,s=this.opts.validateSchema){return this.addSchema(e,t,!0,s),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let s;if(s=e.$schema,s!==void 0&&typeof s!="string")throw new Error("$schema must be a string");if(s=s||this.opts.defaultMeta||this.defaultMeta(),!s)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(s,e);if(!i&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw new Error(n)}return i}getSchema(e){let t;for(;typeof(t=ed.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:s}=this.opts,i=new cs.SchemaEnv({schema:{},schemaId:s});if(t=cs.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=ed.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let s=e[this.opts.schemaId];return s&&(s=(0,ls.normalizeId)(s),delete this.schemas[s],delete this.refs[s]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let s;if(typeof e=="string")s=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=s);else if(typeof e=="object"&&t===void 0){if(t=e,s=t.keyword,Array.isArray(s)&&!s.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(sE.call(this,s,t),!t)return(0,Mo.eachItem)(s,n=>Do.call(this,n)),this;nE.call(this,t);let i={...t,type:(0,vi.getJSONTypes)(t.type),schemaType:(0,vi.getJSONTypes)(t.schemaType)};return(0,Mo.eachItem)(s,i.type.length===0?n=>Do.call(this,n,i):n=>i.type.forEach(o=>Do.call(this,n,i,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let s of t.rules){let i=s.rules.findIndex(n=>n.keyword===e);i>=0&&s.rules.splice(i,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:s="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${s}${i.instancePath} ${i.message}`).reduce((i,n)=>i+t+n)}$dataMetaSchema(e,t){let s=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let n=i.split("/").slice(1),o=e;for(let a of n)o=o[a];for(let a in s){let u=s[a];if(typeof u!="object")continue;let{$data:c}=u.definition,l=o[a];c&&l&&(o[a]=sd(l))}}return e}_removeAllSchemas(e,t){for(let s in e){let i=e[s];(!t||t.test(s))&&(typeof i=="string"?delete e[s]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[s]))}}_addSchema(e,t,s,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;s=(0,ls.normalizeId)(o||s);let c=ls.getSchemaRefs.call(this,e,s);return u=new cs.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:s,localRefs:c}),this._cache.set(u.schema,u),n&&!s.startsWith("#")&&(s&&this._checkUnique(s),this.refs[s]=u),i&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):cs.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{cs.compileSchema.call(this,e)}finally{this.opts=t}}};hs.ValidationError=F$.default;hs.MissingRefError=td.default;oe.default=hs;function Qh(r,e,t,s="error"){for(let i in r){let n=i;n in e&&this.logger[s](`${t}: option ${i}. ${r[n]}`)}}function ed(r){return r=(0,ls.normalizeId)(r),this.schemas[r]||this.refs[r]}function X$(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function J$(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function Z$(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function Q$(){let r={...this.opts};for(let e of z$)delete r[e];return r}var eE={log(){},warn(){},error(){}};function tE(r){if(r===!1)return eE;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var rE=/^[a-z_$][a-z0-9_$:-]*$/i;function sE(r,e){let{RULES:t}=this;if((0,Mo.eachItem)(r,s=>{if(t.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!rE.test(s))throw new Error(`Keyword ${s} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Do(r,e,t){var s;let i=e?.post;if(t&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:n}=this,o=i?n.post:n.rules.find(({type:u})=>u===t);if(o||(o={type:t,rules:[]},n.rules.push(o)),n.keywords[r]=!0,!e)return;let a={keyword:r,definition:{...e,type:(0,vi.getJSONTypes)(e.type),schemaType:(0,vi.getJSONTypes)(e.schemaType)}};e.before?iE.call(this,o,a,e.before):o.rules.push(a),n.all[r]=a,(s=e.implements)===null||s===void 0||s.forEach(u=>this.addKeyword(u))}function iE(r,e,t){let s=r.rules.findIndex(i=>i.keyword===t);s>=0?r.rules.splice(s,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function nE(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=sd(e)),r.validateSchema=this.compile(e,!0))}var oE={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function sd(r){return{anyOf:[r,oE]}}});var id=d(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var aE={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Vo.default=aE});var $i=d(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.callRef=Xt.getValidate=void 0;var uE=fr(),nd=Ie(),Ee=T(),yr=Ae(),od=as(),bi=R(),cE={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:s}=r,{baseId:i,schemaEnv:n,validateName:o,opts:a,self:u}=s,{root:c}=n;if((t==="#"||t==="#/")&&i===c.baseId)return h();let l=od.resolveRef.call(u,c,i,t);if(l===void 0)throw new uE.default(s.opts.uriResolver,i,t);if(l instanceof od.SchemaEnv)return f(l);return p(l);function h(){if(n===c)return wi(r,o,n,n.$async);let m=e.scopeValue("root",{ref:c});return wi(r,(0,Ee._)`${m}.validate`,c,c.$async)}function f(m){let g=ad(r,m);wi(r,g,m,m.$async)}function p(m){let g=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Ee.stringify)(m)}:{ref:m}),y=e.name("valid"),_=r.subschema({schema:m,dataTypes:[],schemaPath:Ee.nil,topSchemaRef:g,errSchemaPath:t},y);r.mergeEvaluated(_),r.ok(y)}}};function ad(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Ee._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Xt.getValidate=ad;function wi(r,e,t,s){let{gen:i,it:n}=r,{allErrors:o,schemaEnv:a,opts:u}=n,c=u.passContext?yr.default.this:Ee.nil;s?l():h();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,Ee._)`await ${(0,nd.callValidateCode)(r,e,c)}`),p(e),o||i.assign(m,!0)},g=>{i.if((0,Ee._)`!(${g} instanceof ${n.ValidationError})`,()=>i.throw(g)),f(g),o||i.assign(m,!1)}),r.ok(m)}function h(){r.result((0,nd.callValidateCode)(r,e,c),()=>p(e),()=>f(e))}function f(m){let g=(0,Ee._)`${m}.errors`;i.assign(yr.default.vErrors,(0,Ee._)`${yr.default.vErrors} === null ? ${g} : ${yr.default.vErrors}.concat(${g})`),i.assign(yr.default.errors,(0,Ee._)`${yr.default.vErrors}.length`)}function p(m){var g;if(!n.opts.unevaluated)return;let y=(g=t?.validate)===null||g===void 0?void 0:g.evaluated;if(n.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(n.props=bi.mergeEvaluated.props(i,y.props,n.props));else{let _=i.var("props",(0,Ee._)`${m}.evaluated.props`);n.props=bi.mergeEvaluated.props(i,_,n.props,Ee.Name)}if(n.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(n.items=bi.mergeEvaluated.items(i,y.items,n.items));else{let _=i.var("items",(0,Ee._)`${m}.evaluated.items`);n.items=bi.mergeEvaluated.items(i,_,n.items,Ee.Name)}}}Xt.callRef=wi;Xt.default=cE});var Uo=d(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});var lE=id(),hE=$i(),dE=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",lE.default,hE.default];Fo.default=dE});var ud=d(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var Ei=T(),Ct=Ei.operators,Si={maximum:{okStr:"<=",ok:Ct.LTE,fail:Ct.GT},minimum:{okStr:">=",ok:Ct.GTE,fail:Ct.LT},exclusiveMaximum:{okStr:"<",ok:Ct.LT,fail:Ct.GTE},exclusiveMinimum:{okStr:">",ok:Ct.GT,fail:Ct.LTE}},fE={message:({keyword:r,schemaCode:e})=>(0,Ei.str)`must be ${Si[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Ei._)`{comparison: ${Si[r].okStr}, limit: ${e}}`},pE={keyword:Object.keys(Si),type:"number",schemaType:"number",$data:!0,error:fE,code(r){let{keyword:e,data:t,schemaCode:s}=r;r.fail$data((0,Ei._)`${t} ${Si[e].fail} ${s} || isNaN(${t})`)}};Ho.default=pE});var cd=d(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var ds=T(),mE={message:({schemaCode:r})=>(0,ds.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,ds._)`{multipleOf: ${r}}`},gE={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:mE,code(r){let{gen:e,data:t,schemaCode:s,it:i}=r,n=i.opts.multipleOfPrecision,o=e.let("res"),a=n?(0,ds._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,ds._)`${o} !== parseInt(${o})`;r.fail$data((0,ds._)`(${s} === 0 || (${o} = ${t}/${s}, ${a}))`)}};Go.default=gE});var hd=d(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});function ld(r){let e=r.length,t=0,s=0,i;for(;s<e;)t++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<e&&(i=r.charCodeAt(s),(i&64512)===56320&&s++);return t}zo.default=ld;ld.code='require("ajv/dist/runtime/ucs2length").default'});var dd=d(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});var Jt=T(),yE=R(),_E=hd(),vE={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Jt.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Jt._)`{limit: ${r}}`},bE={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:vE,code(r){let{keyword:e,data:t,schemaCode:s,it:i}=r,n=e==="maxLength"?Jt.operators.GT:Jt.operators.LT,o=i.opts.unicode===!1?(0,Jt._)`${t}.length`:(0,Jt._)`${(0,yE.useFunc)(r.gen,_E.default)}(${t})`;r.fail$data((0,Jt._)`${o} ${n} ${s}`)}};Bo.default=bE});var fd=d(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var wE=Ie(),$E=R(),_r=T(),EE={message:({schemaCode:r})=>(0,_r.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,_r._)`{pattern: ${r}}`},SE={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:EE,code(r){let{gen:e,data:t,$data:s,schema:i,schemaCode:n,it:o}=r,a=o.opts.unicodeRegExp?"u":"";if(s){let{regExp:u}=o.opts.code,c=u.code==="new RegExp"?(0,_r._)`new RegExp`:(0,$E.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,_r._)`${c}(${n}, ${a}).test(${t})`),()=>e.assign(l,!1)),r.fail$data((0,_r._)`!${l}`)}else{let u=(0,wE.usePattern)(r,i);r.fail$data((0,_r._)`!${u}.test(${t})`)}}};Ko.default=SE});var pd=d(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var fs=T(),OE={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,fs.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,fs._)`{limit: ${r}}`},xE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:OE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxProperties"?fs.operators.GT:fs.operators.LT;r.fail$data((0,fs._)`Object.keys(${t}).length ${i} ${s}`)}};Wo.default=xE});var md=d(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var ps=Ie(),ms=T(),TE=R(),PE={message:({params:{missingProperty:r}})=>(0,ms.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,ms._)`{missingProperty: ${r}}`},AE={keyword:"required",type:"object",schemaType:"array",$data:!0,error:PE,code(r){let{gen:e,schema:t,schemaCode:s,data:i,$data:n,it:o}=r,{opts:a}=o;if(!n&&t.length===0)return;let u=t.length>=a.loopRequired;if(o.allErrors?c():l(),a.strictRequired){let p=r.parentSchema.properties,{definedProperties:m}=r.it;for(let g of t)if(p?.[g]===void 0&&!m.has(g)){let y=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,TE.checkStrictMode)(o,_,o.opts.strictRequired)}}function c(){if(u||n)r.block$data(ms.nil,h);else for(let p of t)(0,ps.checkReportMissingProp)(r,p)}function l(){let p=e.let("missing");if(u||n){let m=e.let("valid",!0);r.block$data(m,()=>f(p,m)),r.ok(m)}else e.if((0,ps.checkMissingProp)(r,t,p)),(0,ps.reportMissingProp)(r,p),e.else()}function h(){e.forOf("prop",s,p=>{r.setParams({missingProperty:p}),e.if((0,ps.noPropertyInData)(e,i,p,a.ownProperties),()=>r.error())})}function f(p,m){r.setParams({missingProperty:p}),e.forOf(p,s,()=>{e.assign(m,(0,ps.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ms.not)(m),()=>{r.error(),e.break()})},ms.nil)}}};Yo.default=AE});var gd=d(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});var gs=T(),IE={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,gs.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,gs._)`{limit: ${r}}`},CE={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxItems"?gs.operators.GT:gs.operators.LT;r.fail$data((0,gs._)`${t}.length ${i} ${s}`)}};Xo.default=CE});var Oi=d(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var yd=_o();yd.code='require("ajv/dist/runtime/equal").default';Jo.default=yd});var _d=d(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var Zo=rs(),ae=T(),RE=R(),NE=Oi(),qE={message:({params:{i:r,j:e}})=>(0,ae.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,ae._)`{i: ${r}, j: ${e}}`},jE={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:qE,code(r){let{gen:e,data:t,$data:s,schema:i,parentSchema:n,schemaCode:o,it:a}=r;if(!s&&!i)return;let u=e.let("valid"),c=n.items?(0,Zo.getSchemaTypes)(n.items):[];r.block$data(u,l,(0,ae._)`${o} === false`),r.ok(u);function l(){let m=e.let("i",(0,ae._)`${t}.length`),g=e.let("j");r.setParams({i:m,j:g}),e.assign(u,!0),e.if((0,ae._)`${m} > 1`,()=>(h()?f:p)(m,g))}function h(){return c.length>0&&!c.some(m=>m==="object"||m==="array")}function f(m,g){let y=e.name("item"),_=(0,Zo.checkDataTypes)(c,y,a.opts.strictNumbers,Zo.DataType.Wrong),S=e.const("indices",(0,ae._)`{}`);e.for((0,ae._)`;${m}--;`,()=>{e.let(y,(0,ae._)`${t}[${m}]`),e.if(_,(0,ae._)`continue`),c.length>1&&e.if((0,ae._)`typeof ${y} == "string"`,(0,ae._)`${y} += "_"`),e.if((0,ae._)`typeof ${S}[${y}] == "number"`,()=>{e.assign(g,(0,ae._)`${S}[${y}]`),r.error(),e.assign(u,!1).break()}).code((0,ae._)`${S}[${y}] = ${m}`)})}function p(m,g){let y=(0,RE.useFunc)(e,NE.default),_=e.name("outer");e.label(_).for((0,ae._)`;${m}--;`,()=>e.for((0,ae._)`${g} = ${m}; ${g}--;`,()=>e.if((0,ae._)`${y}(${t}[${m}], ${t}[${g}])`,()=>{r.error(),e.assign(u,!1).break(_)})))}}};Qo.default=jE});var vd=d(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var ea=T(),kE=R(),DE=Oi(),ME={message:"must be equal to constant",params:({schemaCode:r})=>(0,ea._)`{allowedValue: ${r}}`},LE={keyword:"const",$data:!0,error:ME,code(r){let{gen:e,data:t,$data:s,schemaCode:i,schema:n}=r;s||n&&typeof n=="object"?r.fail$data((0,ea._)`!${(0,kE.useFunc)(e,DE.default)}(${t}, ${i})`):r.fail((0,ea._)`${n} !== ${t}`)}};ta.default=LE});var bd=d(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var ys=T(),VE=R(),FE=Oi(),UE={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,ys._)`{allowedValues: ${r}}`},HE={keyword:"enum",schemaType:"array",$data:!0,error:UE,code(r){let{gen:e,data:t,$data:s,schema:i,schemaCode:n,it:o}=r;if(!s&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,u,c=()=>u??(u=(0,VE.useFunc)(e,FE.default)),l;if(a||s)l=e.let("valid"),r.block$data(l,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",n);l=(0,ys.or)(...i.map((m,g)=>f(p,g)))}r.pass(l);function h(){e.assign(l,!1),e.forOf("v",n,p=>e.if((0,ys._)`${c()}(${t}, ${p})`,()=>e.assign(l,!0).break()))}function f(p,m){let g=i[m];return typeof g=="object"&&g!==null?(0,ys._)`${c()}(${t}, ${p}[${m}])`:(0,ys._)`${t} === ${g}`}}};ra.default=HE});var ia=d(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var GE=ud(),zE=cd(),BE=dd(),KE=fd(),WE=pd(),YE=md(),XE=gd(),JE=_d(),ZE=vd(),QE=bd(),eS=[GE.default,zE.default,BE.default,KE.default,WE.default,YE.default,XE.default,JE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ZE.default,QE.default];sa.default=eS});var oa=d(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.validateAdditionalItems=void 0;var Zt=T(),na=R(),tS={message:({params:{len:r}})=>(0,Zt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Zt._)`{limit: ${r}}`},rS={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:tS,code(r){let{parentSchema:e,it:t}=r,{items:s}=e;if(!Array.isArray(s)){(0,na.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}wd(r,s)}};function wd(r,e){let{gen:t,schema:s,data:i,keyword:n,it:o}=r;o.items=!0;let a=t.const("len",(0,Zt._)`${i}.length`);if(s===!1)r.setParams({len:e.length}),r.pass((0,Zt._)`${a} <= ${e.length}`);else if(typeof s=="object"&&!(0,na.alwaysValidSchema)(o,s)){let c=t.var("valid",(0,Zt._)`${a} <= ${e.length}`);t.if((0,Zt.not)(c),()=>u(c)),r.ok(c)}function u(c){t.forRange("i",e.length,a,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:na.Type.Num},c),o.allErrors||t.if((0,Zt.not)(c),()=>t.break())})}}_s.validateAdditionalItems=wd;_s.default=rS});var aa=d(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.validateTuple=void 0;var $d=T(),xi=R(),sS=Ie(),iS={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return Ed(r,"additionalItems",e);t.items=!0,!(0,xi.alwaysValidSchema)(t,e)&&r.ok((0,sS.validateArray)(r))}};function Ed(r,e,t=r.schema){let{gen:s,parentSchema:i,data:n,keyword:o,it:a}=r;l(i),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=xi.mergeEvaluated.items(s,t.length,a.items));let u=s.name("valid"),c=s.const("len",(0,$d._)`${n}.length`);t.forEach((h,f)=>{(0,xi.alwaysValidSchema)(a,h)||(s.if((0,$d._)`${c} > ${f}`,()=>r.subschema({keyword:o,schemaProp:f,dataProp:f},u)),r.ok(u))});function l(h){let{opts:f,errSchemaPath:p}=a,m=t.length,g=m===h.minItems&&(m===h.maxItems||h[e]===!1);if(f.strictTuples&&!g){let y=`"${o}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,xi.checkStrictMode)(a,y,f.strictTuples)}}}vs.validateTuple=Ed;vs.default=iS});var Sd=d(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var nS=aa(),oS={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,nS.validateTuple)(r,"items")};ua.default=oS});var xd=d(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var Od=T(),aS=R(),uS=Ie(),cS=oa(),lS={message:({params:{len:r}})=>(0,Od.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Od._)`{limit: ${r}}`},hS={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:lS,code(r){let{schema:e,parentSchema:t,it:s}=r,{prefixItems:i}=t;s.items=!0,!(0,aS.alwaysValidSchema)(s,e)&&(i?(0,cS.validateAdditionalItems)(r,i):r.ok((0,uS.validateArray)(r)))}};ca.default=hS});var Td=d(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var Re=T(),Ti=R(),dS={message:({params:{min:r,max:e}})=>e===void 0?(0,Re.str)`must contain at least ${r} valid item(s)`:(0,Re.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,Re._)`{minContains: ${r}}`:(0,Re._)`{minContains: ${r}, maxContains: ${e}}`},fS={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:dS,code(r){let{gen:e,schema:t,parentSchema:s,data:i,it:n}=r,o,a,{minContains:u,maxContains:c}=s;n.opts.next?(o=u===void 0?1:u,a=c):o=1;let l=e.const("len",(0,Re._)`${i}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,Ti.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Ti.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Ti.alwaysValidSchema)(n,t)){let g=(0,Re._)`${l} >= ${o}`;a!==void 0&&(g=(0,Re._)`${g} && ${l} <= ${a}`),r.pass(g);return}n.items=!0;let h=e.name("valid");a===void 0&&o===1?p(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),a!==void 0&&e.if((0,Re._)`${i}.length > 0`,f)):(e.let(h,!1),f()),r.result(h,()=>r.reset());function f(){let g=e.name("_valid"),y=e.let("count",0);p(g,()=>e.if(g,()=>m(y)))}function p(g,y){e.forRange("i",0,l,_=>{r.subschema({keyword:"contains",dataProp:_,dataPropType:Ti.Type.Num,compositeRule:!0},g),y()})}function m(g){e.code((0,Re._)`${g}++`),a===void 0?e.if((0,Re._)`${g} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,Re._)`${g} > ${a}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,Re._)`${g} >= ${o}`,()=>e.assign(h,!0)))}}};la.default=fS});var Pi=d(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.validateSchemaDeps=Qe.validatePropertyDeps=Qe.error=void 0;var ha=T(),pS=R(),bs=Ie();Qe.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let s=e===1?"property":"properties";return(0,ha.str)`must have ${s} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:s}})=>(0,ha._)`{property: ${r},
|
|
6
|
+
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,A._)`[${i}]`)}}}function tw({gen:r,parentData:e,parentDataProperty:t},s){r.if((0,A._)`${e} !== undefined`,()=>r.assign((0,A._)`${e}[${t}]`,s))}function yo(r,e,t,s=dr.Correct){let i=s===dr.Correct?A.operators.EQ:A.operators.NEQ,n;switch(r){case"null":return(0,A._)`${e} ${i} null`;case"array":n=(0,A._)`Array.isArray(${e})`;break;case"object":n=(0,A._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":n=o((0,A._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":n=o();break;default:return(0,A._)`typeof ${e} ${i} ${r}`}return s===dr.Correct?n:(0,A.not)(n);function o(a=A.nil){return(0,A.and)((0,A._)`typeof ${e} == "number"`,a,t?(0,A._)`isFinite(${e})`:A.nil)}}pe.checkDataType=yo;function _o(r,e,t,s){if(r.length===1)return yo(r[0],e,t,s);let i,n=(0,uh.toHash)(r);if(n.array&&n.object){let o=(0,A._)`typeof ${e} != "object"`;i=n.null?o:(0,A._)`!${e} || ${o}`,delete n.null,delete n.array,delete n.object}else i=A.nil;n.number&&delete n.integer;for(let o in n)i=(0,A.and)(i,yo(o,e,t,s));return i}pe.checkDataTypes=_o;var rw={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,A._)`{type: ${r}}`:(0,A._)`{type: ${e}}`};function vo(r){let e=sw(r);(0,Xb.reportError)(e,rw)}pe.reportTypeError=vo;function sw(r){let{gen:e,data:t,schema:s}=r,i=(0,uh.schemaRefOrVal)(r,s,"type");return{gen:e,keyword:"type",data:t,schema:s.type,schemaCode:i,schemaValue:i,parentSchema:s,params:{},it:r}}});var dh=d(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.assignDefaults=void 0;var fr=T(),iw=R();function nw(r,e){let{properties:t,items:s}=r.schema;if(e==="object"&&t)for(let i in t)hh(r,i,t[i].default);else e==="array"&&Array.isArray(s)&&s.forEach((i,n)=>hh(r,n,i.default))}pi.assignDefaults=nw;function hh(r,e,t){let{gen:s,compositeRule:i,data:n,opts:o}=r;if(t===void 0)return;let a=(0,fr._)`${n}${(0,fr.getProperty)(e)}`;if(i){(0,iw.checkStrictMode)(r,`default is ignored for: ${a}`);return}let u=(0,fr._)`${a} === undefined`;o.useDefaults==="empty"&&(u=(0,fr._)`${u} || ${a} === null || ${a} === ""`),s.if(u,(0,fr._)`${a} = ${(0,fr.stringify)(t)}`)}});var Re=d(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.validateUnion=F.validateArray=F.usePattern=F.callValidateCode=F.schemaProperties=F.allSchemaProperties=F.noPropertyInData=F.propertyInData=F.isOwnProperty=F.hasPropFunc=F.reportMissingProp=F.checkMissingProp=F.checkReportMissingProp=void 0;var z=T(),bo=R(),At=Ce(),ow=R();function aw(r,e){let{gen:t,data:s,it:i}=r;t.if($o(t,s,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,z._)`${e}`},!0),r.error()})}F.checkReportMissingProp=aw;function uw({gen:r,data:e,it:{opts:t}},s,i){return(0,z.or)(...s.map(n=>(0,z.and)($o(r,e,n,t.ownProperties),(0,z._)`${i} = ${n}`)))}F.checkMissingProp=uw;function cw(r,e){r.setParams({missingProperty:e},!0),r.error()}F.reportMissingProp=cw;function fh(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,z._)`Object.prototype.hasOwnProperty`})}F.hasPropFunc=fh;function wo(r,e,t){return(0,z._)`${fh(r)}.call(${e}, ${t})`}F.isOwnProperty=wo;function lw(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} !== undefined`;return s?(0,z._)`${i} && ${wo(r,e,t)}`:i}F.propertyInData=lw;function $o(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} === undefined`;return s?(0,z.or)(i,(0,z.not)(wo(r,e,t))):i}F.noPropertyInData=$o;function ph(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}F.allSchemaProperties=ph;function hw(r,e){return ph(e).filter(t=>!(0,bo.alwaysValidSchema)(r,e[t]))}F.schemaProperties=hw;function dw({schemaCode:r,data:e,it:{gen:t,topSchemaRef:s,schemaPath:i,errorPath:n},it:o},a,u,c){let l=c?(0,z._)`${r}, ${e}, ${s}${i}`:e,h=[[At.default.instancePath,(0,z.strConcat)(At.default.instancePath,n)],[At.default.parentData,o.parentData],[At.default.parentDataProperty,o.parentDataProperty],[At.default.rootData,At.default.rootData]];o.opts.dynamicRef&&h.push([At.default.dynamicAnchors,At.default.dynamicAnchors]);let f=(0,z._)`${l}, ${t.object(...h)}`;return u!==z.nil?(0,z._)`${a}.call(${u}, ${f})`:(0,z._)`${a}(${f})`}F.callValidateCode=dw;var fw=(0,z._)`new RegExp`;function pw({gen:r,it:{opts:e}},t){let s=e.unicodeRegExp?"u":"",{regExp:i}=e.code,n=i(t,s);return r.scopeValue("pattern",{key:n.toString(),ref:n,code:(0,z._)`${i.code==="new RegExp"?fw:(0,ow.useFunc)(r,i)}(${t}, ${s})`})}F.usePattern=pw;function mw(r){let{gen:e,data:t,keyword:s,it:i}=r,n=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(n,!0),o(()=>e.break()),n;function o(a){let u=e.const("len",(0,z._)`${t}.length`);e.forRange("i",0,u,c=>{r.subschema({keyword:s,dataProp:c,dataPropType:bo.Type.Num},n),e.if((0,z.not)(n),a)})}}F.validateArray=mw;function gw(r){let{gen:e,schema:t,keyword:s,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(u=>(0,bo.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((u,c)=>{let l=r.subschema({keyword:s,schemaProp:c,compositeRule:!0},a);e.assign(o,(0,z._)`${o} || ${a}`),r.mergeValidEvaluated(l,a)||e.if((0,z.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}F.validateUnion=gw});var yh=d(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.validateKeywordUsage=Qe.validSchemaType=Qe.funcKeywordCode=Qe.macroKeywordCode=void 0;var ye=T(),Xt=Ce(),yw=Re(),_w=ss();function vw(r,e){let{gen:t,keyword:s,schema:i,parentSchema:n,it:o}=r,a=e.macro.call(o.self,i,n,o),u=gh(t,s,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let c=t.name("valid");r.subschema({schema:a,schemaPath:ye.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},c),r.pass(c,()=>r.error(!0))}Qe.macroKeywordCode=vw;function bw(r,e){var t;let{gen:s,keyword:i,schema:n,parentSchema:o,$data:a,it:u}=r;$w(u,e);let c=!a&&e.compile?e.compile.call(u.self,n,o,u):e.validate,l=gh(s,i,c),h=s.let("valid");r.block$data(h,f),r.ok((t=e.valid)!==null&&t!==void 0?t:h);function f(){if(e.errors===!1)g(),e.modifying&&mh(r),y(()=>r.error());else{let _=e.async?p():m();e.modifying&&mh(r),y(()=>ww(r,_))}}function p(){let _=s.let("ruleErrs",null);return s.try(()=>g((0,ye._)`await `),w=>s.assign(h,!1).if((0,ye._)`${w} instanceof ${u.ValidationError}`,()=>s.assign(_,(0,ye._)`${w}.errors`),()=>s.throw(w))),_}function m(){let _=(0,ye._)`${l}.errors`;return s.assign(_,null),g(ye.nil),_}function g(_=e.async?(0,ye._)`await `:ye.nil){let w=u.opts.passContext?Xt.default.this:Xt.default.self,E=!("compile"in e&&!a||e.schema===!1);s.assign(h,(0,ye._)`${_}${(0,yw.callValidateCode)(r,l,w,E)}`,e.modifying)}function y(_){var w;s.if((0,ye.not)((w=e.valid)!==null&&w!==void 0?w:h),_)}}Qe.funcKeywordCode=bw;function mh(r){let{gen:e,data:t,it:s}=r;e.if(s.parentData,()=>e.assign(t,(0,ye._)`${s.parentData}[${s.parentDataProperty}]`))}function ww(r,e){let{gen:t}=r;t.if((0,ye._)`Array.isArray(${e})`,()=>{t.assign(Xt.default.vErrors,(0,ye._)`${Xt.default.vErrors} === null ? ${e} : ${Xt.default.vErrors}.concat(${e})`).assign(Xt.default.errors,(0,ye._)`${Xt.default.vErrors}.length`),(0,_w.extendErrors)(r)},()=>r.error())}function $w({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function gh(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,ye.stringify)(t)})}function Ew(r,e,t=!1){return!e.length||e.some(s=>s==="array"?Array.isArray(r):s==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==s||t&&typeof r>"u")}Qe.validSchemaType=Ew;function Sw({schema:r,opts:e,self:t,errSchemaPath:s},i,n){if(Array.isArray(i.keyword)?!i.keyword.includes(n):i.keyword!==n)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(r,a)))throw new Error(`parent schema must have dependencies of ${n}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(r[n])){let u=`keyword "${n}" value is invalid at path "${s}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(u);else throw new Error(u)}}Qe.validateKeywordUsage=Sw});var vh=d(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.extendSubschemaMode=It.extendSubschemaData=It.getSubschema=void 0;var et=T(),_h=R();function Ow(r,{keyword:e,schemaProp:t,schema:s,schemaPath:i,errSchemaPath:n,topSchemaRef:o}){if(e!==void 0&&s!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=r.schema[e];return t===void 0?{schema:a,schemaPath:(0,et._)`${r.schemaPath}${(0,et.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,et._)`${r.schemaPath}${(0,et.getProperty)(e)}${(0,et.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,_h.escapeFragment)(t)}`}}if(s!==void 0){if(i===void 0||n===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:i,topSchemaRef:o,errSchemaPath:n}}throw new Error('either "keyword" or "schema" must be passed')}It.getSubschema=Ow;function xw(r,e,{dataProp:t,dataPropType:s,data:i,dataTypes:n,propertyName:o}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:c,dataPathArr:l,opts:h}=e,f=a.let("data",(0,et._)`${e.data}${(0,et.getProperty)(t)}`,!0);u(f),r.errorPath=(0,et.str)`${c}${(0,_h.getErrorPath)(t,s,h.jsPropertySyntax)}`,r.parentDataProperty=(0,et._)`${t}`,r.dataPathArr=[...l,r.parentDataProperty]}if(i!==void 0){let c=i instanceof et.Name?i:a.let("data",i,!0);u(c),o!==void 0&&(r.propertyName=o)}n&&(r.dataTypes=n);function u(c){r.data=c,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,c]}}It.extendSubschemaData=xw;function Tw(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:s,createErrors:i,allErrors:n}){s!==void 0&&(r.compositeRule=s),i!==void 0&&(r.createErrors=i),n!==void 0&&(r.allErrors=n),r.jtdDiscriminator=e,r.jtdMetadata=t}It.extendSubschemaMode=Tw});var Eo=d((Kq,bh)=>{"use strict";bh.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var s,i,n;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(n=Object.keys(e),s=n.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(i=s;i--!==0;){var o=n[i];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var $h=d((Wq,wh)=>{"use strict";var Ct=wh.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var s=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};mi(e,s,i,r,"",r)};Ct.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ct.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ct.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ct.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 mi(r,e,t,s,i,n,o,a,u,c){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,i,n,o,a,u,c);for(var l in s){var h=s[l];if(Array.isArray(h)){if(l in Ct.arrayKeywords)for(var f=0;f<h.length;f++)mi(r,e,t,h[f],i+"/"+l+"/"+f,n,i,l,s,f)}else if(l in Ct.propsKeywords){if(h&&typeof h=="object")for(var p in h)mi(r,e,t,h[p],i+"/"+l+"/"+Pw(p),n,i,l,s,p)}else(l in Ct.keywords||r.allKeys&&!(l in Ct.skipKeywords))&&mi(r,e,t,h,i+"/"+l,n,i,l,s)}t(s,i,n,o,a,u,c)}}function Pw(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var ns=d(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getSchemaRefs=Ee.resolveUrl=Ee.normalizeId=Ee._getFullPath=Ee.getFullPath=Ee.inlineRef=void 0;var Aw=R(),Iw=Eo(),Cw=$h(),Rw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Nw(r,e=!0){return typeof r=="boolean"?!0:e===!0?!So(r):e?Eh(r)<=e:!1}Ee.inlineRef=Nw;var qw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function So(r){for(let e in r){if(qw.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(So)||typeof t=="object"&&So(t))return!0}return!1}function Eh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!Rw.has(t)&&(typeof r[t]=="object"&&(0,Aw.eachItem)(r[t],s=>e+=Eh(s)),e===1/0))return 1/0}return e}function Sh(r,e="",t){t!==!1&&(e=pr(e));let s=r.parse(e);return Oh(r,s)}Ee.getFullPath=Sh;function Oh(r,e){return r.serialize(e).split("#")[0]+"#"}Ee._getFullPath=Oh;var Dw=/#\/?$/;function pr(r){return r?r.replace(Dw,""):""}Ee.normalizeId=pr;function jw(r,e,t){return t=pr(t),r.resolve(e,t)}Ee.resolveUrl=jw;var kw=/^[a-z_][-a-z0-9._]*$/i;function Mw(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:s}=this.opts,i=pr(r[t]||e),n={"":i},o=Sh(s,i,!1),a={},u=new Set;return Cw(r,{allKeys:!0},(h,f,p,m)=>{if(m===void 0)return;let g=o+f,y=n[m];typeof h[t]=="string"&&(y=_.call(this,h[t])),w.call(this,h.$anchor),w.call(this,h.$dynamicAnchor),n[f]=y;function _(E){let O=this.opts.uriResolver.resolve;if(E=pr(y?O(y,E):E),u.has(E))throw l(E);u.add(E);let S=this.refs[E];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?c(h,S.schema,E):E!==pr(g)&&(E[0]==="#"?(c(h,a[E],E),a[E]=h):this.refs[E]=g),E}function w(E){if(typeof E=="string"){if(!kw.test(E))throw new Error(`invalid anchor "${E}"`);_.call(this,`#${E}`)}}}),a;function c(h,f,p){if(f!==void 0&&!Iw(h,f))throw l(p)}function l(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Ee.getSchemaRefs=Mw});var mr=d(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.getData=Rt.KeywordCxt=Rt.validateFunctionCode=void 0;var Ih=nh(),xh=is(),xo=go(),gi=is(),Lw=dh(),as=yh(),Oo=vh(),$=T(),x=Ce(),Fw=ns(),pt=R(),os=ss();function Vw(r){if(Nh(r)&&(qh(r),Rh(r))){Gw(r);return}Ch(r,()=>(0,Ih.topBoolOrEmptySchema)(r))}Rt.validateFunctionCode=Vw;function Ch({gen:r,validateName:e,schema:t,schemaEnv:s,opts:i},n){i.code.es5?r.func(e,(0,$._)`${x.default.data}, ${x.default.valCxt}`,s.$async,()=>{r.code((0,$._)`"use strict"; ${Th(t,i)}`),Hw(r,i),r.code(n)}):r.func(e,(0,$._)`${x.default.data}, ${Uw(i)}`,s.$async,()=>r.code(Th(t,i)).code(n))}function Uw(r){return(0,$._)`{${x.default.instancePath}="", ${x.default.parentData}, ${x.default.parentDataProperty}, ${x.default.rootData}=${x.default.data}${r.dynamicRef?(0,$._)`, ${x.default.dynamicAnchors}={}`:$.nil}}={}`}function Hw(r,e){r.if(x.default.valCxt,()=>{r.var(x.default.instancePath,(0,$._)`${x.default.valCxt}.${x.default.instancePath}`),r.var(x.default.parentData,(0,$._)`${x.default.valCxt}.${x.default.parentData}`),r.var(x.default.parentDataProperty,(0,$._)`${x.default.valCxt}.${x.default.parentDataProperty}`),r.var(x.default.rootData,(0,$._)`${x.default.valCxt}.${x.default.rootData}`),e.dynamicRef&&r.var(x.default.dynamicAnchors,(0,$._)`${x.default.valCxt}.${x.default.dynamicAnchors}`)},()=>{r.var(x.default.instancePath,(0,$._)`""`),r.var(x.default.parentData,(0,$._)`undefined`),r.var(x.default.parentDataProperty,(0,$._)`undefined`),r.var(x.default.rootData,x.default.data),e.dynamicRef&&r.var(x.default.dynamicAnchors,(0,$._)`{}`)})}function Gw(r){let{schema:e,opts:t,gen:s}=r;Ch(r,()=>{t.$comment&&e.$comment&&jh(r),Yw(r),s.let(x.default.vErrors,null),s.let(x.default.errors,0),t.unevaluated&&zw(r),Dh(r),Zw(r)})}function zw(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,$._)`${t}.evaluated`),e.if((0,$._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,$._)`${r.evaluated}.props`,(0,$._)`undefined`)),e.if((0,$._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,$._)`${r.evaluated}.items`,(0,$._)`undefined`))}function Th(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,$._)`/*# sourceURL=${t} */`:$.nil}function Bw(r,e){if(Nh(r)&&(qh(r),Rh(r))){Kw(r,e);return}(0,Ih.boolOrEmptySchema)(r,e)}function Rh({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function Nh(r){return typeof r.schema!="boolean"}function Kw(r,e){let{schema:t,gen:s,opts:i}=r;i.$comment&&t.$comment&&jh(r),Xw(r),Jw(r);let n=s.const("_errs",x.default.errors);Dh(r,n),s.var(e,(0,$._)`${n} === ${x.default.errors}`)}function qh(r){(0,pt.checkUnknownRules)(r),Ww(r)}function Dh(r,e){if(r.opts.jtd)return Ph(r,[],!1,e);let t=(0,xh.getSchemaTypes)(r.schema),s=(0,xh.coerceAndCheckDataType)(r,t);Ph(r,t,!s,e)}function Ww(r){let{schema:e,errSchemaPath:t,opts:s,self:i}=r;e.$ref&&s.ignoreKeywordsWithRef&&(0,pt.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function Yw(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,pt.checkStrictMode)(r,"default is ignored in the schema root")}function Xw(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,Fw.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function Jw(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function jh({gen:r,schemaEnv:e,schema:t,errSchemaPath:s,opts:i}){let n=t.$comment;if(i.$comment===!0)r.code((0,$._)`${x.default.self}.logger.log(${n})`);else if(typeof i.$comment=="function"){let o=(0,$.str)`${s}/$comment`,a=r.scopeValue("root",{ref:e.root});r.code((0,$._)`${x.default.self}.opts.$comment(${n}, ${o}, ${a}.schema)`)}}function Zw(r){let{gen:e,schemaEnv:t,validateName:s,ValidationError:i,opts:n}=r;t.$async?e.if((0,$._)`${x.default.errors} === 0`,()=>e.return(x.default.data),()=>e.throw((0,$._)`new ${i}(${x.default.vErrors})`)):(e.assign((0,$._)`${s}.errors`,x.default.vErrors),n.unevaluated&&Qw(r),e.return((0,$._)`${x.default.errors} === 0`))}function Qw({gen:r,evaluated:e,props:t,items:s}){t instanceof $.Name&&r.assign((0,$._)`${e}.props`,t),s instanceof $.Name&&r.assign((0,$._)`${e}.items`,s)}function Ph(r,e,t,s){let{gen:i,schema:n,data:o,allErrors:a,opts:u,self:c}=r,{RULES:l}=c;if(n.$ref&&(u.ignoreKeywordsWithRef||!(0,pt.schemaHasRulesButRef)(n,l))){i.block(()=>Mh(r,"$ref",l.all.$ref.definition));return}u.jtd||e$(r,e),i.block(()=>{for(let f of l.rules)h(f);h(l.post)});function h(f){(0,xo.shouldUseGroup)(n,f)&&(f.type?(i.if((0,gi.checkDataType)(f.type,o,u.strictNumbers)),Ah(r,f),e.length===1&&e[0]===f.type&&t&&(i.else(),(0,gi.reportTypeError)(r)),i.endIf()):Ah(r,f),a||i.if((0,$._)`${x.default.errors} === ${s||0}`))}}function Ah(r,e){let{gen:t,schema:s,opts:{useDefaults:i}}=r;i&&(0,Lw.assignDefaults)(r,e.type),t.block(()=>{for(let n of e.rules)(0,xo.shouldUseRule)(s,n)&&Mh(r,n.keyword,n.definition,e.type)})}function e$(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(t$(r,e),r.opts.allowUnionTypes||r$(r,e),s$(r,r.dataTypes))}function t$(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{kh(r.dataTypes,t)||To(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),n$(r,e)}}function r$(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&To(r,"use allowUnionTypes to allow union type keyword")}function s$(r,e){let t=r.self.RULES.all;for(let s in t){let i=t[s];if(typeof i=="object"&&(0,xo.shouldUseRule)(r.schema,i)){let{type:n}=i.definition;n.length&&!n.some(o=>i$(e,o))&&To(r,`missing type "${n.join(",")}" for keyword "${s}"`)}}}function i$(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function kh(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function n$(r,e){let t=[];for(let s of r.dataTypes)kh(e,s)?t.push(s):e.includes("integer")&&s==="number"&&t.push("integer");r.dataTypes=t}function To(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,pt.checkStrictMode)(r,e,r.opts.strictTypes)}var yi=class{constructor(e,t,s){if((0,as.validateKeywordUsage)(e,t,s),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=s,this.data=e.data,this.schema=e.schema[s],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,pt.schemaRefOrVal)(e,this.schema,s,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Lh(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,as.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${s} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",x.default.errors))}result(e,t,s){this.failResult((0,$.not)(e),t,s)}failResult(e,t,s){this.gen.if(e),s?s():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,$.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,$._)`${t} !== undefined && (${(0,$.or)(this.invalid$data(),e)})`)}error(e,t,s){if(t){this.setParams(t),this._error(e,s),this.setParams({});return}this._error(e,s)}_error(e,t){(e?os.reportExtraError:os.reportError)(this,this.def.error,t)}$dataError(){(0,os.reportError)(this,this.def.$dataError||os.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,os.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,s=$.nil){this.gen.block(()=>{this.check$data(e,s),t()})}check$data(e=$.nil,t=$.nil){if(!this.$data)return;let{gen:s,schemaCode:i,schemaType:n,def:o}=this;s.if((0,$.or)((0,$._)`${i} === undefined`,t)),e!==$.nil&&s.assign(e,!0),(n.length||o.validateSchema)&&(s.elseIf(this.invalid$data()),this.$dataError(),e!==$.nil&&s.assign(e,!1)),s.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:s,def:i,it:n}=this;return(0,$.or)(o(),a());function o(){if(s.length){if(!(t instanceof $.Name))throw new Error("ajv implementation error");let u=Array.isArray(s)?s:[s];return(0,$._)`${(0,gi.checkDataTypes)(u,t,n.opts.strictNumbers,gi.DataType.Wrong)}`}return $.nil}function a(){if(i.validateSchema){let u=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,$._)`!${u}(${t})`}return $.nil}}subschema(e,t){let s=(0,Oo.getSubschema)(this.it,e);(0,Oo.extendSubschemaData)(s,this.it,e),(0,Oo.extendSubschemaMode)(s,e);let i={...this.it,...s,items:void 0,props:void 0};return Bw(i,t),i}mergeEvaluated(e,t){let{it:s,gen:i}=this;s.opts.unevaluated&&(s.props!==!0&&e.props!==void 0&&(s.props=pt.mergeEvaluated.props(i,e.props,s.props,t)),s.items!==!0&&e.items!==void 0&&(s.items=pt.mergeEvaluated.items(i,e.items,s.items,t)))}mergeValidEvaluated(e,t){let{it:s,gen:i}=this;if(s.opts.unevaluated&&(s.props!==!0||s.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,$.Name)),!0}};Rt.KeywordCxt=yi;function Mh(r,e,t,s){let i=new yi(r,t,e);"code"in t?t.code(i,s):i.$data&&t.validate?(0,as.funcKeywordCode)(i,t):"macro"in t?(0,as.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,as.funcKeywordCode)(i,t)}var o$=/^\/(?:[^~]|~0|~1)*$/,a$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Lh(r,{dataLevel:e,dataNames:t,dataPathArr:s}){let i,n;if(r==="")return x.default.rootData;if(r[0]==="/"){if(!o$.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,n=x.default.rootData}else{let c=a$.exec(r);if(!c)throw new Error(`Invalid JSON-pointer: ${r}`);let l=+c[1];if(i=c[2],i==="#"){if(l>=e)throw new Error(u("property/index",l));return s[e-l]}if(l>e)throw new Error(u("data",l));if(n=t[e-l],!i)return n}let o=n,a=i.split("/");for(let c of a)c&&(n=(0,$._)`${n}${(0,$.getProperty)((0,pt.unescapeJsonPointer)(c))}`,o=(0,$._)`${o} && ${n}`);return o;function u(c,l){return`Cannot access ${c} ${l} levels up, current level is ${e}`}}Rt.getData=Lh});var us=d(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});var Po=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Ao.default=Po});var gr=d(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});var Io=ns(),Co=class extends Error{constructor(e,t,s,i){super(i||`can't resolve reference ${s} from id ${t}`),this.missingRef=(0,Io.resolveUrl)(e,t,s),this.missingSchema=(0,Io.normalizeId)((0,Io.getFullPath)(e,this.missingRef))}};Ro.default=Co});var cs=d(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.resolveSchema=Ne.getCompilingSchema=Ne.resolveRef=Ne.compileSchema=Ne.SchemaEnv=void 0;var He=T(),u$=us(),Jt=Ce(),Ge=ns(),Fh=R(),c$=mr(),yr=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let s;typeof e.schema=="object"&&(s=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Ge.normalizeId)(s?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=s?.$async,this.refs={}}};Ne.SchemaEnv=yr;function qo(r){let e=Vh.call(this,r);if(e)return e;let t=(0,Ge.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:s,lines:i}=this.opts.code,{ownProperties:n}=this.opts,o=new He.CodeGen(this.scope,{es5:s,lines:i,ownProperties:n}),a;r.$async&&(a=o.scopeValue("Error",{ref:u$.default,code:(0,He._)`require("ajv/dist/runtime/validation_error").default`}));let u=o.scopeName("validate");r.validateName=u;let c={gen:o,allErrors:this.opts.allErrors,data:Jt.default.data,parentData:Jt.default.parentData,parentDataProperty:Jt.default.parentDataProperty,dataNames:[Jt.default.data],dataPathArr:[He.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,He.stringify)(r.schema)}:{ref:r.schema}),validateName:u,ValidationError:a,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:He.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,He._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(r),(0,c$.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();l=`${o.scopeRefs(Jt.default.scope)}return ${h}`,this.opts.code.process&&(l=this.opts.code.process(l,r));let p=new Function(`${Jt.default.self}`,`${Jt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:p}),p.errors=null,p.schema=r.schema,p.schemaEnv=r,r.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:u,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:m,items:g}=c;p.evaluated={props:m instanceof He.Name?void 0:m,items:g instanceof He.Name?void 0:g,dynamicProps:m instanceof He.Name,dynamicItems:g instanceof He.Name},p.source&&(p.source.evaluated=(0,He.stringify)(p.evaluated))}return r.validate=p,r}catch(h){throw delete r.validate,delete r.validateName,l&&this.logger.error("Error compiling schema, function code:",l),h}finally{this._compilations.delete(r)}}Ne.compileSchema=qo;function l$(r,e,t){var s;t=(0,Ge.resolveUrl)(this.opts.uriResolver,e,t);let i=r.refs[t];if(i)return i;let n=f$.call(this,r,t);if(n===void 0){let o=(s=r.localRefs)===null||s===void 0?void 0:s[t],{schemaId:a}=this.opts;o&&(n=new yr({schema:o,schemaId:a,root:r,baseId:e}))}if(n!==void 0)return r.refs[t]=h$.call(this,n)}Ne.resolveRef=l$;function h$(r){return(0,Ge.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:qo.call(this,r)}function Vh(r){for(let e of this._compilations)if(d$(e,r))return e}Ne.getCompilingSchema=Vh;function d$(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function f$(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||_i.call(this,r,e)}function _i(r,e){let t=this.opts.uriResolver.parse(e),s=(0,Ge._getFullPath)(this.opts.uriResolver,t),i=(0,Ge.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&s===i)return No.call(this,t,r);let n=(0,Ge.normalizeId)(s),o=this.refs[n]||this.schemas[n];if(typeof o=="string"){let a=_i.call(this,r,o);return typeof a?.schema!="object"?void 0:No.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||qo.call(this,o),n===(0,Ge.normalizeId)(e)){let{schema:a}=o,{schemaId:u}=this.opts,c=a[u];return c&&(i=(0,Ge.resolveUrl)(this.opts.uriResolver,i,c)),new yr({schema:a,schemaId:u,root:r,baseId:i})}return No.call(this,t,o)}}Ne.resolveSchema=_i;var p$=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function No(r,{baseId:e,schema:t,root:s}){var i;if(((i=r.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let u=t[(0,Fh.unescapeFragment)(a)];if(u===void 0)return;t=u;let c=typeof t=="object"&&t[this.opts.schemaId];!p$.has(a)&&c&&(e=(0,Ge.resolveUrl)(this.opts.uriResolver,e,c))}let n;if(typeof t!="boolean"&&t.$ref&&!(0,Fh.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Ge.resolveUrl)(this.opts.uriResolver,e,t.$ref);n=_i.call(this,s,a)}let{schemaId:o}=this.opts;if(n=n||new yr({schema:t,schemaId:o,root:s,baseId:e}),n.schema!==n.root.schema)return n}});var Uh=d((eD,m$)=>{m$.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Fo=d((tD,Yh)=>{"use strict";var g$=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),jo=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),y$=RegExp.prototype.test.bind(/^\d*$/u),Zt=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),ko=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Gh=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Mo=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),_$=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Se=new Array(256);{let r="0123456789ABCDEF";for(let e=0;e<256;e++)Se[e]="%"+r[e>>4]+r[e&15]}function me(r){return r<2048?Se[192|r>>6]+Se[128|r&63]:r<65536?Se[224|r>>12]+Se[128|r>>6&63]+Se[128|r&63]:Se[240|r>>18]+Se[128|r>>12&63]+Se[128|r>>6&63]+Se[128|r&63]}function v$(r){let e="",t=0,s=0;for(s=0;s<r.length;s++)if(t=r[s].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[s];break}for(s+=1;s<r.length;s++){if(t=r[s].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[s]}return e}var b$=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),w$=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),$$=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),E$=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function S$(r){if(r.length===0)return!1;for(let e=0;e<r.length;e++)if(!$$(r[e])){if(r[e]==="%"&&e+2<r.length&&Zt(r.slice(e+1,e+3))){e+=2;continue}return!1}return!0}function Hh(r){let e=-1,t=0,s=-1,i=0;for(let a=0;a<r.length;a++)r[a]==="0"?(s===-1&&(s=a),i++,i>t&&(t=i,e=s)):(s=-1,i=0);if(t<2)return r.join(":");let n=r.slice(0,e).join(":"),o=r.slice(e+t).join(":");return n+"::"+o}function O$(r){let e=r.indexOf("::");if(e!==-1&&r.indexOf("::",e+1)!==-1)return;let t=e===-1?r.split(":"):r.slice(0,e).split(":"),s=e===-1?[]:r.slice(e+2).split(":");e!==-1&&(t.length===1&&t[0]===""&&(t.length=0),s.length===1&&s[0]===""&&(s.length=0));let i=t.concat(s),n=0;for(let a=0;a<i.length;a++){let u=i[a];if(u==="")return;if(u.indexOf(".")!==-1){if(a!==i.length-1||e!==-1&&s.length===0||!jo(u))return;n+=2;continue}if(!b$(u))return;i[a]=parseInt(u,16).toString(16),n++}if(e===-1)return n!==8?void 0:Hh(i);if(n>=8)return;let o=i.slice(0,t.length);for(let a=n;a<8;a++)o.push("0");for(let a=t.length;a<i.length;a++)o.push(i[a]);return Hh(o)}function Do(r){let e=r[0]==="["&&r[r.length-1]==="]";if((r[0]==="["||r[r.length-1]==="]")&&!e)return{host:r,isIPV6:!1,error:!0};let s=e?r.slice(1,-1):r;if(e&&w$(s))return s=s.toLowerCase(),{host:`[${s}]`,escapedHost:s,isIPV6:!1,isIPVFuture:!0};if(x$(s,":")<2)return{host:r,isIPV6:!1,error:e};let i="",n=s.indexOf("%");if(n!==-1){let a=s.slice(n,n+3).toLowerCase()==="%25"?3:1;if(i=s.slice(n+a),!S$(i))return{host:r,isIPV6:!1,error:!0};s=s.slice(0,n)}let o=O$(s);return o===void 0?{host:r,isIPV6:!1,error:!0}:{host:o+(i?"%"+i:""),escapedHost:o+(i?"%25"+i:""),isIPV6:!0}}function x$(r,e){let t=0;for(let s=0;s<r.length;s++)r[s]===e&&t++;return t}function T$(r){let e=r,t=[],s=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){t.push("/");break}}else if(i===3&&e==="/.."){t.length!==0&&t.pop(),t.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),t.length!==0&&t.pop();continue}}if((s=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,s)),e=e.slice(s)}return t.join("")}var P$={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},A$=/[@/?#:]/g,I$=/[@/?#]/g;function zh(r,e){let t=e?I$:A$;return t.lastIndex=0,r.replace(t,s=>P$[s])}function Bh(r,e=!1){if(r.indexOf("%")===-1)return r;let t="";for(let s=0;s<r.length;s++){if(r[s]==="%"&&s+2<r.length){let i=r.slice(s+1,s+3);if(Zt(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));e&&ko(o)?t+=o:t+="%"+n,s+=2;continue}}t+=r[s]}return t}function C$(r){let e="";for(let t=0;t<r.length;t++){let s=r[t];if(s==="%"&&t+2<r.length){let i=r.slice(t+1,t+3);if(Zt(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));o!=="."&&ko(o)?e+=o:e+="%"+n,t+=2;continue}}if(Gh(s))e+=s;else{let i=r.charCodeAt(t);if(i<128)e+=Wh(i)?s:Se[i];else if(i<55296||i>57343)e+=me(i);else if(i<=56319&&t+1<r.length){let n=r.charCodeAt(t+1);n>=56320&&n<=57343?(e+=me(65536+(i-55296<<10)+(n-56320)),t++):e+=me(65533)}else e+=me(65533)}}return e}function R$(r,e=!1){let t="",s=e&&r[0]!=="/";for(let i=0;i<r.length;i++){let n=r[i];if(n==="%"&&i+2<r.length){let o=r.slice(i+1,i+3);if(Zt(o)){t+="%"+o.toUpperCase(),i+=2;continue}}if(n==="/"&&(s=!1),Gh(n)&&(n!==":"||!s))t+=n;else{let o=r.charCodeAt(i);if(o<128)t+=Se[o];else if(o<55296||o>57343)t+=me(o);else if(o<=56319&&i+1<r.length){let a=r.charCodeAt(i+1);a>=56320&&a<=57343?(t+=me(65536+(o-55296<<10)+(a-56320)),i++):t+=me(65533)}else t+=me(65533)}}return t}function Lo(r,e){let t="";for(let s=0;s<r.length;s++){let i=r[s];if(i==="%"&&s+2<r.length){let n=r.slice(s+1,s+3);if(Zt(n)){t+="%"+n.toUpperCase(),s+=2;continue}}if(e(i))t+=i;else{let n=r.charCodeAt(s);if(n<128)t+=Se[n];else if(n<55296||n>57343)t+=me(n);else if(n<=56319&&s+1<r.length){let o=r.charCodeAt(s+1);o>=56320&&o<=57343?(t+=me(65536+(n-55296<<10)+(o-56320)),s++):t+=me(65533)}else t+=me(65533)}}return t}function Kh(r){return Lo(r,_$)}function N$(r){return Lo(r,Mo)}function q$(r){return Lo(r,Mo)}function Wh(r){return r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===42||r===43||r===45||r===46||r===47||r===64||r===95}function D$(r){let e="";for(let t=0;t<r.length;t++){let s=r[t];if(s==="%"&&t+2<r.length){let i=r.slice(t+1,t+3);if(Zt(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));ko(o)?e+=o:e+="%"+n,t+=2;continue}}if(Mo(s))e+=s;else{let i=r.charCodeAt(t);if(i<128)e+=Wh(i)?s:Se[i];else if(i<55296||i>57343)e+=me(i);else if(i<=56319&&t+1<r.length){let n=r.charCodeAt(t+1);n>=56320&&n<=57343?(e+=me(65536+(i-55296<<10)+(n-56320)),t++):e+=me(65533)}else e+=me(65533)}}return e}function j$(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let s=r.slice(t+1,t+3);if(Zt(s)){e+="%"+s.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function k$(r){let e=[];if(r.userinfo!==void 0&&(e.push(Kh(r.userinfo)),e.push("@")),r.host!==void 0){let t=r.host;if(!jo(t)){let s=Do(t);s.isIPV6!==!0&&s.isIPVFuture!==!0&&(t=Bh(t,!0),s=Do(t)),s.isIPV6===!0||s.isIPVFuture===!0?t=`[${s.escapedHost}]`:t=zh(t,!1)}e.push(t)}if(typeof r.port=="number"||typeof r.port=="string"){let t=String(r.port);if(!y$(t))throw new TypeError("URI port is malformed.");e.push(":"),e.push(t)}return e.length?e.join(""):void 0}Yh.exports={nonSimpleDomain:E$,recomposeAuthority:k$,reescapeHostDelimiters:zh,normalizePercentEncoding:Bh,normalizePathEncoding:C$,serializePathEncoding:R$,normalizeQueryFragmentEncoding:D$,encodeUserinfo:Kh,encodeQuery:N$,encodeFragment:q$,escapePreservingEscapes:j$,removeDotSegments:T$,isIPv4:jo,isUUID:g$,normalizeIPv6:Do,stringArrayToHexStripped:v$}});var ed=d((rD,Qh)=>{"use strict";var{isUUID:M$}=Fo(),L$=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,F$=["http","https","ws","wss","urn","urn:uuid"];function V$(r){return F$.indexOf(r)!==-1}function Vo(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function Xh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function Jh(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function U$(r){return r.secure=Vo(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function H$(r){if((r.port===(Vo(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let e=r.resourceName.indexOf("?"),t=e===-1?r.resourceName:r.resourceName.slice(0,e);r.path=t&&t!=="/"?t:void 0,r.query=e===-1?void 0:r.resourceName.slice(e+1),r.resourceName=void 0}return r.fragment=void 0,r}function G$(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(L$);if(t&&t[0]===r.path){let s=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let i=`${s}:${e.nid||r.nid}`,n=Uo(i);r.path=void 0,n&&(r=n.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function z$(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",s=r.nid.toLowerCase(),i=`${t}:${e.nid||s}`,n=Uo(i);n&&(r=n.serialize(r,e));let o=r,a=r.nss;return o.path=`${s||e.nid}:${a}`,e.skipEscape=!0,o}function B$(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!M$(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function K$(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var Zh={scheme:"http",domainHost:!0,parse:Xh,serialize:Jh},W$={scheme:"https",domainHost:Zh.domainHost,parse:Xh,serialize:Jh},vi={scheme:"ws",domainHost:!0,parse:U$,serialize:H$},Y$={scheme:"wss",domainHost:vi.domainHost,parse:vi.parse,serialize:vi.serialize},X$={scheme:"urn",parse:G$,serialize:z$,skipNormalize:!0},J$={scheme:"urn:uuid",parse:B$,serialize:K$,skipNormalize:!0},bi={http:Zh,https:W$,ws:vi,wss:Y$,urn:X$,"urn:uuid":J$};Object.setPrototypeOf(bi,null);function Uo(r){return r&&(bi[r]||bi[r.toLowerCase()])||void 0}Qh.exports={wsIsSecure:Vo,SCHEMES:bi,isValidSchemeName:V$,getSchemeHandler:Uo}});var fd=d((sD,Ei)=>{"use strict";var{normalizeIPv6:nd,removeDotSegments:hs,recomposeAuthority:Z$,normalizePercentEncoding:Ho,normalizePathEncoding:Q$,serializePathEncoding:td,normalizeQueryFragmentEncoding:rd,encodeQuery:eE,encodeFragment:tE,reescapeHostDelimiters:rE,isIPv4:od,nonSimpleDomain:sE}=Fo(),{SCHEMES:ad,getSchemeHandler:Go}=ed(),ud=/^[A-Za-z][A-Za-z0-9+.-]*$/u,cd="URI scheme is malformed.";function sd(r){let e=unescape(String(r));if(!ud.test(e))throw new TypeError(cd);return e}function iE(r,e){return typeof r=="string"?r=dE(r,e):typeof r=="object"&&(r=$i(Qt(r,e),e)),r}function nE(r,e,t){let s=t?Object.assign({scheme:"null"},t):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:u,malformedScheme:c}=wi(r,s),{parsed:l,malformedAuthorityOrPort:h,malformedPercentEncoding:f,malformedSchemeSpecific:p,malformedHost:m,malformedScheme:g}=wi(e,s);if(n||h||o||f||a||p||u||m||c||g)throw new Error(i.error||l.error||"URI is malformed.");let y=ld(i,l,s,!0),_=Go(t&&t.scheme||y.scheme),w=y.host,E=w!==void 0&&w!==""&&(od(w)||nd(w).isIPV6);hd(y,t||{},_,E);let O=w&&w.indexOf("%")!==-1&&!/\P{ASCII}/u.test(w);if(y.error&&!O)throw new Error(y.error);return s.skipEscape=!0,Qt(y,s)}function ld(r,e,t,s){let i={};return s||(r=$i(Qt(r,t),t),e=$i(Qt(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=hs(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=hs(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=hs(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+e.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=hs(i.path)),i.query=e.query):(i.path=r.path,e.query!==void 0?i.query=e.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=e.fragment,i}function oE(r,e,t){let s=id(r,t),i=id(e,t);return s!==void 0&&i!==void 0&&s===i}function Qt(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},s=Object.assign({},e),i=[];t.scheme&&(t.scheme=sd(t.scheme));let n=Go(s.scheme||t.scheme);n&&n.serialize&&n.serialize(t,s);let o=t.userinfo!==void 0||t.host!==void 0||t.port!==void 0,a=!s.skipEscape&&t.scheme===void 0&&!o;t.path!==void 0&&(s.skipEscape?t.path=Ho(t.path):t.path=td(t.path,a)),s.reference!=="suffix"&&t.scheme&&(t.scheme=sd(t.scheme),i.push(t.scheme,":"));let u=Z$(t);if(u!==void 0&&(s.reference!=="suffix"&&i.push("//"),i.push(u),t.path&&t.path[0]!=="/"&&i.push("/")),t.path!==void 0){let c=t.path;!s.absolutePath&&(!n||!n.absolutePath)&&(c=hs(c)),a&&(c=td(c,!0)),u===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),i.push(c)}return t.query!==void 0&&i.push("?",eE(t.query)),t.fragment!==void 0&&i.push("#",tE(t.fragment)),i.join("")}var aE=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,uE=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,cE=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function lE(r,e){if(e[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function ls(r){if(r===void 0)return!1;let e=r.indexOf("%");for(;e!==-1;){if(e+2>=r.length||!/^[\da-f]{2}$/iu.test(r.slice(e+1,e+3)))return!0;e=r.indexOf("%",e+3)}return!1}function zo(r){return r[0]==="["&&r[r.length-1]==="]"}function hE(r){let e=r[4];return ls(r[3])||e!==void 0&&!zo(e)&&ls(e)||ls(r[6])||ls(r[7])||ls(r[8])}function hd(r,e,t,s){if(!e.unicodeSupport&&(!t||!t.unicodeSupport)&&r.host&&!zo(r.host)&&(e.domainHost||t&&t.domainHost)&&s===!1&&sE(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(i){return r.error=r.error||"Host's domain name can not be converted to ASCII: "+i,!0}return!1}function wi(r,e){let t=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,n=!1,o=!1,a=!1,u=!1,c=!1,l=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let h=r.match(uE);h!==null&&h[1].indexOf("\\")!==-1&&(s.error="URI authority must not contain a literal backslash.",i=!0);let f=r.match(cE);if(f!==null){let m=f[1],g=m.replace(/[\t\n\r]/g,"");g.length>=2&&(g.slice(0,2)!=="//"?(s.error=s.error||"URI authority must not contain a literal backslash.",i=!0):m.length!==g.length&&(s.error=s.error||"URI authority introducer must not contain whitespace.",i=!0))}let p=r.match(aE);if(p){if(s.scheme=p[1],s.userinfo=p[3],s.host=p[4],s.port=parseInt(p[5],10),s.path=p[6]||"",s.query=p[7],s.fragment=p[8],s.scheme!==void 0){let y=unescape(s.scheme);ud.test(y)?s.scheme=y.toLowerCase():(s.error=s.error||cd,c=!0)}n=hE(p),n&&(s.error=s.error||"URI contains malformed percent-encoding."),isNaN(s.port)&&(s.port=p[5]);let m=lE(s,p);if(m!==void 0&&(s.error=s.error||m,i=!0),s.host)if(od(s.host)===!1){let _=zo(s.host),w=s.host.indexOf("[")!==-1||s.host.indexOf("]")!==-1,E=nd(s.host);l=E.isIPV6||E.isIPVFuture===!0,u=w&&(!_||E.error===!0),s.host=l?E.host:E.host.toLowerCase(),u&&(s.error=s.error||"URI host is malformed.",i=!0)}else l=!0;s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference="same-document":s.scheme===void 0?s.reference="relative":s.fragment===void 0?s.reference="absolute":s.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==s.reference&&(s.error=s.error||"URI is not a "+t.reference+" reference.");let g=Go(t.scheme||s.scheme);if(u||(a=hd(s,t,g,l)),r.indexOf("%")!==-1&&s.host!==void 0&&!u){let y=l?s.host:Ho(s.host,!0);l||(y=Ho(y.toLowerCase())),s.host=rE(y,l)}(!g||g&&!g.skipNormalize)&&(s.path&&(s.path=Q$(s.path)),s.query&&(s.query=rd(s.query)),s.fragment&&(s.fragment=rd(s.fragment))),g&&g.parse&&(g.parse(s,t),g===ad.urn&&s.nid===void 0&&(o=!0))}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:c}}function $i(r,e){return wi(r,e).parsed}function dE(r,e){return dd(r,e).normalized}function dd(r,e){let{parsed:t,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:o,malformedScheme:a}=wi(r,e);return{normalized:s||i||n||o||a?r:Qt(t,e),malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:n,malformedHost:o,malformedScheme:a}}function id(r,e){if(typeof r!="string"&&typeof r!="object")return;let t;try{t=typeof r=="string"?r:Qt(r,e)}catch{return}let{normalized:s,malformedAuthorityOrPort:i,malformedPercentEncoding:n,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:u}=dd(t,e);return i||n||o||a||u?void 0:s}var Bo={SCHEMES:ad,normalize:iE,resolve:nE,resolveComponent:ld,equal:oE,serialize:Qt,parse:$i};Ei.exports=Bo;Ei.exports.default=Bo;Ei.exports.fastUri=Bo});var md=d(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var pd=fd();pd.code='require("ajv/dist/runtime/uri").default';Ko.default=pd});var Xo=d(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.CodeGen=oe.Name=oe.nil=oe.stringify=oe.str=oe._=oe.KeywordCxt=void 0;var fE=mr();Object.defineProperty(oe,"KeywordCxt",{enumerable:!0,get:function(){return fE.KeywordCxt}});var _r=T();Object.defineProperty(oe,"_",{enumerable:!0,get:function(){return _r._}});Object.defineProperty(oe,"str",{enumerable:!0,get:function(){return _r.str}});Object.defineProperty(oe,"stringify",{enumerable:!0,get:function(){return _r.stringify}});Object.defineProperty(oe,"nil",{enumerable:!0,get:function(){return _r.nil}});Object.defineProperty(oe,"Name",{enumerable:!0,get:function(){return _r.Name}});Object.defineProperty(oe,"CodeGen",{enumerable:!0,get:function(){return _r.CodeGen}});var pE=us(),bd=gr(),mE=mo(),ds=cs(),gE=T(),fs=ns(),Si=is(),Yo=R(),gd=Uh(),yE=md(),wd=(r,e)=>new RegExp(r,e);wd.code="new RegExp";var _E=["removeAdditional","useDefaults","coerceTypes"],vE=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),bE={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."},wE={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},yd=200;function $E(r){var e,t,s,i,n,o,a,u,c,l,h,f,p,m,g,y,_,w,E,O,S,he,U,Le,Pe;let G=r.strict,N=(e=r.code)===null||e===void 0?void 0:e.optimize,ei=N===!0||N===void 0?1:N||0,Gr=(s=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&s!==void 0?s:wd,Fe=(i=r.uriResolver)!==null&&i!==void 0?i:yE.default;return{strictSchema:(o=(n=r.strictSchema)!==null&&n!==void 0?n:G)!==null&&o!==void 0?o:!0,strictNumbers:(u=(a=r.strictNumbers)!==null&&a!==void 0?a:G)!==null&&u!==void 0?u:!0,strictTypes:(l=(c=r.strictTypes)!==null&&c!==void 0?c:G)!==null&&l!==void 0?l:"log",strictTuples:(f=(h=r.strictTuples)!==null&&h!==void 0?h:G)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=r.strictRequired)!==null&&p!==void 0?p:G)!==null&&m!==void 0?m:!1,code:r.code?{...r.code,optimize:ei,regExp:Gr}:{optimize:ei,regExp:Gr},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:yd,loopEnum:(y=r.loopEnum)!==null&&y!==void 0?y:yd,meta:(_=r.meta)!==null&&_!==void 0?_:!0,messages:(w=r.messages)!==null&&w!==void 0?w:!0,inlineRefs:(E=r.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(O=r.schemaId)!==null&&O!==void 0?O:"$id",addUsedSchema:(S=r.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(he=r.validateSchema)!==null&&he!==void 0?he:!0,validateFormats:(U=r.validateFormats)!==null&&U!==void 0?U:!0,unicodeRegExp:(Le=r.unicodeRegExp)!==null&&Le!==void 0?Le:!0,int32range:(Pe=r.int32range)!==null&&Pe!==void 0?Pe:!0,uriResolver:Fe}}var ps=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...$E(e)};let{es5:t,lines:s}=this.opts.code;this.scope=new gE.ValueScope({scope:{},prefixes:vE,es5:t,lines:s}),this.logger=PE(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,mE.getRules)(),_d.call(this,bE,e,"NOT SUPPORTED"),_d.call(this,wE,e,"DEPRECATED","warn"),this._metaOpts=xE.call(this),e.formats&&SE.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&OE.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),EE.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:s}=this.opts,i=gd;s==="id"&&(i={...gd},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[s],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let s;if(typeof e=="string"){if(s=this.getSchema(e),!s)throw new Error(`no schema with key or ref "${e}"`)}else s=this.compile(e);let i=s(t);return"$async"in s||(this.errors=s.errors),i}compile(e,t){let s=this._addSchema(e,t);return s.validate||this._compileSchemaEnv(s)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:s}=this.opts;return i.call(this,e,t);async function i(l,h){await n.call(this,l.$schema);let f=this._addSchema(l,h);return f.validate||o.call(this,f)}async function n(l){l&&!this.getSchema(l)&&await i.call(this,{$ref:l},!0)}async function o(l){try{return this._compileSchemaEnv(l)}catch(h){if(!(h instanceof bd.default))throw h;return a.call(this,h),await u.call(this,h.missingSchema),o.call(this,l)}}function a({missingSchema:l,missingRef:h}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${h} cannot be resolved`)}async function u(l){let h=await c.call(this,l);this.refs[l]||await n.call(this,h.$schema),this.refs[l]||this.addSchema(h,l,t)}async function c(l){let h=this._loading[l];if(h)return h;try{return await(this._loading[l]=s(l))}finally{delete this._loading[l]}}}addSchema(e,t,s,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,s,i);return this}let n;if(typeof e=="object"){let{schemaId:o}=this.opts;if(n=e[o],n!==void 0&&typeof n!="string")throw new Error(`schema ${o} must be string`)}return t=(0,fs.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,s,t,i,!0),this}addMetaSchema(e,t,s=this.opts.validateSchema){return this.addSchema(e,t,!0,s),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let s;if(s=e.$schema,s!==void 0&&typeof s!="string")throw new Error("$schema must be a string");if(s=s||this.opts.defaultMeta||this.defaultMeta(),!s)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(s,e);if(!i&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw new Error(n)}return i}getSchema(e){let t;for(;typeof(t=vd.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:s}=this.opts,i=new ds.SchemaEnv({schema:{},schemaId:s});if(t=ds.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=vd.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let s=e[this.opts.schemaId];return s&&(s=(0,fs.normalizeId)(s),delete this.schemas[s],delete this.refs[s]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let s;if(typeof e=="string")s=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=s);else if(typeof e=="object"&&t===void 0){if(t=e,s=t.keyword,Array.isArray(s)&&!s.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(IE.call(this,s,t),!t)return(0,Yo.eachItem)(s,n=>Wo.call(this,n)),this;RE.call(this,t);let i={...t,type:(0,Si.getJSONTypes)(t.type),schemaType:(0,Si.getJSONTypes)(t.schemaType)};return(0,Yo.eachItem)(s,i.type.length===0?n=>Wo.call(this,n,i):n=>i.type.forEach(o=>Wo.call(this,n,i,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let s of t.rules){let i=s.rules.findIndex(n=>n.keyword===e);i>=0&&s.rules.splice(i,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:s="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${s}${i.instancePath} ${i.message}`).reduce((i,n)=>i+t+n)}$dataMetaSchema(e,t){let s=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let n=i.split("/").slice(1),o=e;for(let a of n)o=o[a];for(let a in s){let u=s[a];if(typeof u!="object")continue;let{$data:c}=u.definition,l=o[a];c&&l&&(o[a]=$d(l))}}return e}_removeAllSchemas(e,t){for(let s in e){let i=e[s];(!t||t.test(s))&&(typeof i=="string"?delete e[s]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[s]))}}_addSchema(e,t,s,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;s=(0,fs.normalizeId)(o||s);let c=fs.getSchemaRefs.call(this,e,s);return u=new ds.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:s,localRefs:c}),this._cache.set(u.schema,u),n&&!s.startsWith("#")&&(s&&this._checkUnique(s),this.refs[s]=u),i&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ds.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{ds.compileSchema.call(this,e)}finally{this.opts=t}}};ps.ValidationError=pE.default;ps.MissingRefError=bd.default;oe.default=ps;function _d(r,e,t,s="error"){for(let i in r){let n=i;n in e&&this.logger[s](`${t}: option ${i}. ${r[n]}`)}}function vd(r){return r=(0,fs.normalizeId)(r),this.schemas[r]||this.refs[r]}function EE(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function SE(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function OE(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function xE(){let r={...this.opts};for(let e of _E)delete r[e];return r}var TE={log(){},warn(){},error(){}};function PE(r){if(r===!1)return TE;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var AE=/^[a-z_$][a-z0-9_$:-]*$/i;function IE(r,e){let{RULES:t}=this;if((0,Yo.eachItem)(r,s=>{if(t.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!AE.test(s))throw new Error(`Keyword ${s} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Wo(r,e,t){var s;let i=e?.post;if(t&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:n}=this,o=i?n.post:n.rules.find(({type:u})=>u===t);if(o||(o={type:t,rules:[]},n.rules.push(o)),n.keywords[r]=!0,!e)return;let a={keyword:r,definition:{...e,type:(0,Si.getJSONTypes)(e.type),schemaType:(0,Si.getJSONTypes)(e.schemaType)}};e.before?CE.call(this,o,a,e.before):o.rules.push(a),n.all[r]=a,(s=e.implements)===null||s===void 0||s.forEach(u=>this.addKeyword(u))}function CE(r,e,t){let s=r.rules.findIndex(i=>i.keyword===t);s>=0?r.rules.splice(s,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function RE(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=$d(e)),r.validateSchema=this.compile(e,!0))}var NE={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $d(r){return{anyOf:[r,NE]}}});var Ed=d(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var qE={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Jo.default=qE});var Ti=d(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.callRef=er.getValidate=void 0;var DE=gr(),Sd=Re(),Oe=T(),vr=Ce(),Od=cs(),Oi=R(),jE={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:s}=r,{baseId:i,schemaEnv:n,validateName:o,opts:a,self:u}=s,{root:c}=n;if((t==="#"||t==="#/")&&i===c.baseId)return h();let l=Od.resolveRef.call(u,c,i,t);if(l===void 0)throw new DE.default(s.opts.uriResolver,i,t);if(l instanceof Od.SchemaEnv)return f(l);return p(l);function h(){if(n===c)return xi(r,o,n,n.$async);let m=e.scopeValue("root",{ref:c});return xi(r,(0,Oe._)`${m}.validate`,c,c.$async)}function f(m){let g=xd(r,m);xi(r,g,m,m.$async)}function p(m){let g=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Oe.stringify)(m)}:{ref:m}),y=e.name("valid"),_=r.subschema({schema:m,dataTypes:[],schemaPath:Oe.nil,topSchemaRef:g,errSchemaPath:t},y);r.mergeEvaluated(_),r.ok(y)}}};function xd(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Oe._)`${t.scopeValue("wrapper",{ref:e})}.validate`}er.getValidate=xd;function xi(r,e,t,s){let{gen:i,it:n}=r,{allErrors:o,schemaEnv:a,opts:u}=n,c=u.passContext?vr.default.this:Oe.nil;s?l():h();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,Oe._)`await ${(0,Sd.callValidateCode)(r,e,c)}`),p(e),o||i.assign(m,!0)},g=>{i.if((0,Oe._)`!(${g} instanceof ${n.ValidationError})`,()=>i.throw(g)),f(g),o||i.assign(m,!1)}),r.ok(m)}function h(){r.result((0,Sd.callValidateCode)(r,e,c),()=>p(e),()=>f(e))}function f(m){let g=(0,Oe._)`${m}.errors`;i.assign(vr.default.vErrors,(0,Oe._)`${vr.default.vErrors} === null ? ${g} : ${vr.default.vErrors}.concat(${g})`),i.assign(vr.default.errors,(0,Oe._)`${vr.default.vErrors}.length`)}function p(m){var g;if(!n.opts.unevaluated)return;let y=(g=t?.validate)===null||g===void 0?void 0:g.evaluated;if(n.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(n.props=Oi.mergeEvaluated.props(i,y.props,n.props));else{let _=i.var("props",(0,Oe._)`${m}.evaluated.props`);n.props=Oi.mergeEvaluated.props(i,_,n.props,Oe.Name)}if(n.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(n.items=Oi.mergeEvaluated.items(i,y.items,n.items));else{let _=i.var("items",(0,Oe._)`${m}.evaluated.items`);n.items=Oi.mergeEvaluated.items(i,_,n.items,Oe.Name)}}}er.callRef=xi;er.default=jE});var Qo=d(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});var kE=Ed(),ME=Ti(),LE=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",kE.default,ME.default];Zo.default=LE});var Td=d(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var Pi=T(),Nt=Pi.operators,Ai={maximum:{okStr:"<=",ok:Nt.LTE,fail:Nt.GT},minimum:{okStr:">=",ok:Nt.GTE,fail:Nt.LT},exclusiveMaximum:{okStr:"<",ok:Nt.LT,fail:Nt.GTE},exclusiveMinimum:{okStr:">",ok:Nt.GT,fail:Nt.LTE}},FE={message:({keyword:r,schemaCode:e})=>(0,Pi.str)`must be ${Ai[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Pi._)`{comparison: ${Ai[r].okStr}, limit: ${e}}`},VE={keyword:Object.keys(Ai),type:"number",schemaType:"number",$data:!0,error:FE,code(r){let{keyword:e,data:t,schemaCode:s}=r;r.fail$data((0,Pi._)`${t} ${Ai[e].fail} ${s} || isNaN(${t})`)}};ea.default=VE});var Pd=d(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var ms=T(),UE={message:({schemaCode:r})=>(0,ms.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,ms._)`{multipleOf: ${r}}`},HE={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:UE,code(r){let{gen:e,data:t,schemaCode:s,it:i}=r,n=i.opts.multipleOfPrecision,o=e.let("res"),a=n?(0,ms._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,ms._)`${o} !== parseInt(${o})`;r.fail$data((0,ms._)`(${s} === 0 || (${o} = ${t}/${s}, ${a}))`)}};ta.default=HE});var Id=d(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});function Ad(r){let e=r.length,t=0,s=0,i;for(;s<e;)t++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<e&&(i=r.charCodeAt(s),(i&64512)===56320&&s++);return t}ra.default=Ad;Ad.code='require("ajv/dist/runtime/ucs2length").default'});var Cd=d(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var tr=T(),GE=R(),zE=Id(),BE={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,tr.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,tr._)`{limit: ${r}}`},KE={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:BE,code(r){let{keyword:e,data:t,schemaCode:s,it:i}=r,n=e==="maxLength"?tr.operators.GT:tr.operators.LT,o=i.opts.unicode===!1?(0,tr._)`${t}.length`:(0,tr._)`${(0,GE.useFunc)(r.gen,zE.default)}(${t})`;r.fail$data((0,tr._)`${o} ${n} ${s}`)}};sa.default=KE});var Rd=d(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var WE=Re(),YE=R(),br=T(),XE={message:({schemaCode:r})=>(0,br.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,br._)`{pattern: ${r}}`},JE={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:XE,code(r){let{gen:e,data:t,$data:s,schema:i,schemaCode:n,it:o}=r,a=o.opts.unicodeRegExp?"u":"";if(s){let{regExp:u}=o.opts.code,c=u.code==="new RegExp"?(0,br._)`new RegExp`:(0,YE.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,br._)`${c}(${n}, ${a}).test(${t})`),()=>e.assign(l,!1)),r.fail$data((0,br._)`!${l}`)}else{let u=(0,WE.usePattern)(r,i);r.fail$data((0,br._)`!${u}.test(${t})`)}}};ia.default=JE});var Nd=d(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var gs=T(),ZE={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,gs.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,gs._)`{limit: ${r}}`},QE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ZE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxProperties"?gs.operators.GT:gs.operators.LT;r.fail$data((0,gs._)`Object.keys(${t}).length ${i} ${s}`)}};na.default=QE});var qd=d(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var ys=Re(),_s=T(),eS=R(),tS={message:({params:{missingProperty:r}})=>(0,_s.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,_s._)`{missingProperty: ${r}}`},rS={keyword:"required",type:"object",schemaType:"array",$data:!0,error:tS,code(r){let{gen:e,schema:t,schemaCode:s,data:i,$data:n,it:o}=r,{opts:a}=o;if(!n&&t.length===0)return;let u=t.length>=a.loopRequired;if(o.allErrors?c():l(),a.strictRequired){let p=r.parentSchema.properties,{definedProperties:m}=r.it;for(let g of t)if(p?.[g]===void 0&&!m.has(g)){let y=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,eS.checkStrictMode)(o,_,o.opts.strictRequired)}}function c(){if(u||n)r.block$data(_s.nil,h);else for(let p of t)(0,ys.checkReportMissingProp)(r,p)}function l(){let p=e.let("missing");if(u||n){let m=e.let("valid",!0);r.block$data(m,()=>f(p,m)),r.ok(m)}else e.if((0,ys.checkMissingProp)(r,t,p)),(0,ys.reportMissingProp)(r,p),e.else()}function h(){e.forOf("prop",s,p=>{r.setParams({missingProperty:p}),e.if((0,ys.noPropertyInData)(e,i,p,a.ownProperties),()=>r.error())})}function f(p,m){r.setParams({missingProperty:p}),e.forOf(p,s,()=>{e.assign(m,(0,ys.propertyInData)(e,i,p,a.ownProperties)),e.if((0,_s.not)(m),()=>{r.error(),e.break()})},_s.nil)}}};oa.default=rS});var Dd=d(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var vs=T(),sS={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,vs.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,vs._)`{limit: ${r}}`},iS={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:sS,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxItems"?vs.operators.GT:vs.operators.LT;r.fail$data((0,vs._)`${t}.length ${i} ${s}`)}};aa.default=iS});var Ii=d(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var jd=Eo();jd.code='require("ajv/dist/runtime/equal").default';ua.default=jd});var kd=d(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var ca=is(),ae=T(),nS=R(),oS=Ii(),aS={message:({params:{i:r,j:e}})=>(0,ae.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,ae._)`{i: ${r}, j: ${e}}`},uS={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:aS,code(r){let{gen:e,data:t,$data:s,schema:i,parentSchema:n,schemaCode:o,it:a}=r;if(!s&&!i)return;let u=e.let("valid"),c=n.items?(0,ca.getSchemaTypes)(n.items):[];r.block$data(u,l,(0,ae._)`${o} === false`),r.ok(u);function l(){let m=e.let("i",(0,ae._)`${t}.length`),g=e.let("j");r.setParams({i:m,j:g}),e.assign(u,!0),e.if((0,ae._)`${m} > 1`,()=>(h()?f:p)(m,g))}function h(){return c.length>0&&!c.some(m=>m==="object"||m==="array")}function f(m,g){let y=e.name("item"),_=(0,ca.checkDataTypes)(c,y,a.opts.strictNumbers,ca.DataType.Wrong),w=e.const("indices",(0,ae._)`{}`);e.for((0,ae._)`;${m}--;`,()=>{e.let(y,(0,ae._)`${t}[${m}]`),e.if(_,(0,ae._)`continue`),c.length>1&&e.if((0,ae._)`typeof ${y} == "string"`,(0,ae._)`${y} += "_"`),e.if((0,ae._)`typeof ${w}[${y}] == "number"`,()=>{e.assign(g,(0,ae._)`${w}[${y}]`),r.error(),e.assign(u,!1).break()}).code((0,ae._)`${w}[${y}] = ${m}`)})}function p(m,g){let y=(0,nS.useFunc)(e,oS.default),_=e.name("outer");e.label(_).for((0,ae._)`;${m}--;`,()=>e.for((0,ae._)`${g} = ${m}; ${g}--;`,()=>e.if((0,ae._)`${y}(${t}[${m}], ${t}[${g}])`,()=>{r.error(),e.assign(u,!1).break(_)})))}}};la.default=uS});var Md=d(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var ha=T(),cS=R(),lS=Ii(),hS={message:"must be equal to constant",params:({schemaCode:r})=>(0,ha._)`{allowedValue: ${r}}`},dS={keyword:"const",$data:!0,error:hS,code(r){let{gen:e,data:t,$data:s,schemaCode:i,schema:n}=r;s||n&&typeof n=="object"?r.fail$data((0,ha._)`!${(0,cS.useFunc)(e,lS.default)}(${t}, ${i})`):r.fail((0,ha._)`${n} !== ${t}`)}};da.default=dS});var Ld=d(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var bs=T(),fS=R(),pS=Ii(),mS={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,bs._)`{allowedValues: ${r}}`},gS={keyword:"enum",schemaType:"array",$data:!0,error:mS,code(r){let{gen:e,data:t,$data:s,schema:i,schemaCode:n,it:o}=r;if(!s&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,u,c=()=>u??(u=(0,fS.useFunc)(e,pS.default)),l;if(a||s)l=e.let("valid"),r.block$data(l,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",n);l=(0,bs.or)(...i.map((m,g)=>f(p,g)))}r.pass(l);function h(){e.assign(l,!1),e.forOf("v",n,p=>e.if((0,bs._)`${c()}(${t}, ${p})`,()=>e.assign(l,!0).break()))}function f(p,m){let g=i[m];return typeof g=="object"&&g!==null?(0,bs._)`${c()}(${t}, ${p}[${m}])`:(0,bs._)`${t} === ${g}`}}};fa.default=gS});var ma=d(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var yS=Td(),_S=Pd(),vS=Cd(),bS=Rd(),wS=Nd(),$S=qd(),ES=Dd(),SS=kd(),OS=Md(),xS=Ld(),TS=[yS.default,_S.default,vS.default,bS.default,wS.default,$S.default,ES.default,SS.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},OS.default,xS.default];pa.default=TS});var ya=d(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.validateAdditionalItems=void 0;var rr=T(),ga=R(),PS={message:({params:{len:r}})=>(0,rr.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,rr._)`{limit: ${r}}`},AS={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:PS,code(r){let{parentSchema:e,it:t}=r,{items:s}=e;if(!Array.isArray(s)){(0,ga.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}Fd(r,s)}};function Fd(r,e){let{gen:t,schema:s,data:i,keyword:n,it:o}=r;o.items=!0;let a=t.const("len",(0,rr._)`${i}.length`);if(s===!1)r.setParams({len:e.length}),r.pass((0,rr._)`${a} <= ${e.length}`);else if(typeof s=="object"&&!(0,ga.alwaysValidSchema)(o,s)){let c=t.var("valid",(0,rr._)`${a} <= ${e.length}`);t.if((0,rr.not)(c),()=>u(c)),r.ok(c)}function u(c){t.forRange("i",e.length,a,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:ga.Type.Num},c),o.allErrors||t.if((0,rr.not)(c),()=>t.break())})}}ws.validateAdditionalItems=Fd;ws.default=AS});var _a=d($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.validateTuple=void 0;var Vd=T(),Ci=R(),IS=Re(),CS={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return Ud(r,"additionalItems",e);t.items=!0,!(0,Ci.alwaysValidSchema)(t,e)&&r.ok((0,IS.validateArray)(r))}};function Ud(r,e,t=r.schema){let{gen:s,parentSchema:i,data:n,keyword:o,it:a}=r;l(i),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=Ci.mergeEvaluated.items(s,t.length,a.items));let u=s.name("valid"),c=s.const("len",(0,Vd._)`${n}.length`);t.forEach((h,f)=>{(0,Ci.alwaysValidSchema)(a,h)||(s.if((0,Vd._)`${c} > ${f}`,()=>r.subschema({keyword:o,schemaProp:f,dataProp:f},u)),r.ok(u))});function l(h){let{opts:f,errSchemaPath:p}=a,m=t.length,g=m===h.minItems&&(m===h.maxItems||h[e]===!1);if(f.strictTuples&&!g){let y=`"${o}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,Ci.checkStrictMode)(a,y,f.strictTuples)}}}$s.validateTuple=Ud;$s.default=CS});var Hd=d(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var RS=_a(),NS={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,RS.validateTuple)(r,"items")};va.default=NS});var zd=d(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var Gd=T(),qS=R(),DS=Re(),jS=ya(),kS={message:({params:{len:r}})=>(0,Gd.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Gd._)`{limit: ${r}}`},MS={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:kS,code(r){let{schema:e,parentSchema:t,it:s}=r,{prefixItems:i}=t;s.items=!0,!(0,qS.alwaysValidSchema)(s,e)&&(i?(0,jS.validateAdditionalItems)(r,i):r.ok((0,DS.validateArray)(r)))}};ba.default=MS});var Bd=d(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var qe=T(),Ri=R(),LS={message:({params:{min:r,max:e}})=>e===void 0?(0,qe.str)`must contain at least ${r} valid item(s)`:(0,qe.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,qe._)`{minContains: ${r}}`:(0,qe._)`{minContains: ${r}, maxContains: ${e}}`},FS={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:LS,code(r){let{gen:e,schema:t,parentSchema:s,data:i,it:n}=r,o,a,{minContains:u,maxContains:c}=s;n.opts.next?(o=u===void 0?1:u,a=c):o=1;let l=e.const("len",(0,qe._)`${i}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,Ri.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Ri.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Ri.alwaysValidSchema)(n,t)){let g=(0,qe._)`${l} >= ${o}`;a!==void 0&&(g=(0,qe._)`${g} && ${l} <= ${a}`),r.pass(g);return}n.items=!0;let h=e.name("valid");a===void 0&&o===1?p(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),a!==void 0&&e.if((0,qe._)`${i}.length > 0`,f)):(e.let(h,!1),f()),r.result(h,()=>r.reset());function f(){let g=e.name("_valid"),y=e.let("count",0);p(g,()=>e.if(g,()=>m(y)))}function p(g,y){e.forRange("i",0,l,_=>{r.subschema({keyword:"contains",dataProp:_,dataPropType:Ri.Type.Num,compositeRule:!0},g),y()})}function m(g){e.code((0,qe._)`${g}++`),a===void 0?e.if((0,qe._)`${g} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,qe._)`${g} > ${a}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,qe._)`${g} >= ${o}`,()=>e.assign(h,!0)))}}};wa.default=FS});var Ni=d(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.validateSchemaDeps=tt.validatePropertyDeps=tt.error=void 0;var $a=T(),VS=R(),Es=Re();tt.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let s=e===1?"property":"properties";return(0,$a.str)`must have ${s} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:s}})=>(0,$a._)`{property: ${r},
|
|
7
7
|
missingProperty: ${s},
|
|
8
8
|
depsCount: ${e},
|
|
9
|
-
deps: ${t}}`};var mS={keyword:"dependencies",type:"object",schemaType:"object",error:Qe.error,code(r){let[e,t]=gS(r);Pd(r,e),Ad(r,t)}};function gS({schema:r}){let e={},t={};for(let s in r){if(s==="__proto__")continue;let i=Array.isArray(r[s])?e:t;i[s]=r[s]}return[e,t]}function Pd(r,e=r.schema){let{gen:t,data:s,it:i}=r;if(Object.keys(e).length===0)return;let n=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let u=(0,bs.propertyInData)(t,s,o,i.opts.ownProperties);r.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?t.if(u,()=>{for(let c of a)(0,bs.checkReportMissingProp)(r,c)}):(t.if((0,ha._)`${u} && (${(0,bs.checkMissingProp)(r,a,n)})`),(0,bs.reportMissingProp)(r,n),t.else())}}Qe.validatePropertyDeps=Pd;function Ad(r,e=r.schema){let{gen:t,data:s,keyword:i,it:n}=r,o=t.name("valid");for(let a in e)(0,pS.alwaysValidSchema)(n,e[a])||(t.if((0,bs.propertyInData)(t,s,a,n.opts.ownProperties),()=>{let u=r.subschema({keyword:i,schemaProp:a},o);r.mergeValidEvaluated(u,o)},()=>t.var(o,!0)),r.ok(o))}Qe.validateSchemaDeps=Ad;Qe.default=mS});var Cd=d(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var Id=T(),yS=R(),_S={message:"property name must be valid",params:({params:r})=>(0,Id._)`{propertyName: ${r.propertyName}}`},vS={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_S,code(r){let{gen:e,schema:t,data:s,it:i}=r;if((0,yS.alwaysValidSchema)(i,t))return;let n=e.name("valid");e.forIn("key",s,o=>{r.setParams({propertyName:o}),r.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},n),e.if((0,Id.not)(n),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(n)}};da.default=vS});var pa=d(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var Ai=Ie(),He=T(),bS=Ae(),Ii=R(),wS={message:"must NOT have additional properties",params:({params:r})=>(0,He._)`{additionalProperty: ${r.additionalProperty}}`},$S={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wS,code(r){let{gen:e,schema:t,parentSchema:s,data:i,errsCount:n,it:o}=r;if(!n)throw new Error("ajv implementation error");let{allErrors:a,opts:u}=o;if(o.props=!0,u.removeAdditional!=="all"&&(0,Ii.alwaysValidSchema)(o,t))return;let c=(0,Ai.allSchemaProperties)(s.properties),l=(0,Ai.allSchemaProperties)(s.patternProperties);h(),r.ok((0,He._)`${n} === ${bS.default.errors}`);function h(){e.forIn("key",i,y=>{!c.length&&!l.length?m(y):e.if(f(y),()=>m(y))})}function f(y){let _;if(c.length>8){let S=(0,Ii.schemaRefOrVal)(o,s.properties,"properties");_=(0,Ai.isOwnProperty)(e,S,y)}else c.length?_=(0,He.or)(...c.map(S=>(0,He._)`${y} === ${S}`)):_=He.nil;return l.length&&(_=(0,He.or)(_,...l.map(S=>(0,He._)`${(0,Ai.usePattern)(r,S)}.test(${y})`))),(0,He.not)(_)}function p(y){e.code((0,He._)`delete ${i}[${y}]`)}function m(y){if(u.removeAdditional==="all"||u.removeAdditional&&t===!1){p(y);return}if(t===!1){r.setParams({additionalProperty:y}),r.error(),a||e.break();return}if(typeof t=="object"&&!(0,Ii.alwaysValidSchema)(o,t)){let _=e.name("valid");u.removeAdditional==="failing"?(g(y,_,!1),e.if((0,He.not)(_),()=>{r.reset(),p(y)})):(g(y,_),a||e.if((0,He.not)(_),()=>e.break()))}}function g(y,_,S){let O={keyword:"additionalProperties",dataProp:y,dataPropType:Ii.Type.Str};S===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(O,_)}}};fa.default=$S});var qd=d(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var ES=dr(),Rd=Ie(),ma=R(),Nd=pa(),SS={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:s,data:i,it:n}=r;n.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&Nd.default.code(new ES.KeywordCxt(n,Nd.default,"additionalProperties"));let o=(0,Rd.allSchemaProperties)(t);for(let h of o)n.definedProperties.add(h);n.opts.unevaluated&&o.length&&n.props!==!0&&(n.props=ma.mergeEvaluated.props(e,(0,ma.toHash)(o),n.props));let a=o.filter(h=>!(0,ma.alwaysValidSchema)(n,t[h]));if(a.length===0)return;let u=e.name("valid");for(let h of a)c(h)?l(h):(e.if((0,Rd.propertyInData)(e,i,h,n.opts.ownProperties)),l(h),n.allErrors||e.else().var(u,!0),e.endIf()),r.it.definedProperties.add(h),r.ok(u);function c(h){return n.opts.useDefaults&&!n.compositeRule&&t[h].default!==void 0}function l(h){r.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}}};ga.default=SS});var Md=d(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var jd=Ie(),Ci=T(),kd=R(),Dd=R(),OS={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:s,parentSchema:i,it:n}=r,{opts:o}=n,a=(0,jd.allSchemaProperties)(t),u=a.filter(g=>(0,kd.alwaysValidSchema)(n,t[g]));if(a.length===0||u.length===a.length&&(!n.opts.unevaluated||n.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,l=e.name("valid");n.props!==!0&&!(n.props instanceof Ci.Name)&&(n.props=(0,Dd.evaluatedPropsToName)(e,n.props));let{props:h}=n;f();function f(){for(let g of a)c&&p(g),n.allErrors?m(g):(e.var(l,!0),m(g),e.if(l))}function p(g){for(let y in c)new RegExp(g).test(y)&&(0,kd.checkStrictMode)(n,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){e.forIn("key",s,y=>{e.if((0,Ci._)`${(0,jd.usePattern)(r,g)}.test(${y})`,()=>{let _=u.includes(g);_||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:Dd.Type.Str},l),n.opts.unevaluated&&h!==!0?e.assign((0,Ci._)`${h}[${y}]`,!0):!_&&!n.allErrors&&e.if((0,Ci.not)(l),()=>e.break())})})}}};ya.default=OS});var Ld=d(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var xS=R(),TS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:s}=r;if((0,xS.alwaysValidSchema)(s,t)){r.fail();return}let i=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};_a.default=TS});var Vd=d(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var PS=Ie(),AS={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:PS.validateUnion,error:{message:"must match a schema in anyOf"}};va.default=AS});var Fd=d(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var Ri=T(),IS=R(),CS={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,Ri._)`{passingSchemas: ${r.passing}}`},RS={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:CS,code(r){let{gen:e,schema:t,parentSchema:s,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&s.discriminator)return;let n=t,o=e.let("valid",!1),a=e.let("passing",null),u=e.name("_valid");r.setParams({passing:a}),e.block(c),r.result(o,()=>r.reset(),()=>r.error(!0));function c(){n.forEach((l,h)=>{let f;(0,IS.alwaysValidSchema)(i,l)?e.var(u,!0):f=r.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Ri._)`${u} && ${o}`).assign(o,!1).assign(a,(0,Ri._)`[${a}, ${h}]`).else(),e.if(u,()=>{e.assign(o,!0),e.assign(a,h),f&&r.mergeEvaluated(f,Ri.Name)})})}}};ba.default=RS});var Ud=d(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var NS=R(),qS={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let i=e.name("valid");t.forEach((n,o)=>{if((0,NS.alwaysValidSchema)(s,n))return;let a=r.subschema({keyword:"allOf",schemaProp:o},i);r.ok(i),r.mergeEvaluated(a)})}};wa.default=qS});var zd=d($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var Ni=T(),Gd=R(),jS={message:({params:r})=>(0,Ni.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Ni._)`{failingKeyword: ${r.ifClause}}`},kS={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:jS,code(r){let{gen:e,parentSchema:t,it:s}=r;t.then===void 0&&t.else===void 0&&(0,Gd.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let i=Hd(s,"then"),n=Hd(s,"else");if(!i&&!n)return;let o=e.let("valid",!0),a=e.name("_valid");if(u(),r.reset(),i&&n){let l=e.let("ifClause");r.setParams({ifClause:l}),e.if(a,c("then",l),c("else",l))}else i?e.if(a,c("then")):e.if((0,Ni.not)(a),c("else"));r.pass(o,()=>r.error(!0));function u(){let l=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(l)}function c(l,h){return()=>{let f=r.subschema({keyword:l},a);e.assign(o,a),r.mergeValidEvaluated(f,o),h?e.assign(h,(0,Ni._)`${l}`):r.setParams({ifClause:l})}}}};function Hd(r,e){let t=r.schema[e];return t!==void 0&&!(0,Gd.alwaysValidSchema)(r,t)}$a.default=kS});var Bd=d(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var DS=R(),MS={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,DS.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};Ea.default=MS});var Oa=d(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var LS=oa(),VS=Sd(),FS=aa(),US=xd(),HS=Td(),GS=Pi(),zS=Cd(),BS=pa(),KS=qd(),WS=Md(),YS=Ld(),XS=Vd(),JS=Fd(),ZS=Ud(),QS=zd(),eO=Bd();function tO(r=!1){let e=[YS.default,XS.default,JS.default,ZS.default,QS.default,eO.default,zS.default,BS.default,GS.default,KS.default,WS.default];return r?e.push(VS.default,US.default):e.push(LS.default,FS.default),e.push(HS.default),e}Sa.default=tO});var Ta=d(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.dynamicAnchor=void 0;var xa=T(),rO=Ae(),Kd=as(),sO=$i(),iO={keyword:"$dynamicAnchor",schemaType:"string",code:r=>Wd(r,r.schema)};function Wd(r,e){let{gen:t,it:s}=r;s.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,xa._)`${rO.default.dynamicAnchors}${(0,xa.getProperty)(e)}`,n=s.errSchemaPath==="#"?s.validateName:nO(r);t.if((0,xa._)`!${i}`,()=>t.assign(i,n))}ws.dynamicAnchor=Wd;function nO(r){let{schemaEnv:e,schema:t,self:s}=r.it,{root:i,baseId:n,localRefs:o,meta:a}=e.root,{schemaId:u}=s.opts,c=new Kd.SchemaEnv({schema:t,schemaId:u,root:i,baseId:n,localRefs:o,meta:a});return Kd.compileSchema.call(s,c),(0,sO.getValidate)(r,c)}ws.default=iO});var Pa=d($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.dynamicRef=void 0;var Yd=T(),oO=Ae(),Xd=$i(),aO={keyword:"$dynamicRef",schemaType:"string",code:r=>Jd(r,r.schema)};function Jd(r,e){let{gen:t,keyword:s,it:i}=r;if(e[0]!=="#")throw new Error(`"${s}" only supports hash fragment reference`);let n=e.slice(1);if(i.allErrors)o();else{let u=t.let("valid",!1);o(u),r.ok(u)}function o(u){if(i.schemaEnv.root.dynamicAnchors[n]){let c=t.let("_v",(0,Yd._)`${oO.default.dynamicAnchors}${(0,Yd.getProperty)(n)}`);t.if(c,a(c,u),a(i.validateName,u))}else a(i.validateName,u)()}function a(u,c){return c?()=>t.block(()=>{(0,Xd.callRef)(r,u),t.let(c,!0)}):()=>(0,Xd.callRef)(r,u)}}$s.dynamicRef=Jd;$s.default=aO});var Zd=d(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var uO=Ta(),cO=R(),lO={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,uO.dynamicAnchor)(r,""):(0,cO.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Aa.default=lO});var Qd=d(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var hO=Pa(),dO={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,hO.dynamicRef)(r,r.schema)};Ia.default=dO});var ef=d(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var fO=Ta(),pO=Pa(),mO=Zd(),gO=Qd(),yO=[fO.default,pO.default,mO.default,gO.default];Ca.default=yO});var rf=d(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var tf=Pi(),_O={keyword:"dependentRequired",type:"object",schemaType:"object",error:tf.error,code:r=>(0,tf.validatePropertyDeps)(r)};Ra.default=_O});var sf=d(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var vO=Pi(),bO={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,vO.validateSchemaDeps)(r)};Na.default=bO});var nf=d(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var wO=R(),$O={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,wO.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};qa.default=$O});var of=d(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var EO=rf(),SO=sf(),OO=nf(),xO=[EO.default,SO.default,OO.default];ja.default=xO});var uf=d(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var Rt=T(),af=R(),TO=Ae(),PO={message:"must NOT have unevaluated properties",params:({params:r})=>(0,Rt._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},AO={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:PO,code(r){let{gen:e,schema:t,data:s,errsCount:i,it:n}=r;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=n;a instanceof Rt.Name?e.if((0,Rt._)`${a} !== true`,()=>e.forIn("key",s,h=>e.if(c(a,h),()=>u(h)))):a!==!0&&e.forIn("key",s,h=>a===void 0?u(h):e.if(l(a,h),()=>u(h))),n.props=!0,r.ok((0,Rt._)`${i} === ${TO.default.errors}`);function u(h){if(t===!1){r.setParams({unevaluatedProperty:h}),r.error(),o||e.break();return}if(!(0,af.alwaysValidSchema)(n,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:af.Type.Str},f),o||e.if((0,Rt.not)(f),()=>e.break())}}function c(h,f){return(0,Rt._)`!${h} || !${h}[${f}]`}function l(h,f){let p=[];for(let m in h)h[m]===!0&&p.push((0,Rt._)`${f} !== ${m}`);return(0,Rt.and)(...p)}}};ka.default=AO});var lf=d(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var Qt=T(),cf=R(),IO={message:({params:{len:r}})=>(0,Qt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Qt._)`{limit: ${r}}`},CO={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:IO,code(r){let{gen:e,schema:t,data:s,it:i}=r,n=i.items||0;if(n===!0)return;let o=e.const("len",(0,Qt._)`${s}.length`);if(t===!1)r.setParams({len:n}),r.fail((0,Qt._)`${o} > ${n}`);else if(typeof t=="object"&&!(0,cf.alwaysValidSchema)(i,t)){let u=e.var("valid",(0,Qt._)`${o} <= ${n}`);e.if((0,Qt.not)(u),()=>a(u,n)),r.ok(u)}i.items=!0;function a(u,c){e.forRange("i",c,o,l=>{r.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:cf.Type.Num},u),i.allErrors||e.if((0,Qt.not)(u),()=>e.break())})}}};Da.default=CO});var hf=d(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});var RO=uf(),NO=lf(),qO=[RO.default,NO.default];Ma.default=qO});var df=d(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var re=T(),jO={message:({schemaCode:r})=>(0,re.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,re._)`{format: ${r}}`},kO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:jO,code(r,e){let{gen:t,data:s,$data:i,schema:n,schemaCode:o,it:a}=r,{opts:u,errSchemaPath:c,schemaEnv:l,self:h}=a;if(!u.validateFormats)return;i?f():p();function f(){let m=t.scopeValue("formats",{ref:h.formats,code:u.code.formats}),g=t.const("fDef",(0,re._)`${m}[${o}]`),y=t.let("fType"),_=t.let("format");t.if((0,re._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(y,(0,re._)`${g}.type || "string"`).assign(_,(0,re._)`${g}.validate`),()=>t.assign(y,(0,re._)`"string"`).assign(_,g)),r.fail$data((0,re.or)(S(),O()));function S(){return u.strictSchema===!1?re.nil:(0,re._)`${o} && !${_}`}function O(){let E=l.$async?(0,re._)`(${g}.async ? await ${_}(${s}) : ${_}(${s}))`:(0,re._)`${_}(${s})`,$=(0,re._)`(typeof ${_} == "function" ? ${E} : ${_}.test(${s}))`;return(0,re._)`${_} && ${_} !== true && ${y} === ${e} && !${$}`}}function p(){let m=h.formats[n];if(!m){S();return}if(m===!0)return;let[g,y,_]=O(m);g===e&&r.pass(E());function S(){if(u.strictSchema===!1){h.logger.warn($());return}throw new Error($());function $(){return`unknown format "${n}" ignored in schema at path "${c}"`}}function O($){let he=$ instanceof RegExp?(0,re.regexpCode)($):u.code.formats?(0,re._)`${u.code.formats}${(0,re.getProperty)(n)}`:void 0,U=t.scopeValue("formats",{key:n,ref:$,code:he});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,re._)`${U}.validate`]:["string",$,U]}function E(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,re._)`await ${_}(${s})`}return typeof y=="function"?(0,re._)`${_}(${s})`:(0,re._)`${_}.test(${s})`}}}};La.default=kO});var Fa=d(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});var DO=df(),MO=[DO.default];Va.default=MO});var Ua=d(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.contentVocabulary=vr.metadataVocabulary=void 0;vr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];vr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var pf=d(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var LO=Uo(),VO=ia(),FO=Oa(),UO=ef(),HO=of(),GO=hf(),zO=Fa(),ff=Ua(),BO=[UO.default,LO.default,VO.default,(0,FO.default)(!0),zO.default,ff.metadataVocabulary,ff.contentVocabulary,HO.default,GO.default];Ha.default=BO});var gf=d(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.DiscrError=void 0;var mf;(function(r){r.Tag="tag",r.Mapping="mapping"})(mf||(qi.DiscrError=mf={}))});var Ba=d(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var br=T(),Ga=gf(),yf=as(),KO=fr(),WO=R(),YO={message:({params:{discrError:r,tagName:e}})=>r===Ga.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,br._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},XO={keyword:"discriminator",type:"object",schemaType:"object",error:YO,code(r){let{gen:e,data:t,schema:s,parentSchema:i,it:n}=r,{oneOf:o}=i;if(!n.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=s.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),c=e.const("tag",(0,br._)`${t}${(0,br.getProperty)(a)}`);e.if((0,br._)`typeof ${c} == "string"`,()=>l(),()=>r.error(!1,{discrError:Ga.DiscrError.Tag,tag:c,tagName:a})),r.ok(u);function l(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,br._)`${c} === ${m}`),e.assign(u,h(p[m]));e.else(),r.error(!1,{discrError:Ga.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function h(p){let m=e.name("valid"),g=r.subschema({keyword:"oneOf",schemaProp:p},m);return r.mergeEvaluated(g,br.Name),m}function f(){var p;let m={},g=_(i),y=!0;for(let E=0;E<o.length;E++){let $=o[E];if($?.$ref&&!(0,WO.schemaHasRulesButRef)($,n.self.RULES)){let U=$.$ref;if($=yf.resolveRef.call(n.self,n.schemaEnv.root,n.baseId,U),$ instanceof yf.SchemaEnv&&($=$.schema),$===void 0)throw new KO.default(n.opts.uriResolver,n.baseId,U)}let he=(p=$?.properties)===null||p===void 0?void 0:p[a];if(typeof he!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||_($)),S(he,E)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function _({required:E}){return Array.isArray(E)&&E.includes(a)}function S(E,$){if(E.const)O(E.const,$);else if(E.enum)for(let he of E.enum)O(he,$);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function O(E,$){if(typeof E!="string"||E in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[E]=$}}}};za.default=XO});var _f=d((Ij,JO)=>{JO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var vf=d((Cj,ZO)=>{ZO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var bf=d((Rj,QO)=>{QO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var wf=d((Nj,e1)=>{e1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var $f=d((qj,t1)=>{t1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Ef=d((jj,r1)=>{r1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var Sf=d((kj,s1)=>{s1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Of=d((Dj,i1)=>{i1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var xf=d(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var n1=_f(),o1=vf(),a1=bf(),u1=wf(),c1=$f(),l1=Ef(),h1=Sf(),d1=Of(),f1=["/properties"];function p1(r){return[n1,o1,a1,u1,c1,e(this,l1),h1,e(this,d1)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,s){return r?t.$dataMetaSchema(s,f1):s}}Ka.default=p1});var Tf=d((B,Ya)=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.MissingRefError=B.ValidationError=B.CodeGen=B.Name=B.nil=B.stringify=B.str=B._=B.KeywordCxt=B.Ajv2020=void 0;var m1=Lo(),g1=pf(),y1=Ba(),_1=xf(),Wa="https://json-schema.org/draft/2020-12/schema",wr=class extends m1.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),g1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(y1.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(_1.default.call(this,e),this.refs["http://json-schema.org/schema"]=Wa)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Wa)?Wa:void 0)}};B.Ajv2020=wr;Ya.exports=B=wr;Ya.exports.Ajv2020=wr;Object.defineProperty(B,"__esModule",{value:!0});B.default=wr;var v1=dr();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return v1.KeywordCxt}});var $r=T();Object.defineProperty(B,"_",{enumerable:!0,get:function(){return $r._}});Object.defineProperty(B,"str",{enumerable:!0,get:function(){return $r.str}});Object.defineProperty(B,"stringify",{enumerable:!0,get:function(){return $r.stringify}});Object.defineProperty(B,"nil",{enumerable:!0,get:function(){return $r.nil}});Object.defineProperty(B,"Name",{enumerable:!0,get:function(){return $r.Name}});Object.defineProperty(B,"CodeGen",{enumerable:!0,get:function(){return $r.CodeGen}});var b1=os();Object.defineProperty(B,"ValidationError",{enumerable:!0,get:function(){return b1.default}});var w1=fr();Object.defineProperty(B,"MissingRefError",{enumerable:!0,get:function(){return w1.default}})});var jf=d(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.formatNames=tt.fastFormats=tt.fullFormats=void 0;function et(r,e){return{validate:r,compare:e}}tt.fullFormats={date:et(Cf,Qa),time:et(Ja(!0),eu),"date-time":et(Pf(!0),Nf),"iso-time":et(Ja(),Rf),"iso-date-time":et(Pf(),qf),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:T1,"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:q1,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:P1,int32:{type:"number",validate:C1},int64:{type:"number",validate:R1},float:{type:"number",validate:If},double:{type:"number",validate:If},password:!0,binary:!0};tt.fastFormats={...tt.fullFormats,date:et(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Qa),time:et(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,eu),"date-time":et(/^\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,Nf),"iso-time":et(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Rf),"iso-date-time":et(/^\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,qf),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};tt.formatNames=Object.keys(tt.fullFormats);function $1(r){return r%4===0&&(r%100!==0||r%400===0)}var E1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Cf(r){let e=E1.exec(r);if(!e)return!1;let t=+e[1],s=+e[2],i=+e[3];return s>=1&&s<=12&&i>=1&&i<=(s===2&&$1(t)?29:S1[s])}function Qa(r,e){if(r&&e)return r>e?1:r<e?-1:0}var Xa=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ja(r){return function(t){let s=Xa.exec(t);if(!s)return!1;let i=+s[1],n=+s[2],o=+s[3],a=s[4],u=s[5]==="-"?-1:1,c=+(s[6]||0),l=+(s[7]||0);if(c>23||l>59||r&&!a)return!1;if(i<=23&&n<=59&&o<60)return!0;let h=n-l*u,f=i-c*u-(h<0?1:0);return(f===23||f===-1)&&(h===59||h===-1)&&o<61}}function eu(r,e){if(!(r&&e))return;let t=new Date("2020-01-01T"+r).valueOf(),s=new Date("2020-01-01T"+e).valueOf();if(t&&s)return t-s}function Rf(r,e){if(!(r&&e))return;let t=Xa.exec(r),s=Xa.exec(e);if(t&&s)return r=t[1]+t[2]+t[3],e=s[1]+s[2]+s[3],r>e?1:r<e?-1:0}var Za=/t|\s/i;function Pf(r){let e=Ja(r);return function(s){let i=s.split(Za);return i.length===2&&Cf(i[0])&&e(i[1])}}function Nf(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}function qf(r,e){if(!(r&&e))return;let[t,s]=r.split(Za),[i,n]=e.split(Za),o=Qa(t,i);if(o!==void 0)return o||eu(s,n)}var O1=/\/|:/,x1=/^(?:[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 T1(r){return O1.test(r)&&x1.test(r)}var Af=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function P1(r){return Af.lastIndex=0,Af.test(r)}var A1=-(2**31),I1=2**31-1;function C1(r){return Number.isInteger(r)&&r<=I1&&r>=A1}function R1(r){return Number.isInteger(r)}function If(){return!0}var N1=/[^\\]\\Z/;function q1(r){if(N1.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var Df=d(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});var j1=Uo(),k1=ia(),D1=Oa(),M1=Fa(),kf=Ua(),L1=[j1.default,k1.default,(0,D1.default)(),M1.default,kf.metadataVocabulary,kf.contentVocabulary];tu.default=L1});var Mf=d((Fj,V1)=>{V1.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Vf=d((K,ru)=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.MissingRefError=K.ValidationError=K.CodeGen=K.Name=K.nil=K.stringify=K.str=K._=K.KeywordCxt=K.Ajv=void 0;var F1=Lo(),U1=Df(),H1=Ba(),Lf=Mf(),G1=["/properties"],ji="http://json-schema.org/draft-07/schema",Er=class extends F1.default{_addVocabularies(){super._addVocabularies(),U1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(H1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Lf,G1):Lf;this.addMetaSchema(e,ji,!1),this.refs["http://json-schema.org/schema"]=ji}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ji)?ji:void 0)}};K.Ajv=Er;ru.exports=K=Er;ru.exports.Ajv=Er;Object.defineProperty(K,"__esModule",{value:!0});K.default=Er;var z1=dr();Object.defineProperty(K,"KeywordCxt",{enumerable:!0,get:function(){return z1.KeywordCxt}});var Sr=T();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return Sr._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return Sr.str}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return Sr.stringify}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return Sr.nil}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return Sr.Name}});Object.defineProperty(K,"CodeGen",{enumerable:!0,get:function(){return Sr.CodeGen}});var B1=os();Object.defineProperty(K,"ValidationError",{enumerable:!0,get:function(){return B1.default}});var K1=fr();Object.defineProperty(K,"MissingRefError",{enumerable:!0,get:function(){return K1.default}})});var Ff=d(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.formatLimitDefinition=void 0;var W1=Vf(),Ge=T(),Nt=Ge.operators,ki={formatMaximum:{okStr:"<=",ok:Nt.LTE,fail:Nt.GT},formatMinimum:{okStr:">=",ok:Nt.GTE,fail:Nt.LT},formatExclusiveMaximum:{okStr:"<",ok:Nt.LT,fail:Nt.GTE},formatExclusiveMinimum:{okStr:">",ok:Nt.GT,fail:Nt.LTE}},Y1={message:({keyword:r,schemaCode:e})=>(0,Ge.str)`should be ${ki[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Ge._)`{comparison: ${ki[r].okStr}, limit: ${e}}`};Or.formatLimitDefinition={keyword:Object.keys(ki),type:"string",schemaType:"string",$data:!0,error:Y1,code(r){let{gen:e,data:t,schemaCode:s,keyword:i,it:n}=r,{opts:o,self:a}=n;if(!o.validateFormats)return;let u=new W1.KeywordCxt(n,a.RULES.all.format.definition,"format");u.$data?c():l();function c(){let f=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),p=e.const("fmt",(0,Ge._)`${f}[${u.schemaCode}]`);r.fail$data((0,Ge.or)((0,Ge._)`typeof ${p} != "object"`,(0,Ge._)`${p} instanceof RegExp`,(0,Ge._)`typeof ${p}.compare != "function"`,h(p)))}function l(){let f=u.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:o.code.formats?(0,Ge._)`${o.code.formats}${(0,Ge.getProperty)(f)}`:void 0});r.fail$data(h(m))}function h(f){return(0,Ge._)`${f}.compare(${t}, ${s}) ${ki[i].fail} 0`}},dependencies:["format"]};var X1=r=>(r.addKeyword(Or.formatLimitDefinition),r);Or.default=X1});var zf=d((Es,Gf)=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});var xr=jf(),J1=Ff(),su=T(),Uf=new su.Name("fullFormats"),Z1=new su.Name("fastFormats"),iu=(r,e={keywords:!0})=>{if(Array.isArray(e))return Hf(r,e,xr.fullFormats,Uf),r;let[t,s]=e.mode==="fast"?[xr.fastFormats,Z1]:[xr.fullFormats,Uf],i=e.formats||xr.formatNames;return Hf(r,i,t,s),e.keywords&&(0,J1.default)(r),r};iu.get=(r,e="full")=>{let s=(e==="fast"?xr.fastFormats:xr.fullFormats)[r];if(!s)throw new Error(`Unknown format "${r}"`);return s};function Hf(r,e,t,s){var i,n;(i=(n=r.opts.code).formats)!==null&&i!==void 0||(n.formats=(0,su._)`require("ajv-formats/dist/formats").${s}`);for(let o of e)r.addFormat(o,t[o])}Gf.exports=Es=iu;Object.defineProperty(Es,"__esModule",{value:!0});Es.default=iu});var Tr=d((Bj,Bf)=>{"use strict";var ax="2.0.0",ux=Number.MAX_SAFE_INTEGER||9007199254740991,cx=16,lx=250,hx=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Bf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cx,MAX_SAFE_BUILD_LENGTH:lx,MAX_SAFE_INTEGER:ux,RELEASE_TYPES:hx,SEMVER_SPEC_VERSION:ax,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ss=d((Kj,Kf)=>{"use strict";var dx=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Kf.exports=dx});var Pr=d((rt,Wf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:au,MAX_SAFE_BUILD_LENGTH:fx,MAX_LENGTH:px}=Tr(),mx=Ss();rt=Wf.exports={};var gx=rt.re=[],yx=rt.safeRe=[],v=rt.src=[],_x=rt.safeSrc=[],b=rt.t={},vx=0,uu="[a-zA-Z0-9-]",bx=[["\\s",1],["\\d",px],[uu,fx]],wx=r=>{for(let[e,t]of bx)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},P=(r,e,t)=>{let s=wx(e),i=vx++;mx(r,i,e),b[r]=i,v[i]=e,_x[i]=s,gx[i]=new RegExp(e,t?"g":void 0),yx[i]=new RegExp(s,t?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${uu}*`);P("MAINVERSION",`(${v[b.NUMERICIDENTIFIER]})\\.(${v[b.NUMERICIDENTIFIER]})\\.(${v[b.NUMERICIDENTIFIER]})`);P("MAINVERSIONLOOSE",`(${v[b.NUMERICIDENTIFIERLOOSE]})\\.(${v[b.NUMERICIDENTIFIERLOOSE]})\\.(${v[b.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASEIDENTIFIER",`(?:${v[b.NONNUMERICIDENTIFIER]}|${v[b.NUMERICIDENTIFIER]})`);P("PRERELEASEIDENTIFIERLOOSE",`(?:${v[b.NONNUMERICIDENTIFIER]}|${v[b.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASE",`(?:-(${v[b.PRERELEASEIDENTIFIER]}(?:\\.${v[b.PRERELEASEIDENTIFIER]})*))`);P("PRERELEASELOOSE",`(?:-?(${v[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${v[b.PRERELEASEIDENTIFIERLOOSE]})*))`);P("BUILDIDENTIFIER",`${uu}+`);P("BUILD",`(?:\\+(${v[b.BUILDIDENTIFIER]}(?:\\.${v[b.BUILDIDENTIFIER]})*))`);P("FULLPLAIN",`v?${v[b.MAINVERSION]}${v[b.PRERELEASE]}?${v[b.BUILD]}?`);P("FULL",`^${v[b.FULLPLAIN]}$`);P("LOOSEPLAIN",`[v=\\s]*${v[b.MAINVERSIONLOOSE]}${v[b.PRERELEASELOOSE]}?${v[b.BUILD]}?`);P("LOOSE",`^${v[b.LOOSEPLAIN]}$`);P("GTLT","((?:<|>)?=?)");P("XRANGEIDENTIFIERLOOSE",`${v[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P("XRANGEIDENTIFIER",`${v[b.NUMERICIDENTIFIER]}|x|X|\\*`);P("XRANGEPLAIN",`[v=\\s]*(${v[b.XRANGEIDENTIFIER]})(?:\\.(${v[b.XRANGEIDENTIFIER]})(?:\\.(${v[b.XRANGEIDENTIFIER]})(?:${v[b.PRERELEASE]})?${v[b.BUILD]}?)?)?`);P("XRANGEPLAINLOOSE",`[v=\\s]*(${v[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[b.XRANGEIDENTIFIERLOOSE]})(?:${v[b.PRERELEASELOOSE]})?${v[b.BUILD]}?)?)?`);P("XRANGE",`^${v[b.GTLT]}\\s*${v[b.XRANGEPLAIN]}$`);P("XRANGELOOSE",`^${v[b.GTLT]}\\s*${v[b.XRANGEPLAINLOOSE]}$`);P("COERCEPLAIN",`(^|[^\\d])(\\d{1,${au}})(?:\\.(\\d{1,${au}}))?(?:\\.(\\d{1,${au}}))?`);P("COERCE",`${v[b.COERCEPLAIN]}(?:$|[^\\d])`);P("COERCEFULL",v[b.COERCEPLAIN]+`(?:${v[b.PRERELEASE]})?(?:${v[b.BUILD]})?(?:$|[^\\d])`);P("COERCERTL",v[b.COERCE],!0);P("COERCERTLFULL",v[b.COERCEFULL],!0);P("LONETILDE","(?:~>?)");P("TILDETRIM",`(\\s*)${v[b.LONETILDE]}\\s+`,!0);rt.tildeTrimReplace="$1~";P("TILDE",`^${v[b.LONETILDE]}${v[b.XRANGEPLAIN]}$`);P("TILDELOOSE",`^${v[b.LONETILDE]}${v[b.XRANGEPLAINLOOSE]}$`);P("LONECARET","(?:\\^)");P("CARETTRIM",`(\\s*)${v[b.LONECARET]}\\s+`,!0);rt.caretTrimReplace="$1^";P("CARET",`^${v[b.LONECARET]}${v[b.XRANGEPLAIN]}$`);P("CARETLOOSE",`^${v[b.LONECARET]}${v[b.XRANGEPLAINLOOSE]}$`);P("COMPARATORLOOSE",`^${v[b.GTLT]}\\s*(${v[b.LOOSEPLAIN]})$|^$`);P("COMPARATOR",`^${v[b.GTLT]}\\s*(${v[b.FULLPLAIN]})$|^$`);P("COMPARATORTRIM",`(\\s*)${v[b.GTLT]}\\s*(${v[b.LOOSEPLAIN]}|${v[b.XRANGEPLAIN]})`,!0);rt.comparatorTrimReplace="$1$2$3";P("HYPHENRANGE",`^\\s*(${v[b.XRANGEPLAIN]})\\s+-\\s+(${v[b.XRANGEPLAIN]})\\s*$`);P("HYPHENRANGELOOSE",`^\\s*(${v[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${v[b.XRANGEPLAINLOOSE]})\\s*$`);P("STAR","(<|>)?=?\\s*\\*");P("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Di=d((Wj,Yf)=>{"use strict";var $x=Object.freeze({loose:!0}),Ex=Object.freeze({}),Sx=r=>r?typeof r!="object"?$x:r:Ex;Yf.exports=Sx});var cu=d((Yj,Zf)=>{"use strict";var Xf=/^[0-9]+$/,Jf=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=Xf.test(r),s=Xf.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},Ox=(r,e)=>Jf(e,r);Zf.exports={compareIdentifiers:Jf,rcompareIdentifiers:Ox}});var ue=d((Xj,ep)=>{"use strict";var Mi=Ss(),{MAX_LENGTH:Qf,MAX_SAFE_INTEGER:Li}=Tr(),{safeRe:Vi,t:Fi}=Pr(),xx=Di(),{compareIdentifiers:lu}=cu(),hu=class r{constructor(e,t){if(t=xx(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Qf)throw new TypeError(`version is longer than ${Qf} characters`);Mi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?Vi[Fi.LOOSE]:Vi[Fi.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Li||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Li||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Li||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<Li)return n}return i}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Mi("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let s=this.prerelease[t],i=e.prerelease[t];if(Mi("prerelease compare",t,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return lu(s,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let s=this.build[t],i=e.build[t];if(Mi("build compare",t,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return lu(s,i)}while(++t)}inc(e,t,s){if(e.startsWith("pre")){if(!t&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?Vi[Fi.PRERELEASELOOSE]:Vi[Fi.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,s),this.inc("pre",t,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,s),this.inc("pre",t,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];s===!1&&(n=[t]),lu(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ep.exports=hu});var qt=d((Jj,rp)=>{"use strict";var tp=ue(),Tx=(r,e,t=!1)=>{if(r instanceof tp)return r;try{return new tp(r,e)}catch(s){if(!t)return null;throw s}};rp.exports=Tx});var ip=d((Zj,sp)=>{"use strict";var Px=qt(),Ax=(r,e)=>{let t=Px(r,e);return t?t.version:null};sp.exports=Ax});var op=d((Qj,np)=>{"use strict";var Ix=qt(),Cx=(r,e)=>{let t=Ix(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};np.exports=Cx});var cp=d((ek,up)=>{"use strict";var ap=ue(),Rx=(r,e,t,s,i)=>{typeof t=="string"&&(i=s,s=t,t=void 0);try{return new ap(r instanceof ap?r.version:r,t).inc(e,s,i).version}catch{return null}};up.exports=Rx});var dp=d((tk,hp)=>{"use strict";var lp=qt(),Nx=(r,e)=>{let t=lp(r,null,!0),s=lp(e,null,!0),i=t.compare(s);if(i===0)return null;let n=i>0,o=n?t:s,a=n?s:t,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return t.major!==s.major?l+"major":t.minor!==s.minor?l+"minor":t.patch!==s.patch?l+"patch":"prerelease"};hp.exports=Nx});var pp=d((rk,fp)=>{"use strict";var qx=ue(),jx=(r,e)=>new qx(r,e).major;fp.exports=jx});var gp=d((sk,mp)=>{"use strict";var kx=ue(),Dx=(r,e)=>new kx(r,e).minor;mp.exports=Dx});var _p=d((ik,yp)=>{"use strict";var Mx=ue(),Lx=(r,e)=>new Mx(r,e).patch;yp.exports=Lx});var bp=d((nk,vp)=>{"use strict";var Vx=qt(),Fx=(r,e)=>{let t=Vx(r,e);return t&&t.prerelease.length?t.prerelease:null};vp.exports=Fx});var Ne=d((ok,$p)=>{"use strict";var wp=ue(),Ux=(r,e,t)=>new wp(r,t).compare(new wp(e,t));$p.exports=Ux});var Sp=d((ak,Ep)=>{"use strict";var Hx=Ne(),Gx=(r,e,t)=>Hx(e,r,t);Ep.exports=Gx});var xp=d((uk,Op)=>{"use strict";var zx=Ne(),Bx=(r,e)=>zx(r,e,!0);Op.exports=Bx});var Ui=d((ck,Pp)=>{"use strict";var Tp=ue(),Kx=(r,e,t)=>{let s=new Tp(r,t),i=new Tp(e,t);return s.compare(i)||s.compareBuild(i)};Pp.exports=Kx});var Ip=d((lk,Ap)=>{"use strict";var Wx=Ui(),Yx=(r,e)=>r.sort((t,s)=>Wx(t,s,e));Ap.exports=Yx});var Rp=d((hk,Cp)=>{"use strict";var Xx=Ui(),Jx=(r,e)=>r.sort((t,s)=>Xx(s,t,e));Cp.exports=Jx});var Os=d((dk,Np)=>{"use strict";var Zx=Ne(),Qx=(r,e,t)=>Zx(r,e,t)>0;Np.exports=Qx});var Hi=d((fk,qp)=>{"use strict";var eT=Ne(),tT=(r,e,t)=>eT(r,e,t)<0;qp.exports=tT});var du=d((pk,jp)=>{"use strict";var rT=Ne(),sT=(r,e,t)=>rT(r,e,t)===0;jp.exports=sT});var fu=d((mk,kp)=>{"use strict";var iT=Ne(),nT=(r,e,t)=>iT(r,e,t)!==0;kp.exports=nT});var Gi=d((gk,Dp)=>{"use strict";var oT=Ne(),aT=(r,e,t)=>oT(r,e,t)>=0;Dp.exports=aT});var zi=d((yk,Mp)=>{"use strict";var uT=Ne(),cT=(r,e,t)=>uT(r,e,t)<=0;Mp.exports=cT});var pu=d((_k,Lp)=>{"use strict";var lT=du(),hT=fu(),dT=Os(),fT=Gi(),pT=Hi(),mT=zi(),gT=(r,e,t,s)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return lT(r,t,s);case"!=":return hT(r,t,s);case">":return dT(r,t,s);case">=":return fT(r,t,s);case"<":return pT(r,t,s);case"<=":return mT(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};Lp.exports=gT});var Fp=d((vk,Vp)=>{"use strict";var yT=ue(),_T=qt(),{safeRe:Bi,t:Ki}=Pr(),vT=(r,e)=>{if(r instanceof yT)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?Bi[Ki.COERCEFULL]:Bi[Ki.COERCE]);else{let u=e.includePrerelease?Bi[Ki.COERCERTLFULL]:Bi[Ki.COERCERTL],c;for(;(c=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(t===null)return null;let s=t[2],i=t[3]||"0",n=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",a=e.includePrerelease&&t[6]?`+${t[6]}`:"";return _T(`${s}.${i}.${n}${o}${a}`,e)};Vp.exports=vT});var Hp=d((bk,Up)=>{"use strict";var bT=qt(),wT=Tr(),$T=ue(),ET=(r,e,t)=>{if(!wT.RELEASE_TYPES.includes(e))return null;let s=ST(r,t);return s&&OT(s,e)},ST=(r,e)=>{let t=r instanceof $T?r.version:r;return bT(t,e)},OT=(r,e)=>{if(xT(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},xT=r=>r.startsWith("pre");Up.exports=ET});var zp=d((wk,Gp)=>{"use strict";var mu=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};Gp.exports=mu});var qe=d(($k,Yp)=>{"use strict";var TT=/\s+/g,gu=class r{constructor(e,t){if(t=AT(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof yu)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(TT," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(i=>!Kp(i[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&MT(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let s=0;s<t.length;s++)s>0&&(this.formatted+=" "),this.formatted+=t[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(DT,"");let s=((this.options.includePrerelease&&jT)|(this.options.loose&&kT))+":"+e,i=Bp.get(s);if(i)return i;let n=this.options.loose,o=n?ye[ce.HYPHENRANGELOOSE]:ye[ce.HYPHENRANGE];e=e.replace(o,WT(this.options.includePrerelease)),W("hyphen replace",e),e=e.replace(ye[ce.COMPARATORTRIM],RT),W("comparator trim",e),e=e.replace(ye[ce.TILDETRIM],NT),W("tilde trim",e),e=e.replace(ye[ce.CARETTRIM],qT),W("caret trim",e);let a=e.split(" ").map(h=>LT(h,this.options)).join(" ").split(/\s+/).map(h=>KT(h,this.options));n&&(a=a.filter(h=>(W("loose invalid filter",h,this.options),!!h.match(ye[ce.COMPARATORLOOSE])))),W("range list",a);let u=new Map,c=a.map(h=>new yu(h,this.options));for(let h of c){if(Kp(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Bp.set(s,l),l}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(s=>Wp(s,t)&&e.set.some(i=>Wp(i,t)&&s.every(n=>i.every(o=>n.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new IT(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(YT(this.set[t],e,this.options))return!0;return!1}};Yp.exports=gu;var PT=zp(),Bp=new PT,AT=Di(),yu=xs(),W=Ss(),IT=ue(),{safeRe:ye,src:CT,t:ce,comparatorTrimReplace:RT,tildeTrimReplace:NT,caretTrimReplace:qT}=Pr(),{FLAG_INCLUDE_PRERELEASE:jT,FLAG_LOOSE:kT}=Tr(),DT=new RegExp(CT[ce.BUILD],"g"),Kp=r=>r.value==="<0.0.0-0",MT=r=>r.value==="",Wp=(r,e)=>{let t=!0,s=r.slice(),i=s.pop();for(;t&&s.length;)t=s.every(n=>i.intersects(n,e)),i=s.pop();return t},LT=(r,e)=>(r=r.replace(ye[ce.BUILD],""),W("comp",r,e),r=UT(r,e),W("caret",r),r=VT(r,e),W("tildes",r),r=GT(r,e),W("xrange",r),r=BT(r,e),W("stars",r),r),_e=r=>!r||r.toLowerCase()==="x"||r==="*",VT=(r,e)=>r.trim().split(/\s+/).map(t=>FT(t,e)).join(" "),FT=(r,e)=>{let t=e.loose?ye[ce.TILDELOOSE]:ye[ce.TILDE];return r.replace(t,(s,i,n,o,a)=>{W("tilde",r,s,i,n,o,a);let u;return _e(i)?u="":_e(n)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:_e(o)?u=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:a?(W("replaceTilde pr",a),u=`>=${i}.${n}.${o}-${a} <${i}.${+n+1}.0-0`):u=`>=${i}.${n}.${o} <${i}.${+n+1}.0-0`,W("tilde return",u),u})},UT=(r,e)=>r.trim().split(/\s+/).map(t=>HT(t,e)).join(" "),HT=(r,e)=>{W("caret",r,e);let t=e.loose?ye[ce.CARETLOOSE]:ye[ce.CARET],s=e.includePrerelease?"-0":"";return r.replace(t,(i,n,o,a,u)=>{W("caret",r,i,n,o,a,u);let c;return _e(n)?c="":_e(o)?c=`>=${n}.0.0${s} <${+n+1}.0.0-0`:_e(a)?n==="0"?c=`>=${n}.${o}.0${s} <${n}.${+o+1}.0-0`:c=`>=${n}.${o}.0${s} <${+n+1}.0.0-0`:u?(W("replaceCaret pr",u),n==="0"?o==="0"?c=`>=${n}.${o}.${a}-${u} <${n}.${o}.${+a+1}-0`:c=`>=${n}.${o}.${a}-${u} <${n}.${+o+1}.0-0`:c=`>=${n}.${o}.${a}-${u} <${+n+1}.0.0-0`):(W("no pr"),n==="0"?o==="0"?c=`>=${n}.${o}.${a}${s} <${n}.${o}.${+a+1}-0`:c=`>=${n}.${o}.${a}${s} <${n}.${+o+1}.0-0`:c=`>=${n}.${o}.${a} <${+n+1}.0.0-0`),W("caret return",c),c})},GT=(r,e)=>(W("replaceXRanges",r,e),r.split(/\s+/).map(t=>zT(t,e)).join(" ")),zT=(r,e)=>{r=r.trim();let t=e.loose?ye[ce.XRANGELOOSE]:ye[ce.XRANGE];return r.replace(t,(s,i,n,o,a,u)=>{W("xRange",r,s,i,n,o,a,u);let c=_e(n),l=c||_e(o),h=l||_e(a),f=h;return i==="="&&f&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?s="<0.0.0-0":s="*":i&&f?(l&&(o=0),a=0,i===">"?(i=">=",l?(n=+n+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?n=+n+1:o=+o+1),i==="<"&&(u="-0"),s=`${i+n}.${o}.${a}${u}`):l?s=`>=${n}.0.0${u} <${+n+1}.0.0-0`:h&&(s=`>=${n}.${o}.0${u} <${n}.${+o+1}.0-0`),W("xRange return",s),s})},BT=(r,e)=>(W("replaceStars",r,e),r.trim().replace(ye[ce.STAR],"")),KT=(r,e)=>(W("replaceGTE0",r,e),r.trim().replace(ye[e.includePrerelease?ce.GTE0PRE:ce.GTE0],"")),WT=r=>(e,t,s,i,n,o,a,u,c,l,h,f)=>(_e(s)?t="":_e(i)?t=`>=${s}.0.0${r?"-0":""}`:_e(n)?t=`>=${s}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,_e(c)?u="":_e(l)?u=`<${+c+1}.0.0-0`:_e(h)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${h}-${f}`:r?u=`<${c}.${l}.${+h+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),YT=(r,e,t)=>{for(let s=0;s<r.length;s++)if(!r[s].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let s=0;s<r.length;s++)if(W(r[s].semver),r[s].semver!==yu.ANY&&r[s].semver.prerelease.length>0){let i=r[s].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var xs=d((Ek,tm)=>{"use strict";var Ts=Symbol("SemVer ANY"),bu=class r{static get ANY(){return Ts}constructor(e,t){if(t=Xp(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),vu("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ts?this.value="":this.value=this.operator+this.semver.version,vu("comp",this)}parse(e){let t=this.options.loose?Jp[Zp.COMPARATORLOOSE]:Jp[Zp.COMPARATOR],s=e.match(t);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new Qp(s[2],this.options.loose):this.semver=Ts}toString(){return this.value}test(e){if(vu("Comparator.test",e,this.options.loose),this.semver===Ts||e===Ts)return!0;if(typeof e=="string")try{e=new Qp(e,this.options)}catch{return!1}return _u(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new em(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new em(this.value,t).test(e.semver):(t=Xp(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||_u(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||_u(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};tm.exports=bu;var Xp=Di(),{safeRe:Jp,t:Zp}=Pr(),_u=pu(),vu=Ss(),Qp=ue(),em=qe()});var Ps=d((Sk,rm)=>{"use strict";var XT=qe(),JT=(r,e,t)=>{try{e=new XT(e,t)}catch{return!1}return e.test(r)};rm.exports=JT});var im=d((Ok,sm)=>{"use strict";var ZT=qe(),QT=(r,e)=>new ZT(r,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));sm.exports=QT});var om=d((xk,nm)=>{"use strict";var eP=ue(),tP=qe(),rP=(r,e,t)=>{let s=null,i=null,n=null;try{n=new tP(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new eP(s,t))}),s};nm.exports=rP});var um=d((Tk,am)=>{"use strict";var sP=ue(),iP=qe(),nP=(r,e,t)=>{let s=null,i=null,n=null;try{n=new iP(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new sP(s,t))}),s};am.exports=nP});var hm=d((Pk,lm)=>{"use strict";var wu=ue(),oP=qe(),cm=Os(),aP=(r,e)=>{r=new oP(r,e);let t=new wu("0.0.0");if(r.test(t)||(t=new wu("0.0.0-0"),r.test(t)))return t;t=null;for(let s=0;s<r.set.length;++s){let i=r.set[s],n=null;i.forEach(o=>{let a=new wu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!n||cm(a,n))&&(n=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),n&&(!t||cm(t,n))&&(t=n)}return t&&r.test(t)?t:null};lm.exports=aP});var fm=d((Ak,dm)=>{"use strict";var uP=qe(),cP=(r,e)=>{try{return new uP(r,e).range||"*"}catch{return null}};dm.exports=cP});var Wi=d((Ik,ym)=>{"use strict";var lP=ue(),gm=xs(),{ANY:hP}=gm,dP=qe(),fP=Ps(),pm=Os(),mm=Hi(),pP=zi(),mP=Gi(),gP=(r,e,t,s)=>{r=new lP(r,s),e=new dP(e,s);let i,n,o,a,u;switch(t){case">":i=pm,n=pP,o=mm,a=">",u=">=";break;case"<":i=mm,n=mP,o=pm,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(fP(r,e,s))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],h=null,f=null;if(l.forEach(p=>{p.semver===hP&&(p=new gm(">=0.0.0")),h=h||p,f=f||p,i(p.semver,h.semver,s)?h=p:o(p.semver,f.semver,s)&&(f=p)}),h.operator===a||h.operator===u||(!f.operator||f.operator===a)&&n(r,f.semver))return!1;if(f.operator===u&&o(r,f.semver))return!1}return!0};ym.exports=gP});var vm=d((Ck,_m)=>{"use strict";var yP=Wi(),_P=(r,e,t)=>yP(r,e,">",t);_m.exports=_P});var wm=d((Rk,bm)=>{"use strict";var vP=Wi(),bP=(r,e,t)=>vP(r,e,"<",t);bm.exports=bP});var Sm=d((Nk,Em)=>{"use strict";var $m=qe(),wP=(r,e,t)=>(r=new $m(r,t),e=new $m(e,t),r.intersects(e,t));Em.exports=wP});var xm=d((qk,Om)=>{"use strict";var $P=Ps(),EP=Ne();Om.exports=(r,e,t)=>{let s=[],i=null,n=null,o=r.sort((l,h)=>EP(l,h,t));for(let l of o)$P(l,e,t)?(n=l,i||(i=l)):(n&&s.push([i,n]),n=null,i=null);i&&s.push([i,null]);let a=[];for(let[l,h]of s)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Rm=d((jk,Cm)=>{"use strict";var Tm=qe(),Su=xs(),{ANY:$u}=Su,Eu=Ps(),Ou=Ne(),SP=(r,e,t={})=>{if(r===e)return!0;r=new Tm(r,t),e=new Tm(e,t);let s=!1;e:for(let i of r.set){for(let n of e.set){let o=xP(i,n,t);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},OP=[new Su(">=0.0.0-0")],Pm=[new Su(">=0.0.0")],xP=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===$u){if(e.length===1&&e[0].semver===$u)return!0;t.includePrerelease?r=OP:r=Pm}if(e.length===1&&e[0].semver===$u){if(t.includePrerelease)return!0;e=Pm}let s=new Set,i,n;for(let p of r)p.operator===">"||p.operator===">="?i=Am(i,p,t):p.operator==="<"||p.operator==="<="?n=Im(n,p,t):s.add(p.semver);if(s.size>1)return null;let o;if(i&&n){if(o=Ou(i.semver,n.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of s){if(i&&!Eu(p,String(i),t)||n&&!Eu(p,String(n),t))return null;for(let m of e)if(!Eu(p,String(m),t))return!1;return!0}let a,u,c,l,h=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,f=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&n.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",c=c||p.operator==="<"||p.operator==="<=",i){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator===">"||p.operator===">="){if(a=Am(i,p,t),a===p&&a!==i)return!1}else if(i.operator===">="&&!p.test(i.semver))return!1}if(n){if(h&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===h.major&&p.semver.minor===h.minor&&p.semver.patch===h.patch&&(h=!1),p.operator==="<"||p.operator==="<="){if(u=Im(n,p,t),u===p&&u!==n)return!1}else if(n.operator==="<="&&!p.test(n.semver))return!1}if(!p.operator&&(n||i)&&o!==0)return!1}return!(i&&c&&!n&&o!==0||n&&l&&!i&&o!==0||f||h)},Am=(r,e,t)=>{if(!r)return e;let s=Ou(r.semver,e.semver,t);return s>0?r:s<0||e.operator===">"&&r.operator===">="?e:r},Im=(r,e,t)=>{if(!r)return e;let s=Ou(r.semver,e.semver,t);return s<0?r:s>0||e.operator==="<"&&r.operator==="<="?e:r};Cm.exports=SP});var km=d((kk,jm)=>{"use strict";var xu=Pr(),Nm=Tr(),TP=ue(),qm=cu(),PP=qt(),AP=ip(),IP=op(),CP=cp(),RP=dp(),NP=pp(),qP=gp(),jP=_p(),kP=bp(),DP=Ne(),MP=Sp(),LP=xp(),VP=Ui(),FP=Ip(),UP=Rp(),HP=Os(),GP=Hi(),zP=du(),BP=fu(),KP=Gi(),WP=zi(),YP=pu(),XP=Fp(),JP=Hp(),ZP=xs(),QP=qe(),eA=Ps(),tA=im(),rA=om(),sA=um(),iA=hm(),nA=fm(),oA=Wi(),aA=vm(),uA=wm(),cA=Sm(),lA=xm(),hA=Rm();jm.exports={parse:PP,valid:AP,clean:IP,inc:CP,diff:RP,major:NP,minor:qP,patch:jP,prerelease:kP,compare:DP,rcompare:MP,compareLoose:LP,compareBuild:VP,sort:FP,rsort:UP,gt:HP,lt:GP,eq:zP,neq:BP,gte:KP,lte:WP,cmp:YP,coerce:XP,truncate:JP,Comparator:ZP,Range:QP,satisfies:eA,toComparators:tA,maxSatisfying:rA,minSatisfying:sA,minVersion:iA,validRange:nA,outside:oA,gtr:aA,ltr:uA,intersects:cA,simplifyRange:lA,subset:hA,SemVer:TP,re:xu.re,src:xu.src,tokens:xu.t,SEMVER_SPEC_VERSION:Nm.SEMVER_SPEC_VERSION,RELEASE_TYPES:Nm.RELEASE_TYPES,compareIdentifiers:qm.compareIdentifiers,rcompareIdentifiers:qm.rcompareIdentifiers}});var ee=d((zk,Bm)=>{"use strict";var{FORCE_COLOR:$A,NODE_DISABLE_COLORS:EA,TERM:SA}=process.env,L={enabled:!EA&&SA!=="dumb"&&$A!=="0",reset:H(0,0),bold:H(1,22),dim:H(2,22),italic:H(3,23),underline:H(4,24),inverse:H(7,27),hidden:H(8,28),strikethrough:H(9,29),black:H(30,39),red:H(31,39),green:H(32,39),yellow:H(33,39),blue:H(34,39),magenta:H(35,39),cyan:H(36,39),white:H(37,39),gray:H(90,39),grey:H(90,39),bgBlack:H(40,49),bgRed:H(41,49),bgGreen:H(42,49),bgYellow:H(43,49),bgBlue:H(44,49),bgMagenta:H(45,49),bgCyan:H(46,49),bgWhite:H(47,49)};function zm(r,e){let t=0,s,i="",n="";for(;t<r.length;t++)s=r[t],i+=s.open,n+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return i+e+n}function OA(r,e){let t={has:r,keys:e};return t.reset=L.reset.bind(t),t.bold=L.bold.bind(t),t.dim=L.dim.bind(t),t.italic=L.italic.bind(t),t.underline=L.underline.bind(t),t.inverse=L.inverse.bind(t),t.hidden=L.hidden.bind(t),t.strikethrough=L.strikethrough.bind(t),t.black=L.black.bind(t),t.red=L.red.bind(t),t.green=L.green.bind(t),t.yellow=L.yellow.bind(t),t.blue=L.blue.bind(t),t.magenta=L.magenta.bind(t),t.cyan=L.cyan.bind(t),t.white=L.white.bind(t),t.gray=L.gray.bind(t),t.grey=L.grey.bind(t),t.bgBlack=L.bgBlack.bind(t),t.bgRed=L.bgRed.bind(t),t.bgGreen=L.bgGreen.bind(t),t.bgYellow=L.bgYellow.bind(t),t.bgBlue=L.bgBlue.bind(t),t.bgMagenta=L.bgMagenta.bind(t),t.bgCyan=L.bgCyan.bind(t),t.bgWhite=L.bgWhite.bind(t),t}function H(r,e){let t={open:`\x1B[${r}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(r)||(this.has.push(r),this.keys.push(t)),s===void 0?this:L.enabled?zm(this.keys,s+""):s+""):s===void 0?OA([r],[t]):L.enabled?zm([t],s+""):s+""}}Bm.exports=L});var Wm=d((Bk,Km)=>{"use strict";Km.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var Zi=d((Kk,Ym)=>{"use strict";Ym.exports=r=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof r=="string"?r.replace(t,""):r}});var te=d((Wk,Xm)=>{"use strict";var Cu={to(r,e){return e?`\x1B[${e+1};${r+1}H`:`\x1B[${r+1}G`},move(r,e){let t="";return r<0?t+=`\x1B[${-r}D`:r>0&&(t+=`\x1B[${r}C`),e<0?t+=`\x1B[${-e}A`:e>0&&(t+=`\x1B[${e}B`),t},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},xA={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},TA={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let e="";for(let t=0;t<r;t++)e+=this.line+(t<r-1?Cu.up():"");return r&&(e+=Cu.left),e}};Xm.exports={cursor:Cu,scroll:xA,erase:TA,beep:"\x07"}});var tg=d((Yk,eg)=>{"use strict";function PA(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=AA(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var s=0,i=function(){};return{s:i,n:function(){return s>=r.length?{done:!0}:{done:!1,value:r[s++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){t=t.call(r)},n:function(){var c=t.next();return n=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function
|
|
9
|
+
deps: ${t}}`};var US={keyword:"dependencies",type:"object",schemaType:"object",error:tt.error,code(r){let[e,t]=HS(r);Kd(r,e),Wd(r,t)}};function HS({schema:r}){let e={},t={};for(let s in r){if(s==="__proto__")continue;let i=Array.isArray(r[s])?e:t;i[s]=r[s]}return[e,t]}function Kd(r,e=r.schema){let{gen:t,data:s,it:i}=r;if(Object.keys(e).length===0)return;let n=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let u=(0,Es.propertyInData)(t,s,o,i.opts.ownProperties);r.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?t.if(u,()=>{for(let c of a)(0,Es.checkReportMissingProp)(r,c)}):(t.if((0,$a._)`${u} && (${(0,Es.checkMissingProp)(r,a,n)})`),(0,Es.reportMissingProp)(r,n),t.else())}}tt.validatePropertyDeps=Kd;function Wd(r,e=r.schema){let{gen:t,data:s,keyword:i,it:n}=r,o=t.name("valid");for(let a in e)(0,VS.alwaysValidSchema)(n,e[a])||(t.if((0,Es.propertyInData)(t,s,a,n.opts.ownProperties),()=>{let u=r.subschema({keyword:i,schemaProp:a},o);r.mergeValidEvaluated(u,o)},()=>t.var(o,!0)),r.ok(o))}tt.validateSchemaDeps=Wd;tt.default=US});var Xd=d(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var Yd=T(),GS=R(),zS={message:"property name must be valid",params:({params:r})=>(0,Yd._)`{propertyName: ${r.propertyName}}`},BS={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:zS,code(r){let{gen:e,schema:t,data:s,it:i}=r;if((0,GS.alwaysValidSchema)(i,t))return;let n=e.name("valid");e.forIn("key",s,o=>{r.setParams({propertyName:o}),r.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},n),e.if((0,Yd.not)(n),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(n)}};Ea.default=BS});var Oa=d(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});var qi=Re(),ze=T(),KS=Ce(),Di=R(),WS={message:"must NOT have additional properties",params:({params:r})=>(0,ze._)`{additionalProperty: ${r.additionalProperty}}`},YS={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:WS,code(r){let{gen:e,schema:t,parentSchema:s,data:i,errsCount:n,it:o}=r;if(!n)throw new Error("ajv implementation error");let{allErrors:a,opts:u}=o;if(o.props=!0,u.removeAdditional!=="all"&&(0,Di.alwaysValidSchema)(o,t))return;let c=(0,qi.allSchemaProperties)(s.properties),l=(0,qi.allSchemaProperties)(s.patternProperties);h(),r.ok((0,ze._)`${n} === ${KS.default.errors}`);function h(){e.forIn("key",i,y=>{!c.length&&!l.length?m(y):e.if(f(y),()=>m(y))})}function f(y){let _;if(c.length>8){let w=(0,Di.schemaRefOrVal)(o,s.properties,"properties");_=(0,qi.isOwnProperty)(e,w,y)}else c.length?_=(0,ze.or)(...c.map(w=>(0,ze._)`${y} === ${w}`)):_=ze.nil;return l.length&&(_=(0,ze.or)(_,...l.map(w=>(0,ze._)`${(0,qi.usePattern)(r,w)}.test(${y})`))),(0,ze.not)(_)}function p(y){e.code((0,ze._)`delete ${i}[${y}]`)}function m(y){if(u.removeAdditional==="all"||u.removeAdditional&&t===!1){p(y);return}if(t===!1){r.setParams({additionalProperty:y}),r.error(),a||e.break();return}if(typeof t=="object"&&!(0,Di.alwaysValidSchema)(o,t)){let _=e.name("valid");u.removeAdditional==="failing"?(g(y,_,!1),e.if((0,ze.not)(_),()=>{r.reset(),p(y)})):(g(y,_),a||e.if((0,ze.not)(_),()=>e.break()))}}function g(y,_,w){let E={keyword:"additionalProperties",dataProp:y,dataPropType:Di.Type.Str};w===!1&&Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(E,_)}}};Sa.default=YS});var Qd=d(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var XS=mr(),Jd=Re(),xa=R(),Zd=Oa(),JS={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:s,data:i,it:n}=r;n.opts.removeAdditional==="all"&&s.additionalProperties===void 0&&Zd.default.code(new XS.KeywordCxt(n,Zd.default,"additionalProperties"));let o=(0,Jd.allSchemaProperties)(t);for(let h of o)n.definedProperties.add(h);n.opts.unevaluated&&o.length&&n.props!==!0&&(n.props=xa.mergeEvaluated.props(e,(0,xa.toHash)(o),n.props));let a=o.filter(h=>!(0,xa.alwaysValidSchema)(n,t[h]));if(a.length===0)return;let u=e.name("valid");for(let h of a)c(h)?l(h):(e.if((0,Jd.propertyInData)(e,i,h,n.opts.ownProperties)),l(h),n.allErrors||e.else().var(u,!0),e.endIf()),r.it.definedProperties.add(h),r.ok(u);function c(h){return n.opts.useDefaults&&!n.compositeRule&&t[h].default!==void 0}function l(h){r.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}}};Ta.default=JS});var sf=d(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var ef=Re(),ji=T(),tf=R(),rf=R(),ZS={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:s,parentSchema:i,it:n}=r,{opts:o}=n,a=(0,ef.allSchemaProperties)(t),u=a.filter(g=>(0,tf.alwaysValidSchema)(n,t[g]));if(a.length===0||u.length===a.length&&(!n.opts.unevaluated||n.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,l=e.name("valid");n.props!==!0&&!(n.props instanceof ji.Name)&&(n.props=(0,rf.evaluatedPropsToName)(e,n.props));let{props:h}=n;f();function f(){for(let g of a)c&&p(g),n.allErrors?m(g):(e.var(l,!0),m(g),e.if(l))}function p(g){for(let y in c)new RegExp(g).test(y)&&(0,tf.checkStrictMode)(n,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){e.forIn("key",s,y=>{e.if((0,ji._)`${(0,ef.usePattern)(r,g)}.test(${y})`,()=>{let _=u.includes(g);_||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:rf.Type.Str},l),n.opts.unevaluated&&h!==!0?e.assign((0,ji._)`${h}[${y}]`,!0):!_&&!n.allErrors&&e.if((0,ji.not)(l),()=>e.break())})})}}};Pa.default=ZS});var nf=d(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var QS=R(),eO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:s}=r;if((0,QS.alwaysValidSchema)(s,t)){r.fail();return}let i=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};Aa.default=eO});var of=d(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var tO=Re(),rO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:tO.validateUnion,error:{message:"must match a schema in anyOf"}};Ia.default=rO});var af=d(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var ki=T(),sO=R(),iO={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,ki._)`{passingSchemas: ${r.passing}}`},nO={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:iO,code(r){let{gen:e,schema:t,parentSchema:s,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&s.discriminator)return;let n=t,o=e.let("valid",!1),a=e.let("passing",null),u=e.name("_valid");r.setParams({passing:a}),e.block(c),r.result(o,()=>r.reset(),()=>r.error(!0));function c(){n.forEach((l,h)=>{let f;(0,sO.alwaysValidSchema)(i,l)?e.var(u,!0):f=r.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,ki._)`${u} && ${o}`).assign(o,!1).assign(a,(0,ki._)`[${a}, ${h}]`).else(),e.if(u,()=>{e.assign(o,!0),e.assign(a,h),f&&r.mergeEvaluated(f,ki.Name)})})}}};Ca.default=nO});var uf=d(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var oO=R(),aO={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let i=e.name("valid");t.forEach((n,o)=>{if((0,oO.alwaysValidSchema)(s,n))return;let a=r.subschema({keyword:"allOf",schemaProp:o},i);r.ok(i),r.mergeEvaluated(a)})}};Ra.default=aO});var hf=d(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Mi=T(),lf=R(),uO={message:({params:r})=>(0,Mi.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Mi._)`{failingKeyword: ${r.ifClause}}`},cO={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:uO,code(r){let{gen:e,parentSchema:t,it:s}=r;t.then===void 0&&t.else===void 0&&(0,lf.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let i=cf(s,"then"),n=cf(s,"else");if(!i&&!n)return;let o=e.let("valid",!0),a=e.name("_valid");if(u(),r.reset(),i&&n){let l=e.let("ifClause");r.setParams({ifClause:l}),e.if(a,c("then",l),c("else",l))}else i?e.if(a,c("then")):e.if((0,Mi.not)(a),c("else"));r.pass(o,()=>r.error(!0));function u(){let l=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(l)}function c(l,h){return()=>{let f=r.subschema({keyword:l},a);e.assign(o,a),r.mergeValidEvaluated(f,o),h?e.assign(h,(0,Mi._)`${l}`):r.setParams({ifClause:l})}}}};function cf(r,e){let t=r.schema[e];return t!==void 0&&!(0,lf.alwaysValidSchema)(r,t)}Na.default=cO});var df=d(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var lO=R(),hO={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,lO.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};qa.default=hO});var ja=d(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var dO=ya(),fO=Hd(),pO=_a(),mO=zd(),gO=Bd(),yO=Ni(),_O=Xd(),vO=Oa(),bO=Qd(),wO=sf(),$O=nf(),EO=of(),SO=af(),OO=uf(),xO=hf(),TO=df();function PO(r=!1){let e=[$O.default,EO.default,SO.default,OO.default,xO.default,TO.default,_O.default,vO.default,yO.default,bO.default,wO.default];return r?e.push(fO.default,mO.default):e.push(dO.default,pO.default),e.push(gO.default),e}Da.default=PO});var Ma=d(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.dynamicAnchor=void 0;var ka=T(),AO=Ce(),ff=cs(),IO=Ti(),CO={keyword:"$dynamicAnchor",schemaType:"string",code:r=>pf(r,r.schema)};function pf(r,e){let{gen:t,it:s}=r;s.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,ka._)`${AO.default.dynamicAnchors}${(0,ka.getProperty)(e)}`,n=s.errSchemaPath==="#"?s.validateName:RO(r);t.if((0,ka._)`!${i}`,()=>t.assign(i,n))}Ss.dynamicAnchor=pf;function RO(r){let{schemaEnv:e,schema:t,self:s}=r.it,{root:i,baseId:n,localRefs:o,meta:a}=e.root,{schemaId:u}=s.opts,c=new ff.SchemaEnv({schema:t,schemaId:u,root:i,baseId:n,localRefs:o,meta:a});return ff.compileSchema.call(s,c),(0,IO.getValidate)(r,c)}Ss.default=CO});var La=d(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.dynamicRef=void 0;var mf=T(),NO=Ce(),gf=Ti(),qO={keyword:"$dynamicRef",schemaType:"string",code:r=>yf(r,r.schema)};function yf(r,e){let{gen:t,keyword:s,it:i}=r;if(e[0]!=="#")throw new Error(`"${s}" only supports hash fragment reference`);let n=e.slice(1);if(i.allErrors)o();else{let u=t.let("valid",!1);o(u),r.ok(u)}function o(u){if(i.schemaEnv.root.dynamicAnchors[n]){let c=t.let("_v",(0,mf._)`${NO.default.dynamicAnchors}${(0,mf.getProperty)(n)}`);t.if(c,a(c,u),a(i.validateName,u))}else a(i.validateName,u)()}function a(u,c){return c?()=>t.block(()=>{(0,gf.callRef)(r,u),t.let(c,!0)}):()=>(0,gf.callRef)(r,u)}}Os.dynamicRef=yf;Os.default=qO});var _f=d(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var DO=Ma(),jO=R(),kO={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,DO.dynamicAnchor)(r,""):(0,jO.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Fa.default=kO});var vf=d(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});var MO=La(),LO={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,MO.dynamicRef)(r,r.schema)};Va.default=LO});var bf=d(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});var FO=Ma(),VO=La(),UO=_f(),HO=vf(),GO=[FO.default,VO.default,UO.default,HO.default];Ua.default=GO});var $f=d(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var wf=Ni(),zO={keyword:"dependentRequired",type:"object",schemaType:"object",error:wf.error,code:r=>(0,wf.validatePropertyDeps)(r)};Ha.default=zO});var Ef=d(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});var BO=Ni(),KO={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,BO.validateSchemaDeps)(r)};Ga.default=KO});var Sf=d(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var WO=R(),YO={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,WO.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};za.default=YO});var Of=d(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});var XO=$f(),JO=Ef(),ZO=Sf(),QO=[XO.default,JO.default,ZO.default];Ba.default=QO});var Tf=d(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});var qt=T(),xf=R(),e1=Ce(),t1={message:"must NOT have unevaluated properties",params:({params:r})=>(0,qt._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},r1={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:t1,code(r){let{gen:e,schema:t,data:s,errsCount:i,it:n}=r;if(!i)throw new Error("ajv implementation error");let{allErrors:o,props:a}=n;a instanceof qt.Name?e.if((0,qt._)`${a} !== true`,()=>e.forIn("key",s,h=>e.if(c(a,h),()=>u(h)))):a!==!0&&e.forIn("key",s,h=>a===void 0?u(h):e.if(l(a,h),()=>u(h))),n.props=!0,r.ok((0,qt._)`${i} === ${e1.default.errors}`);function u(h){if(t===!1){r.setParams({unevaluatedProperty:h}),r.error(),o||e.break();return}if(!(0,xf.alwaysValidSchema)(n,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:xf.Type.Str},f),o||e.if((0,qt.not)(f),()=>e.break())}}function c(h,f){return(0,qt._)`!${h} || !${h}[${f}]`}function l(h,f){let p=[];for(let m in h)h[m]===!0&&p.push((0,qt._)`${f} !== ${m}`);return(0,qt.and)(...p)}}};Ka.default=r1});var Af=d(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});var sr=T(),Pf=R(),s1={message:({params:{len:r}})=>(0,sr.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,sr._)`{limit: ${r}}`},i1={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:s1,code(r){let{gen:e,schema:t,data:s,it:i}=r,n=i.items||0;if(n===!0)return;let o=e.const("len",(0,sr._)`${s}.length`);if(t===!1)r.setParams({len:n}),r.fail((0,sr._)`${o} > ${n}`);else if(typeof t=="object"&&!(0,Pf.alwaysValidSchema)(i,t)){let u=e.var("valid",(0,sr._)`${o} <= ${n}`);e.if((0,sr.not)(u),()=>a(u,n)),r.ok(u)}i.items=!0;function a(u,c){e.forRange("i",c,o,l=>{r.subschema({keyword:"unevaluatedItems",dataProp:l,dataPropType:Pf.Type.Num},u),i.allErrors||e.if((0,sr.not)(u),()=>e.break())})}}};Wa.default=i1});var If=d(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});var n1=Tf(),o1=Af(),a1=[n1.default,o1.default];Ya.default=a1});var Cf=d(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});var re=T(),u1={message:({schemaCode:r})=>(0,re.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,re._)`{format: ${r}}`},c1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:u1,code(r,e){let{gen:t,data:s,$data:i,schema:n,schemaCode:o,it:a}=r,{opts:u,errSchemaPath:c,schemaEnv:l,self:h}=a;if(!u.validateFormats)return;i?f():p();function f(){let m=t.scopeValue("formats",{ref:h.formats,code:u.code.formats}),g=t.const("fDef",(0,re._)`${m}[${o}]`),y=t.let("fType"),_=t.let("format");t.if((0,re._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>t.assign(y,(0,re._)`${g}.type || "string"`).assign(_,(0,re._)`${g}.validate`),()=>t.assign(y,(0,re._)`"string"`).assign(_,g)),r.fail$data((0,re.or)(w(),E()));function w(){return u.strictSchema===!1?re.nil:(0,re._)`${o} && !${_}`}function E(){let O=l.$async?(0,re._)`(${g}.async ? await ${_}(${s}) : ${_}(${s}))`:(0,re._)`${_}(${s})`,S=(0,re._)`(typeof ${_} == "function" ? ${O} : ${_}.test(${s}))`;return(0,re._)`${_} && ${_} !== true && ${y} === ${e} && !${S}`}}function p(){let m=h.formats[n];if(!m){w();return}if(m===!0)return;let[g,y,_]=E(m);g===e&&r.pass(O());function w(){if(u.strictSchema===!1){h.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${n}" ignored in schema at path "${c}"`}}function E(S){let he=S instanceof RegExp?(0,re.regexpCode)(S):u.code.formats?(0,re._)`${u.code.formats}${(0,re.getProperty)(n)}`:void 0,U=t.scopeValue("formats",{key:n,ref:S,code:he});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,re._)`${U}.validate`]:["string",S,U]}function O(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,re._)`await ${_}(${s})`}return typeof y=="function"?(0,re._)`${_}(${s})`:(0,re._)`${_}.test(${s})`}}}};Xa.default=c1});var Za=d(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});var l1=Cf(),h1=[l1.default];Ja.default=h1});var Qa=d(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.contentVocabulary=wr.metadataVocabulary=void 0;wr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];wr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Nf=d(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});var d1=Qo(),f1=ma(),p1=ja(),m1=bf(),g1=Of(),y1=If(),_1=Za(),Rf=Qa(),v1=[m1.default,d1.default,f1.default,(0,p1.default)(!0),_1.default,Rf.metadataVocabulary,Rf.contentVocabulary,g1.default,y1.default];eu.default=v1});var Df=d(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.DiscrError=void 0;var qf;(function(r){r.Tag="tag",r.Mapping="mapping"})(qf||(Li.DiscrError=qf={}))});var su=d(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});var $r=T(),tu=Df(),jf=cs(),b1=gr(),w1=R(),$1={message:({params:{discrError:r,tagName:e}})=>r===tu.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,$r._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},E1={keyword:"discriminator",type:"object",schemaType:"object",error:$1,code(r){let{gen:e,data:t,schema:s,parentSchema:i,it:n}=r,{oneOf:o}=i;if(!n.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=s.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),c=e.const("tag",(0,$r._)`${t}${(0,$r.getProperty)(a)}`);e.if((0,$r._)`typeof ${c} == "string"`,()=>l(),()=>r.error(!1,{discrError:tu.DiscrError.Tag,tag:c,tagName:a})),r.ok(u);function l(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,$r._)`${c} === ${m}`),e.assign(u,h(p[m]));e.else(),r.error(!1,{discrError:tu.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function h(p){let m=e.name("valid"),g=r.subschema({keyword:"oneOf",schemaProp:p},m);return r.mergeEvaluated(g,$r.Name),m}function f(){var p;let m={},g=_(i),y=!0;for(let O=0;O<o.length;O++){let S=o[O];if(S?.$ref&&!(0,w1.schemaHasRulesButRef)(S,n.self.RULES)){let U=S.$ref;if(S=jf.resolveRef.call(n.self,n.schemaEnv.root,n.baseId,U),S instanceof jf.SchemaEnv&&(S=S.schema),S===void 0)throw new b1.default(n.opts.uriResolver,n.baseId,U)}let he=(p=S?.properties)===null||p===void 0?void 0:p[a];if(typeof he!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||_(S)),w(he,O)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function _({required:O}){return Array.isArray(O)&&O.includes(a)}function w(O,S){if(O.const)E(O.const,S);else if(O.enum)for(let he of O.enum)E(he,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function E(O,S){if(typeof O!="string"||O in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[O]=S}}}};ru.default=E1});var kf=d((sj,S1)=>{S1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Mf=d((ij,O1)=>{O1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Lf=d((nj,x1)=>{x1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Ff=d((oj,T1)=>{T1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Vf=d((aj,P1)=>{P1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Uf=d((uj,A1)=>{A1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var Hf=d((cj,I1)=>{I1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Gf=d((lj,C1)=>{C1.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var zf=d(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});var R1=kf(),N1=Mf(),q1=Lf(),D1=Ff(),j1=Vf(),k1=Uf(),M1=Hf(),L1=Gf(),F1=["/properties"];function V1(r){return[R1,N1,q1,D1,j1,e(this,k1),M1,e(this,L1)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,s){return r?t.$dataMetaSchema(s,F1):s}}iu.default=V1});var Bf=d((B,ou)=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.MissingRefError=B.ValidationError=B.CodeGen=B.Name=B.nil=B.stringify=B.str=B._=B.KeywordCxt=B.Ajv2020=void 0;var U1=Xo(),H1=Nf(),G1=su(),z1=zf(),nu="https://json-schema.org/draft/2020-12/schema",Er=class extends U1.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),H1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(G1.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(z1.default.call(this,e),this.refs["http://json-schema.org/schema"]=nu)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(nu)?nu:void 0)}};B.Ajv2020=Er;ou.exports=B=Er;ou.exports.Ajv2020=Er;Object.defineProperty(B,"__esModule",{value:!0});B.default=Er;var B1=mr();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return B1.KeywordCxt}});var Sr=T();Object.defineProperty(B,"_",{enumerable:!0,get:function(){return Sr._}});Object.defineProperty(B,"str",{enumerable:!0,get:function(){return Sr.str}});Object.defineProperty(B,"stringify",{enumerable:!0,get:function(){return Sr.stringify}});Object.defineProperty(B,"nil",{enumerable:!0,get:function(){return Sr.nil}});Object.defineProperty(B,"Name",{enumerable:!0,get:function(){return Sr.Name}});Object.defineProperty(B,"CodeGen",{enumerable:!0,get:function(){return Sr.CodeGen}});var K1=us();Object.defineProperty(B,"ValidationError",{enumerable:!0,get:function(){return K1.default}});var W1=gr();Object.defineProperty(B,"MissingRefError",{enumerable:!0,get:function(){return W1.default}})});var ep=d(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.formatNames=st.fastFormats=st.fullFormats=void 0;function rt(r,e){return{validate:r,compare:e}}st.fullFormats={date:rt(Xf,lu),time:rt(uu(!0),hu),"date-time":rt(Kf(!0),Zf),"iso-time":rt(uu(),Jf),"iso-date-time":rt(Kf(),Qf),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:ex,"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:ax,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:tx,int32:{type:"number",validate:ix},int64:{type:"number",validate:nx},float:{type:"number",validate:Yf},double:{type:"number",validate:Yf},password:!0,binary:!0};st.fastFormats={...st.fullFormats,date:rt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,lu),time:rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,hu),"date-time":rt(/^\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,Zf),"iso-time":rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Jf),"iso-date-time":rt(/^\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,Qf),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};st.formatNames=Object.keys(st.fullFormats);function Y1(r){return r%4===0&&(r%100!==0||r%400===0)}var X1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,J1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Xf(r){let e=X1.exec(r);if(!e)return!1;let t=+e[1],s=+e[2],i=+e[3];return s>=1&&s<=12&&i>=1&&i<=(s===2&&Y1(t)?29:J1[s])}function lu(r,e){if(r&&e)return r>e?1:r<e?-1:0}var au=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function uu(r){return function(t){let s=au.exec(t);if(!s)return!1;let i=+s[1],n=+s[2],o=+s[3],a=s[4],u=s[5]==="-"?-1:1,c=+(s[6]||0),l=+(s[7]||0);if(c>23||l>59||r&&!a)return!1;if(i<=23&&n<=59&&o<60)return!0;let h=n-l*u,f=i-c*u-(h<0?1:0);return(f===23||f===-1)&&(h===59||h===-1)&&o<61}}function hu(r,e){if(!(r&&e))return;let t=new Date("2020-01-01T"+r).valueOf(),s=new Date("2020-01-01T"+e).valueOf();if(t&&s)return t-s}function Jf(r,e){if(!(r&&e))return;let t=au.exec(r),s=au.exec(e);if(t&&s)return r=t[1]+t[2]+t[3],e=s[1]+s[2]+s[3],r>e?1:r<e?-1:0}var cu=/t|\s/i;function Kf(r){let e=uu(r);return function(s){let i=s.split(cu);return i.length===2&&Xf(i[0])&&e(i[1])}}function Zf(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}function Qf(r,e){if(!(r&&e))return;let[t,s]=r.split(cu),[i,n]=e.split(cu),o=lu(t,i);if(o!==void 0)return o||hu(s,n)}var Z1=/\/|:/,Q1=/^(?:[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 ex(r){return Z1.test(r)&&Q1.test(r)}var Wf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function tx(r){return Wf.lastIndex=0,Wf.test(r)}var rx=-(2**31),sx=2**31-1;function ix(r){return Number.isInteger(r)&&r<=sx&&r>=rx}function nx(r){return Number.isInteger(r)}function Yf(){return!0}var ox=/[^\\]\\Z/;function ax(r){if(ox.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var rp=d(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});var ux=Qo(),cx=ma(),lx=ja(),hx=Za(),tp=Qa(),dx=[ux.default,cx.default,(0,lx.default)(),hx.default,tp.metadataVocabulary,tp.contentVocabulary];du.default=dx});var sp=d((pj,fx)=>{fx.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var np=d((K,fu)=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.MissingRefError=K.ValidationError=K.CodeGen=K.Name=K.nil=K.stringify=K.str=K._=K.KeywordCxt=K.Ajv=void 0;var px=Xo(),mx=rp(),gx=su(),ip=sp(),yx=["/properties"],Fi="http://json-schema.org/draft-07/schema",Or=class extends px.default{_addVocabularies(){super._addVocabularies(),mx.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(gx.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ip,yx):ip;this.addMetaSchema(e,Fi,!1),this.refs["http://json-schema.org/schema"]=Fi}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Fi)?Fi:void 0)}};K.Ajv=Or;fu.exports=K=Or;fu.exports.Ajv=Or;Object.defineProperty(K,"__esModule",{value:!0});K.default=Or;var _x=mr();Object.defineProperty(K,"KeywordCxt",{enumerable:!0,get:function(){return _x.KeywordCxt}});var xr=T();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return xr._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return xr.str}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return xr.stringify}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return xr.nil}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return xr.Name}});Object.defineProperty(K,"CodeGen",{enumerable:!0,get:function(){return xr.CodeGen}});var vx=us();Object.defineProperty(K,"ValidationError",{enumerable:!0,get:function(){return vx.default}});var bx=gr();Object.defineProperty(K,"MissingRefError",{enumerable:!0,get:function(){return bx.default}})});var op=d(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.formatLimitDefinition=void 0;var wx=np(),Be=T(),Dt=Be.operators,Vi={formatMaximum:{okStr:"<=",ok:Dt.LTE,fail:Dt.GT},formatMinimum:{okStr:">=",ok:Dt.GTE,fail:Dt.LT},formatExclusiveMaximum:{okStr:"<",ok:Dt.LT,fail:Dt.GTE},formatExclusiveMinimum:{okStr:">",ok:Dt.GT,fail:Dt.LTE}},$x={message:({keyword:r,schemaCode:e})=>(0,Be.str)`should be ${Vi[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Be._)`{comparison: ${Vi[r].okStr}, limit: ${e}}`};Tr.formatLimitDefinition={keyword:Object.keys(Vi),type:"string",schemaType:"string",$data:!0,error:$x,code(r){let{gen:e,data:t,schemaCode:s,keyword:i,it:n}=r,{opts:o,self:a}=n;if(!o.validateFormats)return;let u=new wx.KeywordCxt(n,a.RULES.all.format.definition,"format");u.$data?c():l();function c(){let f=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),p=e.const("fmt",(0,Be._)`${f}[${u.schemaCode}]`);r.fail$data((0,Be.or)((0,Be._)`typeof ${p} != "object"`,(0,Be._)`${p} instanceof RegExp`,(0,Be._)`typeof ${p}.compare != "function"`,h(p)))}function l(){let f=u.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:o.code.formats?(0,Be._)`${o.code.formats}${(0,Be.getProperty)(f)}`:void 0});r.fail$data(h(m))}function h(f){return(0,Be._)`${f}.compare(${t}, ${s}) ${Vi[i].fail} 0`}},dependencies:["format"]};var Ex=r=>(r.addKeyword(Tr.formatLimitDefinition),r);Tr.default=Ex});var lp=d((xs,cp)=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var Pr=ep(),Sx=op(),pu=T(),ap=new pu.Name("fullFormats"),Ox=new pu.Name("fastFormats"),mu=(r,e={keywords:!0})=>{if(Array.isArray(e))return up(r,e,Pr.fullFormats,ap),r;let[t,s]=e.mode==="fast"?[Pr.fastFormats,Ox]:[Pr.fullFormats,ap],i=e.formats||Pr.formatNames;return up(r,i,t,s),e.keywords&&(0,Sx.default)(r),r};mu.get=(r,e="full")=>{let s=(e==="fast"?Pr.fastFormats:Pr.fullFormats)[r];if(!s)throw new Error(`Unknown format "${r}"`);return s};function up(r,e,t,s){var i,n;(i=(n=r.opts.code).formats)!==null&&i!==void 0||(n.formats=(0,pu._)`require("ajv-formats/dist/formats").${s}`);for(let o of e)r.addFormat(o,t[o])}cp.exports=xs=mu;Object.defineProperty(xs,"__esModule",{value:!0});xs.default=mu});var Ar=d((vj,hp)=>{"use strict";var qx="2.0.0",Dx=Number.MAX_SAFE_INTEGER||9007199254740991,jx=16,kx=250,Mx=["major","premajor","minor","preminor","patch","prepatch","prerelease"];hp.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:jx,MAX_SAFE_BUILD_LENGTH:kx,MAX_SAFE_INTEGER:Dx,RELEASE_TYPES:Mx,SEMVER_SPEC_VERSION:qx,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ts=d((bj,dp)=>{"use strict";var Lx=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};dp.exports=Lx});var Ir=d((it,fp)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:_u,MAX_SAFE_BUILD_LENGTH:Fx,MAX_LENGTH:Vx}=Ar(),Ux=Ts();it=fp.exports={};var Hx=it.re=[],Gx=it.safeRe=[],v=it.src=[],zx=it.safeSrc=[],b=it.t={},Bx=0,vu="[a-zA-Z0-9-]",Kx=[["\\s",1],["\\d",Vx],[vu,Fx]],Wx=r=>{for(let[e,t]of Kx)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},P=(r,e,t)=>{let s=Wx(e),i=Bx++;Ux(r,i,e),b[r]=i,v[i]=e,zx[i]=s,Hx[i]=new RegExp(e,t?"g":void 0),Gx[i]=new RegExp(s,t?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${vu}*`);P("MAINVERSION",`(${v[b.NUMERICIDENTIFIER]})\\.(${v[b.NUMERICIDENTIFIER]})\\.(${v[b.NUMERICIDENTIFIER]})`);P("MAINVERSIONLOOSE",`(${v[b.NUMERICIDENTIFIERLOOSE]})\\.(${v[b.NUMERICIDENTIFIERLOOSE]})\\.(${v[b.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASEIDENTIFIER",`(?:${v[b.NONNUMERICIDENTIFIER]}|${v[b.NUMERICIDENTIFIER]})`);P("PRERELEASEIDENTIFIERLOOSE",`(?:${v[b.NONNUMERICIDENTIFIER]}|${v[b.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASE",`(?:-(${v[b.PRERELEASEIDENTIFIER]}(?:\\.${v[b.PRERELEASEIDENTIFIER]})*))`);P("PRERELEASELOOSE",`(?:-?(${v[b.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${v[b.PRERELEASEIDENTIFIERLOOSE]})*))`);P("BUILDIDENTIFIER",`${vu}+`);P("BUILD",`(?:\\+(${v[b.BUILDIDENTIFIER]}(?:\\.${v[b.BUILDIDENTIFIER]})*))`);P("FULLPLAIN",`v?${v[b.MAINVERSION]}${v[b.PRERELEASE]}?${v[b.BUILD]}?`);P("FULL",`^${v[b.FULLPLAIN]}$`);P("LOOSEPLAIN",`[v=\\s]*${v[b.MAINVERSIONLOOSE]}${v[b.PRERELEASELOOSE]}?${v[b.BUILD]}?`);P("LOOSE",`^${v[b.LOOSEPLAIN]}$`);P("GTLT","((?:<|>)?=?)");P("XRANGEIDENTIFIERLOOSE",`${v[b.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P("XRANGEIDENTIFIER",`${v[b.NUMERICIDENTIFIER]}|x|X|\\*`);P("XRANGEPLAIN",`[v=\\s]*(${v[b.XRANGEIDENTIFIER]})(?:\\.(${v[b.XRANGEIDENTIFIER]})(?:\\.(${v[b.XRANGEIDENTIFIER]})(?:${v[b.PRERELEASE]})?${v[b.BUILD]}?)?)?`);P("XRANGEPLAINLOOSE",`[v=\\s]*(${v[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[b.XRANGEIDENTIFIERLOOSE]})(?:\\.(${v[b.XRANGEIDENTIFIERLOOSE]})(?:${v[b.PRERELEASELOOSE]})?${v[b.BUILD]}?)?)?`);P("XRANGE",`^${v[b.GTLT]}\\s*${v[b.XRANGEPLAIN]}$`);P("XRANGELOOSE",`^${v[b.GTLT]}\\s*${v[b.XRANGEPLAINLOOSE]}$`);P("COERCEPLAIN",`(^|[^\\d])(\\d{1,${_u}})(?:\\.(\\d{1,${_u}}))?(?:\\.(\\d{1,${_u}}))?`);P("COERCE",`${v[b.COERCEPLAIN]}(?:$|[^\\d])`);P("COERCEFULL",v[b.COERCEPLAIN]+`(?:${v[b.PRERELEASE]})?(?:${v[b.BUILD]})?(?:$|[^\\d])`);P("COERCERTL",v[b.COERCE],!0);P("COERCERTLFULL",v[b.COERCEFULL],!0);P("LONETILDE","(?:~>?)");P("TILDETRIM",`(\\s*)${v[b.LONETILDE]}\\s+`,!0);it.tildeTrimReplace="$1~";P("TILDE",`^${v[b.LONETILDE]}${v[b.XRANGEPLAIN]}$`);P("TILDELOOSE",`^${v[b.LONETILDE]}${v[b.XRANGEPLAINLOOSE]}$`);P("LONECARET","(?:\\^)");P("CARETTRIM",`(\\s*)${v[b.LONECARET]}\\s+`,!0);it.caretTrimReplace="$1^";P("CARET",`^${v[b.LONECARET]}${v[b.XRANGEPLAIN]}$`);P("CARETLOOSE",`^${v[b.LONECARET]}${v[b.XRANGEPLAINLOOSE]}$`);P("COMPARATORLOOSE",`^${v[b.GTLT]}\\s*(${v[b.LOOSEPLAIN]})$|^$`);P("COMPARATOR",`^${v[b.GTLT]}\\s*(${v[b.FULLPLAIN]})$|^$`);P("COMPARATORTRIM",`(\\s*)${v[b.GTLT]}\\s*(${v[b.LOOSEPLAIN]}|${v[b.XRANGEPLAIN]})`,!0);it.comparatorTrimReplace="$1$2$3";P("HYPHENRANGE",`^\\s*(${v[b.XRANGEPLAIN]})\\s+-\\s+(${v[b.XRANGEPLAIN]})\\s*$`);P("HYPHENRANGELOOSE",`^\\s*(${v[b.XRANGEPLAINLOOSE]})\\s+-\\s+(${v[b.XRANGEPLAINLOOSE]})\\s*$`);P("STAR","(<|>)?=?\\s*\\*");P("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ui=d((wj,pp)=>{"use strict";var Yx=Object.freeze({loose:!0}),Xx=Object.freeze({}),Jx=r=>r?typeof r!="object"?Yx:r:Xx;pp.exports=Jx});var bu=d(($j,yp)=>{"use strict";var mp=/^[0-9]+$/,gp=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=mp.test(r),s=mp.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},Zx=(r,e)=>gp(e,r);yp.exports={compareIdentifiers:gp,rcompareIdentifiers:Zx}});var ue=d((Ej,vp)=>{"use strict";var Hi=Ts(),{MAX_LENGTH:_p,MAX_SAFE_INTEGER:Gi}=Ar(),{safeRe:zi,t:Bi}=Ir(),Qx=Ui(),{compareIdentifiers:wu}=bu(),$u=class r{constructor(e,t){if(t=Qx(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>_p)throw new TypeError(`version is longer than ${_p} characters`);Hi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?zi[Bi.LOOSE]:zi[Bi.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Gi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gi||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<Gi)return n}return i}):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Hi("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let s=this.prerelease[t],i=e.prerelease[t];if(Hi("prerelease compare",t,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return wu(s,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let s=this.build[t],i=e.build[t];if(Hi("build compare",t,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return wu(s,i)}while(++t)}inc(e,t,s){if(e.startsWith("pre")){if(!t&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?zi[Bi.PRERELEASELOOSE]:zi[Bi.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,s),this.inc("pre",t,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,s),this.inc("pre",t,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];s===!1&&(n=[t]),wu(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};vp.exports=$u});var jt=d((Sj,wp)=>{"use strict";var bp=ue(),eT=(r,e,t=!1)=>{if(r instanceof bp)return r;try{return new bp(r,e)}catch(s){if(!t)return null;throw s}};wp.exports=eT});var Ep=d((Oj,$p)=>{"use strict";var tT=jt(),rT=(r,e)=>{let t=tT(r,e);return t?t.version:null};$p.exports=rT});var Op=d((xj,Sp)=>{"use strict";var sT=jt(),iT=(r,e)=>{let t=sT(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Sp.exports=iT});var Pp=d((Tj,Tp)=>{"use strict";var xp=ue(),nT=(r,e,t,s,i)=>{typeof t=="string"&&(i=s,s=t,t=void 0);try{return new xp(r instanceof xp?r.version:r,t).inc(e,s,i).version}catch{return null}};Tp.exports=nT});var Cp=d((Pj,Ip)=>{"use strict";var Ap=jt(),oT=(r,e)=>{let t=Ap(r,null,!0),s=Ap(e,null,!0),i=t.compare(s);if(i===0)return null;let n=i>0,o=n?t:s,a=n?s:t,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return t.major!==s.major?l+"major":t.minor!==s.minor?l+"minor":t.patch!==s.patch?l+"patch":"prerelease"};Ip.exports=oT});var Np=d((Aj,Rp)=>{"use strict";var aT=ue(),uT=(r,e)=>new aT(r,e).major;Rp.exports=uT});var Dp=d((Ij,qp)=>{"use strict";var cT=ue(),lT=(r,e)=>new cT(r,e).minor;qp.exports=lT});var kp=d((Cj,jp)=>{"use strict";var hT=ue(),dT=(r,e)=>new hT(r,e).patch;jp.exports=dT});var Lp=d((Rj,Mp)=>{"use strict";var fT=jt(),pT=(r,e)=>{let t=fT(r,e);return t&&t.prerelease.length?t.prerelease:null};Mp.exports=pT});var De=d((Nj,Vp)=>{"use strict";var Fp=ue(),mT=(r,e,t)=>new Fp(r,t).compare(new Fp(e,t));Vp.exports=mT});var Hp=d((qj,Up)=>{"use strict";var gT=De(),yT=(r,e,t)=>gT(e,r,t);Up.exports=yT});var zp=d((Dj,Gp)=>{"use strict";var _T=De(),vT=(r,e)=>_T(r,e,!0);Gp.exports=vT});var Ki=d((jj,Kp)=>{"use strict";var Bp=ue(),bT=(r,e,t)=>{let s=new Bp(r,t),i=new Bp(e,t);return s.compare(i)||s.compareBuild(i)};Kp.exports=bT});var Yp=d((kj,Wp)=>{"use strict";var wT=Ki(),$T=(r,e)=>r.sort((t,s)=>wT(t,s,e));Wp.exports=$T});var Jp=d((Mj,Xp)=>{"use strict";var ET=Ki(),ST=(r,e)=>r.sort((t,s)=>ET(s,t,e));Xp.exports=ST});var Ps=d((Lj,Zp)=>{"use strict";var OT=De(),xT=(r,e,t)=>OT(r,e,t)>0;Zp.exports=xT});var Wi=d((Fj,Qp)=>{"use strict";var TT=De(),PT=(r,e,t)=>TT(r,e,t)<0;Qp.exports=PT});var Eu=d((Vj,em)=>{"use strict";var AT=De(),IT=(r,e,t)=>AT(r,e,t)===0;em.exports=IT});var Su=d((Uj,tm)=>{"use strict";var CT=De(),RT=(r,e,t)=>CT(r,e,t)!==0;tm.exports=RT});var Yi=d((Hj,rm)=>{"use strict";var NT=De(),qT=(r,e,t)=>NT(r,e,t)>=0;rm.exports=qT});var Xi=d((Gj,sm)=>{"use strict";var DT=De(),jT=(r,e,t)=>DT(r,e,t)<=0;sm.exports=jT});var Ou=d((zj,im)=>{"use strict";var kT=Eu(),MT=Su(),LT=Ps(),FT=Yi(),VT=Wi(),UT=Xi(),HT=(r,e,t,s)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return kT(r,t,s);case"!=":return MT(r,t,s);case">":return LT(r,t,s);case">=":return FT(r,t,s);case"<":return VT(r,t,s);case"<=":return UT(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};im.exports=HT});var om=d((Bj,nm)=>{"use strict";var GT=ue(),zT=jt(),{safeRe:Ji,t:Zi}=Ir(),BT=(r,e)=>{if(r instanceof GT)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?Ji[Zi.COERCEFULL]:Ji[Zi.COERCE]);else{let u=e.includePrerelease?Ji[Zi.COERCERTLFULL]:Ji[Zi.COERCERTL],c;for(;(c=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(t===null)return null;let s=t[2],i=t[3]||"0",n=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",a=e.includePrerelease&&t[6]?`+${t[6]}`:"";return zT(`${s}.${i}.${n}${o}${a}`,e)};nm.exports=BT});var um=d((Kj,am)=>{"use strict";var KT=jt(),WT=Ar(),YT=ue(),XT=(r,e,t)=>{if(!WT.RELEASE_TYPES.includes(e))return null;let s=JT(r,t);return s&&ZT(s,e)},JT=(r,e)=>{let t=r instanceof YT?r.version:r;return KT(t,e)},ZT=(r,e)=>{if(QT(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},QT=r=>r.startsWith("pre");am.exports=XT});var lm=d((Wj,cm)=>{"use strict";var xu=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};cm.exports=xu});var je=d((Yj,pm)=>{"use strict";var eP=/\s+/g,Tu=class r{constructor(e,t){if(t=rP(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Pu)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(eP," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(i=>!dm(i[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hP(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let s=0;s<t.length;s++)s>0&&(this.formatted+=" "),this.formatted+=t[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(lP,"");let s=((this.options.includePrerelease&&uP)|(this.options.loose&&cP))+":"+e,i=hm.get(s);if(i)return i;let n=this.options.loose,o=n?_e[ce.HYPHENRANGELOOSE]:_e[ce.HYPHENRANGE];e=e.replace(o,wP(this.options.includePrerelease)),W("hyphen replace",e),e=e.replace(_e[ce.COMPARATORTRIM],nP),W("comparator trim",e),e=e.replace(_e[ce.TILDETRIM],oP),W("tilde trim",e),e=e.replace(_e[ce.CARETTRIM],aP),W("caret trim",e);let a=e.split(" ").map(h=>dP(h,this.options)).join(" ").split(/\s+/).map(h=>bP(h,this.options));n&&(a=a.filter(h=>(W("loose invalid filter",h,this.options),!!h.match(_e[ce.COMPARATORLOOSE])))),W("range list",a);let u=new Map,c=a.map(h=>new Pu(h,this.options));for(let h of c){if(dm(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return hm.set(s,l),l}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(s=>fm(s,t)&&e.set.some(i=>fm(i,t)&&s.every(n=>i.every(o=>n.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new sP(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if($P(this.set[t],e,this.options))return!0;return!1}};pm.exports=Tu;var tP=lm(),hm=new tP,rP=Ui(),Pu=As(),W=Ts(),sP=ue(),{safeRe:_e,src:iP,t:ce,comparatorTrimReplace:nP,tildeTrimReplace:oP,caretTrimReplace:aP}=Ir(),{FLAG_INCLUDE_PRERELEASE:uP,FLAG_LOOSE:cP}=Ar(),lP=new RegExp(iP[ce.BUILD],"g"),dm=r=>r.value==="<0.0.0-0",hP=r=>r.value==="",fm=(r,e)=>{let t=!0,s=r.slice(),i=s.pop();for(;t&&s.length;)t=s.every(n=>i.intersects(n,e)),i=s.pop();return t},dP=(r,e)=>(r=r.replace(_e[ce.BUILD],""),W("comp",r,e),r=mP(r,e),W("caret",r),r=fP(r,e),W("tildes",r),r=yP(r,e),W("xrange",r),r=vP(r,e),W("stars",r),r),ve=r=>!r||r.toLowerCase()==="x"||r==="*",fP=(r,e)=>r.trim().split(/\s+/).map(t=>pP(t,e)).join(" "),pP=(r,e)=>{let t=e.loose?_e[ce.TILDELOOSE]:_e[ce.TILDE];return r.replace(t,(s,i,n,o,a)=>{W("tilde",r,s,i,n,o,a);let u;return ve(i)?u="":ve(n)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:ve(o)?u=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:a?(W("replaceTilde pr",a),u=`>=${i}.${n}.${o}-${a} <${i}.${+n+1}.0-0`):u=`>=${i}.${n}.${o} <${i}.${+n+1}.0-0`,W("tilde return",u),u})},mP=(r,e)=>r.trim().split(/\s+/).map(t=>gP(t,e)).join(" "),gP=(r,e)=>{W("caret",r,e);let t=e.loose?_e[ce.CARETLOOSE]:_e[ce.CARET],s=e.includePrerelease?"-0":"";return r.replace(t,(i,n,o,a,u)=>{W("caret",r,i,n,o,a,u);let c;return ve(n)?c="":ve(o)?c=`>=${n}.0.0${s} <${+n+1}.0.0-0`:ve(a)?n==="0"?c=`>=${n}.${o}.0${s} <${n}.${+o+1}.0-0`:c=`>=${n}.${o}.0${s} <${+n+1}.0.0-0`:u?(W("replaceCaret pr",u),n==="0"?o==="0"?c=`>=${n}.${o}.${a}-${u} <${n}.${o}.${+a+1}-0`:c=`>=${n}.${o}.${a}-${u} <${n}.${+o+1}.0-0`:c=`>=${n}.${o}.${a}-${u} <${+n+1}.0.0-0`):(W("no pr"),n==="0"?o==="0"?c=`>=${n}.${o}.${a}${s} <${n}.${o}.${+a+1}-0`:c=`>=${n}.${o}.${a}${s} <${n}.${+o+1}.0-0`:c=`>=${n}.${o}.${a} <${+n+1}.0.0-0`),W("caret return",c),c})},yP=(r,e)=>(W("replaceXRanges",r,e),r.split(/\s+/).map(t=>_P(t,e)).join(" ")),_P=(r,e)=>{r=r.trim();let t=e.loose?_e[ce.XRANGELOOSE]:_e[ce.XRANGE];return r.replace(t,(s,i,n,o,a,u)=>{W("xRange",r,s,i,n,o,a,u);let c=ve(n),l=c||ve(o),h=l||ve(a),f=h;return i==="="&&f&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?s="<0.0.0-0":s="*":i&&f?(l&&(o=0),a=0,i===">"?(i=">=",l?(n=+n+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",l?n=+n+1:o=+o+1),i==="<"&&(u="-0"),s=`${i+n}.${o}.${a}${u}`):l?s=`>=${n}.0.0${u} <${+n+1}.0.0-0`:h&&(s=`>=${n}.${o}.0${u} <${n}.${+o+1}.0-0`),W("xRange return",s),s})},vP=(r,e)=>(W("replaceStars",r,e),r.trim().replace(_e[ce.STAR],"")),bP=(r,e)=>(W("replaceGTE0",r,e),r.trim().replace(_e[e.includePrerelease?ce.GTE0PRE:ce.GTE0],"")),wP=r=>(e,t,s,i,n,o,a,u,c,l,h,f)=>(ve(s)?t="":ve(i)?t=`>=${s}.0.0${r?"-0":""}`:ve(n)?t=`>=${s}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,ve(c)?u="":ve(l)?u=`<${+c+1}.0.0-0`:ve(h)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${h}-${f}`:r?u=`<${c}.${l}.${+h+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),$P=(r,e,t)=>{for(let s=0;s<r.length;s++)if(!r[s].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let s=0;s<r.length;s++)if(W(r[s].semver),r[s].semver!==Pu.ANY&&r[s].semver.prerelease.length>0){let i=r[s].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var As=d((Xj,bm)=>{"use strict";var Is=Symbol("SemVer ANY"),Cu=class r{static get ANY(){return Is}constructor(e,t){if(t=mm(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Iu("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Is?this.value="":this.value=this.operator+this.semver.version,Iu("comp",this)}parse(e){let t=this.options.loose?gm[ym.COMPARATORLOOSE]:gm[ym.COMPARATOR],s=e.match(t);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new _m(s[2],this.options.loose):this.semver=Is}toString(){return this.value}test(e){if(Iu("Comparator.test",e,this.options.loose),this.semver===Is||e===Is)return!0;if(typeof e=="string")try{e=new _m(e,this.options)}catch{return!1}return Au(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new vm(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new vm(this.value,t).test(e.semver):(t=mm(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Au(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Au(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};bm.exports=Cu;var mm=Ui(),{safeRe:gm,t:ym}=Ir(),Au=Ou(),Iu=Ts(),_m=ue(),vm=je()});var Cs=d((Jj,wm)=>{"use strict";var EP=je(),SP=(r,e,t)=>{try{e=new EP(e,t)}catch{return!1}return e.test(r)};wm.exports=SP});var Em=d((Zj,$m)=>{"use strict";var OP=je(),xP=(r,e)=>new OP(r,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));$m.exports=xP});var Om=d((Qj,Sm)=>{"use strict";var TP=ue(),PP=je(),AP=(r,e,t)=>{let s=null,i=null,n=null;try{n=new PP(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new TP(s,t))}),s};Sm.exports=AP});var Tm=d((ek,xm)=>{"use strict";var IP=ue(),CP=je(),RP=(r,e,t)=>{let s=null,i=null,n=null;try{n=new CP(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new IP(s,t))}),s};xm.exports=RP});var Im=d((tk,Am)=>{"use strict";var Ru=ue(),NP=je(),Pm=Ps(),qP=(r,e)=>{r=new NP(r,e);let t=new Ru("0.0.0");if(r.test(t)||(t=new Ru("0.0.0-0"),r.test(t)))return t;t=null;for(let s=0;s<r.set.length;++s){let i=r.set[s],n=null;i.forEach(o=>{let a=new Ru(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!n||Pm(a,n))&&(n=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),n&&(!t||Pm(t,n))&&(t=n)}return t&&r.test(t)?t:null};Am.exports=qP});var Rm=d((rk,Cm)=>{"use strict";var DP=je(),jP=(r,e)=>{try{return new DP(r,e).range||"*"}catch{return null}};Cm.exports=jP});var Qi=d((sk,jm)=>{"use strict";var kP=ue(),Dm=As(),{ANY:MP}=Dm,LP=je(),FP=Cs(),Nm=Ps(),qm=Wi(),VP=Xi(),UP=Yi(),HP=(r,e,t,s)=>{r=new kP(r,s),e=new LP(e,s);let i,n,o,a,u;switch(t){case">":i=Nm,n=VP,o=qm,a=">",u=">=";break;case"<":i=qm,n=UP,o=Nm,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(FP(r,e,s))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],h=null,f=null;if(l.forEach(p=>{p.semver===MP&&(p=new Dm(">=0.0.0")),h=h||p,f=f||p,i(p.semver,h.semver,s)?h=p:o(p.semver,f.semver,s)&&(f=p)}),h.operator===a||h.operator===u||(!f.operator||f.operator===a)&&n(r,f.semver))return!1;if(f.operator===u&&o(r,f.semver))return!1}return!0};jm.exports=HP});var Mm=d((ik,km)=>{"use strict";var GP=Qi(),zP=(r,e,t)=>GP(r,e,">",t);km.exports=zP});var Fm=d((nk,Lm)=>{"use strict";var BP=Qi(),KP=(r,e,t)=>BP(r,e,"<",t);Lm.exports=KP});var Hm=d((ok,Um)=>{"use strict";var Vm=je(),WP=(r,e,t)=>(r=new Vm(r,t),e=new Vm(e,t),r.intersects(e,t));Um.exports=WP});var zm=d((ak,Gm)=>{"use strict";var YP=Cs(),XP=De();Gm.exports=(r,e,t)=>{let s=[],i=null,n=null,o=r.sort((l,h)=>XP(l,h,t));for(let l of o)YP(l,e,t)?(n=l,i||(i=l)):(n&&s.push([i,n]),n=null,i=null);i&&s.push([i,null]);let a=[];for(let[l,h]of s)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var Jm=d((uk,Xm)=>{"use strict";var Bm=je(),Du=As(),{ANY:Nu}=Du,qu=Cs(),ju=De(),JP=(r,e,t={})=>{if(r===e)return!0;r=new Bm(r,t),e=new Bm(e,t);let s=!1;e:for(let i of r.set){for(let n of e.set){let o=QP(i,n,t);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},ZP=[new Du(">=0.0.0-0")],Km=[new Du(">=0.0.0")],QP=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Nu){if(e.length===1&&e[0].semver===Nu)return!0;t.includePrerelease?r=ZP:r=Km}if(e.length===1&&e[0].semver===Nu){if(t.includePrerelease)return!0;e=Km}let s=new Set,i,n;for(let p of r)p.operator===">"||p.operator===">="?i=Wm(i,p,t):p.operator==="<"||p.operator==="<="?n=Ym(n,p,t):s.add(p.semver);if(s.size>1)return null;let o;if(i&&n){if(o=ju(i.semver,n.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let p of s){if(i&&!qu(p,String(i),t)||n&&!qu(p,String(n),t))return null;for(let m of e)if(!qu(p,String(m),t))return!1;return!0}let a,u,c,l,h=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,f=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&n.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let p of e){if(l=l||p.operator===">"||p.operator===">=",c=c||p.operator==="<"||p.operator==="<=",i){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator===">"||p.operator===">="){if(a=Wm(i,p,t),a===p&&a!==i)return!1}else if(i.operator===">="&&!p.test(i.semver))return!1}if(n){if(h&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===h.major&&p.semver.minor===h.minor&&p.semver.patch===h.patch&&(h=!1),p.operator==="<"||p.operator==="<="){if(u=Ym(n,p,t),u===p&&u!==n)return!1}else if(n.operator==="<="&&!p.test(n.semver))return!1}if(!p.operator&&(n||i)&&o!==0)return!1}return!(i&&c&&!n&&o!==0||n&&l&&!i&&o!==0||f||h)},Wm=(r,e,t)=>{if(!r)return e;let s=ju(r.semver,e.semver,t);return s>0?r:s<0||e.operator===">"&&r.operator===">="?e:r},Ym=(r,e,t)=>{if(!r)return e;let s=ju(r.semver,e.semver,t);return s<0?r:s>0||e.operator==="<"&&r.operator==="<="?e:r};Xm.exports=JP});var tg=d((ck,eg)=>{"use strict";var ku=Ir(),Zm=Ar(),eA=ue(),Qm=bu(),tA=jt(),rA=Ep(),sA=Op(),iA=Pp(),nA=Cp(),oA=Np(),aA=Dp(),uA=kp(),cA=Lp(),lA=De(),hA=Hp(),dA=zp(),fA=Ki(),pA=Yp(),mA=Jp(),gA=Ps(),yA=Wi(),_A=Eu(),vA=Su(),bA=Yi(),wA=Xi(),$A=Ou(),EA=om(),SA=um(),OA=As(),xA=je(),TA=Cs(),PA=Em(),AA=Om(),IA=Tm(),CA=Im(),RA=Rm(),NA=Qi(),qA=Mm(),DA=Fm(),jA=Hm(),kA=zm(),MA=Jm();eg.exports={parse:tA,valid:rA,clean:sA,inc:iA,diff:nA,major:oA,minor:aA,patch:uA,prerelease:cA,compare:lA,rcompare:hA,compareLoose:dA,compareBuild:fA,sort:pA,rsort:mA,gt:gA,lt:yA,eq:_A,neq:vA,gte:bA,lte:wA,cmp:$A,coerce:EA,truncate:SA,Comparator:OA,Range:xA,satisfies:TA,toComparators:PA,maxSatisfying:AA,minSatisfying:IA,minVersion:CA,validRange:RA,outside:NA,gtr:qA,ltr:DA,intersects:jA,simplifyRange:kA,subset:MA,SemVer:eA,re:ku.re,src:ku.src,tokens:ku.t,SEMVER_SPEC_VERSION:Zm.SEMVER_SPEC_VERSION,RELEASE_TYPES:Zm.RELEASE_TYPES,compareIdentifiers:Qm.compareIdentifiers,rcompareIdentifiers:Qm.rcompareIdentifiers}});var ee=d((_k,hg)=>{"use strict";var{FORCE_COLOR:YA,NODE_DISABLE_COLORS:XA,TERM:JA}=process.env,L={enabled:!XA&&JA!=="dumb"&&YA!=="0",reset:H(0,0),bold:H(1,22),dim:H(2,22),italic:H(3,23),underline:H(4,24),inverse:H(7,27),hidden:H(8,28),strikethrough:H(9,29),black:H(30,39),red:H(31,39),green:H(32,39),yellow:H(33,39),blue:H(34,39),magenta:H(35,39),cyan:H(36,39),white:H(37,39),gray:H(90,39),grey:H(90,39),bgBlack:H(40,49),bgRed:H(41,49),bgGreen:H(42,49),bgYellow:H(43,49),bgBlue:H(44,49),bgMagenta:H(45,49),bgCyan:H(46,49),bgWhite:H(47,49)};function lg(r,e){let t=0,s,i="",n="";for(;t<r.length;t++)s=r[t],i+=s.open,n+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return i+e+n}function ZA(r,e){let t={has:r,keys:e};return t.reset=L.reset.bind(t),t.bold=L.bold.bind(t),t.dim=L.dim.bind(t),t.italic=L.italic.bind(t),t.underline=L.underline.bind(t),t.inverse=L.inverse.bind(t),t.hidden=L.hidden.bind(t),t.strikethrough=L.strikethrough.bind(t),t.black=L.black.bind(t),t.red=L.red.bind(t),t.green=L.green.bind(t),t.yellow=L.yellow.bind(t),t.blue=L.blue.bind(t),t.magenta=L.magenta.bind(t),t.cyan=L.cyan.bind(t),t.white=L.white.bind(t),t.gray=L.gray.bind(t),t.grey=L.grey.bind(t),t.bgBlack=L.bgBlack.bind(t),t.bgRed=L.bgRed.bind(t),t.bgGreen=L.bgGreen.bind(t),t.bgYellow=L.bgYellow.bind(t),t.bgBlue=L.bgBlue.bind(t),t.bgMagenta=L.bgMagenta.bind(t),t.bgCyan=L.bgCyan.bind(t),t.bgWhite=L.bgWhite.bind(t),t}function H(r,e){let t={open:`\x1B[${r}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(r)||(this.has.push(r),this.keys.push(t)),s===void 0?this:L.enabled?lg(this.keys,s+""):s+""):s===void 0?ZA([r],[t]):L.enabled?lg([t],s+""):s+""}}hg.exports=L});var fg=d((vk,dg)=>{"use strict";dg.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var sn=d((bk,pg)=>{"use strict";pg.exports=r=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof r=="string"?r.replace(t,""):r}});var te=d((wk,mg)=>{"use strict";var Uu={to(r,e){return e?`\x1B[${e+1};${r+1}H`:`\x1B[${r+1}G`},move(r,e){let t="";return r<0?t+=`\x1B[${-r}D`:r>0&&(t+=`\x1B[${r}C`),e<0?t+=`\x1B[${-e}A`:e>0&&(t+=`\x1B[${e}B`),t},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},QA={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},eI={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let e="";for(let t=0;t<r;t++)e+=this.line+(t<r-1?Uu.up():"");return r&&(e+=Uu.left),e}};mg.exports={cursor:Uu,scroll:QA,erase:eI,beep:"\x07"}});var bg=d(($k,vg)=>{"use strict";function tI(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=rI(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var s=0,i=function(){};return{s:i,n:function(){return s>=r.length?{done:!0}:{done:!1,value:r[s++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){t=t.call(r)},n:function(){var c=t.next();return n=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function rI(r,e){if(r){if(typeof r=="string")return gg(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gg(r,e)}}function gg(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=r[t];return s}var sI=sn(),_g=te(),yg=_g.erase,iI=_g.cursor,nI=r=>[...sI(r)].length;vg.exports=function(r,e){if(!e)return yg.line+iI.to(0);let t=0,s=r.split(/\r?\n/);var i=tI(s),n;try{for(i.s();!(n=i.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(nI(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return yg.lines(t)}});var Hu=d((Ek,wg)=>{"use strict";var Ds={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},oI={arrowUp:Ds.arrowUp,arrowDown:Ds.arrowDown,arrowLeft:Ds.arrowLeft,arrowRight:Ds.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},aI=process.platform==="win32"?oI:Ds;wg.exports=aI});var Eg=d((Sk,$g)=>{"use strict";var Rr=ee(),nr=Hu(),Gu=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),uI=r=>Gu[r]||Gu.default,js=Object.freeze({aborted:Rr.red(nr.cross),done:Rr.green(nr.tick),exited:Rr.yellow(nr.cross),default:Rr.cyan("?")}),cI=(r,e,t)=>e?js.aborted:t?js.exited:r?js.done:js.default,lI=r=>Rr.gray(r?nr.ellipsis:nr.pointerSmall),hI=(r,e)=>Rr.gray(r?e?nr.pointerSmall:"+":nr.line);$g.exports={styles:Gu,render:uI,symbols:js,symbol:cI,delimiter:lI,item:hI}});var Og=d((Ok,Sg)=>{"use strict";var dI=sn();Sg.exports=function(r,e){let t=String(dI(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var Tg=d((xk,xg)=>{"use strict";xg.exports=(r,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(r||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
|
|
11
11
|
`)).join(`
|
|
12
|
-
`)}});var
|
|
13
|
-
`),this.close()}validate(){var e=this;return
|
|
14
|
-
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${s}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(
|
|
12
|
+
`)}});var Ag=d((Tk,Pg)=>{"use strict";Pg.exports=(r,e,t)=>{t=t||e;let s=Math.min(e-t,r-Math.floor(t/2));s<0&&(s=0);let i=Math.min(s+t,e);return{startIndex:s,endIndex:i}}});var Ke=d((Pk,Ig)=>{"use strict";Ig.exports={action:fg(),clear:bg(),style:Eg(),strip:sn(),figures:Hu(),lines:Og(),wrap:Tg(),entriesToDisplay:Ag()}});var gt=d((Ak,Ng)=>{"use strict";var Cg=require("readline"),fI=Ke(),pI=fI.action,mI=require("events"),Rg=te(),gI=Rg.beep,yI=Rg.cursor,_I=ee(),zu=class extends mI{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=Cg.createInterface({input:this.in,escapeCodeTimeout:50});Cg.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(n,o)=>{let a=pI(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(yI.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(gI)}render(){this.onRender(_I),this.firstRender&&(this.firstRender=!1)}};Ng.exports=zu});var Mg=d((Ik,kg)=>{"use strict";function qg(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(c){t(c);return}a.done?e(u):Promise.resolve(u).then(s,i)}function Dg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){qg(n,s,i,o,a,"next",u)}function a(u){qg(n,s,i,o,a,"throw",u)}o(void 0)})}}var nn=ee(),vI=gt(),jg=te(),bI=jg.erase,ks=jg.cursor,on=Ke(),Bu=on.style,Ku=on.clear,wI=on.lines,$I=on.figures,Wu=class extends vI{constructor(e={}){super(e),this.transform=Bu.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Ku("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=nn.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
13
|
+
`),this.close()}validate(){var e=this;return Dg(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Dg(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
14
|
+
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${s}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ks.down(wI(this.outputError,this.out.columns)-1)+Ku(this.outputError,this.out.columns)),this.out.write(Ku(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Bu.symbol(this.done,this.aborted),nn.bold(this.msg),Bu.delimiter(this.done),this.red?nn.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
15
15
|
`).reduce((e,t,s)=>e+`
|
|
16
|
-
${s?" "
|
|
16
|
+
${s?" ":$I.pointerSmall} ${nn.red().italic(t)}`,"")),this.out.write(bI.line+ks.to(0)+this.outputText+ks.save+this.outputError+ks.restore+ks.move(this.cursorOffset,0)))}};kg.exports=Wu});var Ug=d((Ck,Vg)=>{"use strict";var yt=ee(),EI=gt(),Ms=Ke(),Lg=Ms.style,Fg=Ms.clear,an=Ms.figures,SI=Ms.wrap,OI=Ms.entriesToDisplay,xI=te(),TI=xI.cursor,Yu=class extends EI{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Fg("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
17
17
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
18
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(
|
|
19
|
-
`;for(let i=t;i<s;i++){let n,o,a="",u=this.choices[i];i===t&&t>0?o=
|
|
20
|
-
`+
|
|
21
|
-
`}}this.out.write(this.outputText)}}
|
|
18
|
+
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(TI.hide):this.out.write(Fg(this.outputText,this.out.columns)),super.render();let e=OI(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[Lg.symbol(this.done,this.aborted),yt.bold(this.msg),Lg.delimiter(!1),this.done?this.selection.title:this.selection.disabled?yt.yellow(this.warn):yt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
19
|
+
`;for(let i=t;i<s;i++){let n,o,a="",u=this.choices[i];i===t&&t>0?o=an.arrowUp:i===s-1&&s<this.choices.length?o=an.arrowDown:o=" ",u.disabled?(n=this.cursor===i?yt.gray().underline(u.title):yt.strikethrough().gray(u.title),o=(this.cursor===i?yt.bold().gray(an.pointer)+" ":" ")+o):(n=this.cursor===i?yt.cyan().underline(u.title):u.title,o=(this.cursor===i?yt.cyan(an.pointer)+" ":" ")+o,u.description&&this.cursor===i&&(a=` - ${u.description}`,(o.length+n.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
|
|
20
|
+
`+SI(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${yt.gray(a)}
|
|
21
|
+
`}}this.out.write(this.outputText)}};Vg.exports=Yu});var Wg=d((Rk,Kg)=>{"use strict";var un=ee(),PI=gt(),zg=Ke(),Hg=zg.style,AI=zg.clear,Bg=te(),Gg=Bg.cursor,II=Bg.erase,Xu=class extends PI{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
22
22
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
23
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(
|
|
24
|
-
`),this.close()}validate(){var e=this;return
|
|
25
|
-
`),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof
|
|
23
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Gg.hide):this.out.write(AI(this.outputText,this.out.columns)),super.render(),this.outputText=[Hg.symbol(this.done,this.aborted),un.bold(this.msg),Hg.delimiter(this.done),this.value?this.inactive:un.cyan().underline(this.inactive),un.gray("/"),this.value?un.cyan().underline(this.active):this.active].join(" "),this.out.write(II.line+Gg.to(0)+this.outputText))}};Kg.exports=Xu});var ot=d((Nk,Yg)=>{"use strict";var Ju=class r{constructor({token:e,date:t,parts:s,locales:i}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof r)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,i)=>i>t&&s instanceof r)}toString(){return String(this.date)}};Yg.exports=Ju});var Jg=d((qk,Xg)=>{"use strict";var CI=ot(),Zu=class extends CI{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Xg.exports=Zu});var Qg=d((Dk,Zg)=>{"use strict";var RI=ot(),NI=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Qu=class extends RI{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+NI(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Zg.exports=Qu});var ty=d((jk,ey)=>{"use strict";var qI=ot(),ec=class extends qI{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};ey.exports=ec});var sy=d((kk,ry)=>{"use strict";var DI=ot(),tc=class extends DI{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};ry.exports=tc});var ny=d((Mk,iy)=>{"use strict";var jI=ot(),rc=class extends jI{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};iy.exports=rc});var ay=d((Lk,oy)=>{"use strict";var kI=ot(),sc=class extends kI{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};oy.exports=sc});var cy=d((Fk,uy)=>{"use strict";var MI=ot(),ic=class extends MI{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};uy.exports=ic});var hy=d((Vk,ly)=>{"use strict";var LI=ot(),nc=class extends LI{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};ly.exports=nc});var fy=d((Uk,dy)=>{"use strict";dy.exports={DatePart:ot(),Meridiem:Jg(),Day:Qg(),Hours:ty(),Milliseconds:sy(),Minutes:ny(),Month:ay(),Seconds:cy(),Year:hy()}});var Ey=d((Hk,$y)=>{"use strict";function py(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(c){t(c);return}a.done?e(u):Promise.resolve(u).then(s,i)}function my(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){py(n,s,i,o,a,"next",u)}function a(u){py(n,s,i,o,a,"throw",u)}o(void 0)})}}var oc=ee(),FI=gt(),uc=Ke(),gy=uc.style,yy=uc.clear,VI=uc.figures,wy=te(),UI=wy.erase,_y=wy.cursor,_t=fy(),vy=_t.DatePart,HI=_t.Meridiem,GI=_t.Day,zI=_t.Hours,BI=_t.Milliseconds,KI=_t.Minutes,WI=_t.Month,YI=_t.Seconds,XI=_t.Year,JI=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,by={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new GI(r),3:r=>new WI(r),4:r=>new XI(r),5:r=>new HI(r),6:r=>new zI(r),7:r=>new KI(r),8:r=>new YI(r),9:r=>new BI(r)},ZI={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},ac=class extends FI{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ZI,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=yy("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=JI.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in by?by[n]({token:t[n]||i,date:this.date,parts:this.parts,locales:this.locales}):t[n]||i)}let s=this.parts.reduce((i,n)=>(typeof n=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=n:i.push(n),i),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof vy)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
24
|
+
`),this.close()}validate(){var e=this;return my(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return my(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
|
|
25
|
+
`),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof vy)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(_y.hide):this.out.write(yy(this.outputText,this.out.columns)),super.render(),this.outputText=[gy.symbol(this.done,this.aborted),oc.bold(this.msg),gy.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?oc.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
26
26
|
`).reduce((e,t,s)=>e+`
|
|
27
|
-
${s?" ":
|
|
28
|
-
`),this.close()}validate(){var e=this;return
|
|
29
|
-
`),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(
|
|
27
|
+
${s?" ":VI.pointerSmall} ${oc.red().italic(t)}`,"")),this.out.write(UI.line+_y.to(0)+this.outputText))}};$y.exports=ac});var Iy=d((Gk,Ay)=>{"use strict";function Sy(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(c){t(c);return}a.done?e(u):Promise.resolve(u).then(s,i)}function Oy(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Sy(n,s,i,o,a,"next",u)}function a(u){Sy(n,s,i,o,a,"throw",u)}o(void 0)})}}var cn=ee(),QI=gt(),Py=te(),ln=Py.cursor,eC=Py.erase,hn=Ke(),cc=hn.style,tC=hn.figures,xy=hn.clear,rC=hn.lines,sC=/[0-9]/,lc=r=>r!==void 0,Ty=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},hc=class extends QI{constructor(e={}){super(e),this.transform=cc.render(e.style),this.msg=e.message,this.initial=lc(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=lc(e.min)?e.min:-1/0,this.max=lc(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=cn.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Ty(e,this.round)}`),this._value=Ty(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||sC.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
28
|
+
`),this.close()}validate(){var e=this;return Oy(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Oy(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
|
|
29
|
+
`),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ln.down(rC(this.outputError,this.out.columns)-1)+xy(this.outputError,this.out.columns)),this.out.write(xy(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[cc.symbol(this.done,this.aborted),cn.bold(this.msg),cc.delimiter(this.done),!this.done||!this.done&&!this.placeholder?cn[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
30
30
|
`).reduce((e,t,s)=>e+`
|
|
31
|
-
${s?" ":
|
|
31
|
+
${s?" ":tC.pointerSmall} ${cn.red().italic(t)}`,"")),this.out.write(eC.line+ln.to(0)+this.outputText+ln.save+this.outputError+ln.restore))}};Ay.exports=hc});var fc=d((zk,Ny)=>{"use strict";var at=ee(),iC=te(),nC=iC.cursor,oC=gt(),Ls=Ke(),Cy=Ls.clear,Mt=Ls.figures,Ry=Ls.style,aC=Ls.wrap,uC=Ls.entriesToDisplay,dc=class extends oC{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=Cy("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
32
32
|
`),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
33
33
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
34
34
|
Instructions:
|
|
35
|
-
${
|
|
36
|
-
${
|
|
35
|
+
${Mt.arrowUp}/${Mt.arrowDown}: Highlight option
|
|
36
|
+
${Mt.arrowLeft}/${Mt.arrowRight}/[space]: Toggle selection
|
|
37
37
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|
38
|
-
`:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?
|
|
39
|
-
`+
|
|
38
|
+
`:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?at.green(Mt.radioOn):Mt.radioOff)+" "+i+" ",o,a;return t.disabled?o=e===s?at.gray().underline(t.title):at.strikethrough().gray(t.title):(o=e===s?at.cyan().underline(t.title):t.title,e===s&&t.description&&(a=` - ${t.description}`,(n.length+o.length+a.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(a=`
|
|
39
|
+
`+aC(t.description,{margin:n.length,width:this.out.columns})))),n+o+at.gray(a||"")}paginateOptions(e){if(e.length===0)return at.red("No matches for this query.");let t=uC(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,i=t.endIndex,n,o=[];for(let a=s;a<i;a++)a===s&&s>0?n=Mt.arrowUp:a===i-1&&i<e.length?n=Mt.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return`
|
|
40
40
|
`+o.join(`
|
|
41
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[
|
|
41
|
+
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[at.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(at.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(nC.hide),super.render();let e=[Ry.symbol(this.done,this.aborted),at.bold(this.msg),Ry.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=at.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Cy(e,this.out.columns)}};Ny.exports=dc});var Fy=d((Bk,Ly)=>{"use strict";function qy(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(c){t(c);return}a.done?e(u):Promise.resolve(u).then(s,i)}function cC(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){qy(n,s,i,o,a,"next",u)}function a(u){qy(n,s,i,o,a,"throw",u)}o(void 0)})}}var Fs=ee(),lC=gt(),My=te(),hC=My.erase,Dy=My.cursor,Vs=Ke(),pc=Vs.style,jy=Vs.clear,mc=Vs.figures,dC=Vs.wrap,fC=Vs.entriesToDisplay,ky=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),pC=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),mC=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},gc=class extends lC{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:mC(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=pc.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=jy("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ky(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return cC(function*(){let s=t.completing=t.suggest(t.input,t.choices),i=yield s;if(t.completing!==s)return;t.suggestions=i.map((o,a,u)=>({title:pC(u,a),value:ky(u,a),description:o.description})),t.completing=!1;let n=Math.max(i.length-1,0);t.moveSelect(Math.min(n,t.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
42
42
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
43
43
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
44
|
-
`),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${s}${e}${i}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,i){let n,o=s?
|
|
45
|
-
`+
|
|
44
|
+
`),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${s}${e}${i}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,i){let n,o=s?mc.arrowUp:i?mc.arrowDown:" ",a=t?Fs.cyan().underline(e.title):e.title;return o=(t?Fs.cyan(mc.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
|
|
45
|
+
`+dC(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Fs.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Dy.hide):this.out.write(jy(this.outputText,this.out.columns)),super.render();let e=fC(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[pc.symbol(this.done,this.aborted,this.exited),Fs.bold(this.msg),pc.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(t,s).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===s-1&&s<this.choices.length)).join(`
|
|
46
46
|
`);this.outputText+=`
|
|
47
|
-
`+(i||
|
|
47
|
+
`+(i||Fs.gray(this.fallback.title))}this.out.write(hC.line+Dy.to(0)+this.outputText)}};Ly.exports=gc});var Gy=d((Kk,Hy)=>{"use strict";var vt=ee(),gC=te(),yC=gC.cursor,_C=fc(),_c=Ke(),Vy=_c.clear,Uy=_c.style,Nr=_c.figures,yc=class extends _C{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Vy("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
48
48
|
Instructions:
|
|
49
|
-
${
|
|
50
|
-
${
|
|
49
|
+
${Nr.arrowUp}/${Nr.arrowDown}: Highlight option
|
|
50
|
+
${Nr.arrowLeft}/${Nr.arrowRight}/[space]: Toggle selection
|
|
51
51
|
[a,b,c]/delete: Filter choices
|
|
52
52
|
enter/return: Complete answer
|
|
53
53
|
`:""}renderCurrentInput(){return`
|
|
54
|
-
Filtered results for: ${this.inputValue?this.inputValue:
|
|
55
|
-
`}renderOption(e,t,s){let i;return t.disabled?i=e===s?
|
|
54
|
+
Filtered results for: ${this.inputValue?this.inputValue:vt.gray("Enter something to filter")}
|
|
55
|
+
`}renderOption(e,t,s){let i;return t.disabled?i=e===s?vt.gray().underline(t.title):vt.strikethrough().gray(t.title):i=e===s?vt.cyan().underline(t.title):t.title,(t.selected?vt.green(Nr.radioOn):Nr.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[vt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(vt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(yC.hide),super.render();let e=[Uy.symbol(this.done,this.aborted),vt.bold(this.msg),Uy.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=vt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Vy(e,this.out.columns)}};Hy.exports=yc});var Jy=d((Wk,Xy)=>{"use strict";var zy=ee(),vC=gt(),Wy=Ke(),By=Wy.style,bC=Wy.clear,Yy=te(),wC=Yy.erase,Ky=Yy.cursor,vc=class extends vC{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
56
56
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
57
|
-
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(
|
|
58
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){t=t.call(r)},n:function(){var c=t.next();return n=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function
|
|
57
|
+
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Ky.hide):this.out.write(bC(this.outputText,this.out.columns)),super.render(),this.outputText=[By.symbol(this.done,this.aborted),zy.bold(this.msg),By.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:zy.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(wC.line+Ky.to(0)+this.outputText))}};Xy.exports=vc});var Qy=d((Yk,Zy)=>{"use strict";Zy.exports={TextPrompt:Mg(),SelectPrompt:Ug(),TogglePrompt:Wg(),DatePrompt:Ey(),NumberPrompt:Iy(),MultiselectPrompt:fc(),AutocompletePrompt:Fy(),AutocompleteMultiselectPrompt:Gy(),ConfirmPrompt:Jy()}});var t0=d(e0=>{"use strict";var xe=e0,$C=Qy(),dn=r=>r;function ut(r,e,t={}){return new Promise((s,i)=>{let n=new $C[r](e),o=t.onAbort||dn,a=t.onSubmit||dn,u=t.onExit||dn;n.on("state",e.onState||dn),n.on("submit",c=>s(a(c))),n.on("exit",c=>s(u(c))),n.on("abort",c=>i(o(c)))})}xe.text=r=>ut("TextPrompt",r);xe.password=r=>(r.style="password",xe.text(r));xe.invisible=r=>(r.style="invisible",xe.text(r));xe.number=r=>ut("NumberPrompt",r);xe.date=r=>ut("DatePrompt",r);xe.confirm=r=>ut("ConfirmPrompt",r);xe.list=r=>{let e=r.separator||",";return ut("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};xe.toggle=r=>ut("TogglePrompt",r);xe.select=r=>ut("SelectPrompt",r);xe.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ut("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};xe.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ut("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var EC=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));xe.autocomplete=r=>(r.suggest=r.suggest||EC,r.choices=[].concat(r.choices||[]),ut("AutocompletePrompt",r))});var c0=d((Jk,u0)=>{"use strict";function r0(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,s)}return t}function s0(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?r0(Object(t),!0).forEach(function(s){SC(r,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):r0(Object(t)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))})}return r}function SC(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function OC(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=xC(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var s=0,i=function(){};return{s:i,n:function(){return s>=r.length?{done:!0}:{done:!1,value:r[s++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
58
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){t=t.call(r)},n:function(){var c=t.next();return n=c.done,c},e:function(c){o=!0,a=c},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function xC(r,e){if(r){if(typeof r=="string")return i0(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i0(r,e)}}function i0(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=r[t];return s}function n0(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(c){t(c);return}a.done?e(u):Promise.resolve(u).then(s,i)}function o0(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){n0(n,s,i,o,a,"next",u)}function a(u){n0(n,s,i,o,a,"throw",u)}o(void 0)})}}var bc=t0(),TC=["suggest","format","onState","validate","onRender","type"],a0=()=>{};function Lt(){return wc.apply(this,arguments)}function wc(){return wc=o0(function*(r=[],{onSubmit:e=a0,onCancel:t=a0}={}){let s={},i=Lt._override||{};r=[].concat(r);let n,o,a,u,c,l,h=(function(){var y=o0(function*(_,w,E=!1){if(!(!E&&_.validate&&_.validate(w)!==!0))return _.format?yield _.format(w,s):w});return function(w,E){return y.apply(this,arguments)}})();var f=OC(r),p;try{for(f.s();!(p=f.n()).done;){o=p.value;var m=o;if(u=m.name,c=m.type,typeof c=="function"&&(c=yield c(n,s0({},s),o),o.type=c),!!c){for(let y in o){if(TC.includes(y))continue;let _=o[y];o[y]=typeof _=="function"?yield _(n,s0({},s),l):_}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(u=g.name,c=g.type,bc[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[o.name]!==void 0&&(n=yield h(o,i[o.name]),n!==void 0)){s[u]=n;continue}try{n=Lt._injected?PC(Lt._injected,o.initial):yield bc[c](o),s[u]=n=yield h(o,n,!0),a=yield e(o,n,s)}catch{a=!(yield t(o,s))}if(a)return s}}}catch(y){f.e(y)}finally{f.f()}return s}),wc.apply(this,arguments)}function PC(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function AC(r){Lt._injected=(Lt._injected||[]).concat(r)}function IC(r){Lt._override=Object.assign({},r)}u0.exports=Object.assign(Lt,{prompt:Lt,prompts:bc,inject:AC,override:IC})});var h0=d((Zk,l0)=>{"use strict";l0.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var fn=d((Qk,d0)=>{"use strict";d0.exports=r=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof r=="string"?r.replace(t,""):r}});var m0=d((e2,p0)=>{"use strict";var CC=fn(),{erase:f0,cursor:RC}=te(),NC=r=>[...CC(r)].length;p0.exports=function(r,e){if(!e)return f0.line+RC.to(0);let t=0,s=r.split(/\r?\n/);for(let i of s)t+=1+Math.floor(Math.max(NC(i)-1,0)/e);return f0.lines(t)}});var $c=d((t2,g0)=>{"use strict";var Us={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},qC={arrowUp:Us.arrowUp,arrowDown:Us.arrowDown,arrowLeft:Us.arrowLeft,arrowRight:Us.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},DC=process.platform==="win32"?qC:Us;g0.exports=DC});var _0=d((r2,y0)=>{"use strict";var qr=ee(),or=$c(),Ec=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),jC=r=>Ec[r]||Ec.default,Hs=Object.freeze({aborted:qr.red(or.cross),done:qr.green(or.tick),exited:qr.yellow(or.cross),default:qr.cyan("?")}),kC=(r,e,t)=>e?Hs.aborted:t?Hs.exited:r?Hs.done:Hs.default,MC=r=>qr.gray(r?or.ellipsis:or.pointerSmall),LC=(r,e)=>qr.gray(r?e?or.pointerSmall:"+":or.line);y0.exports={styles:Ec,render:jC,symbols:Hs,symbol:kC,delimiter:MC,item:LC}});var b0=d((s2,v0)=>{"use strict";var FC=fn();v0.exports=function(r,e){let t=String(FC(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var $0=d((i2,w0)=>{"use strict";w0.exports=(r,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(r||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
|
|
59
59
|
`)).join(`
|
|
60
|
-
`)}});var
|
|
60
|
+
`)}});var S0=d((n2,E0)=>{"use strict";E0.exports=(r,e,t)=>{t=t||e;let s=Math.min(e-t,r-Math.floor(t/2));s<0&&(s=0);let i=Math.min(s+t,e);return{startIndex:s,endIndex:i}}});var We=d((o2,O0)=>{"use strict";O0.exports={action:h0(),clear:m0(),style:_0(),strip:fn(),figures:$c(),lines:b0(),wrap:$0(),entriesToDisplay:S0()}});var bt=d((a2,T0)=>{"use strict";var x0=require("readline"),{action:VC}=We(),UC=require("events"),{beep:HC,cursor:GC}=te(),zC=ee(),Sc=class extends UC{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=x0.createInterface({input:this.in,escapeCodeTimeout:50});x0.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(n,o)=>{let a=VC(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(GC.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(HC)}render(){this.onRender(zC),this.firstRender&&(this.firstRender=!1)}};T0.exports=Sc});var A0=d((u2,P0)=>{var pn=ee(),BC=bt(),{erase:KC,cursor:Gs}=te(),{style:Oc,clear:xc,lines:WC,figures:YC}=We(),Tc=class extends BC{constructor(e={}){super(e),this.transform=Oc.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=xc("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=pn.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
61
61
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
62
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${s}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(
|
|
62
|
+
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${s}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Gs.down(WC(this.outputError,this.out.columns)-1)+xc(this.outputError,this.out.columns)),this.out.write(xc(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Oc.symbol(this.done,this.aborted),pn.bold(this.msg),Oc.delimiter(this.done),this.red?pn.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
63
63
|
`).reduce((e,t,s)=>e+`
|
|
64
|
-
${s?" "
|
|
64
|
+
${s?" ":YC.pointerSmall} ${pn.red().italic(t)}`,"")),this.out.write(KC.line+Gs.to(0)+this.outputText+Gs.save+this.outputError+Gs.restore+Gs.move(this.cursorOffset,0)))}};P0.exports=Tc});var N0=d((c2,R0)=>{"use strict";var wt=ee(),XC=bt(),{style:I0,clear:C0,figures:mn,wrap:JC,entriesToDisplay:ZC}=We(),{cursor:QC}=te(),Pc=class extends XC{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=C0("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
65
65
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
66
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(
|
|
67
|
-
`;for(let s=e;s<t;s++){let i,n,o="",a=this.choices[s];s===e&&e>0?n=
|
|
68
|
-
`+
|
|
69
|
-
`}}this.out.write(this.outputText)}};
|
|
66
|
+
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(QC.hide):this.out.write(C0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=ZC(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[I0.symbol(this.done,this.aborted),wt.bold(this.msg),I0.delimiter(!1),this.done?this.selection.title:this.selection.disabled?wt.yellow(this.warn):wt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
67
|
+
`;for(let s=e;s<t;s++){let i,n,o="",a=this.choices[s];s===e&&e>0?n=mn.arrowUp:s===t-1&&t<this.choices.length?n=mn.arrowDown:n=" ",a.disabled?(i=this.cursor===s?wt.gray().underline(a.title):wt.strikethrough().gray(a.title),n=(this.cursor===s?wt.bold().gray(mn.pointer)+" ":" ")+n):(i=this.cursor===s?wt.cyan().underline(a.title):a.title,n=(this.cursor===s?wt.cyan(mn.pointer)+" ":" ")+n,a.description&&this.cursor===s&&(o=` - ${a.description}`,(n.length+i.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
|
|
68
|
+
`+JC(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${i}${wt.gray(o)}
|
|
69
|
+
`}}this.out.write(this.outputText)}};R0.exports=Pc});var k0=d((l2,j0)=>{var gn=ee(),eR=bt(),{style:q0,clear:tR}=We(),{cursor:D0,erase:rR}=te(),Ac=class extends eR{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
70
70
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
71
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(
|
|
71
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(D0.hide):this.out.write(tR(this.outputText,this.out.columns)),super.render(),this.outputText=[q0.symbol(this.done,this.aborted),gn.bold(this.msg),q0.delimiter(this.done),this.value?this.inactive:gn.cyan().underline(this.inactive),gn.gray("/"),this.value?gn.cyan().underline(this.active):this.active].join(" "),this.out.write(rR.line+D0.to(0)+this.outputText))}};j0.exports=Ac});var ct=d((h2,M0)=>{"use strict";var Ic=class r{constructor({token:e,date:t,parts:s,locales:i}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof r)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,i)=>i>t&&s instanceof r)}toString(){return String(this.date)}};M0.exports=Ic});var F0=d((d2,L0)=>{"use strict";var sR=ct(),Cc=class extends sR{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};L0.exports=Cc});var U0=d((f2,V0)=>{"use strict";var iR=ct(),nR=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Rc=class extends iR{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+nR(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};V0.exports=Rc});var G0=d((p2,H0)=>{"use strict";var oR=ct(),Nc=class extends oR{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};H0.exports=Nc});var B0=d((m2,z0)=>{"use strict";var aR=ct(),qc=class extends aR{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};z0.exports=qc});var W0=d((g2,K0)=>{"use strict";var uR=ct(),Dc=class extends uR{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};K0.exports=Dc});var X0=d((y2,Y0)=>{"use strict";var cR=ct(),jc=class extends cR{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Y0.exports=jc});var Z0=d((_2,J0)=>{"use strict";var lR=ct(),kc=class extends lR{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};J0.exports=kc});var e_=d((v2,Q0)=>{"use strict";var hR=ct(),Mc=class extends hR{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Q0.exports=Mc});var r_=d((b2,t_)=>{"use strict";t_.exports={DatePart:ct(),Meridiem:F0(),Day:U0(),Hours:G0(),Milliseconds:B0(),Minutes:W0(),Month:X0(),Seconds:Z0(),Year:e_()}});var c_=d((w2,u_)=>{"use strict";var Lc=ee(),dR=bt(),{style:s_,clear:i_,figures:fR}=We(),{erase:pR,cursor:n_}=te(),{DatePart:o_,Meridiem:mR,Day:gR,Hours:yR,Milliseconds:_R,Minutes:vR,Month:bR,Seconds:wR,Year:$R}=r_(),ER=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,a_={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new gR(r),3:r=>new bR(r),4:r=>new $R(r),5:r=>new mR(r),6:r=>new yR(r),7:r=>new vR(r),8:r=>new wR(r),9:r=>new _R(r)},SR={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Fc=class extends dR{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(SR,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i_("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=ER.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in a_?a_[n]({token:t[n]||i,date:this.date,parts:this.parts,locales:this.locales}):t[n]||i)}let s=this.parts.reduce((i,n)=>(typeof n=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=n:i.push(n),i),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof o_)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
72
72
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
73
|
-
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof
|
|
73
|
+
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof o_)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(n_.hide):this.out.write(i_(this.outputText,this.out.columns)),super.render(),this.outputText=[s_.symbol(this.done,this.aborted),Lc.bold(this.msg),s_.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Lc.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
74
74
|
`).reduce((e,t,s)=>e+`
|
|
75
|
-
${s?" ":
|
|
75
|
+
${s?" ":fR.pointerSmall} ${Lc.red().italic(t)}`,"")),this.out.write(pR.line+n_.to(0)+this.outputText))}};u_.exports=Fc});var f_=d(($2,d_)=>{var yn=ee(),OR=bt(),{cursor:_n,erase:xR}=te(),{style:Vc,figures:TR,clear:l_,lines:PR}=We(),AR=/[0-9]/,Uc=r=>r!==void 0,h_=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Hc=class extends OR{constructor(e={}){super(e),this.transform=Vc.render(e.style),this.msg=e.message,this.initial=Uc(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Uc(e.min)?e.min:-1/0,this.max=Uc(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=yn.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${h_(e,this.round)}`),this._value=h_(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||AR.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
76
76
|
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
77
|
-
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(
|
|
77
|
+
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(_n.down(PR(this.outputError,this.out.columns)-1)+l_(this.outputError,this.out.columns)),this.out.write(l_(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Vc.symbol(this.done,this.aborted),yn.bold(this.msg),Vc.delimiter(this.done),!this.done||!this.done&&!this.placeholder?yn[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
78
78
|
`).reduce((e,t,s)=>e+`
|
|
79
|
-
${s?" ":
|
|
79
|
+
${s?" ":TR.pointerSmall} ${yn.red().italic(t)}`,"")),this.out.write(xR.line+_n.to(0)+this.outputText+_n.save+this.outputError+_n.restore))}};d_.exports=Hc});var zc=d((E2,g_)=>{"use strict";var lt=ee(),{cursor:IR}=te(),CR=bt(),{clear:p_,figures:Ft,style:m_,wrap:RR,entriesToDisplay:NR}=We(),Gc=class extends CR{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=p_("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
80
80
|
`),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
81
81
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
82
82
|
Instructions:
|
|
83
|
-
${
|
|
84
|
-
${
|
|
83
|
+
${Ft.arrowUp}/${Ft.arrowDown}: Highlight option
|
|
84
|
+
${Ft.arrowLeft}/${Ft.arrowRight}/[space]: Toggle selection
|
|
85
85
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|
86
|
-
`:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?
|
|
87
|
-
`+
|
|
86
|
+
`:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?lt.green(Ft.radioOn):Ft.radioOff)+" "+i+" ",o,a;return t.disabled?o=e===s?lt.gray().underline(t.title):lt.strikethrough().gray(t.title):(o=e===s?lt.cyan().underline(t.title):t.title,e===s&&t.description&&(a=` - ${t.description}`,(n.length+o.length+a.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(a=`
|
|
87
|
+
`+RR(t.description,{margin:n.length,width:this.out.columns})))),n+o+lt.gray(a||"")}paginateOptions(e){if(e.length===0)return lt.red("No matches for this query.");let{startIndex:t,endIndex:s}=NR(this.cursor,e.length,this.optionsPerPage),i,n=[];for(let o=t;o<s;o++)o===t&&t>0?i=Ft.arrowUp:o===s-1&&s<e.length?i=Ft.arrowDown:i=" ",n.push(this.renderOption(this.cursor,e[o],o,i));return`
|
|
88
88
|
`+n.join(`
|
|
89
|
-
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[
|
|
89
|
+
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[lt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(lt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(IR.hide),super.render();let e=[m_.symbol(this.done,this.aborted),lt.bold(this.msg),m_.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=lt.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=p_(e,this.out.columns)}};g_.exports=Gc});var w_=d((S2,b_)=>{"use strict";var zs=ee(),qR=bt(),{erase:DR,cursor:y_}=te(),{style:Bc,clear:__,figures:Kc,wrap:jR,entriesToDisplay:kR}=We(),v_=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),MR=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),LR=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Wc=class extends qR{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:LR(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Bc.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=__("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=v_(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((n,o,a)=>({title:MR(a,o),value:v_(a,o),description:n.description})),this.completing=!1;let i=Math.max(s.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
90
90
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
91
91
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
92
|
-
`),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${s}${e}${i}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,i){let n,o=s?
|
|
93
|
-
`+
|
|
92
|
+
`),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${s}${e}${i}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,i){let n,o=s?Kc.arrowUp:i?Kc.arrowDown:" ",a=t?zs.cyan().underline(e.title):e.title;return o=(t?zs.cyan(Kc.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
|
|
93
|
+
`+jR(e.description,{margin:3,width:this.out.columns}))),o+" "+a+zs.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(y_.hide):this.out.write(__(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=kR(this.select,this.choices.length,this.limit);if(this.outputText=[Bc.symbol(this.done,this.aborted,this.exited),zs.bold(this.msg),Bc.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(e,t).map((i,n)=>this.renderOption(i,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
|
|
94
94
|
`);this.outputText+=`
|
|
95
|
-
`+(s||
|
|
95
|
+
`+(s||zs.gray(this.fallback.title))}this.out.write(DR.line+y_.to(0)+this.outputText)}};b_.exports=Wc});var O_=d((O2,S_)=>{"use strict";var $t=ee(),{cursor:FR}=te(),VR=zc(),{clear:$_,style:E_,figures:Dr}=We(),Yc=class extends VR{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=$_("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
96
96
|
Instructions:
|
|
97
|
-
${
|
|
98
|
-
${
|
|
97
|
+
${Dr.arrowUp}/${Dr.arrowDown}: Highlight option
|
|
98
|
+
${Dr.arrowLeft}/${Dr.arrowRight}/[space]: Toggle selection
|
|
99
99
|
[a,b,c]/delete: Filter choices
|
|
100
100
|
enter/return: Complete answer
|
|
101
101
|
`:""}renderCurrentInput(){return`
|
|
102
|
-
Filtered results for: ${this.inputValue?this.inputValue
|
|
103
|
-
`}renderOption(e,t,s){let i;return t.disabled?i=e===s
|
|
102
|
+
Filtered results for: ${this.inputValue?this.inputValue:$t.gray("Enter something to filter")}
|
|
103
|
+
`}renderOption(e,t,s){let i;return t.disabled?i=e===s?$t.gray().underline(t.title):$t.strikethrough().gray(t.title):i=e===s?$t.cyan().underline(t.title):t.title,(t.selected?$t.green(Dr.radioOn):Dr.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[$t.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($t.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(FR.hide),super.render();let e=[E_.symbol(this.done,this.aborted),$t.bold(this.msg),E_.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=$_(e,this.out.columns)}};S_.exports=Yc});var I_=d((x2,A_)=>{var x_=ee(),UR=bt(),{style:T_,clear:HR}=We(),{erase:GR,cursor:P_}=te(),Xc=class extends UR{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
104
104
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
105
|
-
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(
|
|
106
|
-
`)}displayWidth(e){return
|
|
105
|
+
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(P_.hide):this.out.write(HR(this.outputText,this.out.columns)),super.render(),this.outputText=[T_.symbol(this.done,this.aborted),x_.bold(this.msg),T_.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:x_.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(GR.line+P_.to(0)+this.outputText))}};A_.exports=Xc});var R_=d((T2,C_)=>{"use strict";C_.exports={TextPrompt:A0(),SelectPrompt:N0(),TogglePrompt:k0(),DatePrompt:c_(),NumberPrompt:f_(),MultiselectPrompt:zc(),AutocompletePrompt:w_(),AutocompleteMultiselectPrompt:O_(),ConfirmPrompt:I_()}});var q_=d(N_=>{"use strict";var Te=N_,zR=R_(),vn=r=>r;function ht(r,e,t={}){return new Promise((s,i)=>{let n=new zR[r](e),o=t.onAbort||vn,a=t.onSubmit||vn,u=t.onExit||vn;n.on("state",e.onState||vn),n.on("submit",c=>s(a(c))),n.on("exit",c=>s(u(c))),n.on("abort",c=>i(o(c)))})}Te.text=r=>ht("TextPrompt",r);Te.password=r=>(r.style="password",Te.text(r));Te.invisible=r=>(r.style="invisible",Te.text(r));Te.number=r=>ht("NumberPrompt",r);Te.date=r=>ht("DatePrompt",r);Te.confirm=r=>ht("ConfirmPrompt",r);Te.list=r=>{let e=r.separator||",";return ht("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};Te.toggle=r=>ht("TogglePrompt",r);Te.select=r=>ht("SelectPrompt",r);Te.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ht("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};Te.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ht("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var BR=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Te.autocomplete=r=>(r.suggest=r.suggest||BR,r.choices=[].concat(r.choices||[]),ht("AutocompletePrompt",r))});var k_=d((A2,j_)=>{"use strict";var Jc=q_(),KR=["suggest","format","onState","validate","onRender","type"],D_=()=>{};async function Vt(r=[],{onSubmit:e=D_,onCancel:t=D_}={}){let s={},i=Vt._override||{};r=[].concat(r);let n,o,a,u,c,l,h=async(f,p,m=!1)=>{if(!(!m&&f.validate&&f.validate(p)!==!0))return f.format?await f.format(p,s):p};for(o of r)if({name:u,type:c}=o,typeof c=="function"&&(c=await c(n,{...s},o),o.type=c),!!c){for(let f in o){if(KR.includes(f))continue;let p=o[f];o[f]=typeof p=="function"?await p(n,{...s},l):p}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=o,Jc[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[o.name]!==void 0&&(n=await h(o,i[o.name]),n!==void 0)){s[u]=n;continue}try{n=Vt._injected?WR(Vt._injected,o.initial):await Jc[c](o),s[u]=n=await h(o,n,!0),a=await e(o,n,s)}catch{a=!await t(o,s)}if(a)return s}return s}function WR(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function YR(r){Vt._injected=(Vt._injected||[]).concat(r)}function XR(r){Vt._override=Object.assign({},r)}j_.exports=Object.assign(Vt,{prompt:Vt,prompts:Jc,inject:YR,override:XR})});var L_=d((I2,M_)=>{function JR(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<r.length;e++){if(t[e]>r[e])return!1;if(r[e]>t[e])return!0}return!1}M_.exports=JR("8.6.0")?c0():k_()});var Ws=d(sl=>{var En=class extends Error{constructor(e,t,s){super(s),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},rl=class extends En{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};sl.CommanderError=En;sl.InvalidArgumentError=rl});var Sn=d(nl=>{var{InvalidArgumentError:dN}=Ws(),il=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,s)=>{if(!this.argChoices.includes(t))throw new dN(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,s):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function fN(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}nl.Argument=il;nl.humanReadableArgName=fN});var ul=d(al=>{var{humanReadableArgName:pN}=Sn(),ol=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),s=e._getHelpCommand();return s&&!s._hidden&&t.push(s),this.sortSubcommands&&t.sort((i,n)=>i.name().localeCompare(n.name())),t}compareOptions(e,t){let s=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return s(e).localeCompare(s(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),s=e._getHelpOption();if(s&&!s.hidden){let i=s.short&&e._findOption(s.short),n=s.long&&e._findOption(s.long);!i&&!n?t.push(s):s.long&&!n?t.push(e.createOption(s.long,s.description)):s.short&&!i&&t.push(e.createOption(s.short,s.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let s=e.parent;s;s=s.parent){let i=s.options.filter(n=>!n.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(s=>pN(s)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((s,i)=>Math.max(s,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((s,i)=>Math.max(s,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((s,i)=>Math.max(s,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((s,i)=>Math.max(s,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let s="";for(let i=e.parent;i;i=i.parent)s=i.name()+" "+s;return s+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let s=`(${t.join(", ")})`;return e.description?`${e.description} ${s}`:s}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let s=`(${t.join(", ")})`;return e.description?`${e.description} ${s}`:s}return e.description}formatItemList(e,t,s){return t.length===0?[]:[s.styleTitle(e),...t,""]}groupItems(e,t,s){let i=new Map;return e.forEach(n=>{let o=s(n);i.has(o)||i.set(o,[])}),t.forEach(n=>{let o=s(n);i.has(o)||i.set(o,[]),i.get(o).push(n)}),i}formatHelp(e,t){let s=t.padWidth(e,t),i=t.helpWidth??80;function n(h,f){return t.formatItem(h,s,f,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(a),i),""]));let u=t.visibleArguments(e).map(h=>n(t.styleArgumentTerm(t.argumentTerm(h)),t.styleArgumentDescription(t.argumentDescription(h))));if(o=o.concat(this.formatItemList("Arguments:",u,t)),this.groupItems(e.options,t.visibleOptions(e),h=>h.helpGroupHeading??"Options:").forEach((h,f)=>{let p=h.map(m=>n(t.styleOptionTerm(t.optionTerm(m)),t.styleOptionDescription(t.optionDescription(m))));o=o.concat(this.formatItemList(f,p,t))}),t.showGlobalOptions){let h=t.visibleGlobalOptions(e).map(f=>n(t.styleOptionTerm(t.optionTerm(f)),t.styleOptionDescription(t.optionDescription(f))));o=o.concat(this.formatItemList("Global Options:",h,t))}return this.groupItems(e.commands,t.visibleCommands(e),h=>h.helpGroup()||"Commands:").forEach((h,f)=>{let p=h.map(m=>n(t.styleSubcommandTerm(t.subcommandTerm(m)),t.styleSubcommandDescription(t.subcommandDescription(m))));o=o.concat(this.formatItemList(f,p,t))}),o.join(`
|
|
106
|
+
`)}displayWidth(e){return J_(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,s,i){let o=" ".repeat(2);if(!s)return o+e;let a=e.padEnd(t+e.length-i.displayWidth(e)),u=2,l=(this.helpWidth??80)-t-u-2,h;return l<this.minWidthToWrap||i.preformatted(s)?h=s:h=i.boxWrap(s,l).replace(/\n/g,`
|
|
107
107
|
`+" ".repeat(t+u)),o+a+" ".repeat(u)+h.replace(/\n/g,`
|
|
108
108
|
${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let s=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,n=[];return s.forEach(o=>{let a=o.match(i);if(a===null){n.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let h=this.displayWidth(l);if(c+h<=t){u.push(l),c+=h;return}n.push(u.join(""));let f=l.trimStart();u=[f],c=this.displayWidth(f)}),n.push(u.join(""))}),n.join(`
|
|
109
|
-
`)}};function
|
|
109
|
+
`)}};function J_(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}al.Help=ol;al.stripColor=J_});var dl=d(hl=>{var{InvalidArgumentError:mN}=Ws(),cl=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let s=gN(e);this.short=s.shortFlag,this.long=s.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,s)=>{if(!this.argChoices.includes(t))throw new mN(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,s):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Z_(this.name().replace(/^no-/,"")):Z_(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ll=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,s)=>{this.positiveOptions.has(s)&&this.dualOptions.add(s)})}valueFromOption(e,t){let s=t.attributeName();if(!this.dualOptions.has(s))return!0;let i=this.negativeOptions.get(s).presetArg,n=i!==void 0?i:!1;return t.negate===(n===e)}};function Z_(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function gN(r){let e,t,s=/^-[^-]$/,i=/^--[^-]/,n=r.split(/[ |,]+/).concat("guard");if(s.test(n[0])&&(e=n.shift()),i.test(n[0])&&(t=n.shift()),!e&&s.test(n[0])&&(e=n.shift()),!e&&i.test(n[0])&&(e=t,t=n.shift()),n[0].startsWith("-")){let o=n[0],a=`option creation failed due to '${o}' in option flags '${r}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
|
|
110
110
|
- a short flag is a single dash and a single character
|
|
111
111
|
- either use a single dash and a single character (for a short flag)
|
|
112
112
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):s.test(o)?new Error(`${a}
|
|
113
113
|
- too many short flags`):i.test(o)?new Error(`${a}
|
|
114
114
|
- too many long flags`):new Error(`${a}
|
|
115
|
-
- unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${r}'.`);return{shortFlag:e,longFlag:t}}
|
|
115
|
+
- unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${r}'.`);return{shortFlag:e,longFlag:t}}hl.Option=cl;hl.DualOptions=ll});var ev=d(Q_=>{function yN(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let s=0;s<=r.length;s++)t[s]=[s];for(let s=0;s<=e.length;s++)t[0][s]=s;for(let s=1;s<=e.length;s++)for(let i=1;i<=r.length;i++){let n=1;r[i-1]===e[s-1]?n=0:n=1,t[i][s]=Math.min(t[i-1][s]+1,t[i][s-1]+1,t[i-1][s-1]+n),i>1&&s>1&&r[i-1]===e[s-2]&&r[i-2]===e[s-1]&&(t[i][s]=Math.min(t[i][s],t[i-2][s-2]+1))}return t[r.length][e.length]}function _N(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(o=>o.slice(2)));let s=[],i=3,n=.4;return e.forEach(o=>{if(o.length<=1)return;let a=yN(r,o),u=Math.max(r.length,o.length);(u-a)/u>n&&(a<i?(i=a,s=[o]):a===i&&s.push(o))}),s.sort((o,a)=>o.localeCompare(a)),t&&(s=s.map(o=>`--${o}`)),s.length>1?`
|
|
116
116
|
(Did you mean one of ${s.join(", ")}?)`:s.length===1?`
|
|
117
|
-
(Did you mean ${s[0]}?)`:""}
|
|
118
|
-
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new
|
|
119
|
-
Expecting one of '${s.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,s){this._exitCallback&&this._exitCallback(new
|
|
120
|
-
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),s=t(e).find(i=>this._findCommand(i));if(s){let i=t(this._findCommand(s)).join("|"),n=t(e).join("|");throw new Error(`cannot add command '${n}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),s=e.attributeName();if(e.negate){let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(s,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(s,e.defaultValue,"default");let i=(n,o,a)=>{n==null&&e.presetArg!==void 0&&(n=e.presetArg);let u=this.getOptionValue(s);n!==null&&e.parseArg?n=this._callParseArg(e,n,u,o):n!==null&&e.variadic&&(n=e._collectValue(n,u)),n==null&&(e.negate?n=!1:e.isBoolean()||e.optional?n=!0:n=""),this.setOptionValueWithSource(s,n,a)};return this.on("option:"+t,n=>{let o=`error: option '${e.flags}' argument '${n}' is invalid.`;i(n,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,n=>{let o=`error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;i(n,o,"env")}),this}_optionEx(e,t,s,i,n){if(typeof t=="object"&&t instanceof
|
|
121
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,s){if(
|
|
117
|
+
(Did you mean ${s[0]}?)`:""}Q_.suggestSimilar=_N});var iv=d(yl=>{var vN=require("node:events").EventEmitter,fl=require("node:child_process"),Et=require("node:path"),On=require("node:fs"),M=require("node:process"),{Argument:bN,humanReadableArgName:wN}=Sn(),{CommanderError:pl}=Ws(),{Help:$N,stripColor:EN}=ul(),{Option:tv,DualOptions:SN}=dl(),{suggestSimilar:rv}=ev(),ml=class r extends vN{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>M.stdout.write(t),writeErr:t=>M.stderr.write(t),outputError:(t,s)=>s(t),getOutHelpWidth:()=>M.stdout.isTTY?M.stdout.columns:void 0,getErrHelpWidth:()=>M.stderr.isTTY?M.stderr.columns:void 0,getOutHasColors:()=>gl()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>gl()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:t=>EN(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,s){let i=t,n=s;typeof i=="object"&&i!==null&&(n=i,i=null),n=n||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(o);return i&&(u.description(i),u._executableHandler=!0),n.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(n.noHelp||n.hidden),u._executableFile=n.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new r(e)}createHelp(){return Object.assign(new $N,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
118
|
+
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new bN(e,t)}argument(e,t,s,i){let n=this.createArgument(e,t);return typeof s=="function"?n.default(i).argParser(s):n.default(s),this.addArgument(n),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let s=e??"help [command]",[,i,n]=s.match(/([^ ]+) *(.*)/),o=t??"display help for command",a=this.createCommand(i);return a.helpOption(!1),n&&a.arguments(n),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let s=["preSubcommand","preAction","postAction"];if(!s.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
119
|
+
Expecting one of '${s.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,s){this._exitCallback&&this._exitCallback(new pl(e,t,s)),M.exit(e)}action(e){let t=s=>{let i=this.registeredArguments.length,n=s.slice(0,i);return this._storeOptionsAsProperties?n[i]=this:n[i]=this.opts(),n.push(this),e.apply(this,n)};return this._actionHandler=t,this}createOption(e,t){return new tv(e,t)}_callParseArg(e,t,s,i){try{return e.parseArg(t,s)}catch(n){if(n.code==="commander.invalidArgument"){let o=`${i} ${n.message}`;this.error(o,{exitCode:n.exitCode,code:n.code})}throw n}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let s=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${s}'
|
|
120
|
+
- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),s=t(e).find(i=>this._findCommand(i));if(s){let i=t(this._findCommand(s)).join("|"),n=t(e).join("|");throw new Error(`cannot add command '${n}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),s=e.attributeName();if(e.negate){let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(s,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(s,e.defaultValue,"default");let i=(n,o,a)=>{n==null&&e.presetArg!==void 0&&(n=e.presetArg);let u=this.getOptionValue(s);n!==null&&e.parseArg?n=this._callParseArg(e,n,u,o):n!==null&&e.variadic&&(n=e._collectValue(n,u)),n==null&&(e.negate?n=!1:e.isBoolean()||e.optional?n=!0:n=""),this.setOptionValueWithSource(s,n,a)};return this.on("option:"+t,n=>{let o=`error: option '${e.flags}' argument '${n}' is invalid.`;i(n,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,n=>{let o=`error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;i(n,o,"env")}),this}_optionEx(e,t,s,i,n){if(typeof t=="object"&&t instanceof tv)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(t,s);if(o.makeOptionMandatory(!!e.mandatory),typeof i=="function")o.default(n).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},o.default(n).argParser(i)}else o.default(i);return this.addOption(o)}option(e,t,s,i){return this._optionEx({},e,t,s,i)}requiredOption(e,t,s,i){return this._optionEx({mandatory:!0},e,t,s,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,s){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=s,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(s=>{s.getOptionValueSource(e)!==void 0&&(t=s.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){M.versions?.electron&&(t.from="electron");let i=M.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(t.from="eval")}e===void 0&&(e=M.argv),this.rawArgs=e.slice();let s;switch(t.from){case void 0:case"node":this._scriptPath=e[1],s=e.slice(2);break;case"electron":M.defaultApp?(this._scriptPath=e[1],s=e.slice(2)):s=e.slice(1);break;case"user":s=e.slice(0);break;case"eval":s=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",s}parse(e,t){this._prepareForParse();let s=this._prepareUserArgs(e,t);return this._parseCommand([],s),this}async parseAsync(e,t){this._prepareForParse();let s=this._prepareUserArgs(e,t);return await this._parseCommand([],s),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
121
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,s){if(On.existsSync(e))return;let i=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${e}' does not exist
|
|
122
122
|
- if '${s}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
123
123
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
124
|
-
- ${i}`;throw new Error(n)}_executeSubCommand(e,t){t=t.slice();let s=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,h){let f=
|
|
124
|
+
- ${i}`;throw new Error(n)}_executeSubCommand(e,t){t=t.slice();let s=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,h){let f=Et.resolve(l,h);if(On.existsSync(f))return f;if(i.includes(Et.extname(h)))return;let p=i.find(m=>On.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=On.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=Et.resolve(Et.dirname(l),a)}if(a){let l=n(a,o);if(!l&&!e._executableFile&&this._scriptPath){let h=Et.basename(this._scriptPath,Et.extname(this._scriptPath));h!==this._name&&(l=n(a,`${h}-${e._name}`))}o=l||o}s=i.includes(Et.extname(o));let u;M.platform!=="win32"?s?(t.unshift(o),t=sv(M.execArgv).concat(t),u=fl.spawn(M.argv[0],t,{stdio:"inherit"})):u=fl.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=sv(M.execArgv).concat(t),u=fl.spawn(M.execPath,t,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{M.on(h,()=>{u.killed===!1&&u.exitCode===null&&u.kill(h)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new pl(l,"commander.executeSubCommandAsync","(close)")):M.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)M.exit(1);else{let h=new pl(1,"commander.executeSubCommandAsync","(error)");h.nestedError=l,c(h)}}),this.runningCommand=u}_dispatchSubcommand(e,t,s){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let n;return n=this._chainOrCallSubCommandHook(n,i,"preSubcommand"),n=this._chainOrCall(n,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(s));else return i._parseCommand(t,s)}),n}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(s,i,n)=>{let o=i;if(i!==null&&s.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${s.name()}'.`;o=this._callParseArg(s,i,n,a)}return o};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((s,i)=>{let n=s.defaultValue;s.variadic?i<this.args.length?(n=this.args.slice(i),s.parseArg&&(n=n.reduce((o,a)=>e(s,a,o),s.defaultValue))):n===void 0&&(n=[]):i<this.args.length&&(n=this.args[i],s.parseArg&&(n=e(s,n,s.defaultValue))),t[i]=n}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let s=e,i=[];return this._getCommandAndAncestors().reverse().filter(n=>n._lifeCycleHooks[t]!==void 0).forEach(n=>{n._lifeCycleHooks[t].forEach(o=>{i.push({hookedCommand:n,callback:o})})}),t==="postAction"&&i.reverse(),i.forEach(n=>{s=this._chainOrCall(s,()=>n.callback(n.hookedCommand,this))}),s}_chainOrCallSubCommandHook(e,t,s){let i=e;return this._lifeCycleHooks[s]!==void 0&&this._lifeCycleHooks[s].forEach(n=>{i=this._chainOrCall(i,()=>n(this,t))}),i}_parseCommand(e,t){let s=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(s.operands),t=s.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(s.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{s.unknown.length>0&&this.unknownOption(s.unknown[0])},n=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(n,e,t)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(n))i(),this._processArguments(),this.parent.emit(n,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(s=>{let i=s.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(s=>s.conflictsWith.length>0).forEach(s=>{let i=e.find(n=>s.conflictsWith.includes(n.attributeName()));i&&this._conflictingOption(s,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],s=[],i=t;function n(l){return l.length>1&&l[0]==="-"}let o=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(h=>h.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,u=null,c=0;for(;c<e.length||u;){let l=u??e[c++];if(u=null,l==="--"){i===s&&i.push(l),i.push(...e.slice(c));break}if(a&&(!n(l)||o(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,n(l)){let h=this._findOption(l);if(h){if(h.required){let f=e[c++];f===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,f)}else if(h.optional){let f=null;c<e.length&&(!n(e[c])||o(e[c]))&&(f=e[c++]),this.emit(`option:${h.name()}`,f)}else this.emit(`option:${h.name()}`);a=h.variadic?h:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let h=this._findOption(`-${l[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,l.slice(2)):(this.emit(`option:${h.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let h=l.indexOf("="),f=this._findOption(l.slice(0,h));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(h+1));continue}}if(i===t&&n(l)&&!(this.commands.length===0&&o(l))&&(i=s),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&s.length===0){if(this._findCommand(l)){t.push(l),s.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){s.push(l,...e.slice(c));break}}if(this._passThroughOptions){i.push(l,...e.slice(c));break}i.push(l)}return{operands:t,unknown:s}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let s=0;s<t;s++){let i=this.options[s].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
|
|
125
125
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
126
126
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
127
|
-
`),this.outputHelp({error:!0}));let s=t||{},i=s.exitCode||1,n=s.code||"commander.error";this._exit(i,n,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in M.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,M.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new
|
|
128
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let s=this.parent?._findCommand(e);if(s){let i=[s.name()].concat(s.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(s=>
|
|
127
|
+
`),this.outputHelp({error:!0}));let s=t||{},i=s.exitCode||1,n=s.code||"commander.error";this._exit(i,n,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in M.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,M.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new SN(this.options),t=s=>this.getOptionValue(s)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(s));this.options.filter(s=>s.implied!==void 0&&t(s.attributeName())&&e.valueFromOption(this.getOptionValue(s.attributeName()),s)).forEach(s=>{Object.keys(s.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,s.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let s=o=>{let a=o.attributeName(),u=this.getOptionValue(a),c=this.options.find(h=>h.negate&&a===h.attributeName()),l=this.options.find(h=>!h.negate&&a===h.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||o},i=o=>{let a=s(o),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},n=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],n=this;do{let o=n.createHelp().visibleOptions(n).filter(a=>a.long).map(a=>a.long);i=i.concat(o),n=n.parent}while(n&&!n._enablePositionalOptions);t=rv(e,i)}let s=`error: unknown option '${e}'${t}`;this.error(s,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,s=t===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${s} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(n=>{i.push(n.name()),n.alias()&&i.push(n.alias())}),t=rv(e,i)}let s=`error: unknown command '${e}'${t}`;this.error(s,{code:"commander.unknownCommand"})}version(e,t,s){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",s=s||"output the version number";let i=this.createOption(t,s);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
128
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let s=this.parent?._findCommand(e);if(s){let i=[s.name()].concat(s.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(s=>wN(s));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Et.basename(e,Et.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),s=this._getOutputContext(e);t.prepareContext({error:s.error,helpWidth:s.helpWidth,outputHasColors:s.hasColors});let i=t.formatHelp(this,t);return s.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,s,i,n;return t?(s=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(s=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),s(a)),hasColors:i,helpWidth:n}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let s=this._getOutputContext(e),i={error:s.error,write:s.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation({error:s.error});if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");s.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(M.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let s=["beforeAll","before","after","afterAll"];if(!s.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
129
129
|
Expecting one of '${s.join("', '")}'`);let i=`${e}Help`;return this.on(i,n=>{let o;typeof t=="function"?o=t({error:n.error,command:n.command}):o=t,o&&n.write(`${o}
|
|
130
|
-
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function M_(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,s="127.0.0.1",i="9229",n;return(n=e.match(/^(--inspect(-brk)?)$/))!==null?t=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:s=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=n[1],s=n[3],i=n[4]),t&&i!=="0"?`${t}=${s}:${parseInt(i)+1}`:e})}function nl(){if(M.env.NO_COLOR||M.env.FORCE_COLOR==="0"||M.env.FORCE_COLOR==="false")return!1;if(M.env.FORCE_COLOR||M.env.CLICOLOR_FORCE!==void 0)return!0}ol.Command=il;ol.useColor=nl});var H_=d(ke=>{var{Argument:V_}=vn(),{Command:al}=L_(),{CommanderError:ZR,InvalidArgumentError:F_}=zs(),{Help:QR}=Jc(),{Option:U_}=tl();ke.program=new al;ke.createCommand=r=>new al(r);ke.createOption=(r,e)=>new U_(r,e);ke.createArgument=(r,e)=>new V_(r,e);ke.Command=al;ke.Option=U_;ke.Argument=V_;ke.Help=QR;ke.CommanderError=ZR;ke.InvalidArgumentError=F_;ke.InvalidOptionArgumentError=F_});var Au=require("node:util"),Ji=Y(require("node:process"),1),st=Y(require("node:fs"),1),Is=Y(require("node:path"),1),Ar=Y(require("node:crypto"),1),Iu=Y(require("node:assert"),1);var Vt=r=>{let e=typeof r;return r!==null&&(e==="object"||e==="function")};var pl=new Set(["__proto__","prototype","constructor"]),ml=1e6,Tv=r=>r>="0"&&r<="9";function gl(r){if(r==="0")return!0;if(/^[1-9]\d*$/.test(r)){let e=Number.parseInt(r,10);return e<=Number.MAX_SAFE_INTEGER&&e<=ml}return!1}function Pn(r,e){return pl.has(r)?!1:(r&&gl(r)?e.push(Number.parseInt(r,10)):e.push(r),!0)}function Pv(r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);let e=[],t="",s="start",i=!1,n=0;for(let o of r){if(n++,i){t+=o,i=!1;continue}if(o==="\\"){if(s==="index")throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${n}`);i=!0,s=s==="start"?"property":s;continue}switch(o){case".":{if(s==="index")throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd"){s="property";break}if(!Pn(t,e))return[];t="",s="property";break}case"[":{if(s==="index")throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd"){s="index";break}if(s==="property"||s==="start"){if((t||s==="property")&&!Pn(t,e))return[];t=""}s="index";break}case"]":{if(s==="index"){if(t==="")t=(e.pop()||"")+"[]",s="property";else{let a=Number.parseInt(t,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=ml&&t===String(a)?e.push(a):e.push(t),t="",s="indexEnd"}break}if(s==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${n}`);t+=o;break}default:{if(s==="index"&&!Tv(o))throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${n}`);s==="start"&&(s="property"),t+=o}}}switch(i&&(t+="\\"),s){case"property":{if(!Pn(t,e))return[];break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Zs(r){if(typeof r=="string")return Pv(r);if(Array.isArray(r)){let e=[];for(let[t,s]of r.entries()){if(typeof s!="string"&&typeof s!="number")throw new TypeError(`Expected a string or number for path segment at index ${t}, got ${typeof s}`);if(typeof s=="number"&&!Number.isFinite(s))throw new TypeError(`Path segment at index ${t} must be a finite number, got ${s}`);if(pl.has(s))return[];typeof s=="string"&&gl(s)?e.push(Number.parseInt(s,10)):e.push(s)}return e}return[]}function An(r,e,t){if(!Vt(r)||typeof e!="string"&&!Array.isArray(e))return t===void 0?r:t;let s=Zs(e);if(s.length===0)return t;for(let i=0;i<s.length;i++){let n=s[i];if(r=r[n],r==null){if(i!==s.length-1)return t;break}}return r===void 0?t:r}function Hr(r,e,t){if(!Vt(r)||typeof e!="string"&&!Array.isArray(e))return r;let s=r,i=Zs(e);if(i.length===0)return r;for(let n=0;n<i.length;n++){let o=i[n];if(n===i.length-1)r[o]=t;else if(!Vt(r[o])){let u=typeof i[n+1]=="number";r[o]=u?[]:{}}r=r[o]}return s}function yl(r,e){if(!Vt(r)||typeof e!="string"&&!Array.isArray(e))return!1;let t=Zs(e);if(t.length===0)return!1;for(let s=0;s<t.length;s++){let i=t[s];if(s===t.length-1)return Object.hasOwn(r,i)?(delete r[i],!0):!1;if(r=r[i],!Vt(r))return!1}}function Qs(r,e){if(!Vt(r)||typeof e!="string"&&!Array.isArray(e))return!1;let t=Zs(e);if(t.length===0)return!1;for(let s of t){if(!Vt(r)||!(s in r))return!1;r=r[s]}return!0}var X=Y(require("node:path"),1),In=Y(require("node:os"),1),ei=Y(require("node:process"),1),Et=In.default.homedir(),Cn=In.default.tmpdir(),{env:ir}=ei.default,Av=r=>{let e=X.default.join(Et,"Library");return{data:X.default.join(e,"Application Support",r),config:X.default.join(e,"Preferences",r),cache:X.default.join(e,"Caches",r),log:X.default.join(e,"Logs",r),temp:X.default.join(Cn,r)}},Iv=r=>{let e=ir.APPDATA||X.default.join(Et,"AppData","Roaming"),t=ir.LOCALAPPDATA||X.default.join(Et,"AppData","Local");return{data:X.default.join(t,r,"Data"),config:X.default.join(e,r,"Config"),cache:X.default.join(t,r,"Cache"),log:X.default.join(t,r,"Log"),temp:X.default.join(Cn,r)}},Cv=r=>{let e=X.default.basename(Et);return{data:X.default.join(ir.XDG_DATA_HOME||X.default.join(Et,".local","share"),r),config:X.default.join(ir.XDG_CONFIG_HOME||X.default.join(Et,".config"),r),cache:X.default.join(ir.XDG_CACHE_HOME||X.default.join(Et,".cache"),r),log:X.default.join(ir.XDG_STATE_HOME||X.default.join(Et,".local","state"),r),temp:X.default.join(Cn,e,r)}};function Rn(r,{suffix:e="nodejs"}={}){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);return e&&(r+=`-${e}`),ei.default.platform==="darwin"?Av(r):ei.default.platform==="win32"?Iv(r):Cv(r)}var Rl=Y(require("node:path"),1);var j=Y(require("node:fs"),1),ne=require("node:util");var Rv=(r,e)=>{let{onError:t}=e;return function(...i){return r.apply(void 0,i).catch(t)}},We=Rv;var Nv=(r,e)=>{let{onError:t}=e;return function(...i){try{return r.apply(void 0,i)}catch(n){return t(n)}}},Le=Nv;var jv=(r,e)=>{let{isRetriable:t}=e;return function(i){let{timeout:n}=i,o=i.interval??250,a=Date.now()+n;return function u(...c){return r.apply(void 0,c).catch(l=>{if(!t(l)||Date.now()>=a)throw l;let h=Math.round(o*Math.random());return h>0?new Promise(p=>setTimeout(p,h)).then(()=>u.apply(void 0,c)):u.apply(void 0,c)})}}},Ye=jv;var kv=(r,e)=>{let{isRetriable:t}=e;return function(i){let{timeout:n}=i,o=Date.now()+n;return function(...u){for(;;)try{return r.apply(void 0,u)}catch(c){if(!t(c)||Date.now()>=o)throw c;continue}}}},Xe=kv;var qn=Y(require("node:process"),1);var Gr={isChangeErrorOk:r=>{if(!Gr.isNodeError(r))return!1;let{code:e}=r;return e==="ENOSYS"||!_l&&(e==="EINVAL"||e==="EPERM")},isNodeError:r=>r instanceof Error,isRetriableError:r=>{if(!Gr.isNodeError(r))return!1;let{code:e}=r;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:r=>{if(!Gr.isNodeError(r))throw r;if(!Gr.isChangeErrorOk(r))throw r}},Nn=Gr;var zr={onError:Nn.onChangeError},ve={onError:()=>{}},_l=qn.default.getuid?!qn.default.getuid():!1,ie={isRetriable:Nn.isRetriableError};var Dv={attempt:{chmod:We((0,ne.promisify)(j.default.chmod),zr),chown:We((0,ne.promisify)(j.default.chown),zr),close:We((0,ne.promisify)(j.default.close),ve),fsync:We((0,ne.promisify)(j.default.fsync),ve),mkdir:We((0,ne.promisify)(j.default.mkdir),ve),realpath:We((0,ne.promisify)(j.default.realpath),ve),stat:We((0,ne.promisify)(j.default.stat),ve),unlink:We((0,ne.promisify)(j.default.unlink),ve),chmodSync:Le(j.default.chmodSync,zr),chownSync:Le(j.default.chownSync,zr),closeSync:Le(j.default.closeSync,ve),existsSync:Le(j.default.existsSync,ve),fsyncSync:Le(j.default.fsync,ve),mkdirSync:Le(j.default.mkdirSync,ve),realpathSync:Le(j.default.realpathSync,ve),statSync:Le(j.default.statSync,ve),unlinkSync:Le(j.default.unlinkSync,ve)},retry:{close:Ye((0,ne.promisify)(j.default.close),ie),fsync:Ye((0,ne.promisify)(j.default.fsync),ie),open:Ye((0,ne.promisify)(j.default.open),ie),readFile:Ye((0,ne.promisify)(j.default.readFile),ie),rename:Ye((0,ne.promisify)(j.default.rename),ie),stat:Ye((0,ne.promisify)(j.default.stat),ie),write:Ye((0,ne.promisify)(j.default.write),ie),writeFile:Ye((0,ne.promisify)(j.default.writeFile),ie),closeSync:Xe(j.default.closeSync,ie),fsyncSync:Xe(j.default.fsyncSync,ie),openSync:Xe(j.default.openSync,ie),readFileSync:Xe(j.default.readFileSync,ie),renameSync:Xe(j.default.renameSync,ie),statSync:Xe(j.default.statSync,ie),writeSync:Xe(j.default.writeSync,ie),writeFileSync:Xe(j.default.writeFileSync,ie)}},se=Dv;var St=Y(require("node:process"),1),vl="utf8",jn=438,bl=511;var wl={},$l=St.default.geteuid?St.default.geteuid():-1,El=St.default.getegid?St.default.getegid():-1;var Sl=1e3,Ol=!!St.default.getuid,NN=St.default.getuid?!St.default.getuid():!1,kn=128;var xl=r=>r instanceof Error&&"code"in r;var Dn=r=>typeof r=="string",ti=r=>r===void 0;var Cl=Y(require("node:path"),1);var Ft=Y(require("node:process"),1);var Mn=Y(require("node:process"),1),Tl=Mn.default.platform==="linux",ri=Mn.default.platform==="win32";var Ln=["SIGHUP","SIGINT","SIGTERM"];ri||Ln.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Tl&&Ln.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Pl=Ln;var Vn=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(let t of this.callbacks)t();e&&(ri&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Ft.default.kill(Ft.default.pid,"SIGTERM"):Ft.default.kill(Ft.default.pid,e))}},this.hook=()=>{Ft.default.once("exit",()=>this.exit());for(let e of Pl)try{Ft.default.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Al=new Vn;var Mv=Al.register,Il=Mv;var Te={store:{},create:r=>{let e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${r}${i}`},get:(r,e,t=!0)=>{let s=Te.truncate(e(r));return s in Te.store?Te.get(r,e,t):(Te.store[s]=t,[s,()=>delete Te.store[s]])},purge:r=>{Te.store[r]&&(delete Te.store[r],se.attempt.unlink(r))},purgeSync:r=>{Te.store[r]&&(delete Te.store[r],se.attempt.unlinkSync(r))},purgeSyncAll:()=>{for(let r in Te.store)Te.purgeSync(r)},truncate:r=>{let e=Cl.default.basename(r);if(e.length<=kn)return r;let t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!t)return r;let s=e.length-kn;return`${r.slice(0,-e.length)}${t[1]}${t[2].slice(0,-s)}${t[3]}`}};Il(Te.purgeSyncAll);var Br=Te;function Fn(r,e,t=wl){if(Dn(t))return Fn(r,e,{encoding:t});let i={timeout:t.timeout??Sl},n=null,o=null,a=null;try{let u=se.attempt.realpathSync(r),c=!!u;r=u||r,[o,n]=Br.get(r,t.tmpCreate||Br.create,t.tmpPurge!==!1);let l=Ol&&ti(t.chown),h=ti(t.mode);if(c&&(l||h)){let f=se.attempt.statSync(r);f&&(t={...t},l&&(t.chown={uid:f.uid,gid:f.gid}),h&&(t.mode=f.mode))}if(!c){let f=Rl.default.dirname(r);se.attempt.mkdirSync(f,{mode:bl,recursive:!0})}a=se.retry.openSync(i)(o,"w",t.mode||jn),t.tmpCreated&&t.tmpCreated(o),Dn(e)?se.retry.writeSync(i)(a,e,0,t.encoding||vl):ti(e)||se.retry.writeSync(i)(a,e,0,e.length,0),t.fsync!==!1&&(t.fsyncWait!==!1?se.retry.fsyncSync(i)(a):se.attempt.fsync(a)),se.retry.closeSync(i)(a),a=null,t.chown&&(t.chown.uid!==$l||t.chown.gid!==El)&&se.attempt.chownSync(o,t.chown.uid,t.chown.gid),t.mode&&t.mode!==jn&&se.attempt.chmodSync(o,t.mode);try{se.retry.renameSync(i)(o,r)}catch(f){if(!xl(f)||f.code!=="ENAMETOOLONG")throw f;se.retry.renameSync(i)(o,Br.truncate(r))}n(),o=null}finally{a&&se.attempt.closeSync(a),o&&Br.purge(o)}}var Um=Y(Tf(),1),Hm=Y(zf(),1);var Q1=(r,e,t,s)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(r,t),n=Object.getOwnPropertyDescriptor(e,t);!ex(i,n)&&s||Object.defineProperty(r,t,n)},ex=function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},tx=(r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},rx=(r,e)=>`/* Wrapped ${r}*/
|
|
131
|
-
${e}`,sx=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ix=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),nx=(r,e,t)=>{let s=t===""?"":`with ${t.trim()}() `,i=rx.bind(null,s,e.toString());Object.defineProperty(i,"name",ix);let{writable:n,enumerable:o,configurable:a}=sx;Object.defineProperty(r,"toString",{value:i,writable:n,enumerable:o,configurable:a})};function nu(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:s}=r;for(let i of Reflect.ownKeys(e))Q1(r,e,i,t);return tx(r,e),nx(r,e,s),r}var ox=(r,e={})=>{if(typeof r!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof r}\``);let{wait:t=0,maxWait:s=Number.POSITIVE_INFINITY,before:i=!1,after:n=!0}=e;if(t<0||s<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!n)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,u,c=function(...l){let h=this,f=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),n&&(u=r.apply(h,l))},p=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),n&&(u=r.apply(h,l))},m=i&&!o;return clearTimeout(o),o=setTimeout(f,t),s>0&&s!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(p,s)),m&&(u=r.apply(h,l)),u};return nu(c,r),c.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},c},ou=ox;var er=Y(km(),1);var dA=Object.prototype.toString,fA="[object Uint8Array]",pA="[object ArrayBuffer]";function Mm(r,e,t){return r?r.constructor===e?!0:dA.call(r)===t:!1}function Lm(r){return Mm(r,Uint8Array,fA)}function mA(r){return Mm(r,ArrayBuffer,pA)}function gA(r){return Lm(r)||mA(r)}function yA(r){if(!Lm(r))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}function _A(r){if(!gA(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}function Yi(r,e){if(r.length===0)return new Uint8Array(0);e??=r.reduce((i,n)=>i+n.length,0);let t=new Uint8Array(e),s=0;for(let i of r)yA(i),t.set(i,s),s+=i.length;return t}var Dm={utf8:new globalThis.TextDecoder("utf8")};function As(r,e="utf8"){return _A(r),Dm[e]??=new globalThis.TextDecoder(e),Dm[e].decode(r)}function vA(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}var bA=new globalThis.TextEncoder;function Xi(r){return vA(r),bA.encode(r)}var Dk=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var Vm="aes-256-cbc",Gm=new Set(["aes-256-cbc","aes-256-gcm","aes-256-ctr"]),wA=r=>typeof r=="string"&&Gm.has(r),ft=()=>Object.create(null),Fm=r=>r!==void 0,Tu=(r,e)=>{let t=new Set(["undefined","symbol","function"]),s=typeof e;if(t.has(s))throw new TypeError(`Setting a value of type \`${s}\` for key \`${r}\` is not allowed as it's not supported by JSON`)},jt="__internal__",Pu=`${jt}.migrations.version`,Cs=class{path;events;#s;#i;#n;#e;#t={};#o=!1;#a;#u;#r;constructor(e={}){let t=this.#c(e);this.#e=t,this.#l(t),this.#d(t),this.#f(t),this.events=new EventTarget,this.#i=t.encryptionKey,this.#n=t.encryptionAlgorithm??Vm,this.path=this.#p(t),this.#m(t),t.watch&&this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:s}=this;return e in s?s[e]:t}set(e,t){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&t===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${jt} key, as it's used to manage this module internal operations.`);let{store:s}=this,i=(n,o)=>{if(Tu(n,o),this.#e.accessPropertiesByDotNotation)Hr(s,n,o);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;s[n]=o}};if(typeof e=="object"){let n=e;for(let[o,a]of Object.entries(n))i(o,a)}else i(e,t);this.store=s}has(e){return this.#e.accessPropertiesByDotNotation?Qs(this.store,e):e in this.store}appendToArray(e,t){Tu(e,t);let s=this.#e.accessPropertiesByDotNotation?this._get(e,[]):e in this.store?this.store[e]:[];if(!Array.isArray(s))throw new TypeError(`The key \`${e}\` is already set to a non-array value`);this.set(e,[...s,t])}reset(...e){for(let t of e)Fm(this.#t[t])&&this.set(t,this.#t[t])}delete(e){let{store:t}=this;this.#e.accessPropertiesByDotNotation?yl(t,e):delete t[e],this.store=t}clear(){let e=ft();for(let t of Object.keys(this.#t))Fm(this.#t[t])&&(Tu(t,this.#t[t]),this.#e.accessPropertiesByDotNotation?Hr(e,t,this.#t[t]):e[t]=this.#t[t]);this.store=e}onDidChange(e,t){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleValueChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleStoreChange(e)}get size(){return Object.keys(this.store).filter(t=>!this._isReservedKeyPath(t)).length}get store(){try{let e=st.default.readFileSync(this.path,this.#i?null:"utf8"),t=this._decryptData(e);return(i=>{let n=this._deserialize(i);return this.#o||this._validate(n),Object.assign(ft(),n)})(t)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),ft();if(this.#e.clearInvalidConfig){let t=e;if(t.name==="SyntaxError"||t.message?.startsWith("Config schema violation:")||t.message==="Failed to decrypt config data.")return ft()}throw e}}set store(e){if(this._ensureDirectory(),!Qs(e,jt))try{let t=st.default.readFileSync(this.path,this.#i?null:"utf8"),s=this._decryptData(t),i=this._deserialize(s);Qs(i,jt)&&Hr(e,jt,An(i,jt))}catch{}this.#o||this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))this._isReservedKeyPath(e)||(yield[e,t])}_closeWatcher(){this.#a&&(this.#a.close(),this.#a=void 0),this.#u&&(st.default.unwatchFile(this.path),this.#u=!1),this.#r=void 0}_decryptData(e){let t=this.#i;if(!t)return typeof e=="string"?e:As(e);let s=this.#n,i=s==="aes-256-gcm"?16:0,n=":".codePointAt(0),o=typeof e=="string"?e.codePointAt(16):e[16];if(!(n!==void 0&&o===n)){if(s==="aes-256-cbc")return typeof e=="string"?e:As(e);throw new Error("Failed to decrypt config data.")}let u=p=>{if(i===0)return{ciphertext:p};let m=p.length-i;if(m<0)throw new Error("Invalid authentication tag length.");return{ciphertext:p.slice(0,m),authenticationTag:p.slice(m)}},c=e.slice(0,16),l=e.slice(17),h=typeof l=="string"?Xi(l):l,f=p=>{let{ciphertext:m,authenticationTag:g}=u(h),y=Ar.default.pbkdf2Sync(t,p,1e4,32,"sha512"),_=Ar.default.createDecipheriv(s,y,c);return g&&_.setAuthTag(g),As(Yi([_.update(m),_.final()]))};try{return f(c)}catch{try{return f(c.toString())}catch{}}if(s==="aes-256-cbc")return typeof e=="string"?e:As(e);throw new Error("Failed to decrypt config data.")}_handleStoreChange(e){let t=this.store,s=()=>{let i=t,n=this.store;(0,Au.isDeepStrictEqual)(n,i)||(t=n,e.call(this,n,i))};return this.events.addEventListener("change",s),()=>{this.events.removeEventListener("change",s)}}_handleValueChange(e,t){let s=e(),i=()=>{let n=s,o=e();(0,Au.isDeepStrictEqual)(o,n)||(s=o,t.call(this,o,n))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#s||this.#s(e)||!this.#s.errors)return;let s=this.#s.errors.map(({instancePath:i,message:n=""})=>`\`${i.slice(1)}\` ${n}`);throw new Error("Config schema violation: "+s.join("; "))}_ensureDirectory(){st.default.mkdirSync(Is.default.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e),s=this.#i;if(s){let i=Ar.default.randomBytes(16),n=Ar.default.pbkdf2Sync(s,i,1e4,32,"sha512"),o=Ar.default.createCipheriv(this.#n,n,i),a=Yi([o.update(Xi(t)),o.final()]),u=[i,Xi(":"),a];this.#n==="aes-256-gcm"&&u.push(o.getAuthTag()),t=Yi(u)}if(Ji.default.env.SNAP)st.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Fn(this.path,t,{mode:this.#e.configFileMode})}catch(i){if(i?.code==="EXDEV"){st.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw i}}_watch(){if(this._ensureDirectory(),st.default.existsSync(this.path)||this._write(ft()),Ji.default.platform==="win32"||Ji.default.platform==="darwin"){this.#r??=ou(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100});let e=Is.default.dirname(this.path),t=Is.default.basename(this.path);this.#a=st.default.watch(e,{persistent:!1,encoding:"utf8"},(s,i)=>{i&&i!==t||typeof this.#r=="function"&&this.#r()})}else this.#r??=ou(()=>{this.events.dispatchEvent(new Event("change"))},{wait:1e3}),st.default.watchFile(this.path,{persistent:!1},(e,t)=>{typeof this.#r=="function"&&this.#r()}),this.#u=!0}_migrate(e,t,s){let i=this._get(Pu,"0.0.0"),n=Object.keys(e).filter(a=>this._shouldPerformMigration(a,i,t)),o=structuredClone(this.store);for(let a of n)try{s&&s(this,{fromVersion:i,toVersion:a,finalVersion:t,versions:n});let u=e[a];u?.(this),this._set(Pu,a),i=a,o=structuredClone(this.store)}catch(u){this.store=o;let c=u instanceof Error?u.message:String(u);throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(i)||!er.default.eq(i,t))&&this._set(Pu,t)}_containsReservedKey(e){return typeof e=="string"?this._isReservedKeyPath(e):!e||typeof e!="object"?!1:this._objectContainsReservedKey(e)}_objectContainsReservedKey(e){if(!e||typeof e!="object")return!1;for(let[t,s]of Object.entries(e))if(this._isReservedKeyPath(t)||this._objectContainsReservedKey(s))return!0;return!1}_isReservedKeyPath(e){return e===jt||e.startsWith(`${jt}.`)}_isVersionInRangeFormat(e){return er.default.clean(e)===null}_shouldPerformMigration(e,t,s){return this._isVersionInRangeFormat(e)?t!=="0.0.0"&&er.default.satisfies(t,e)?!1:er.default.satisfies(s,e):!(er.default.lte(e,t)||er.default.gt(e,s))}_get(e,t){return An(this.store,e,t)}_set(e,t){let{store:s}=this;Hr(s,e,t),this.store=s}#c(e){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(t.encryptionAlgorithm??=Vm,!wA(t.encryptionAlgorithm))throw new TypeError(`The \`encryptionAlgorithm\` option must be one of: ${[...Gm].join(", ")}`);if(!t.cwd){if(!t.projectName)throw new Error("Please specify the `projectName` option.");t.cwd=Rn(t.projectName,{suffix:t.projectSuffix}).config}return typeof t.fileExtension=="string"&&(t.fileExtension=t.fileExtension.replace(/^\.+/,"")),t}#l(e){if(!(e.schema??e.ajvOptions??e.rootSchema))return;if(e.schema&&typeof e.schema!="object")throw new TypeError("The `schema` option must be an object.");let t=Hm.default.default,s=new Um.Ajv2020({allErrors:!0,useDefaults:!0,...e.ajvOptions});t(s);let i={...e.rootSchema,type:"object",properties:e.schema};this.#s=s.compile(i),this.#h(e.schema)}#h(e){let t=Object.entries(e??{});for(let[s,i]of t){if(!i||typeof i!="object"||!Object.hasOwn(i,"default"))continue;let{default:n}=i;n!==void 0&&(this.#t[s]=n)}}#d(e){e.defaults&&Object.assign(this.#t,e.defaults)}#f(e){e.serialize&&(this._serialize=e.serialize),e.deserialize&&(this._deserialize=e.deserialize)}#p(e){let t=typeof e.fileExtension=="string"?e.fileExtension:void 0,s=t?`.${t}`:"";return Is.default.resolve(e.cwd,`${e.configName??"config"}${s}`)}#m(e){if(e.migrations){this.#g(e),this._validate(this.store);return}let t=this.store,s=Object.assign(ft(),e.defaults??{},t);this._validate(s);try{Iu.default.deepEqual(t,s)}catch{this.store=s}}#g(e){let{migrations:t,projectVersion:s}=e;if(t){if(!s)throw new Error("Please specify the `projectVersion` option.");this.#o=!0;try{let i=this.store,n=Object.assign(ft(),e.defaults??{},i);try{Iu.default.deepEqual(i,n)}catch{this._write(n)}this._migrate(t,s,e.beforeEachMigration)}finally{this.#o=!1}}}};var Tn=Y(b_());var w_=(r=0)=>e=>`\x1B[${e+r}m`,$_=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,E_=(r=0)=>(e,t,s)=>`\x1B[${38+r};2;${e};${t};${s}m`,J={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},i2=Object.keys(J.modifier),OR=Object.keys(J.color),xR=Object.keys(J.bgColor),n2=[...OR,...xR];function TR(){let r=new Map;for(let[e,t]of Object.entries(J)){for(let[s,i]of Object.entries(t))J[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[s]=J[s],r.set(i[0],i[1]);Object.defineProperty(J,e,{value:t,enumerable:!1})}return Object.defineProperty(J,"codes",{value:r,enumerable:!1}),J.color.close="\x1B[39m",J.bgColor.close="\x1B[49m",J.color.ansi=w_(),J.color.ansi256=$_(),J.color.ansi16m=E_(),J.bgColor.ansi=w_(10),J.bgColor.ansi256=$_(10),J.bgColor.ansi16m=E_(10),Object.defineProperties(J,{rgbToAnsi256:{value(e,t,s){return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(n=>n+n).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>J.rgbToAnsi256(...J.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,s,i;if(e>=232)t=((e-232)*10+8)/255,s=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,s=Math.floor(a/6)/5,i=a%6/5}let n=Math.max(t,s,i)*2;if(n===0)return 30;let o=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(t));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,s)=>J.ansi256ToAnsi(J.rgbToAnsi256(e,t,s)),enumerable:!1},hexToAnsi:{value:e=>J.ansi256ToAnsi(J.hexToAnsi256(e)),enumerable:!1}}),J}var PR=TR(),Ke=PR;var gn=Y(require("node:process"),1),O_=Y(require("node:os"),1),Fc=Y(require("node:tty"),1);function je(r,e=globalThis.Deno?globalThis.Deno.args:gn.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",s=e.indexOf(t+r),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:Z}=gn.default,mn;je("no-color")||je("no-colors")||je("color=false")||je("color=never")?mn=0:(je("color")||je("colors")||je("color=true")||je("color=always"))&&(mn=1);function AR(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function IR(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function CR(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=AR();s!==void 0&&(mn=s);let i=t?mn:s;if(i===0)return 0;if(t){if(je("color=16m")||je("color=full")||je("color=truecolor"))return 3;if(je("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(r&&!e&&i===void 0)return 0;let n=i||0;if(Z.TERM==="dumb")return n;if(gn.default.platform==="win32"){let o=O_.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Z)||Z.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let o=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:n}function S_(r,e={}){let t=CR(r,{streamIsTTY:r&&r.isTTY,...e});return IR(t)}var RR={stdout:S_({isTTY:Fc.default.isatty(1)}),stderr:S_({isTTY:Fc.default.isatty(2)})},x_=RR;function T_(r,e,t){let s=r.indexOf(e);if(s===-1)return r;let i=e.length,n=0,o="";do o+=r.slice(n,s)+e+t,n=s+i,s=r.indexOf(e,n);while(s!==-1);return o+=r.slice(n),o}function P_(r,e,t,s){let i=0,n="";do{let o=r[s-1]==="\r";n+=r.slice(i,o?s-1:s)+e+(o?`\r
|
|
130
|
+
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function sv(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,s="127.0.0.1",i="9229",n;return(n=e.match(/^(--inspect(-brk)?)$/))!==null?t=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:s=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=n[1],s=n[3],i=n[4]),t&&i!=="0"?`${t}=${s}:${parseInt(i)+1}`:e})}function gl(){if(M.env.NO_COLOR||M.env.FORCE_COLOR==="0"||M.env.FORCE_COLOR==="false")return!1;if(M.env.FORCE_COLOR||M.env.CLICOLOR_FORCE!==void 0)return!0}yl.Command=ml;yl.useColor=gl});var uv=d(Me=>{var{Argument:nv}=Sn(),{Command:_l}=iv(),{CommanderError:ON,InvalidArgumentError:ov}=Ws(),{Help:xN}=ul(),{Option:av}=dl();Me.program=new _l;Me.createCommand=r=>new _l(r);Me.createOption=(r,e)=>new av(r,e);Me.createArgument=(r,e)=>new nv(r,e);Me.Command=_l;Me.Option=av;Me.Argument=nv;Me.Help=xN;Me.CommanderError=ON;Me.InvalidArgumentError=ov;Me.InvalidOptionArgumentError=ov});var Fu=require("node:util"),rn=Y(require("node:process"),1),nt=Y(require("node:fs"),1),Ns=Y(require("node:path"),1),Cr=Y(require("node:crypto"),1),Vu=Y(require("node:assert"),1);var Ht=r=>{let e=typeof r;return r!==null&&(e==="object"||e==="function")};var Ol=new Set(["__proto__","prototype","constructor"]),xl=1e6,Bv=r=>r>="0"&&r<="9";function Tl(r){if(r==="0")return!0;if(/^[1-9]\d*$/.test(r)){let e=Number.parseInt(r,10);return e<=Number.MAX_SAFE_INTEGER&&e<=xl}return!1}function Nn(r,e){return Ol.has(r)?!1:(r&&Tl(r)?e.push(Number.parseInt(r,10)):e.push(r),!0)}function Kv(r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);let e=[],t="",s="start",i=!1,n=0;for(let o of r){if(n++,i){t+=o,i=!1;continue}if(o==="\\"){if(s==="index")throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${n}`);i=!0,s=s==="start"?"property":s;continue}switch(o){case".":{if(s==="index")throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd"){s="property";break}if(!Nn(t,e))return[];t="",s="property";break}case"[":{if(s==="index")throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd"){s="index";break}if(s==="property"||s==="start"){if((t||s==="property")&&!Nn(t,e))return[];t=""}s="index";break}case"]":{if(s==="index"){if(t==="")t=(e.pop()||"")+"[]",s="property";else{let a=Number.parseInt(t,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=xl&&t===String(a)?e.push(a):e.push(t),t="",s="indexEnd"}break}if(s==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${n}`);t+=o;break}default:{if(s==="index"&&!Bv(o))throw new Error(`Invalid character '${o}' in an index at position ${n}`);if(s==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${n}`);s==="start"&&(s="property"),t+=o}}}switch(i&&(t+="\\"),s){case"property":{if(!Nn(t,e))return[];break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function ti(r){if(typeof r=="string")return Kv(r);if(Array.isArray(r)){let e=[];for(let[t,s]of r.entries()){if(typeof s!="string"&&typeof s!="number")throw new TypeError(`Expected a string or number for path segment at index ${t}, got ${typeof s}`);if(typeof s=="number"&&!Number.isFinite(s))throw new TypeError(`Path segment at index ${t} must be a finite number, got ${s}`);if(Ol.has(s))return[];typeof s=="string"&&Tl(s)?e.push(Number.parseInt(s,10)):e.push(s)}return e}return[]}function qn(r,e,t){if(!Ht(r)||typeof e!="string"&&!Array.isArray(e))return t===void 0?r:t;let s=ti(e);if(s.length===0)return t;for(let i=0;i<s.length;i++){let n=s[i];if(r=r[n],r==null){if(i!==s.length-1)return t;break}}return r===void 0?t:r}function zr(r,e,t){if(!Ht(r)||typeof e!="string"&&!Array.isArray(e))return r;let s=r,i=ti(e);if(i.length===0)return r;for(let n=0;n<i.length;n++){let o=i[n];if(n===i.length-1)r[o]=t;else if(!Ht(r[o])){let u=typeof i[n+1]=="number";r[o]=u?[]:{}}r=r[o]}return s}function Pl(r,e){if(!Ht(r)||typeof e!="string"&&!Array.isArray(e))return!1;let t=ti(e);if(t.length===0)return!1;for(let s=0;s<t.length;s++){let i=t[s];if(s===t.length-1)return Object.hasOwn(r,i)?(delete r[i],!0):!1;if(r=r[i],!Ht(r))return!1}}function ri(r,e){if(!Ht(r)||typeof e!="string"&&!Array.isArray(e))return!1;let t=ti(e);if(t.length===0)return!1;for(let s of t){if(!Ht(r)||!(s in r))return!1;r=r[s]}return!0}var X=Y(require("node:path"),1),Dn=Y(require("node:os"),1),si=Y(require("node:process"),1),Ot=Dn.default.homedir(),jn=Dn.default.tmpdir(),{env:ar}=si.default,Wv=r=>{let e=X.default.join(Ot,"Library");return{data:X.default.join(e,"Application Support",r),config:X.default.join(e,"Preferences",r),cache:X.default.join(e,"Caches",r),log:X.default.join(e,"Logs",r),temp:X.default.join(jn,r)}},Yv=r=>{let e=ar.APPDATA||X.default.join(Ot,"AppData","Roaming"),t=ar.LOCALAPPDATA||X.default.join(Ot,"AppData","Local");return{data:X.default.join(t,r,"Data"),config:X.default.join(e,r,"Config"),cache:X.default.join(t,r,"Cache"),log:X.default.join(t,r,"Log"),temp:X.default.join(jn,r)}},Xv=r=>{let e=X.default.basename(Ot);return{data:X.default.join(ar.XDG_DATA_HOME||X.default.join(Ot,".local","share"),r),config:X.default.join(ar.XDG_CONFIG_HOME||X.default.join(Ot,".config"),r),cache:X.default.join(ar.XDG_CACHE_HOME||X.default.join(Ot,".cache"),r),log:X.default.join(ar.XDG_STATE_HOME||X.default.join(Ot,".local","state"),r),temp:X.default.join(jn,e,r)}};function kn(r,{suffix:e="nodejs"}={}){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);return e&&(r+=`-${e}`),si.default.platform==="darwin"?Wv(r):si.default.platform==="win32"?Yv(r):Xv(r)}var Hl=Y(require("node:path"),1);var D=Y(require("node:fs"),1),ne=require("node:util");var Jv=(r,e)=>{let{onError:t}=e;return function(...i){return r.apply(void 0,i).catch(t)}},Xe=Jv;var Zv=(r,e)=>{let{onError:t}=e;return function(...i){try{return r.apply(void 0,i)}catch(n){return t(n)}}},Ve=Zv;var eb=(r,e)=>{let{isRetriable:t}=e;return function(i){let{timeout:n}=i,o=i.interval??250,a=Date.now()+n;return function u(...c){return r.apply(void 0,c).catch(l=>{if(!t(l)||Date.now()>=a)throw l;let h=Math.round(o*Math.random());return h>0?new Promise(p=>setTimeout(p,h)).then(()=>u.apply(void 0,c)):u.apply(void 0,c)})}}},Je=eb;var tb=(r,e)=>{let{isRetriable:t}=e;return function(i){let{timeout:n}=i,o=Date.now()+n;return function(...u){for(;;)try{return r.apply(void 0,u)}catch(c){if(!t(c)||Date.now()>=o)throw c;continue}}}},Ze=tb;var Ln=Y(require("node:process"),1);var Br={isChangeErrorOk:r=>{if(!Br.isNodeError(r))return!1;let{code:e}=r;return e==="ENOSYS"||!Al&&(e==="EINVAL"||e==="EPERM")},isNodeError:r=>r instanceof Error,isRetriableError:r=>{if(!Br.isNodeError(r))return!1;let{code:e}=r;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:r=>{if(!Br.isNodeError(r))throw r;if(!Br.isChangeErrorOk(r))throw r}},Mn=Br;var Kr={onError:Mn.onChangeError},be={onError:()=>{}},Al=Ln.default.getuid?!Ln.default.getuid():!1,ie={isRetriable:Mn.isRetriableError};var rb={attempt:{chmod:Xe((0,ne.promisify)(D.default.chmod),Kr),chown:Xe((0,ne.promisify)(D.default.chown),Kr),close:Xe((0,ne.promisify)(D.default.close),be),fsync:Xe((0,ne.promisify)(D.default.fsync),be),mkdir:Xe((0,ne.promisify)(D.default.mkdir),be),realpath:Xe((0,ne.promisify)(D.default.realpath),be),stat:Xe((0,ne.promisify)(D.default.stat),be),unlink:Xe((0,ne.promisify)(D.default.unlink),be),chmodSync:Ve(D.default.chmodSync,Kr),chownSync:Ve(D.default.chownSync,Kr),closeSync:Ve(D.default.closeSync,be),existsSync:Ve(D.default.existsSync,be),fsyncSync:Ve(D.default.fsync,be),mkdirSync:Ve(D.default.mkdirSync,be),realpathSync:Ve(D.default.realpathSync,be),statSync:Ve(D.default.statSync,be),unlinkSync:Ve(D.default.unlinkSync,be)},retry:{close:Je((0,ne.promisify)(D.default.close),ie),fsync:Je((0,ne.promisify)(D.default.fsync),ie),open:Je((0,ne.promisify)(D.default.open),ie),readFile:Je((0,ne.promisify)(D.default.readFile),ie),rename:Je((0,ne.promisify)(D.default.rename),ie),stat:Je((0,ne.promisify)(D.default.stat),ie),write:Je((0,ne.promisify)(D.default.write),ie),writeFile:Je((0,ne.promisify)(D.default.writeFile),ie),closeSync:Ze(D.default.closeSync,ie),fsyncSync:Ze(D.default.fsyncSync,ie),openSync:Ze(D.default.openSync,ie),readFileSync:Ze(D.default.readFileSync,ie),renameSync:Ze(D.default.renameSync,ie),statSync:Ze(D.default.statSync,ie),writeSync:Ze(D.default.writeSync,ie),writeFileSync:Ze(D.default.writeFileSync,ie)}},se=rb;var xt=Y(require("node:process"),1),Il="utf8",Fn=438,Cl=511;var Rl={},Nl=xt.default.geteuid?xt.default.geteuid():-1,ql=xt.default.getegid?xt.default.getegid():-1;var Dl=1e3,jl=!!xt.default.getuid,oq=xt.default.getuid?!xt.default.getuid():!1,Vn=128;var kl=r=>r instanceof Error&&"code"in r;var Un=r=>typeof r=="string",ii=r=>r===void 0;var Ul=Y(require("node:path"),1);var Gt=Y(require("node:process"),1);var Hn=Y(require("node:process"),1),Ml=Hn.default.platform==="linux",ni=Hn.default.platform==="win32";var Gn=["SIGHUP","SIGINT","SIGTERM"];ni||Gn.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Ml&&Gn.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ll=Gn;var zn=class{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(let t of this.callbacks)t();e&&(ni&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Gt.default.kill(Gt.default.pid,"SIGTERM"):Gt.default.kill(Gt.default.pid,e))}},this.hook=()=>{Gt.default.once("exit",()=>this.exit());for(let e of Ll)try{Gt.default.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Fl=new zn;var sb=Fl.register,Vl=sb;var Ae={store:{},create:r=>{let e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${r}${i}`},get:(r,e,t=!0)=>{let s=Ae.truncate(e(r));return s in Ae.store?Ae.get(r,e,t):(Ae.store[s]=t,[s,()=>delete Ae.store[s]])},purge:r=>{Ae.store[r]&&(delete Ae.store[r],se.attempt.unlink(r))},purgeSync:r=>{Ae.store[r]&&(delete Ae.store[r],se.attempt.unlinkSync(r))},purgeSyncAll:()=>{for(let r in Ae.store)Ae.purgeSync(r)},truncate:r=>{let e=Ul.default.basename(r);if(e.length<=Vn)return r;let t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!t)return r;let s=e.length-Vn;return`${r.slice(0,-e.length)}${t[1]}${t[2].slice(0,-s)}${t[3]}`}};Vl(Ae.purgeSyncAll);var Wr=Ae;function Bn(r,e,t=Rl){if(Un(t))return Bn(r,e,{encoding:t});let i={timeout:t.timeout??Dl},n=null,o=null,a=null;try{let u=se.attempt.realpathSync(r),c=!!u;r=u||r,[o,n]=Wr.get(r,t.tmpCreate||Wr.create,t.tmpPurge!==!1);let l=jl&&ii(t.chown),h=ii(t.mode);if(c&&(l||h)){let f=se.attempt.statSync(r);f&&(t={...t},l&&(t.chown={uid:f.uid,gid:f.gid}),h&&(t.mode=f.mode))}if(!c){let f=Hl.default.dirname(r);se.attempt.mkdirSync(f,{mode:Cl,recursive:!0})}a=se.retry.openSync(i)(o,"w",t.mode||Fn),t.tmpCreated&&t.tmpCreated(o),Un(e)?se.retry.writeSync(i)(a,e,0,t.encoding||Il):ii(e)||se.retry.writeSync(i)(a,e,0,e.length,0),t.fsync!==!1&&(t.fsyncWait!==!1?se.retry.fsyncSync(i)(a):se.attempt.fsync(a)),se.retry.closeSync(i)(a),a=null,t.chown&&(t.chown.uid!==Nl||t.chown.gid!==ql)&&se.attempt.chownSync(o,t.chown.uid,t.chown.gid),t.mode&&t.mode!==Fn&&se.attempt.chmodSync(o,t.mode);try{se.retry.renameSync(i)(o,r)}catch(f){if(!kl(f)||f.code!=="ENAMETOOLONG")throw f;se.retry.renameSync(i)(o,Wr.truncate(r))}n(),o=null}finally{a&&se.attempt.closeSync(a),o&&Wr.purge(o)}}var ag=Y(Bf(),1),ug=Y(lp(),1);var xx=(r,e,t,s)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(r,t),n=Object.getOwnPropertyDescriptor(e,t);!Tx(i,n)&&s||Object.defineProperty(r,t,n)},Tx=function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},Px=(r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},Ax=(r,e)=>`/* Wrapped ${r}*/
|
|
131
|
+
${e}`,Ix=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Cx=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Rx=(r,e,t)=>{let s=t===""?"":`with ${t.trim()}() `,i=Ax.bind(null,s,e.toString());Object.defineProperty(i,"name",Cx);let{writable:n,enumerable:o,configurable:a}=Ix;Object.defineProperty(r,"toString",{value:i,writable:n,enumerable:o,configurable:a})};function gu(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:s}=r;for(let i of Reflect.ownKeys(e))xx(r,e,i,t);return Px(r,e),Rx(r,e,s),r}var Nx=(r,e={})=>{if(typeof r!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof r}\``);let{wait:t=0,maxWait:s=Number.POSITIVE_INFINITY,before:i=!1,after:n=!0}=e;if(t<0||s<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!n)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,u,c=function(...l){let h=this,f=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),n&&(u=r.apply(h,l))},p=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),n&&(u=r.apply(h,l))},m=i&&!o;return clearTimeout(o),o=setTimeout(f,t),s>0&&s!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(p,s)),m&&(u=r.apply(h,l)),u};return gu(c,r),c.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},c},yu=Nx;var ir=Y(tg(),1);var LA=Object.prototype.toString,FA="[object Uint8Array]",VA="[object ArrayBuffer]";function sg(r,e,t){return r?r.constructor===e?!0:LA.call(r)===t:!1}function ig(r){return sg(r,Uint8Array,FA)}function UA(r){return sg(r,ArrayBuffer,VA)}function HA(r){return ig(r)||UA(r)}function GA(r){if(!ig(r))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}function zA(r){if(!HA(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}function en(r,e){if(r.length===0)return new Uint8Array(0);e??=r.reduce((i,n)=>i+n.length,0);let t=new Uint8Array(e),s=0;for(let i of r)GA(i),t.set(i,s),s+=i.length;return t}var rg={utf8:new globalThis.TextDecoder("utf8")};function Rs(r,e="utf8"){return zA(r),rg[e]??=new globalThis.TextDecoder(e),rg[e].decode(r)}function BA(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}var KA=new globalThis.TextEncoder;function tn(r){return BA(r),KA.encode(r)}var lk=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var ng="aes-256-cbc",cg=new Set(["aes-256-cbc","aes-256-gcm","aes-256-ctr"]),WA=r=>typeof r=="string"&&cg.has(r),mt=()=>Object.create(null),og=r=>r!==void 0,Mu=(r,e)=>{let t=new Set(["undefined","symbol","function"]),s=typeof e;if(t.has(s))throw new TypeError(`Setting a value of type \`${s}\` for key \`${r}\` is not allowed as it's not supported by JSON`)},kt="__internal__",Lu=`${kt}.migrations.version`,qs=class{path;events;#s;#i;#n;#e;#t={};#o=!1;#a;#u;#r;constructor(e={}){let t=this.#c(e);this.#e=t,this.#l(t),this.#d(t),this.#f(t),this.events=new EventTarget,this.#i=t.encryptionKey,this.#n=t.encryptionAlgorithm??ng,this.path=this.#p(t),this.#m(t),t.watch&&this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:s}=this;return e in s?s[e]:t}set(e,t){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&t===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${kt} key, as it's used to manage this module internal operations.`);let{store:s}=this,i=(n,o)=>{if(Mu(n,o),this.#e.accessPropertiesByDotNotation)zr(s,n,o);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;s[n]=o}};if(typeof e=="object"){let n=e;for(let[o,a]of Object.entries(n))i(o,a)}else i(e,t);this.store=s}has(e){return this.#e.accessPropertiesByDotNotation?ri(this.store,e):e in this.store}appendToArray(e,t){Mu(e,t);let s=this.#e.accessPropertiesByDotNotation?this._get(e,[]):e in this.store?this.store[e]:[];if(!Array.isArray(s))throw new TypeError(`The key \`${e}\` is already set to a non-array value`);this.set(e,[...s,t])}reset(...e){for(let t of e)og(this.#t[t])&&this.set(t,this.#t[t])}delete(e){let{store:t}=this;this.#e.accessPropertiesByDotNotation?Pl(t,e):delete t[e],this.store=t}clear(){let e=mt();for(let t of Object.keys(this.#t))og(this.#t[t])&&(Mu(t,this.#t[t]),this.#e.accessPropertiesByDotNotation?zr(e,t,this.#t[t]):e[t]=this.#t[t]);this.store=e}onDidChange(e,t){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleValueChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleStoreChange(e)}get size(){return Object.keys(this.store).filter(t=>!this._isReservedKeyPath(t)).length}get store(){try{let e=nt.default.readFileSync(this.path,this.#i?null:"utf8"),t=this._decryptData(e);return(i=>{let n=this._deserialize(i);return this.#o||this._validate(n),Object.assign(mt(),n)})(t)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),mt();if(this.#e.clearInvalidConfig){let t=e;if(t.name==="SyntaxError"||t.message?.startsWith("Config schema violation:")||t.message==="Failed to decrypt config data.")return mt()}throw e}}set store(e){if(this._ensureDirectory(),!ri(e,kt))try{let t=nt.default.readFileSync(this.path,this.#i?null:"utf8"),s=this._decryptData(t),i=this._deserialize(s);ri(i,kt)&&zr(e,kt,qn(i,kt))}catch{}this.#o||this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))this._isReservedKeyPath(e)||(yield[e,t])}_closeWatcher(){this.#a&&(this.#a.close(),this.#a=void 0),this.#u&&(nt.default.unwatchFile(this.path),this.#u=!1),this.#r=void 0}_decryptData(e){let t=this.#i;if(!t)return typeof e=="string"?e:Rs(e);let s=this.#n,i=s==="aes-256-gcm"?16:0,n=":".codePointAt(0),o=typeof e=="string"?e.codePointAt(16):e[16];if(!(n!==void 0&&o===n)){if(s==="aes-256-cbc")return typeof e=="string"?e:Rs(e);throw new Error("Failed to decrypt config data.")}let u=p=>{if(i===0)return{ciphertext:p};let m=p.length-i;if(m<0)throw new Error("Invalid authentication tag length.");return{ciphertext:p.slice(0,m),authenticationTag:p.slice(m)}},c=e.slice(0,16),l=e.slice(17),h=typeof l=="string"?tn(l):l,f=p=>{let{ciphertext:m,authenticationTag:g}=u(h),y=Cr.default.pbkdf2Sync(t,p,1e4,32,"sha512"),_=Cr.default.createDecipheriv(s,y,c);return g&&_.setAuthTag(g),Rs(en([_.update(m),_.final()]))};try{return f(c)}catch{try{return f(c.toString())}catch{}}if(s==="aes-256-cbc")return typeof e=="string"?e:Rs(e);throw new Error("Failed to decrypt config data.")}_handleStoreChange(e){let t=this.store,s=()=>{let i=t,n=this.store;(0,Fu.isDeepStrictEqual)(n,i)||(t=n,e.call(this,n,i))};return this.events.addEventListener("change",s),()=>{this.events.removeEventListener("change",s)}}_handleValueChange(e,t){let s=e(),i=()=>{let n=s,o=e();(0,Fu.isDeepStrictEqual)(o,n)||(s=o,t.call(this,o,n))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#s||this.#s(e)||!this.#s.errors)return;let s=this.#s.errors.map(({instancePath:i,message:n=""})=>`\`${i.slice(1)}\` ${n}`);throw new Error("Config schema violation: "+s.join("; "))}_ensureDirectory(){nt.default.mkdirSync(Ns.default.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e),s=this.#i;if(s){let i=Cr.default.randomBytes(16),n=Cr.default.pbkdf2Sync(s,i,1e4,32,"sha512"),o=Cr.default.createCipheriv(this.#n,n,i),a=en([o.update(tn(t)),o.final()]),u=[i,tn(":"),a];this.#n==="aes-256-gcm"&&u.push(o.getAuthTag()),t=en(u)}if(rn.default.env.SNAP)nt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Bn(this.path,t,{mode:this.#e.configFileMode})}catch(i){if(i?.code==="EXDEV"){nt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw i}}_watch(){if(this._ensureDirectory(),nt.default.existsSync(this.path)||this._write(mt()),rn.default.platform==="win32"||rn.default.platform==="darwin"){this.#r??=yu(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100});let e=Ns.default.dirname(this.path),t=Ns.default.basename(this.path);this.#a=nt.default.watch(e,{persistent:!1,encoding:"utf8"},(s,i)=>{i&&i!==t||typeof this.#r=="function"&&this.#r()})}else this.#r??=yu(()=>{this.events.dispatchEvent(new Event("change"))},{wait:1e3}),nt.default.watchFile(this.path,{persistent:!1},(e,t)=>{typeof this.#r=="function"&&this.#r()}),this.#u=!0}_migrate(e,t,s){let i=this._get(Lu,"0.0.0"),n=Object.keys(e).filter(a=>this._shouldPerformMigration(a,i,t)),o=structuredClone(this.store);for(let a of n)try{s&&s(this,{fromVersion:i,toVersion:a,finalVersion:t,versions:n});let u=e[a];u?.(this),this._set(Lu,a),i=a,o=structuredClone(this.store)}catch(u){this.store=o;let c=u instanceof Error?u.message:String(u);throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(i)||!ir.default.eq(i,t))&&this._set(Lu,t)}_containsReservedKey(e){return typeof e=="string"?this._isReservedKeyPath(e):!e||typeof e!="object"?!1:this._objectContainsReservedKey(e)}_objectContainsReservedKey(e){if(!e||typeof e!="object")return!1;for(let[t,s]of Object.entries(e))if(this._isReservedKeyPath(t)||this._objectContainsReservedKey(s))return!0;return!1}_isReservedKeyPath(e){return e===kt||e.startsWith(`${kt}.`)}_isVersionInRangeFormat(e){return ir.default.clean(e)===null}_shouldPerformMigration(e,t,s){return this._isVersionInRangeFormat(e)?t!=="0.0.0"&&ir.default.satisfies(t,e)?!1:ir.default.satisfies(s,e):!(ir.default.lte(e,t)||ir.default.gt(e,s))}_get(e,t){return qn(this.store,e,t)}_set(e,t){let{store:s}=this;zr(s,e,t),this.store=s}#c(e){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(t.encryptionAlgorithm??=ng,!WA(t.encryptionAlgorithm))throw new TypeError(`The \`encryptionAlgorithm\` option must be one of: ${[...cg].join(", ")}`);if(!t.cwd){if(!t.projectName)throw new Error("Please specify the `projectName` option.");t.cwd=kn(t.projectName,{suffix:t.projectSuffix}).config}return typeof t.fileExtension=="string"&&(t.fileExtension=t.fileExtension.replace(/^\.+/,"")),t}#l(e){if(!(e.schema??e.ajvOptions??e.rootSchema))return;if(e.schema&&typeof e.schema!="object")throw new TypeError("The `schema` option must be an object.");let t=ug.default.default,s=new ag.Ajv2020({allErrors:!0,useDefaults:!0,...e.ajvOptions});t(s);let i={...e.rootSchema,type:"object",properties:e.schema};this.#s=s.compile(i),this.#h(e.schema)}#h(e){let t=Object.entries(e??{});for(let[s,i]of t){if(!i||typeof i!="object"||!Object.hasOwn(i,"default"))continue;let{default:n}=i;n!==void 0&&(this.#t[s]=n)}}#d(e){e.defaults&&Object.assign(this.#t,e.defaults)}#f(e){e.serialize&&(this._serialize=e.serialize),e.deserialize&&(this._deserialize=e.deserialize)}#p(e){let t=typeof e.fileExtension=="string"?e.fileExtension:void 0,s=t?`.${t}`:"";return Ns.default.resolve(e.cwd,`${e.configName??"config"}${s}`)}#m(e){if(e.migrations){this.#g(e),this._validate(this.store);return}let t=this.store,s=Object.assign(mt(),e.defaults??{},t);this._validate(s);try{Vu.default.deepEqual(t,s)}catch{this.store=s}}#g(e){let{migrations:t,projectVersion:s}=e;if(t){if(!s)throw new Error("Please specify the `projectVersion` option.");this.#o=!0;try{let i=this.store,n=Object.assign(mt(),e.defaults??{},i);try{Vu.default.deepEqual(i,n)}catch{this._write(n)}this._migrate(t,s,e.beforeEachMigration)}finally{this.#o=!1}}}};var Rn=Y(L_());var F_=(r=0)=>e=>`\x1B[${e+r}m`,V_=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,U_=(r=0)=>(e,t,s)=>`\x1B[${38+r};2;${e};${t};${s}m`,J={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},C2=Object.keys(J.modifier),ZR=Object.keys(J.color),QR=Object.keys(J.bgColor),R2=[...ZR,...QR];function eN(){let r=new Map;for(let[e,t]of Object.entries(J)){for(let[s,i]of Object.entries(t))J[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[s]=J[s],r.set(i[0],i[1]);Object.defineProperty(J,e,{value:t,enumerable:!1})}return Object.defineProperty(J,"codes",{value:r,enumerable:!1}),J.color.close="\x1B[39m",J.bgColor.close="\x1B[49m",J.color.ansi=F_(),J.color.ansi256=V_(),J.color.ansi16m=U_(),J.bgColor.ansi=F_(10),J.bgColor.ansi256=V_(10),J.bgColor.ansi16m=U_(10),Object.defineProperties(J,{rgbToAnsi256:{value(e,t,s){return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(n=>n+n).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>J.rgbToAnsi256(...J.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,s,i;if(e>=232)t=((e-232)*10+8)/255,s=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,s=Math.floor(a/6)/5,i=a%6/5}let n=Math.max(t,s,i)*2;if(n===0)return 30;let o=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(t));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,s)=>J.ansi256ToAnsi(J.rgbToAnsi256(e,t,s)),enumerable:!1},hexToAnsi:{value:e=>J.ansi256ToAnsi(J.hexToAnsi256(e)),enumerable:!1}}),J}var tN=eN(),Ye=tN;var wn=Y(require("node:process"),1),G_=Y(require("node:os"),1),Zc=Y(require("node:tty"),1);function ke(r,e=globalThis.Deno?globalThis.Deno.args:wn.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",s=e.indexOf(t+r),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:Z}=wn.default,bn;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?bn=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(bn=1);function rN(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function sN(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function iN(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=rN();s!==void 0&&(bn=s);let i=t?bn:s;if(i===0)return 0;if(t){if(ke("color=16m")||ke("color=full")||ke("color=truecolor"))return 3;if(ke("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(r&&!e&&i===void 0)return 0;let n=i||0;if(Z.TERM==="dumb")return n;if(wn.default.platform==="win32"){let o=G_.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Z)||Z.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let o=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:n}function H_(r,e={}){let t=iN(r,{streamIsTTY:r&&r.isTTY,...e});return sN(t)}var nN={stdout:H_({isTTY:Zc.default.isatty(1)}),stderr:H_({isTTY:Zc.default.isatty(2)})},z_=nN;function B_(r,e,t){let s=r.indexOf(e);if(s===-1)return r;let i=e.length,n=0,o="";do o+=r.slice(n,s)+e+t,n=s+i,s=r.indexOf(e,n);while(s!==-1);return o+=r.slice(n),o}function K_(r,e,t,s){let i=0,n="";do{let o=r[s-1]==="\r";n+=r.slice(i,o?s-1:s)+e+(o?`\r
|
|
132
132
|
`:`
|
|
133
133
|
`)+t,i=s+1,s=r.indexOf(`
|
|
134
|
-
`,i)}while(s!==-1);return n+=r.slice(i),n}var{stdout:
|
|
135
|
-
`);return n!==-1&&(e=
|
|
136
|
-
`);for(let s of t){let i=s.indexOf(":");if(i<0)continue;let n=s.substring(0,i).toLowerCase().trim(),o=s.substring(i+1).trim();n.length>0&&o.length>0&&e.push({name:n,value:o})}return e}function
|
|
137
|
-
`)})}function
|
|
134
|
+
`,i)}while(s!==-1);return n+=r.slice(i),n}var{stdout:W_,stderr:Y_}=z_,Qc=Symbol("GENERATOR"),jr=Symbol("STYLER"),Bs=Symbol("IS_EMPTY"),X_=["ansi","ansi","ansi256","ansi16m"],kr=Object.create(null),oN=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=W_?W_.level:0;r.level=e.level===void 0?t:e.level};var aN=r=>{let e=(...t)=>t.join(" ");return oN(e,r),Object.setPrototypeOf(e,Ks.prototype),e};function Ks(r){return aN(r)}Object.setPrototypeOf(Ks.prototype,Function.prototype);for(let[r,e]of Object.entries(Ye))kr[r]={get(){let t=$n(this,tl(e.open,e.close,this[jr]),this[Bs]);return Object.defineProperty(this,r,{value:t}),t}};kr.visible={get(){let r=$n(this,this[jr],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var el=(r,e,t,...s)=>r==="rgb"?e==="ansi16m"?Ye[t].ansi16m(...s):e==="ansi256"?Ye[t].ansi256(Ye.rgbToAnsi256(...s)):Ye[t].ansi(Ye.rgbToAnsi(...s)):r==="hex"?el("rgb",e,t,...Ye.hexToRgb(...s)):Ye[t][r](...s),uN=["rgb","hex","ansi256"];for(let r of uN){kr[r]={get(){let{level:t}=this;return function(...s){let i=tl(el(r,X_[t],"color",...s),Ye.color.close,this[jr]);return $n(this,i,this[Bs])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);kr[e]={get(){let{level:t}=this;return function(...s){let i=tl(el(r,X_[t],"bgColor",...s),Ye.bgColor.close,this[jr]);return $n(this,i,this[Bs])}}}}var cN=Object.defineProperties(()=>{},{...kr,level:{enumerable:!0,get(){return this[Qc].level},set(r){this[Qc].level=r}}}),tl=(r,e,t)=>{let s,i;return t===void 0?(s=r,i=e):(s=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:s,closeAll:i,parent:t}},$n=(r,e,t)=>{let s=(...i)=>lN(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,cN),s[Qc]=r,s[jr]=e,s[Bs]=t,s},lN=(r,e)=>{if(r.level<=0||!e)return r[Bs]?"":e;let t=r[jr];if(t===void 0)return e;let{openAll:s,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=B_(e,t.close,t.open),t=t.parent;let n=e.indexOf(`
|
|
135
|
+
`);return n!==-1&&(e=K_(e,i,s,n)),s+e+i};Object.defineProperties(Ks.prototype,kr);var hN=Ks(),L2=Ks({level:Y_?Y_.level:0});var le=hN;var cv=Y(uv(),1),{program:lv,createCommand:W2,createArgument:Y2,createOption:X2,CommanderError:J2,InvalidArgumentError:Z2,InvalidOptionArgumentError:Q2,Command:eM,Argument:tM,Option:rM,Help:sM}=cv.default;var hv=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/i;function dv(){let r,e,t=new Promise((s,i)=>{r=s,e=i});return t.resolve=r,t.reject=e,t}var Mr=class{constructor(e,t){this.interval=e;this.func=t}interval;func;lastUpdated=0;updateTimer;update(e,t){let s=new Date().valueOf();t||s-this.lastUpdated>this.interval?(clearTimeout(this.updateTimer),this.func(e),this.lastUpdated=s):this.updateTimer=setTimeout(()=>{this.func(e),this.updateTimer=void 0},this.interval-s+this.lastUpdated).unref()}};function St(r){return r.toLocaleString("en-US",{useGrouping:!0})}function xn(r){if(r.length<=24)return{service:"",user:"",token:r};let e=Buffer.from(TN(r),"base64").toString("utf8").split("#");return{service:e[0]??"",user:e[1]??"",token:e[2]??""}}function TN(r){let e="",t=r.length;for(let s=0;s<2;s++,t--)for(let i=t-1;i>=0;i-=2)e+=r[i];return e}var Dv=require("net"),jv=Y(require("tls"));var Tn=(l=>(l[l.HELLO_REQ=1]="HELLO_REQ",l[l.HELLO_RESP=2]="HELLO_RESP",l[l.END=3]="END",l[l.SERVER_OPEN=4]="SERVER_OPEN",l[l.SERVER_CLOSE=5]="SERVER_CLOSE",l[l.CLIENT_CLOSE=6]="CLIENT_CLOSE",l[l.PING=7]="PING",l[l.PONG=8]="PONG",l[l.SERVER_DATA=65]="SERVER_DATA",l[l.CLIENT_DATA=66]="CLIENT_DATA",l))(Tn||{});function fv(r){return{name:Object.keys(Tn).find(e=>Tn[e]===r)??"UNKNOWN",isBinary:!!(r&64)}}var pv=1;var PN="service";var vl=PN+".",mv=5e3;var AN=1*1024*1024,Ys=12,gv=70,yv=80,_v=0,vv=1,bv=2,wv=4,$v=8,Ev=!!process.env.DERTUNNEL_DEBUG,Pn=class{constructor(e){this.onMessage=e}onMessage;buffer=void 0;async receive(e){let t=this.buffer?Buffer.concat([this.buffer,e]):e,s=0;for(;s<t.length;){if(t.length<s+Ys)return this.buffer=t.subarray(s),!0;if(t[s+_v]!=gv||t[s+vv]!=yv)return this.reset(),!1;let i=t.readUint16LE(s+bv),n=t.readUint32LE(s+wv),o=t.readUint32LE(s+$v),u=o+Ys+s;if(o>AN)return this.reset(),!1;if(t.length>=u)try{let c=t.subarray(s+Ys,u);Ev&&Sv(i,n,c,!1),await this.onMessage(i,n,c)}catch{return this.reset(),!1}else break;s=u}return this.buffer=t.length>s?t.subarray(s):void 0,!0}reset(){this.buffer=void 0}};function Lr(r,e,t,s){let i=Buffer.isBuffer(s)?s:s?Buffer.from(JSON.stringify(s)):void 0,n=Buffer.allocUnsafe(Ys+(i?i.length:0));n.writeUint8(gv,_v),n.writeUint8(yv,vv),n.writeUint16LE(e,bv),n.writeUint32LE(t,wv),n.writeUint32LE(i?i.length:0,$v),i?.copy(n,Ys,0);let o=r.write(n);return Ev&&Sv(e,t,i,!0),o}function Xs(r){return JSON.parse(r.toString("utf8"))}function Sv(r,e,t,s){let{name:i,isBinary:n}=fv(r);console.debug(`[msg-${s?"out":"in"} ${i} ${e>0?e:""}] ${t?n?`- ${t.length} payload bytes`:t.toString("utf8"):"- empty"}`)}var bl=require("node:crypto");var IN=128,Ut,Fr;function CN(r){if(r<0)throw new RangeError("Wrong ID size");try{!Ut||Ut.length<r?(Ut=Buffer.allocUnsafe(r*IN),bl.webcrypto.getRandomValues(Ut),Fr=0):Fr+r>Ut.length&&(bl.webcrypto.getRandomValues(Ut),Fr=0)}catch(e){throw Ut=void 0,e}Fr+=r}function RN(r){return CN(r|=0),Ut.subarray(Fr-r,Fr)}function NN(r,e,t){let s=256-256%r.length;if(s===256){let n=r.length-1;return(o=e)=>{if(!o)return"";let a="";for(;;){let u=t(o),c=o;for(;c--;)if(a+=r[u[c]&n],a.length>=o)return a}}}let i=Math.ceil(1.6*256*e/s);return(n=e)=>{if(!n)return"";let o="";for(;;){let a=t(i),u=i;for(;u--;)if(a[u]<s&&(o+=r[a[u]%r.length],o.length>=n))return o}}}function wl(r,e=21){return NN(r,e,RN)}var An=wl("0123456789abcdef",8),pM=wl("0123456789abcdefghijklmnopqrstuvwxyz",24);var Iv=4096,Vr=13,Ur=10,Ov=new Uint8Array([72,84,84,80,47,49,46,49,Vr,Ur]),qN=new Uint8Array([72,84,84,80,47,49,46,49,32]),$l=0,In=1,Cn=2,El=3,xv=4,Cv=5,Js=class{constructor(e){this.onParsed=e}onParsed;state=$l;id="";contentData;headers=[];expectedBodyLen=0;isRequest=!1;method="";path="";status=0;statusText="";startAt=0;onData(e){let s=0,i=0;for(;s<e.length&&s!==-1&&i++<100;)if(this.state===$l||this.state===In||this.state===Cn){this.contentData=void 0;let n=s;if((s=e.indexOf(Ov,n))>=0)for(let o=0;o<1;o++){let a=s+Ov.length;for(;s>0&&e[s-1]!==Ur&&e[s-1]!==Vr;)s--;let u=e.subarray(s,a).toString("ascii").split(" ");if(u.length!==3){s=a;break}let c=Pv(e,a);if(c){s=a+c.length,this.headers=Av(c);let{nextState:l,len:h}=Tv(this.headers,!0);this.state=l,this.expectedBodyLen=h}else break;this.isRequest=!0,this.id=An(12),this.method=u[0].toUpperCase(),this.path=decodeURI(u[1]),this.onParsed?.({id:this.id,type:"http-request-header",headers:this.headers,method:this.method,path:this.path,status:0,statusText:"",startAt:this.startAt=new Date().valueOf()})}else if((s=e.indexOf(qN,n))>=0){let o=s,a=e.length;for(;s<a&&!(e[s+1]===Vr&&e[s+2]===Ur);)s++;for(let u=0;u<1;u++){let c=e.subarray(o,s+1).toString("ascii").split(" ");if(c.length<3)break;let l=Pv(e,o);if(l){s=o+l.length,this.headers=Av(l);let{nextState:f,len:p}=Tv(this.headers,!1);this.state=f,this.expectedBodyLen=p}else break;let h=Number.parseInt(c[1]);if(!Number.isFinite(h)||h<100||h>999)break;this.isRequest=!1,this.status=h,this.statusText=c.slice(2).join(" "),this.onParsed?.({id:this.id,type:"http-response-header",headers:this.headers,status:this.status,statusText:this.statusText,method:this.method,path:this.path,endAt:new Date().valueOf()})}}}else if(this.state===El){let{ok:n,p:o,size:a}=DN(e,s);s=o,a>0?(this.expectedBodyLen=a,this.state=n?xv:$l):n&&(this.isRequest?this.onParsed?.({id:this.id,type:"http-request-body",headers:this.headers,method:this.method,path:this.path,status:this.status,statusText:this.statusText,content:this.contentData,startAt:this.startAt,endAt:new Date().valueOf()}):this.onParsed?.({id:this.id,type:"http-response-body",headers:this.headers,method:this.method,path:this.path,status:this.status,statusText:this.statusText,content:this.contentData,startAt:this.startAt,endAt:new Date().valueOf()}),s+=2,this.state=this.isRequest?Cn:In)}else if(this.state===xv){let n=Math.min(e.length-s,this.expectedBodyLen),o=e.slice(s,s+this.expectedBodyLen);this.contentData=this.contentData?Buffer.concat([this.contentData,o]):Buffer.from(o),this.expectedBodyLen-=n,s+=n,this.expectedBodyLen===0&&(s+=2,this.state=El)}else if(this.state===Cv){let n=Math.min(e.length-s,this.expectedBodyLen),o=e.slice(s,s+this.expectedBodyLen);this.contentData=this.contentData?Buffer.concat([this.contentData,o]):Buffer.from(o),this.expectedBodyLen-=n,s+=n,this.expectedBodyLen===0&&(this.isRequest?this.onParsed?.({id:this.id,type:"http-request-body",headers:this.headers,method:this.method,path:this.path,status:this.status,statusText:this.statusText,content:this.contentData,startAt:this.startAt,endAt:new Date().valueOf()}):this.onParsed?.({id:this.id,type:"http-response-body",headers:this.headers,method:this.method,path:this.path,status:this.status,statusText:this.statusText,content:this.contentData,startAt:this.startAt,endAt:new Date().valueOf()}),this.state=this.isRequest?Cn:In)}if(i>=100)throw new Error("Internal parser error: "+this.state)}};function Tv(r,e){let t=Number.parseInt(r.find(s=>s.name==="content-length")?.value??"0");return r.find(s=>s.name==="transfer-encoding")?.value.includes("chunked")?{nextState:El,isChunked:!0,len:0}:t>0?{nextState:Cv,isChunked:!1,len:t}:{nextState:e?Cn:In,isChunked:!1,len:0}}function Pv(r,e){let t=e,s=Math.min(r.length-3,e+Iv);for(;t<s&&!(r[t]===Vr&&r[t+1]===Ur&&r[t+2]===Vr&&r[t+3]===Ur);)t++;return t<s?r.slice(e,t+4):void 0}function Av(r){let e=[],t=r.toString("ascii").split(`\r
|
|
136
|
+
`);for(let s of t){let i=s.indexOf(":");if(i<0)continue;let n=s.substring(0,i).toLowerCase().trim(),o=s.substring(i+1).trim();n.length>0&&o.length>0&&e.push({name:n,value:o})}return e}function DN(r,e){let t=0,s=e,i=!1,n=jN(r,e);return n!==void 0&&(t=Number.parseInt(n,16))>=0&&Number.isFinite(t)&&(s=e+n.length+2,i=!0),{ok:i,p:s,size:t}}function jN(r,e){let t=e,s=Math.min(r.length-1,e+Iv);for(;t<s&&!(r[t]===Vr&&r[t+1]===Ur);)t++;return t<s?r.slice(e,t).toString("ascii"):void 0}var Rv="0.7.17";var Q={headerLines:[`/__\\ DERTUNNEL v${Rv} /__\\`,""],logLines:[],inspectedRequests:[],statusLines:[]};function Zs(){let r=process.stdout,[e,t]=r.getWindowSize();if(Q.inspectedRequests.length>t-15){let n=Q.inspectedRequests.findIndex(o=>o.type==="http-response-body"||o.type==="http-response-header");Q.inspectedRequests.splice(n>=0?n:0,1)}let s=Q.inspectedRequests.map(n=>{let o;n.status===0?o="...":n.status<400?o=le.blue(n.status):n.status<500?o=le.yellow(n.status):o=le.redBright(n.status);let a=new Date(n.startAt).toISOString(),u=n.endAt?`${n.endAt-n.startAt}ms`:"",c=a.slice(0,10)+" "+a.slice(11,19),l=n.headers.find(m=>m.name==="content-type")?.value??"(none)",h=l.split(";")[0],f=n.path.slice(0,Math.min(e-45-(l?l.length:2),n.path.length)),p=le.white(n.content?" "+St(n.content.length)+"b ":"");return`${le.cyan(`${c} -`)} ${o} ${le.green(n.method)} ${le.white(f)} ${n.content?le.gray(h):""} ${p} ${le.cyanBright(u)}`});for(;Q.headerLines.length+Q.statusLines.length+s.length+Q.logLines.length+2>t&&Q.logLines.length>2;)Q.logLines.splice(0,1);let i=[...Q.headerLines,"",...Q.statusLines,...s,"",...Q.logLines];r.cursorTo(0,0),r.clearScreenDown(),i.forEach(n=>{r.write(n??""),r.write(`
|
|
137
|
+
`)})}function Hr(r,e){process.stdout.isTTY?(e!==void 0?Q.headerLines[e]=r:Q.headerLines.push(r),Zs()):console.log(r)}function Qs(r){process.stdout.isTTY?(Q.logLines.push(r),Q.logLines.length>20&&Q.logLines.splice(0,1),Zs()):console.log(r)}var kN=new Mr(200,()=>Zs());function Nv(r,e,t){if(r==="http-request-header"){let s=Q.inspectedRequests.find(i=>i.cid===e);s&&(s.cid=""),Q.inspectedRequests.push({cid:e,...t})}else{let s=Q.inspectedRequests.findIndex(i=>i.cid===e);if(s>=0){let i=Q.inspectedRequests[s];Q.inspectedRequests[s]={id:i.id,cid:i.cid,type:t.type,headers:t.headers,method:t.method||i.method,path:t.path||i.path,status:t.status||i.status,statusText:t.statusText||i.statusText,content:t.content??i.content,startAt:t.startAt||i.startAt,endAt:t.endAt}}}kN.update(void 0)}function qv(r){return["STATS | SENT chunks bytes | RECV chunks bytes | CONN active total errors |",` |${St(r.chunksSent).padStart(14)}${St(r.bytesSent).padStart(14)} |${St(r.chunksReceived).padStart(14)}${St(r.bytesReceived).padStart(14)} |${St(r.currentConnections).padStart(14)}${St(r.totalConnections).padStart(8)}${St(r.connectionErrors).padStart(9)} |`,""]}async function kv(r){let e=!1,t=!1,s,i=300,n=1.4,o=1e4,a={reconnectTime:i};if(!r.endpoint&&!r.endpointPrefix)throw new Error("Must either define 'endpoint' or 'endpointPrefix'");if(!r.clientToken||!r.localPort&&!r.localUrl)throw new Error("Missing required options");let u=xn(r.clientToken);r.serviceHost??=u.service;let c=u.user,l=u.token,h,f;if(r.localPort)h=r.localServer??"127.0.0.1",f=r.localPort;else{let y=new URL(r.localUrl||"http://localhost");if(y.protocol!=="http:")throw new Error("Local endpoints only support http protocol");h=y.hostname,f=Number.parseInt(y.port??"80")}let p=dv(),m=r.serviceHost;m.startsWith(vl)||(m=vl+m);let g=()=>{let y=new Mr(200,()=>w("data")),_={bytesReceived:0,bytesSent:0,chunksReceived:0,chunksSent:0,currentConnections:0,totalConnections:0,connectionErrors:0};function w(U,Le){try{r.onEndpoint?.(U,_,Le??"")}catch{}}s?.destroy(),r.ignoreCertErrors&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),s=jv.default.connect({timeout:1e4,host:m,port:r.servicePort||443,servername:m,...r.ignoreCertErrors?{checkServerIdentity:()=>{}}:{}},()=>{s&&(s.setKeepAlive(!0,mv),Lr(s,1,0,{version:pv,user:c,token:l,endpoint:r.endpoint,endpointPrefix:r.endpointPrefix}))}),s.setMaxListeners(0);let E=new Map,O,S,he=new Pn(async(U,Le,Pe)=>{if(!e&&U===2){let G=Xs(Pe);if(!G.success){s?.destroy();let N="Server connection error: "+(G.error??"Unknown error");p.reject(new Error(N)),r.onError?.(N);return}r.onConnected?.(G.endpoint||""),y.update(void 0,!0),p.resolve(),e=!0,a.reconnectTime=i,O=setInterval(()=>{if(!s){O&&clearInterval(O),S&&clearTimeout(S);return}try{Lr(s,7,0)}catch{O&&clearInterval(O)}S=setTimeout(()=>{r.onError?.("Server pong timeout"),s?.destroy()},7e3).unref()},15e3).unref()}if(U===3){s?.destroy();let G=Xs(Pe);G.error&&r.onError?.(G.error);return}if(e){if(U===7)Lr(s,8,0);else if(U===8)S&&clearTimeout(S);else if(U===65){let G=E.get(Le);if(G){if(_.bytesSent+=Pe.length,_.chunksSent++,G.bytesSent+=Pe.length,G.parserOut)try{G.parserOut.onData(Pe)}catch(N){w("error",N?.message)}G.write(Pe),y.update(void 0,!1)}}else if(U===4){let G=Xs(Pe),N=(0,Dv.createConnection)({host:h,port:f,allowHalfOpen:!1});N.channelId=G.channelId,N.wasConnected=!1;let ei=An(),Gr=Fe=>{try{r.onProtocolData?.(Fe.type,ei,Fe)}catch{}};r.protocols?.inspect&&(N.parserIn=new Js(Gr),N.parserOut=new Js(Gr)),N.bytesReceived=N.bytesSent=0,E.set(G.channelId,N),N.on("connect",()=>{N.wasConnected=!0,_.currentConnections++,_.totalConnections++,w("connect"),y.update(void 0,!0)}),N.on("close",()=>{N.wasConnected&&(_.currentConnections=Math.max(0,_.currentConnections-1)),E.delete(G.channelId),Lr(s,6,0,{channelId:N.channelId}),w("disconnect"),y.update(void 0,!0)}),N.on("data",Fe=>{if(N.bytesReceived+=Fe.length,_.bytesReceived+=Fe.length,_.chunksReceived++,N.parserIn)try{N.parserIn.onData(Fe)}catch(Lv){w("error",Lv?.message)}!Lr(s,66,N.channelId,Fe)&&!N.isPaused()&&(N.pause(),s.once("drain",()=>{N.resume()})),y.update(void 0,!1)}),N.on("error",Fe=>{_.connectionErrors++,w("error",Fe?.message),y.update(void 0,!0)})}else if(U===5){let G=Xs(Pe),N=E.get(G.channelId);N&&(E.delete(G.channelId),N.end(()=>N.destroy()))}}});s.on("error",U=>{e=!1,!t&&(p.reject(U),r.onError?.("Server connection error: "+U.message))}),s.on("close",()=>{e=!1,O&&clearInterval(O),S&&clearTimeout(S),E.forEach(U=>U.destroy()),!t&&(setTimeout(g,a.reconnectTime),a.reconnectTime=Math.min(o,a.reconnectTime*n))}),s.on("data",U=>{t||!s||(s.pause(),he.receive(U).then(Le=>{Le||s?.destroy(),s?.resume()}).catch(Le=>Qs(`Unexpected parser error: ${Le.message}`)))})};return g(),r.waitForInitialConnection!==!1&&await p,()=>{t=!0,s?.destroy()}}(async function(){let e=new qs({projectName:"dertunnel",defaults:{configured:!1,serviceUrl:"",user:"",token:""}}),t=e.get("configured"),s=lv.name("dertunnel").option("-s, --service <url>","Service URL or host name").option("-u, --user <username>","The username for authenticating to the service").option("--reset","Removes stored user configuration").option("--ignore-cert-errors","Ignore all certificate errors (UNSAFE)").option("--no-inspect","Do not inspect traffic - HTTP logging will be unavailable").argument("[public-endpoint-name]","Public name for the tunnel endpoint").argument("[local-endpoint]","Local port name or URL").parse(process.argv),i=s.opts();i.reset&&(e.clear(),console.log("Stored configuration was purged"),process.exit());let n=i.service||(t?e.get("serviceUrl"):void 0),o=i.user||(t?e.get("user"):void 0),a=process.env.DERTUNNEL_TOKEN||(t?e.get("token"):void 0);if(!a){if(a=(await(0,Rn.default)({name:"value",type:"password",message:"Connection token"})).value,!a)throw new Error("Must specify a connection token");e.set("token",a)}e.set("configured",!0);let{service:u,user:c}=xn(a);c=o||c;let[l,h]=s.args;if(!l&&(l=(await(0,Rn.default)({name:"value",type:"text",message:"Public endpoint name",validate:O=>hv.test(O)})).value,!l))throw new Error("Must specify a public endpoint name");if(!h&&(h=(await(0,Rn.default)({name:"value",type:"text",message:"Local endpoint URL or port"})).value,!h))throw new Error("Must specify a local endpoint");let f,p,m,g=Number.parseInt(h);if(Number.isNaN(g)){let O=new URL(h);if(O.protocol!=="http:")throw new Error("Ony http protocol is supported for local endpoints");m=O.toString()}else f="127.0.0.1",p=g;Hr(`Service: ${le.cyanBright(n||u)}`,3),Hr(`User: ${le.cyanBright(c)}`,4),Hr(`Local: ${le.cyanBright(m??`${f} ${p}`)}`,5);let y=!!i.inspect,_,w;if(n){let O=new URL(n);_=O.hostname,w=Number.parseInt(O.port||"443")}let E=await kv({clientToken:a,localServer:f,localPort:p,localUrl:m,serviceHost:_,servicePort:w,endpoint:l,endpointPrefix:void 0,ignoreCertErrors:!!i.ignoreCertErrors,waitForInitialConnection:!0,protocols:{inspect:y},onConnected:O=>{Hr(`Connected - public endpoint: ${le.green(O)}`,6)},onError:O=>{Hr(le.redBright(O),6)},onEndpoint(O,S,he){Q.statusLines=qv(S),O==="error"&&Qs(le.redBright(he)),Zs()},onProtocolData(O,S,he){Nv(O,S,he)}});["SIGINT","SIGTERM","SIGQUIT"].forEach(O=>{process.on(O,()=>{Qs("Shutting down"),E(),process.exit(0)})})})().catch(r=>{console.error(r)});
|