@faulpeltz/dertunnel 0.7.13 → 0.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,137 +1,137 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var mv=Object.create;var cl=Object.defineProperty;var gv=Object.getOwnPropertyDescriptor;var yv=Object.getOwnPropertyNames;var _v=Object.getPrototypeOf,vv=Object.prototype.hasOwnProperty;var d=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var bv=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yv(e))!vv.call(r,i)&&i!==t&&cl(r,i,{get:()=>e[i],enumerable:!(s=gv(e,i))||s.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?mv(_v(r)):{},bv(e||!r||!r.__esModule?cl(t,"default",{value:r,enumerable:!0}):t,r));var Br=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 Gr=class{};D._CodeOrName=Gr;D.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Lt=class extends Gr{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=Lt;var Pe=class extends Gr{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 Lt&&(t[s.str]=(t[s.str]||0)+1),t),{})}};D._Code=Pe;D.nil=new Pe("");function Il(r,...e){let t=[r[0]],s=0;for(;s<e.length;)Ln(t,e[s]),t.push(r[++s]);return new Pe(t)}D._=Il;var Mn=new Pe("+");function Al(r,...e){let t=[zr(r[0])],s=0;for(;s<e.length;)t.push(Mn),Ln(t,e[s]),t.push(Mn,zr(r[++s]));return Rv(t),new Pe(t)}D.str=Al;function Ln(r,e){e instanceof Pe?r.push(...e._items):e instanceof Lt?r.push(e):r.push(kv(e))}D.addCodeArg=Ln;function Rv(r){let e=1;for(;e<r.length-1;){if(r[e]===Mn){let t=Nv(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Nv(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof Lt||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 Lt))return`"${r}${e.slice(1)}`}function qv(r,e){return e.emptyStr()?r:r.emptyStr()?e:Al`${r}${e}`}D.strConcat=qv;function kv(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:zr(Array.isArray(r)?r.join(","):r)}function jv(r){return new Pe(zr(r))}D.stringify=jv;function zr(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}D.safeStringify=zr;function Dv(r){return typeof r=="string"&&D.IDENTIFIER.test(r)?new Pe(`.${r}`):Il`[${r}]`}D.getProperty=Dv;function Mv(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=Mv;function Lv(r){return new Pe(r.toString())}D.regexpCode=Lv});var Un=d(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ValueScope=we.ValueScopeName=we.Scope=we.varKinds=we.UsedValueState=void 0;var be=Br(),Vn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Qs;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Qs||(we.UsedValueState=Qs={}));we.varKinds={const:new be.Name("const"),let:new be.Name("let"),var:new be.Name("var")};var ei=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=ei;var ti=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=ti;var Vv=(0,be._)`\n`,Fn=class extends ei{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Vv:be.nil}}get(){return this._scope}name(e){return new ti(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,Qs.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 Vn(c);u.set(c,Qs.Completed)})}return n}};we.ValueScope=Fn});var T=d(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.or=A.and=A.not=A.CodeGen=A.operators=A.varKinds=A.ValueScopeName=A.ValueScope=A.Scope=A.Name=A.regexpCode=A.stringify=A.getProperty=A.nil=A.strConcat=A.str=A._=void 0;var q=Br(),Ve=Un(),Et=Br();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return Et._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return Et.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return Et.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return Et.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return Et.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return Et.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return Et.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return Et.Name}});var ni=Un();Object.defineProperty(A,"Scope",{enumerable:!0,get:function(){return ni.Scope}});Object.defineProperty(A,"ValueScope",{enumerable:!0,get:function(){return ni.ValueScope}});Object.defineProperty(A,"ValueScopeName",{enumerable:!0,get:function(){return ni.ValueScopeName}});Object.defineProperty(A,"varKinds",{enumerable:!0,get:function(){return ni.varKinds}});A.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 ct=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Hn=class extends ct{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=ir(this.rhs,e,t)),this}get names(){return this.rhs instanceof q._CodeOrName?this.rhs.names:{}}},ri=class extends ct{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=ir(this.rhs,e,t),this}get names(){let e=this.lhs instanceof q.Name?{}:{...this.lhs.names};return ii(e,this.rhs)}},Gn=class extends ri{constructor(e,t,s,i){super(e,s,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},zn=class extends ct{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Bn=class extends ct{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Wn=class extends ct{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Kn=class extends ct{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=ir(this.code,e,t),this}get names(){return this.code instanceof q._CodeOrName?this.code.names:{}}},Wr=class extends ct{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)||(Fv(e,n.names),s.splice(i,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Ut(e,t.names),{})}},lt=class extends Wr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Yn=class extends Wr{},sr=class extends lt{};sr.kind="else";var Vt=class r extends lt{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 sr(s):s}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(Cl(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=ir(this.condition,e,t),this}get names(){let e=super.names;return ii(e,this.condition),this.else&&Ut(e,this.else.names),e}};Vt.kind="if";var Ft=class extends lt{};Ft.kind="for";var Xn=class extends Ft{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=ir(this.iteration,e,t),this}get names(){return Ut(super.names,this.iteration.names)}},Jn=class extends Ft{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=ii(super.names,this.from);return ii(e,this.to)}},si=class extends Ft{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=ir(this.iterable,e,t),this}get names(){return Ut(super.names,this.iterable.names)}},Kr=class extends lt{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)}};Kr.kind="func";var Yr=class extends Wr{render(e){return"return "+super.render(e)}};Yr.kind="return";var Zn=class extends lt{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&&Ut(e,this.catch.names),this.finally&&Ut(e,this.finally.names),e}},Xr=class extends lt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Xr.kind="catch";var Jr=class extends lt{render(e){return"finally"+super.render(e)}};Jr.kind="finally";var Qn=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 Yn]}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 Hn(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 ri(e,t,s))}add(e,t){return this._leafNode(new Gn(e,A.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==q.nil&&this._leafNode(new Kn(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 Vt(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 Vt(e))}else(){return this._elseNode(new sr)}endIf(){return this._endBlockNode(Vt,sr)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Xn(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 Jn(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 si("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 si("in",i,n,t),()=>s(n))}endFor(){return this._endBlockNode(Ft)}label(e){return this._leafNode(new zn(e))}break(e){return this._leafNode(new Bn(e))}return(e){let t=new Yr;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Yr)}try(e,t,s){if(!t&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Zn;if(this._blockNode(i),this.code(e),t){let n=this.name("e");this._currNode=i.catch=new Xr(n),t(n)}return s&&(this._currNode=i.finally=new Jr,this.code(s)),this._endBlockNode(Xr,Jr)}throw(e){return this._leafNode(new Wn(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 Kr(e,t,s)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Kr)}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 Vt))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}};A.CodeGen=Qn;function Ut(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function ii(r,e){return e instanceof q._CodeOrName?Ut(r,e.names):r}function ir(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 Fv(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function Cl(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,q._)`!${eo(r)}`}A.not=Cl;var Uv=Rl(A.operators.AND);function Hv(...r){return r.reduce(Uv)}A.and=Hv;var Gv=Rl(A.operators.OR);function zv(...r){return r.reduce(Gv)}A.or=zv;function Rl(r){return(e,t)=>e===q.nil?t:t===q.nil?e:(0,q._)`${eo(e)} ${r} ${eo(t)}`}function eo(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(),Bv=Br();function Wv(r){let e={};for(let t of r)e[t]=!0;return e}C.toHash=Wv;function Kv(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(kl(r,e),!jl(e,r.self.RULES.all))}C.alwaysValidSchema=Kv;function kl(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]||Ll(r,`unknown keyword: "${n}"`)}C.checkUnknownRules=kl;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 Yv(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=Yv;function Xv({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=Xv;function Jv(r){return Dl(decodeURIComponent(r))}C.unescapeFragment=Jv;function Zv(r){return encodeURIComponent(ro(r))}C.escapeFragment=Zv;function ro(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}C.escapeJsonPointer=ro;function Dl(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}C.unescapeJsonPointer=Dl;function Qv(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}C.eachItem=Qv;function Nl({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:Nl({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} || {}`),so(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:Ml}),items:Nl({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 Ml(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,F._)`{}`);return e!==void 0&&so(r,t,e),t}C.evaluatedPropsToName=Ml;function so(r,e,t){Object.keys(t).forEach(s=>r.assign((0,F._)`${e}${(0,F.getProperty)(s)}`,!0))}C.setEvaluated=so;var ql={};function eb(r,e){return r.scopeValue("func",{ref:e,code:ql[e.code]||(ql[e.code]=new Bv._Code(e.code))})}C.useFunc=eb;var to;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(to||(C.Type=to={}));function tb(r,e,t){if(r instanceof F.Name){let s=e===to.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():"/"+ro(r)}C.getErrorPath=tb;function Ll(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=Ll});var Ie=d(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});var le=T(),rb={data:new le.Name("data"),valCxt:new le.Name("valCxt"),instancePath:new le.Name("instancePath"),parentData:new le.Name("parentData"),parentDataProperty:new le.Name("parentDataProperty"),rootData:new le.Name("rootData"),dynamicAnchors:new le.Name("dynamicAnchors"),vErrors:new le.Name("vErrors"),errors:new le.Name("errors"),this:new le.Name("this"),self:new le.Name("self"),scope:new le.Name("scope"),json:new le.Name("json"),jsonPos:new le.Name("jsonPos"),jsonLen:new le.Name("jsonLen"),jsonPart:new le.Name("jsonPart")};io.default=rb});var Zr=d(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.extendErrors=he.resetErrorsCount=he.reportExtraError=he.reportError=he.keyword$DataError=he.keywordError=void 0;var j=T(),oi=R(),me=Ie();he.keywordError={message:({keyword:r})=>(0,j.str)`must pass "${r}" keyword validation`};he.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 sb(r,e=he.keywordError,t,s){let{it:i}=r,{gen:n,compositeRule:o,allErrors:a}=i,u=Ul(r,e,t);s??(o||a)?Vl(n,u):Fl(i,(0,j._)`[${u}]`)}he.reportError=sb;function ib(r,e=he.keywordError,t){let{it:s}=r,{gen:i,compositeRule:n,allErrors:o}=s,a=Ul(r,e,t);Vl(i,a),n||o||Fl(s,me.default.vErrors)}he.reportExtraError=ib;function nb(r,e){r.assign(me.default.errors,e),r.if((0,j._)`${me.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,j._)`${me.default.vErrors}.length`,e),()=>r.assign(me.default.vErrors,null)))}he.resetErrorsCount=nb;function ob({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,j._)`${me.default.vErrors}[${a}]`),r.if((0,j._)`${o}.instancePath === undefined`,()=>r.assign((0,j._)`${o}.instancePath`,(0,j.strConcat)(me.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))})}he.extendErrors=ob;function Vl(r,e){let t=r.const("err",e);r.if((0,j._)`${me.default.vErrors} === null`,()=>r.assign(me.default.vErrors,(0,j._)`[${t}]`),(0,j._)`${me.default.vErrors}.push(${t})`),r.code((0,j._)`${me.default.errors}++`)}function Fl(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 Ht={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 Ul(r,e,t){let{createErrors:s}=r.it;return s===!1?(0,j._)`{}`:ab(r,e,t)}function ab(r,e,t={}){let{gen:s,it:i}=r,n=[ub(i,t),cb(r,t)];return lb(r,e,n),s.object(...n)}function ub({errorPath:r},{instancePath:e}){let t=e?(0,j.str)`${r}${(0,oi.getErrorPath)(e,oi.Type.Str)}`:r;return[me.default.instancePath,(0,j.strConcat)(me.default.instancePath,t)]}function cb({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,oi.getErrorPath)(t,oi.Type.Str)}`),[Ht.schemaPath,i]}function lb(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([Ht.keyword,i],[Ht.params,typeof e=="function"?e(r):e||(0,j._)`{}`]),u.messages&&s.push([Ht.message,typeof t=="function"?t(r):t]),u.verbose&&s.push([Ht.schema,o],[Ht.parentSchema,(0,j._)`${l}${h}`],[me.default.data,n]),c&&s.push([Ht.propertyName,c])}});var Gl=d(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.boolOrEmptySchema=nr.topBoolOrEmptySchema=void 0;var hb=Zr(),db=T(),fb=Ie(),pb={message:"boolean schema is false"};function mb(r){let{gen:e,schema:t,validateName:s}=r;t===!1?Hl(r,!1):typeof t=="object"&&t.$async===!0?e.return(fb.default.data):(e.assign((0,db._)`${s}.errors`,null),e.return(!0))}nr.topBoolOrEmptySchema=mb;function gb(r,e){let{gen:t,schema:s}=r;s===!1?(t.var(e,!1),Hl(r)):t.var(e,!0)}nr.boolOrEmptySchema=gb;function Hl(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,hb.reportError)(i,pb,void 0,e)}});var no=d(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.getRules=or.isJSONType=void 0;var yb=["string","number","integer","boolean","null","object","array"],_b=new Set(yb);function vb(r){return typeof r=="string"&&_b.has(r)}or.isJSONType=vb;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:{}}}or.getRules=bb});var oo=d(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.shouldUseRule=St.shouldUseGroup=St.schemaHasRulesForType=void 0;function wb({schema:r,self:e},t){let s=e.RULES.types[t];return s&&s!==!0&&zl(r,s)}St.schemaHasRulesForType=wb;function zl(r,e){return e.rules.some(t=>Bl(r,t))}St.shouldUseGroup=zl;function Bl(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))}St.shouldUseRule=Bl});var Qr=d(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.reportTypeError=de.checkDataTypes=de.checkDataType=de.coerceAndCheckDataType=de.getJSONTypes=de.getSchemaTypes=de.DataType=void 0;var $b=no(),Eb=oo(),Sb=Zr(),I=T(),Wl=R(),ar;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(ar||(de.DataType=ar={}));function Ob(r){let e=Kl(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}de.getSchemaTypes=Ob;function Kl(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every($b.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}de.getJSONTypes=Kl;function xb(r,e){let{gen:t,data:s,opts:i}=r,n=Tb(e,i.coerceTypes),o=e.length>0&&!(n.length===0&&e.length===1&&(0,Eb.schemaHasRulesForType)(r,e[0]));if(o){let a=uo(e,s,i.strictNumbers,ar.Wrong);t.if(a,()=>{n.length?Pb(r,e,n):co(r)})}return o}de.coerceAndCheckDataType=xb;var Yl=new Set(["string","number","integer","boolean","null"]);function Tb(r,e){return e?r.filter(t=>Yl.has(t)||e==="array"&&t==="array"):[]}function Pb(r,e,t){let{gen:s,data:i,opts:n}=r,o=s.let("dataType",(0,I._)`typeof ${i}`),a=s.let("coerced",(0,I._)`undefined`);n.coerceTypes==="array"&&s.if((0,I._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>s.assign(i,(0,I._)`${i}[0]`).assign(o,(0,I._)`typeof ${i}`).if(uo(e,i,n.strictNumbers),()=>s.assign(a,i))),s.if((0,I._)`${a} !== undefined`);for(let c of t)(Yl.has(c)||c==="array"&&n.coerceTypes==="array")&&u(c);s.else(),co(r),s.endIf(),s.if((0,I._)`${a} !== undefined`,()=>{s.assign(i,a),Ib(r,a)});function u(c){switch(c){case"string":s.elseIf((0,I._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,I._)`"" + ${i}`).elseIf((0,I._)`${i} === null`).assign(a,(0,I._)`""`);return;case"number":s.elseIf((0,I._)`${o} == "boolean" || ${i} === null
4
- || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,I._)`+${i}`);return;case"integer":s.elseIf((0,I._)`${o} === "boolean" || ${i} === null
5
- || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,I._)`+${i}`);return;case"boolean":s.elseIf((0,I._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,I._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":s.elseIf((0,I._)`${i} === "" || ${i} === 0 || ${i} === false`),s.assign(a,null);return;case"array":s.elseIf((0,I._)`${o} === "string" || ${o} === "number"
6
- || ${o} === "boolean" || ${i} === null`).assign(a,(0,I._)`[${i}]`)}}}function Ib({gen:r,parentData:e,parentDataProperty:t},s){r.if((0,I._)`${e} !== undefined`,()=>r.assign((0,I._)`${e}[${t}]`,s))}function ao(r,e,t,s=ar.Correct){let i=s===ar.Correct?I.operators.EQ:I.operators.NEQ,n;switch(r){case"null":return(0,I._)`${e} ${i} null`;case"array":n=(0,I._)`Array.isArray(${e})`;break;case"object":n=(0,I._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":n=o((0,I._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":n=o();break;default:return(0,I._)`typeof ${e} ${i} ${r}`}return s===ar.Correct?n:(0,I.not)(n);function o(a=I.nil){return(0,I.and)((0,I._)`typeof ${e} == "number"`,a,t?(0,I._)`isFinite(${e})`:I.nil)}}de.checkDataType=ao;function uo(r,e,t,s){if(r.length===1)return ao(r[0],e,t,s);let i,n=(0,Wl.toHash)(r);if(n.array&&n.object){let o=(0,I._)`typeof ${e} != "object"`;i=n.null?o:(0,I._)`!${e} || ${o}`,delete n.null,delete n.array,delete n.object}else i=I.nil;n.number&&delete n.integer;for(let o in n)i=(0,I.and)(i,ao(o,e,t,s));return i}de.checkDataTypes=uo;var Ab={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,I._)`{type: ${r}}`:(0,I._)`{type: ${e}}`};function co(r){let e=Cb(r);(0,Sb.reportError)(e,Ab)}de.reportTypeError=co;function Cb(r){let{gen:e,data:t,schema:s}=r,i=(0,Wl.schemaRefOrVal)(r,s,"type");return{gen:e,keyword:"type",data:t,schema:s.type,schemaCode:i,schemaValue:i,parentSchema:s,params:{},it:r}}});var Jl=d(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.assignDefaults=void 0;var ur=T(),Rb=R();function Nb(r,e){let{properties:t,items:s}=r.schema;if(e==="object"&&t)for(let i in t)Xl(r,i,t[i].default);else e==="array"&&Array.isArray(s)&&s.forEach((i,n)=>Xl(r,n,i.default))}ai.assignDefaults=Nb;function Xl(r,e,t){let{gen:s,compositeRule:i,data:n,opts:o}=r;if(t===void 0)return;let a=(0,ur._)`${n}${(0,ur.getProperty)(e)}`;if(i){(0,Rb.checkStrictMode)(r,`default is ignored for: ${a}`);return}let u=(0,ur._)`${a} === undefined`;o.useDefaults==="empty"&&(u=(0,ur._)`${u} || ${a} === null || ${a} === ""`),s.if(u,(0,ur._)`${a} = ${(0,ur.stringify)(t)}`)}});var Ae=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(),lo=R(),Ot=Ie(),qb=R();function kb(r,e){let{gen:t,data:s,it:i}=r;t.if(fo(t,s,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,z._)`${e}`},!0),r.error()})}V.checkReportMissingProp=kb;function jb({gen:r,data:e,it:{opts:t}},s,i){return(0,z.or)(...s.map(n=>(0,z.and)(fo(r,e,n,t.ownProperties),(0,z._)`${i} = ${n}`)))}V.checkMissingProp=jb;function Db(r,e){r.setParams({missingProperty:e},!0),r.error()}V.reportMissingProp=Db;function Zl(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,z._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=Zl;function ho(r,e,t){return(0,z._)`${Zl(r)}.call(${e}, ${t})`}V.isOwnProperty=ho;function Mb(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} !== undefined`;return s?(0,z._)`${i} && ${ho(r,e,t)}`:i}V.propertyInData=Mb;function fo(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} === undefined`;return s?(0,z.or)(i,(0,z.not)(ho(r,e,t))):i}V.noPropertyInData=fo;function Ql(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=Ql;function Lb(r,e){return Ql(e).filter(t=>!(0,lo.alwaysValidSchema)(r,e[t]))}V.schemaProperties=Lb;function Vb({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=[[Ot.default.instancePath,(0,z.strConcat)(Ot.default.instancePath,n)],[Ot.default.parentData,o.parentData],[Ot.default.parentDataProperty,o.parentDataProperty],[Ot.default.rootData,Ot.default.rootData]];o.opts.dynamicRef&&h.push([Ot.default.dynamicAnchors,Ot.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=Vb;var Fb=(0,z._)`new RegExp`;function Ub({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"?Fb:(0,qb.useFunc)(r,i)}(${t}, ${s})`})}V.usePattern=Ub;function Hb(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:lo.Type.Num},n),e.if((0,z.not)(n),a)})}}V.validateArray=Hb;function Gb(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,lo.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=Gb});var rh=d(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.validateKeywordUsage=Je.validSchemaType=Je.funcKeywordCode=Je.macroKeywordCode=void 0;var ge=T(),Gt=Ie(),zb=Ae(),Bb=Zr();function Wb(r,e){let{gen:t,keyword:s,schema:i,parentSchema:n,it:o}=r,a=e.macro.call(o.self,i,n,o),u=th(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=Wb;function Kb(r,e){var t;let{gen:s,keyword:i,schema:n,parentSchema:o,$data:a,it:u}=r;Xb(u,e);let c=!a&&e.compile?e.compile.call(u.self,n,o,u):e.validate,l=th(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&&eh(r),y(()=>r.error());else{let _=e.async?p():m();e.modifying&&eh(r),y(()=>Yb(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?Gt.default.this:Gt.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=Kb;function eh(r){let{gen:e,data:t,it:s}=r;e.if(s.parentData,()=>e.assign(t,(0,ge._)`${s.parentData}[${s.parentDataProperty}]`))}function Yb(r,e){let{gen:t}=r;t.if((0,ge._)`Array.isArray(${e})`,()=>{t.assign(Gt.default.vErrors,(0,ge._)`${Gt.default.vErrors} === null ? ${e} : ${Gt.default.vErrors}.concat(${e})`).assign(Gt.default.errors,(0,ge._)`${Gt.default.vErrors}.length`),(0,Bb.extendErrors)(r)},()=>r.error())}function Xb({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function th(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 Jb(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=Jb;function Zb({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=Zb});var ih=d(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.extendSubschemaMode=xt.extendSubschemaData=xt.getSubschema=void 0;var Ze=T(),sh=R();function Qb(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,sh.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')}xt.getSubschema=Qb;function ew(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,sh.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]}}xt.extendSubschemaData=ew;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}xt.extendSubschemaMode=tw});var po=d((nq,nh)=>{"use strict";nh.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 ah=d((oq,oh)=>{"use strict";var Tt=oh.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(){};ui(e,s,i,r,"",r)};Tt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Tt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Tt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Tt.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 ui(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 Tt.arrayKeywords)for(var f=0;f<h.length;f++)ui(r,e,t,h[f],i+"/"+l+"/"+f,n,i,l,s,f)}else if(l in Tt.propsKeywords){if(h&&typeof h=="object")for(var p in h)ui(r,e,t,h[p],i+"/"+l+"/"+rw(p),n,i,l,s,p)}else(l in Tt.keywords||r.allKeys&&!(l in Tt.skipKeywords))&&ui(r,e,t,h,i+"/"+l,n,i,l,s)}t(s,i,n,o,a,u,c)}}function rw(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var es=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 sw=R(),iw=po(),nw=ah(),ow=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function aw(r,e=!0){return typeof r=="boolean"?!0:e===!0?!mo(r):e?uh(r)<=e:!1}$e.inlineRef=aw;var uw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function mo(r){for(let e in r){if(uw.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(mo)||typeof t=="object"&&mo(t))return!0}return!1}function uh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!ow.has(t)&&(typeof r[t]=="object"&&(0,sw.eachItem)(r[t],s=>e+=uh(s)),e===1/0))return 1/0}return e}function ch(r,e="",t){t!==!1&&(e=cr(e));let s=r.parse(e);return lh(r,s)}$e.getFullPath=ch;function lh(r,e){return r.serialize(e).split("#")[0]+"#"}$e._getFullPath=lh;var cw=/#\/?$/;function cr(r){return r?r.replace(cw,""):""}$e.normalizeId=cr;function lw(r,e,t){return t=cr(t),r.resolve(e,t)}$e.resolveUrl=lw;var hw=/^[a-z_][-a-z0-9._]*$/i;function dw(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:s}=this.opts,i=cr(r[t]||e),n={"":i},o=ch(s,i,!1),a={},u=new Set;return nw(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=cr(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!==cr(g)&&(O[0]==="#"?(c(h,a[O],O),a[O]=h):this.refs[O]=g),O}function S(O){if(typeof O=="string"){if(!hw.test(O))throw new Error(`invalid anchor "${O}"`);_.call(this,`#${O}`)}}}),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`)}}$e.getSchemaRefs=dw});var lr=d(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.getData=Pt.KeywordCxt=Pt.validateFunctionCode=void 0;var mh=Gl(),hh=Qr(),yo=oo(),ci=Qr(),fw=Jl(),rs=rh(),go=ih(),w=T(),x=Ie(),pw=es(),ht=R(),ts=Zr();function mw(r){if(_h(r)&&(vh(r),yh(r))){_w(r);return}gh(r,()=>(0,mh.topBoolOrEmptySchema)(r))}Pt.validateFunctionCode=mw;function gh({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"; ${dh(t,i)}`),yw(r,i),r.code(n)}):r.func(e,(0,w._)`${x.default.data}, ${gw(i)}`,s.$async,()=>r.code(dh(t,i)).code(n))}function gw(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 yw(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 _w(r){let{schema:e,opts:t,gen:s}=r;gh(r,()=>{t.$comment&&e.$comment&&wh(r),Ew(r),s.let(x.default.vErrors,null),s.let(x.default.errors,0),t.unevaluated&&vw(r),bh(r),xw(r)})}function vw(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 dh(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 bw(r,e){if(_h(r)&&(vh(r),yh(r))){ww(r,e);return}(0,mh.boolOrEmptySchema)(r,e)}function yh({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 ww(r,e){let{schema:t,gen:s,opts:i}=r;i.$comment&&t.$comment&&wh(r),Sw(r),Ow(r);let n=s.const("_errs",x.default.errors);bh(r,n),s.var(e,(0,w._)`${n} === ${x.default.errors}`)}function vh(r){(0,ht.checkUnknownRules)(r),$w(r)}function bh(r,e){if(r.opts.jtd)return fh(r,[],!1,e);let t=(0,hh.getSchemaTypes)(r.schema),s=(0,hh.coerceAndCheckDataType)(r,t);fh(r,t,!s,e)}function $w(r){let{schema:e,errSchemaPath:t,opts:s,self:i}=r;e.$ref&&s.ignoreKeywordsWithRef&&(0,ht.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function Ew(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,ht.checkStrictMode)(r,"default is ignored in the schema root")}function Sw(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,pw.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function Ow(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function wh({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 xw(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&&Tw(r),e.return((0,w._)`${x.default.errors} === 0`))}function Tw({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 fh(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,ht.schemaHasRulesButRef)(n,l))){i.block(()=>Eh(r,"$ref",l.all.$ref.definition));return}u.jtd||Pw(r,e),i.block(()=>{for(let f of l.rules)h(f);h(l.post)});function h(f){(0,yo.shouldUseGroup)(n,f)&&(f.type?(i.if((0,ci.checkDataType)(f.type,o,u.strictNumbers)),ph(r,f),e.length===1&&e[0]===f.type&&t&&(i.else(),(0,ci.reportTypeError)(r)),i.endIf()):ph(r,f),a||i.if((0,w._)`${x.default.errors} === ${s||0}`))}}function ph(r,e){let{gen:t,schema:s,opts:{useDefaults:i}}=r;i&&(0,fw.assignDefaults)(r,e.type),t.block(()=>{for(let n of e.rules)(0,yo.shouldUseRule)(s,n)&&Eh(r,n.keyword,n.definition,e.type)})}function Pw(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(Iw(r,e),r.opts.allowUnionTypes||Aw(r,e),Cw(r,r.dataTypes))}function Iw(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{$h(r.dataTypes,t)||_o(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),Nw(r,e)}}function Aw(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&_o(r,"use allowUnionTypes to allow union type keyword")}function Cw(r,e){let t=r.self.RULES.all;for(let s in t){let i=t[s];if(typeof i=="object"&&(0,yo.shouldUseRule)(r.schema,i)){let{type:n}=i.definition;n.length&&!n.some(o=>Rw(e,o))&&_o(r,`missing type "${n.join(",")}" for keyword "${s}"`)}}}function Rw(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function $h(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function Nw(r,e){let t=[];for(let s of r.dataTypes)$h(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,ht.checkStrictMode)(r,e,r.opts.strictTypes)}var li=class{constructor(e,t,s){if((0,rs.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,ht.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",Sh(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,rs.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?ts.reportExtraError:ts.reportError)(this,this.def.error,t)}$dataError(){(0,ts.reportError)(this,this.def.$dataError||ts.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ts.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,ci.checkDataTypes)(u,t,n.opts.strictNumbers,ci.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,go.getSubschema)(this.it,e);(0,go.extendSubschemaData)(s,this.it,e),(0,go.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=ht.mergeEvaluated.props(i,e.props,s.props,t)),s.items!==!0&&e.items!==void 0&&(s.items=ht.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}};Pt.KeywordCxt=li;function Eh(r,e,t,s){let i=new li(r,t,e);"code"in t?t.code(i,s):i.$data&&t.validate?(0,rs.funcKeywordCode)(i,t):"macro"in t?(0,rs.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,rs.funcKeywordCode)(i,t)}var qw=/^\/(?:[^~]|~0|~1)*$/,kw=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Sh(r,{dataLevel:e,dataNames:t,dataPathArr:s}){let i,n;if(r==="")return x.default.rootData;if(r[0]==="/"){if(!qw.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,n=x.default.rootData}else{let c=kw.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,ht.unescapeJsonPointer)(c))}`,o=(0,w._)`${o} && ${n}`);return o;function u(c,l){return`Cannot access ${c} ${l} levels up, current level is ${e}`}}Pt.getData=Sh});var ss=d(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});var vo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};bo.default=vo});var hr=d(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});var wo=es(),$o=class extends Error{constructor(e,t,s,i){super(i||`can't resolve reference ${s} from id ${t}`),this.missingRef=(0,wo.resolveUrl)(e,t,s),this.missingSchema=(0,wo.normalizeId)((0,wo.getFullPath)(e,this.missingRef))}};Eo.default=$o});var is=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(),jw=ss(),zt=Ie(),Ue=es(),Oh=R(),Dw=lr(),dr=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=dr;function Oo(r){let e=xh.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:jw.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:zt.default.data,parentData:zt.default.parentData,parentDataProperty:zt.default.parentDataProperty,dataNames:[zt.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,Dw.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();l=`${o.scopeRefs(zt.default.scope)}return ${h}`,this.opts.code.process&&(l=this.opts.code.process(l,r));let p=new Function(`${zt.default.self}`,`${zt.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=Oo;function Mw(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=Fw.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 dr({schema:o,schemaId:a,root:r,baseId:e}))}if(n!==void 0)return r.refs[t]=Lw.call(this,n)}Ce.resolveRef=Mw;function Lw(r){return(0,Ue.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:Oo.call(this,r)}function xh(r){for(let e of this._compilations)if(Vw(e,r))return e}Ce.getCompilingSchema=xh;function Vw(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function Fw(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||hi.call(this,r,e)}function hi(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 So.call(this,t,r);let n=(0,Ue.normalizeId)(s),o=this.refs[n]||this.schemas[n];if(typeof o=="string"){let a=hi.call(this,r,o);return typeof a?.schema!="object"?void 0:So.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Oo.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 dr({schema:a,schemaId:u,root:r,baseId:i})}return So.call(this,t,o)}}Ce.resolveSchema=hi;var Uw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function So(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,Oh.unescapeFragment)(a)];if(u===void 0)return;t=u;let c=typeof t=="object"&&t[this.opts.schemaId];!Uw.has(a)&&c&&(e=(0,Ue.resolveUrl)(this.opts.uriResolver,e,c))}let n;if(typeof t!="boolean"&&t.$ref&&!(0,Oh.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Ue.resolveUrl)(this.opts.uriResolver,e,t.$ref);n=hi.call(this,s,a)}let{schemaId:o}=this.opts;if(n=n||new dr({schema:t,schemaId:o,root:s,baseId:e}),n.schema!==n.root.schema)return n}});var Th=d((dq,Hw)=>{Hw.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 Po=d((fq,Nh)=>{"use strict";var Gw=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ih=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),xo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ah=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),zw=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function To(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 Bw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Ph(r){return r.length=0,!0}function Ww(r,e,t){if(r.length){let s=To(r);if(s!=="")e.push(s);else return t.error=!0,!1;r.length=0}return!0}function Kw(r){let e=0,t={error:!1,address:"",zone:""},s=[],i=[],n=!1,o=!1,a=Ww;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=Ph}else{i.push(c);continue}}return i.length&&(a===Ph?t.zone=i.join(""):o?s.push(i.join("")):s.push(To(i))),t.address=s.join(""),t}function Ch(r){if(Yw(r,":")<2)return{host:r,isIPV6:!1};let e=Kw(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 Yw(r,e){let t=0;for(let s=0;s<r.length;s++)r[s]===e&&t++;return t}function Xw(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 Jw={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Zw=/[@/?#:]/g,Qw=/[@/?#]/g;function Rh(r,e){let t=e?Qw:Zw;return t.lastIndex=0,r.replace(t,s=>Jw[s])}function e$(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(xo(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));e&&Ah(o)?t+=o:t+="%"+n,s+=2;continue}}t+=r[s]}return t}function t$(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(xo(s)){let i=s.toUpperCase(),n=String.fromCharCode(parseInt(i,16));n!=="."&&Ah(n)?e+=n:e+="%"+i,t+=2;continue}}zw(r[t])?e+=r[t]:e+=escape(r[t])}return e}function r$(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(xo(s)){e+="%"+s.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function s$(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!Ih(t)){let s=Ch(t);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=Rh(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}Nh.exports={nonSimpleDomain:Bw,recomposeAuthority:s$,reescapeHostDelimiters:Rh,normalizePercentEncoding:e$,normalizePathEncoding:t$,escapePreservingEscapes:r$,removeDotSegments:Xw,isIPv4:Ih,isUUID:Gw,normalizeIPv6:Ch,stringArrayToHexStripped:To}});var Mh=d((pq,Dh)=>{"use strict";var{isUUID:i$}=Po(),n$=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o$=["http","https","ws","wss","urn","urn:uuid"];function a$(r){return o$.indexOf(r)!==-1}function Io(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 qh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function kh(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=Io(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function c$(r){if((r.port===(Io(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 l$(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(n$);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=Ao(i);r.path=void 0,n&&(r=n.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function h$(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=Ao(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 d$(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!i$(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function f$(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var jh={scheme:"http",domainHost:!0,parse:qh,serialize:kh},p$={scheme:"https",domainHost:jh.domainHost,parse:qh,serialize:kh},di={scheme:"ws",domainHost:!0,parse:u$,serialize:c$},m$={scheme:"wss",domainHost:di.domainHost,parse:di.parse,serialize:di.serialize},g$={scheme:"urn",parse:l$,serialize:h$,skipNormalize:!0},y$={scheme:"urn:uuid",parse:d$,serialize:f$,skipNormalize:!0},fi={http:jh,https:p$,ws:di,wss:m$,urn:g$,"urn:uuid":y$};Object.setPrototypeOf(fi,null);function Ao(r){return r&&(fi[r]||fi[r.toLowerCase()])||void 0}Dh.exports={wsIsSecure:Io,SCHEMES:fi,isValidSchemeName:a$,getSchemeHandler:Ao}});var Gh=d((mq,pi)=>{"use strict";var{normalizeIPv6:_$,removeDotSegments:ns,recomposeAuthority:v$,normalizePercentEncoding:b$,normalizePathEncoding:w$,escapePreservingEscapes:$$,reescapeHostDelimiters:E$,isIPv4:S$,nonSimpleDomain:O$}=Po(),{SCHEMES:x$,getSchemeHandler:Vh}=Mh();function T$(r,e){return typeof r=="string"?r=R$(r,e):typeof r=="object"&&(r=fr(Bt(r,e),e)),r}function P$(r,e,t){let s=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=Fh(fr(r,s),fr(e,s),s,!0);return s.skipEscape=!0,Bt(i,s)}function Fh(r,e,t,s){let i={};return s||(r=fr(Bt(r,t),t),e=fr(Bt(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=ns(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=ns(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=ns(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=ns(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 I$(r,e,t){let s=Lh(r,t),i=Lh(e,t);return s!==void 0&&i!==void 0&&s.toLowerCase()===i.toLowerCase()}function Bt(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=Vh(s.scheme||t.scheme);n&&n.serialize&&n.serialize(t,s),t.path!==void 0&&(s.skipEscape?t.path=b$(t.path):(t.path=$$(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),s.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let o=v$(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=ns(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 A$=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function C$(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 Uh(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(A$);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=C$(s,o);if(a!==void 0&&(s.error=s.error||a,i=!0),s.host)if(S$(s.host)===!1){let l=_$(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=Vh(t.scheme||s.scheme);if(!t.unicodeSupport&&(!u||!u.unicodeSupport)&&s.host&&(t.domainHost||u&&u.domainHost)&&n===!1&&O$(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=E$(unescape(s.host),n))),s.path&&(s.path=w$(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 fr(r,e){return Uh(r,e).parsed}function R$(r,e){return Hh(r,e).normalized}function Hh(r,e){let{parsed:t,malformedAuthorityOrPort:s}=Uh(r,e);return{normalized:s?r:Bt(t,e),malformedAuthorityOrPort:s}}function Lh(r,e){if(typeof r=="string"){let{normalized:t,malformedAuthorityOrPort:s}=Hh(r,e);return s?void 0:t}if(typeof r=="object")return Bt(r,e)}var Co={SCHEMES:x$,normalize:T$,resolve:P$,resolveComponent:Fh,equal:I$,serialize:Bt,parse:fr};pi.exports=Co;pi.exports.default=Co;pi.exports.fastUri=Co});var Bh=d(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});var zh=Gh();zh.code='require("ajv/dist/runtime/uri").default';Ro.default=zh});var ko=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 N$=lr();Object.defineProperty(oe,"KeywordCxt",{enumerable:!0,get:function(){return N$.KeywordCxt}});var pr=T();Object.defineProperty(oe,"_",{enumerable:!0,get:function(){return pr._}});Object.defineProperty(oe,"str",{enumerable:!0,get:function(){return pr.str}});Object.defineProperty(oe,"stringify",{enumerable:!0,get:function(){return pr.stringify}});Object.defineProperty(oe,"nil",{enumerable:!0,get:function(){return pr.nil}});Object.defineProperty(oe,"Name",{enumerable:!0,get:function(){return pr.Name}});Object.defineProperty(oe,"CodeGen",{enumerable:!0,get:function(){return pr.CodeGen}});var q$=ss(),Jh=hr(),k$=no(),os=is(),j$=T(),as=es(),mi=Qr(),qo=R(),Wh=Th(),D$=Bh(),Zh=(r,e)=>new RegExp(r,e);Zh.code="new RegExp";var M$=["removeAdditional","useDefaults","coerceTypes"],L$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),V$={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."},F$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Kh=200;function U$(r){var e,t,s,i,n,o,a,u,c,l,h,f,p,m,g,y,_,S,O,E,$,ce,U,De,xe;let G=r.strict,N=(e=r.code)===null||e===void 0?void 0:e.optimize,Ks=N===!0||N===void 0?1:N||0,Vr=(s=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&s!==void 0?s:Zh,Me=(i=r.uriResolver)!==null&&i!==void 0?i:D$.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:Ks,regExp:Vr}:{optimize:Ks,regExp:Vr},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:Kh,loopEnum:(y=r.loopEnum)!==null&&y!==void 0?y:Kh,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:(ce=r.validateSchema)!==null&&ce!==void 0?ce:!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 us=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...U$(e)};let{es5:t,lines:s}=this.opts.code;this.scope=new j$.ValueScope({scope:{},prefixes:L$,es5:t,lines:s}),this.logger=K$(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,k$.getRules)(),Yh.call(this,V$,e,"NOT SUPPORTED"),Yh.call(this,F$,e,"DEPRECATED","warn"),this._metaOpts=B$.call(this),e.formats&&G$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&z$.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),H$.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:s}=this.opts,i=Wh;s==="id"&&(i={...Wh},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 Jh.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,as.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=Xh.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:s}=this.opts,i=new os.SchemaEnv({schema:{},schemaId:s});if(t=os.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=Xh.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,as.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(X$.call(this,s,t),!t)return(0,qo.eachItem)(s,n=>No.call(this,n)),this;Z$.call(this,t);let i={...t,type:(0,mi.getJSONTypes)(t.type),schemaType:(0,mi.getJSONTypes)(t.schemaType)};return(0,qo.eachItem)(s,i.type.length===0?n=>No.call(this,n,i):n=>i.type.forEach(o=>No.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]=Qh(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,as.normalizeId)(o||s);let c=as.getSchemaRefs.call(this,e,s);return u=new os.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):os.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{os.compileSchema.call(this,e)}finally{this.opts=t}}};us.ValidationError=q$.default;us.MissingRefError=Jh.default;oe.default=us;function Yh(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 Xh(r){return r=(0,as.normalizeId)(r),this.schemas[r]||this.refs[r]}function H$(){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 G$(){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 B$(){let r={...this.opts};for(let e of M$)delete r[e];return r}var W$={log(){},warn(){},error(){}};function K$(r){if(r===!1)return W$;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 Y$=/^[a-z_$][a-z0-9_$:-]*$/i;function X$(r,e){let{RULES:t}=this;if((0,qo.eachItem)(r,s=>{if(t.keywords[s])throw new Error(`Keyword ${s} is already defined`);if(!Y$.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 No(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,mi.getJSONTypes)(e.type),schemaType:(0,mi.getJSONTypes)(e.schemaType)}};e.before?J$.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 J$(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 Z$(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=Qh(e)),r.validateSchema=this.compile(e,!0))}var Q$={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Qh(r){return{anyOf:[r,Q$]}}});var ed=d(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});var eE={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};jo.default=eE});var _i=d(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.callRef=Wt.getValidate=void 0;var tE=hr(),td=Ae(),Ee=T(),mr=Ie(),rd=is(),gi=R(),rE={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=rd.resolveRef.call(u,c,i,t);if(l===void 0)throw new tE.default(s.opts.uriResolver,i,t);if(l instanceof rd.SchemaEnv)return f(l);return p(l);function h(){if(n===c)return yi(r,o,n,n.$async);let m=e.scopeValue("root",{ref:c});return yi(r,(0,Ee._)`${m}.validate`,c,c.$async)}function f(m){let g=sd(r,m);yi(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 sd(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Ee._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Wt.getValidate=sd;function yi(r,e,t,s){let{gen:i,it:n}=r,{allErrors:o,schemaEnv:a,opts:u}=n,c=u.passContext?mr.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,td.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,td.callValidateCode)(r,e,c),()=>p(e),()=>f(e))}function f(m){let g=(0,Ee._)`${m}.errors`;i.assign(mr.default.vErrors,(0,Ee._)`${mr.default.vErrors} === null ? ${g} : ${mr.default.vErrors}.concat(${g})`),i.assign(mr.default.errors,(0,Ee._)`${mr.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=gi.mergeEvaluated.props(i,y.props,n.props));else{let _=i.var("props",(0,Ee._)`${m}.evaluated.props`);n.props=gi.mergeEvaluated.props(i,_,n.props,Ee.Name)}if(n.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(n.items=gi.mergeEvaluated.items(i,y.items,n.items));else{let _=i.var("items",(0,Ee._)`${m}.evaluated.items`);n.items=gi.mergeEvaluated.items(i,_,n.items,Ee.Name)}}}Wt.callRef=yi;Wt.default=rE});var Mo=d(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var sE=ed(),iE=_i(),nE=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",sE.default,iE.default];Do.default=nE});var id=d(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});var vi=T(),It=vi.operators,bi={maximum:{okStr:"<=",ok:It.LTE,fail:It.GT},minimum:{okStr:">=",ok:It.GTE,fail:It.LT},exclusiveMaximum:{okStr:"<",ok:It.LT,fail:It.GTE},exclusiveMinimum:{okStr:">",ok:It.GT,fail:It.LTE}},oE={message:({keyword:r,schemaCode:e})=>(0,vi.str)`must be ${bi[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,vi._)`{comparison: ${bi[r].okStr}, limit: ${e}}`},aE={keyword:Object.keys(bi),type:"number",schemaType:"number",$data:!0,error:oE,code(r){let{keyword:e,data:t,schemaCode:s}=r;r.fail$data((0,vi._)`${t} ${bi[e].fail} ${s} || isNaN(${t})`)}};Lo.default=aE});var nd=d(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var cs=T(),uE={message:({schemaCode:r})=>(0,cs.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,cs._)`{multipleOf: ${r}}`},cE={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,cs._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,cs._)`${o} !== parseInt(${o})`;r.fail$data((0,cs._)`(${s} === 0 || (${o} = ${t}/${s}, ${a}))`)}};Vo.default=cE});var ad=d(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});function od(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}Fo.default=od;od.code='require("ajv/dist/runtime/ucs2length").default'});var ud=d(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});var Kt=T(),lE=R(),hE=ad(),dE={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Kt.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Kt._)`{limit: ${r}}`},fE={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:dE,code(r){let{keyword:e,data:t,schemaCode:s,it:i}=r,n=e==="maxLength"?Kt.operators.GT:Kt.operators.LT,o=i.opts.unicode===!1?(0,Kt._)`${t}.length`:(0,Kt._)`${(0,lE.useFunc)(r.gen,hE.default)}(${t})`;r.fail$data((0,Kt._)`${o} ${n} ${s}`)}};Uo.default=fE});var cd=d(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var pE=Ae(),mE=R(),gr=T(),gE={message:({schemaCode:r})=>(0,gr.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,gr._)`{pattern: ${r}}`},yE={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:gE,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,gr._)`new RegExp`:(0,mE.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,gr._)`${c}(${n}, ${a}).test(${t})`),()=>e.assign(l,!1)),r.fail$data((0,gr._)`!${l}`)}else{let u=(0,pE.usePattern)(r,i);r.fail$data((0,gr._)`!${u}.test(${t})`)}}};Ho.default=yE});var ld=d(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var ls=T(),_E={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,ls.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,ls._)`{limit: ${r}}`},vE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_E,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxProperties"?ls.operators.GT:ls.operators.LT;r.fail$data((0,ls._)`Object.keys(${t}).length ${i} ${s}`)}};Go.default=vE});var hd=d(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});var hs=Ae(),ds=T(),bE=R(),wE={message:({params:{missingProperty:r}})=>(0,ds.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,ds._)`{missingProperty: ${r}}`},$E={keyword:"required",type:"object",schemaType:"array",$data:!0,error:wE,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,bE.checkStrictMode)(o,_,o.opts.strictRequired)}}function c(){if(u||n)r.block$data(ds.nil,h);else for(let p of t)(0,hs.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,hs.checkMissingProp)(r,t,p)),(0,hs.reportMissingProp)(r,p),e.else()}function h(){e.forOf("prop",s,p=>{r.setParams({missingProperty:p}),e.if((0,hs.noPropertyInData)(e,i,p,a.ownProperties),()=>r.error())})}function f(p,m){r.setParams({missingProperty:p}),e.forOf(p,s,()=>{e.assign(m,(0,hs.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ds.not)(m),()=>{r.error(),e.break()})},ds.nil)}}};zo.default=$E});var dd=d(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});var fs=T(),EE={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,fs.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,fs._)`{limit: ${r}}`},SE={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:EE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxItems"?fs.operators.GT:fs.operators.LT;r.fail$data((0,fs._)`${t}.length ${i} ${s}`)}};Bo.default=SE});var wi=d(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});var fd=po();fd.code='require("ajv/dist/runtime/equal").default';Wo.default=fd});var pd=d(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var Ko=Qr(),ae=T(),OE=R(),xE=wi(),TE={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}}`},PE={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:TE,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,Ko.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,Ko.checkDataTypes)(c,y,a.opts.strictNumbers,Ko.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,OE.useFunc)(e,xE.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(_)})))}}};Yo.default=PE});var md=d(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var Xo=T(),IE=R(),AE=wi(),CE={message:"must be equal to constant",params:({schemaCode:r})=>(0,Xo._)`{allowedValue: ${r}}`},RE={keyword:"const",$data:!0,error:CE,code(r){let{gen:e,data:t,$data:s,schemaCode:i,schema:n}=r;s||n&&typeof n=="object"?r.fail$data((0,Xo._)`!${(0,IE.useFunc)(e,AE.default)}(${t}, ${i})`):r.fail((0,Xo._)`${n} !== ${t}`)}};Jo.default=RE});var gd=d(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});var ps=T(),NE=R(),qE=wi(),kE={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,ps._)`{allowedValues: ${r}}`},jE={keyword:"enum",schemaType:"array",$data:!0,error:kE,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,NE.useFunc)(e,qE.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,ps.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,ps._)`${c()}(${t}, ${p})`,()=>e.assign(l,!0).break()))}function f(p,m){let g=i[m];return typeof g=="object"&&g!==null?(0,ps._)`${c()}(${t}, ${p}[${m}])`:(0,ps._)`${t} === ${g}`}}};Zo.default=jE});var ea=d(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var DE=id(),ME=nd(),LE=ud(),VE=cd(),FE=ld(),UE=hd(),HE=dd(),GE=pd(),zE=md(),BE=gd(),WE=[DE.default,ME.default,LE.default,VE.default,FE.default,UE.default,HE.default,GE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zE.default,BE.default];Qo.default=WE});var ra=d(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.validateAdditionalItems=void 0;var Yt=T(),ta=R(),KE={message:({params:{len:r}})=>(0,Yt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Yt._)`{limit: ${r}}`},YE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:KE,code(r){let{parentSchema:e,it:t}=r,{items:s}=e;if(!Array.isArray(s)){(0,ta.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}yd(r,s)}};function yd(r,e){let{gen:t,schema:s,data:i,keyword:n,it:o}=r;o.items=!0;let a=t.const("len",(0,Yt._)`${i}.length`);if(s===!1)r.setParams({len:e.length}),r.pass((0,Yt._)`${a} <= ${e.length}`);else if(typeof s=="object"&&!(0,ta.alwaysValidSchema)(o,s)){let c=t.var("valid",(0,Yt._)`${a} <= ${e.length}`);t.if((0,Yt.not)(c),()=>u(c)),r.ok(c)}function u(c){t.forRange("i",e.length,a,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:ta.Type.Num},c),o.allErrors||t.if((0,Yt.not)(c),()=>t.break())})}}ms.validateAdditionalItems=yd;ms.default=YE});var sa=d(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.validateTuple=void 0;var _d=T(),$i=R(),XE=Ae(),JE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return vd(r,"additionalItems",e);t.items=!0,!(0,$i.alwaysValidSchema)(t,e)&&r.ok((0,XE.validateArray)(r))}};function vd(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=$i.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,$i.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,$i.checkStrictMode)(a,y,f.strictTuples)}}}gs.validateTuple=vd;gs.default=JE});var bd=d(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var ZE=sa(),QE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,ZE.validateTuple)(r,"items")};ia.default=QE});var $d=d(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var wd=T(),eS=R(),tS=Ae(),rS=ra(),sS={message:({params:{len:r}})=>(0,wd.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,wd._)`{limit: ${r}}`},iS={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:sS,code(r){let{schema:e,parentSchema:t,it:s}=r,{prefixItems:i}=t;s.items=!0,!(0,eS.alwaysValidSchema)(s,e)&&(i?(0,rS.validateAdditionalItems)(r,i):r.ok((0,tS.validateArray)(r)))}};na.default=iS});var Ed=d(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var Re=T(),Ei=R(),nS={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}}`},oS={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:nS,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,Ei.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Ei.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Ei.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:Ei.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)))}}};oa.default=oS});var Si=d(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.validateSchemaDeps=Qe.validatePropertyDeps=Qe.error=void 0;var aa=T(),aS=R(),ys=Ae();Qe.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let s=e===1?"property":"properties";return(0,aa.str)`must have ${s} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:s}})=>(0,aa._)`{property: ${r},
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
4
+ || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,A._)`+${i}`);return;case"integer":s.elseIf((0,A._)`${o} === "boolean" || ${i} === null
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},
7
7
  missingProperty: ${s},
8
8
  depsCount: ${e},
9
- deps: ${t}}`};var uS={keyword:"dependencies",type:"object",schemaType:"object",error:Qe.error,code(r){let[e,t]=cS(r);Sd(r,e),Od(r,t)}};function cS({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 Sd(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,ys.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,ys.checkReportMissingProp)(r,c)}):(t.if((0,aa._)`${u} && (${(0,ys.checkMissingProp)(r,a,n)})`),(0,ys.reportMissingProp)(r,n),t.else())}}Qe.validatePropertyDeps=Sd;function Od(r,e=r.schema){let{gen:t,data:s,keyword:i,it:n}=r,o=t.name("valid");for(let a in e)(0,aS.alwaysValidSchema)(n,e[a])||(t.if((0,ys.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=Od;Qe.default=uS});var Td=d(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var xd=T(),lS=R(),hS={message:"property name must be valid",params:({params:r})=>(0,xd._)`{propertyName: ${r.propertyName}}`},dS={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:hS,code(r){let{gen:e,schema:t,data:s,it:i}=r;if((0,lS.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,xd.not)(n),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(n)}};ua.default=dS});var la=d(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var Oi=Ae(),He=T(),fS=Ie(),xi=R(),pS={message:"must NOT have additional properties",params:({params:r})=>(0,He._)`{additionalProperty: ${r.additionalProperty}}`},mS={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:pS,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,xi.alwaysValidSchema)(o,t))return;let c=(0,Oi.allSchemaProperties)(s.properties),l=(0,Oi.allSchemaProperties)(s.patternProperties);h(),r.ok((0,He._)`${n} === ${fS.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,xi.schemaRefOrVal)(o,s.properties,"properties");_=(0,Oi.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,Oi.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,xi.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:xi.Type.Str};S===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(O,_)}}};ca.default=mS});var Ad=d(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var gS=lr(),Pd=Ae(),ha=R(),Id=la(),yS={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&&Id.default.code(new gS.KeywordCxt(n,Id.default,"additionalProperties"));let o=(0,Pd.allSchemaProperties)(t);for(let h of o)n.definedProperties.add(h);n.opts.unevaluated&&o.length&&n.props!==!0&&(n.props=ha.mergeEvaluated.props(e,(0,ha.toHash)(o),n.props));let a=o.filter(h=>!(0,ha.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,Pd.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)}}};da.default=yS});var qd=d(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var Cd=Ae(),Ti=T(),Rd=R(),Nd=R(),_S={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,Cd.allSchemaProperties)(t),u=a.filter(g=>(0,Rd.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 Ti.Name)&&(n.props=(0,Nd.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,Rd.checkStrictMode)(n,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){e.forIn("key",s,y=>{e.if((0,Ti._)`${(0,Cd.usePattern)(r,g)}.test(${y})`,()=>{let _=u.includes(g);_||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:Nd.Type.Str},l),n.opts.unevaluated&&h!==!0?e.assign((0,Ti._)`${h}[${y}]`,!0):!_&&!n.allErrors&&e.if((0,Ti.not)(l),()=>e.break())})})}}};fa.default=_S});var kd=d(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var vS=R(),bS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:s}=r;if((0,vS.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"}};pa.default=bS});var jd=d(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var wS=Ae(),$S={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wS.validateUnion,error:{message:"must match a schema in anyOf"}};ma.default=$S});var Dd=d(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Pi=T(),ES=R(),SS={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,Pi._)`{passingSchemas: ${r.passing}}`},OS={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:SS,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,ES.alwaysValidSchema)(i,l)?e.var(u,!0):f=r.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Pi._)`${u} && ${o}`).assign(o,!1).assign(a,(0,Pi._)`[${a}, ${h}]`).else(),e.if(u,()=>{e.assign(o,!0),e.assign(a,h),f&&r.mergeEvaluated(f,Pi.Name)})})}}};ga.default=OS});var Md=d(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var xS=R(),TS={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,xS.alwaysValidSchema)(s,n))return;let a=r.subschema({keyword:"allOf",schemaProp:o},i);r.ok(i),r.mergeEvaluated(a)})}};ya.default=TS});var Fd=d(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var Ii=T(),Vd=R(),PS={message:({params:r})=>(0,Ii.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Ii._)`{failingKeyword: ${r.ifClause}}`},IS={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:PS,code(r){let{gen:e,parentSchema:t,it:s}=r;t.then===void 0&&t.else===void 0&&(0,Vd.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let i=Ld(s,"then"),n=Ld(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,Ii.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,Ii._)`${l}`):r.setParams({ifClause:l})}}}};function Ld(r,e){let t=r.schema[e];return t!==void 0&&!(0,Vd.alwaysValidSchema)(r,t)}_a.default=IS});var Ud=d(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var AS=R(),CS={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,AS.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};va.default=CS});var wa=d(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var RS=ra(),NS=bd(),qS=sa(),kS=$d(),jS=Ed(),DS=Si(),MS=Td(),LS=la(),VS=Ad(),FS=qd(),US=kd(),HS=jd(),GS=Dd(),zS=Md(),BS=Fd(),WS=Ud();function KS(r=!1){let e=[US.default,HS.default,GS.default,zS.default,BS.default,WS.default,MS.default,LS.default,DS.default,VS.default,FS.default];return r?e.push(NS.default,kS.default):e.push(RS.default,qS.default),e.push(jS.default),e}ba.default=KS});var Ea=d(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.dynamicAnchor=void 0;var $a=T(),YS=Ie(),Hd=is(),XS=_i(),JS={keyword:"$dynamicAnchor",schemaType:"string",code:r=>Gd(r,r.schema)};function Gd(r,e){let{gen:t,it:s}=r;s.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,$a._)`${YS.default.dynamicAnchors}${(0,$a.getProperty)(e)}`,n=s.errSchemaPath==="#"?s.validateName:ZS(r);t.if((0,$a._)`!${i}`,()=>t.assign(i,n))}_s.dynamicAnchor=Gd;function ZS(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 Hd.SchemaEnv({schema:t,schemaId:u,root:i,baseId:n,localRefs:o,meta:a});return Hd.compileSchema.call(s,c),(0,XS.getValidate)(r,c)}_s.default=JS});var Sa=d(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.dynamicRef=void 0;var zd=T(),QS=Ie(),Bd=_i(),eO={keyword:"$dynamicRef",schemaType:"string",code:r=>Wd(r,r.schema)};function Wd(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,zd._)`${QS.default.dynamicAnchors}${(0,zd.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,Bd.callRef)(r,u),t.let(c,!0)}):()=>(0,Bd.callRef)(r,u)}}vs.dynamicRef=Wd;vs.default=eO});var Kd=d(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var tO=Ea(),rO=R(),sO={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,tO.dynamicAnchor)(r,""):(0,rO.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Oa.default=sO});var Yd=d(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var iO=Sa(),nO={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,iO.dynamicRef)(r,r.schema)};xa.default=nO});var Xd=d(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var oO=Ea(),aO=Sa(),uO=Kd(),cO=Yd(),lO=[oO.default,aO.default,uO.default,cO.default];Ta.default=lO});var Zd=d(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Jd=Si(),hO={keyword:"dependentRequired",type:"object",schemaType:"object",error:Jd.error,code:r=>(0,Jd.validatePropertyDeps)(r)};Pa.default=hO});var Qd=d(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var dO=Si(),fO={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,dO.validateSchemaDeps)(r)};Ia.default=fO});var ef=d(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var pO=R(),mO={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,pO.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};Aa.default=mO});var tf=d(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var gO=Zd(),yO=Qd(),_O=ef(),vO=[gO.default,yO.default,_O.default];Ca.default=vO});var sf=d(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var At=T(),rf=R(),bO=Ie(),wO={message:"must NOT have unevaluated properties",params:({params:r})=>(0,At._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},$O={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:wO,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 At.Name?e.if((0,At._)`${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,At._)`${i} === ${bO.default.errors}`);function u(h){if(t===!1){r.setParams({unevaluatedProperty:h}),r.error(),o||e.break();return}if(!(0,rf.alwaysValidSchema)(n,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:rf.Type.Str},f),o||e.if((0,At.not)(f),()=>e.break())}}function c(h,f){return(0,At._)`!${h} || !${h}[${f}]`}function l(h,f){let p=[];for(let m in h)h[m]===!0&&p.push((0,At._)`${f} !== ${m}`);return(0,At.and)(...p)}}};Ra.default=$O});var of=d(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Xt=T(),nf=R(),EO={message:({params:{len:r}})=>(0,Xt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Xt._)`{limit: ${r}}`},SO={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:EO,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,Xt._)`${s}.length`);if(t===!1)r.setParams({len:n}),r.fail((0,Xt._)`${o} > ${n}`);else if(typeof t=="object"&&!(0,nf.alwaysValidSchema)(i,t)){let u=e.var("valid",(0,Xt._)`${o} <= ${n}`);e.if((0,Xt.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:nf.Type.Num},u),i.allErrors||e.if((0,Xt.not)(u),()=>e.break())})}}};Na.default=SO});var af=d(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var OO=sf(),xO=of(),TO=[OO.default,xO.default];qa.default=TO});var uf=d(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var re=T(),PO={message:({schemaCode:r})=>(0,re.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,re._)`{format: ${r}}`},IO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:PO,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 ce=$ 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:ce});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})`}}}};ka.default=IO});var Da=d(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var AO=uf(),CO=[AO.default];ja.default=CO});var Ma=d(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.contentVocabulary=yr.metadataVocabulary=void 0;yr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];yr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var lf=d(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var RO=Mo(),NO=ea(),qO=wa(),kO=Xd(),jO=tf(),DO=af(),MO=Da(),cf=Ma(),LO=[kO.default,RO.default,NO.default,(0,qO.default)(!0),MO.default,cf.metadataVocabulary,cf.contentVocabulary,jO.default,DO.default];La.default=LO});var df=d(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.DiscrError=void 0;var hf;(function(r){r.Tag="tag",r.Mapping="mapping"})(hf||(Ai.DiscrError=hf={}))});var Ua=d(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var _r=T(),Va=df(),ff=is(),VO=hr(),FO=R(),UO={message:({params:{discrError:r,tagName:e}})=>r===Va.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}}`},HO={keyword:"discriminator",type:"object",schemaType:"object",error:UO,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:Va.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:Va.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 E=0;E<o.length;E++){let $=o[E];if($?.$ref&&!(0,FO.schemaHasRulesButRef)($,n.self.RULES)){let U=$.$ref;if($=ff.resolveRef.call(n.self,n.schemaEnv.root,n.baseId,U),$ instanceof ff.SchemaEnv&&($=$.schema),$===void 0)throw new VO.default(n.opts.uriResolver,n.baseId,U)}let ce=(p=$?.properties)===null||p===void 0?void 0:p[a];if(typeof ce!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||_($)),S(ce,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 ce of E.enum)O(ce,$);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]=$}}}};Fa.default=HO});var pf=d((mk,GO)=>{GO.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((gk,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 gf=d((yk,BO)=>{BO.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 yf=d((_k,WO)=>{WO.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((vk,KO)=>{KO.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 vf=d((bk,YO)=>{YO.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 bf=d((wk,XO)=>{XO.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 wf=d(($k,JO)=>{JO.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 $f=d(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var ZO=pf(),QO=mf(),e1=gf(),t1=yf(),r1=_f(),s1=vf(),i1=bf(),n1=wf(),o1=["/properties"];function a1(r){return[ZO,QO,e1,t1,r1,e(this,s1),i1,e(this,n1)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,s){return r?t.$dataMetaSchema(s,o1):s}}Ha.default=a1});var Ef=d((B,za)=>{"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=ko(),c1=lf(),l1=Ua(),h1=$f(),Ga="https://json-schema.org/draft/2020-12/schema",vr=class extends u1.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),c1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(l1.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(h1.default.call(this,e),this.refs["http://json-schema.org/schema"]=Ga)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ga)?Ga:void 0)}};B.Ajv2020=vr;za.exports=B=vr;za.exports.Ajv2020=vr;Object.defineProperty(B,"__esModule",{value:!0});B.default=vr;var d1=lr();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return d1.KeywordCxt}});var br=T();Object.defineProperty(B,"_",{enumerable:!0,get:function(){return br._}});Object.defineProperty(B,"str",{enumerable:!0,get:function(){return br.str}});Object.defineProperty(B,"stringify",{enumerable:!0,get:function(){return br.stringify}});Object.defineProperty(B,"nil",{enumerable:!0,get:function(){return br.nil}});Object.defineProperty(B,"Name",{enumerable:!0,get:function(){return br.Name}});Object.defineProperty(B,"CodeGen",{enumerable:!0,get:function(){return br.CodeGen}});var f1=ss();Object.defineProperty(B,"ValidationError",{enumerable:!0,get:function(){return f1.default}});var p1=hr();Object.defineProperty(B,"MissingRefError",{enumerable:!0,get:function(){return p1.default}})});var Cf=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(Tf,Ya),time:et(Wa(!0),Xa),"date-time":et(Sf(!0),If),"iso-time":et(Wa(),Pf),"iso-date-time":et(Sf(),Af),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:b1,"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:T1,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:w1,int32:{type:"number",validate:S1},int64:{type:"number",validate:O1},float:{type:"number",validate:xf},double:{type:"number",validate:xf},password:!0,binary:!0};tt.fastFormats={...tt.fullFormats,date:et(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ya),time:et(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xa),"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,If),"iso-time":et(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Pf),"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,Af),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 m1(r){return r%4===0&&(r%100!==0||r%400===0)}var g1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,y1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Tf(r){let e=g1.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&&m1(t)?29:y1[s])}function Ya(r,e){if(r&&e)return r>e?1:r<e?-1:0}var Ba=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Wa(r){return function(t){let s=Ba.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 Xa(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 Pf(r,e){if(!(r&&e))return;let t=Ba.exec(r),s=Ba.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 Ka=/t|\s/i;function Sf(r){let e=Wa(r);return function(s){let i=s.split(Ka);return i.length===2&&Tf(i[0])&&e(i[1])}}function If(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}function Af(r,e){if(!(r&&e))return;let[t,s]=r.split(Ka),[i,n]=e.split(Ka),o=Ya(t,i);if(o!==void 0)return o||Xa(s,n)}var _1=/\/|:/,v1=/^(?:[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 b1(r){return _1.test(r)&&v1.test(r)}var Of=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w1(r){return Of.lastIndex=0,Of.test(r)}var $1=-(2**31),E1=2**31-1;function S1(r){return Number.isInteger(r)&&r<=E1&&r>=$1}function O1(r){return Number.isInteger(r)}function xf(){return!0}var x1=/[^\\]\\Z/;function T1(r){if(x1.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var Nf=d(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});var P1=Mo(),I1=ea(),A1=wa(),C1=Da(),Rf=Ma(),R1=[P1.default,I1.default,(0,A1.default)(),C1.default,Rf.metadataVocabulary,Rf.contentVocabulary];Ja.default=R1});var qf=d((xk,N1)=>{N1.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 jf=d((W,Za)=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.MissingRefError=W.ValidationError=W.CodeGen=W.Name=W.nil=W.stringify=W.str=W._=W.KeywordCxt=W.Ajv=void 0;var q1=ko(),k1=Nf(),j1=Ua(),kf=qf(),D1=["/properties"],Ci="http://json-schema.org/draft-07/schema",wr=class extends q1.default{_addVocabularies(){super._addVocabularies(),k1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(j1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(kf,D1):kf;this.addMetaSchema(e,Ci,!1),this.refs["http://json-schema.org/schema"]=Ci}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ci)?Ci:void 0)}};W.Ajv=wr;Za.exports=W=wr;Za.exports.Ajv=wr;Object.defineProperty(W,"__esModule",{value:!0});W.default=wr;var M1=lr();Object.defineProperty(W,"KeywordCxt",{enumerable:!0,get:function(){return M1.KeywordCxt}});var $r=T();Object.defineProperty(W,"_",{enumerable:!0,get:function(){return $r._}});Object.defineProperty(W,"str",{enumerable:!0,get:function(){return $r.str}});Object.defineProperty(W,"stringify",{enumerable:!0,get:function(){return $r.stringify}});Object.defineProperty(W,"nil",{enumerable:!0,get:function(){return $r.nil}});Object.defineProperty(W,"Name",{enumerable:!0,get:function(){return $r.Name}});Object.defineProperty(W,"CodeGen",{enumerable:!0,get:function(){return $r.CodeGen}});var L1=ss();Object.defineProperty(W,"ValidationError",{enumerable:!0,get:function(){return L1.default}});var V1=hr();Object.defineProperty(W,"MissingRefError",{enumerable:!0,get:function(){return V1.default}})});var Df=d(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.formatLimitDefinition=void 0;var F1=jf(),Ge=T(),Ct=Ge.operators,Ri={formatMaximum:{okStr:"<=",ok:Ct.LTE,fail:Ct.GT},formatMinimum:{okStr:">=",ok:Ct.GTE,fail:Ct.LT},formatExclusiveMaximum:{okStr:"<",ok:Ct.LT,fail:Ct.GTE},formatExclusiveMinimum:{okStr:">",ok:Ct.GT,fail:Ct.LTE}},U1={message:({keyword:r,schemaCode:e})=>(0,Ge.str)`should be ${Ri[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Ge._)`{comparison: ${Ri[r].okStr}, limit: ${e}}`};Er.formatLimitDefinition={keyword:Object.keys(Ri),type:"string",schemaType:"string",$data:!0,error:U1,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 F1.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}) ${Ri[i].fail} 0`}},dependencies:["format"]};var H1=r=>(r.addKeyword(Er.formatLimitDefinition),r);Er.default=H1});var Ff=d((bs,Vf)=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var Sr=Cf(),G1=Df(),Qa=T(),Mf=new Qa.Name("fullFormats"),z1=new Qa.Name("fastFormats"),eu=(r,e={keywords:!0})=>{if(Array.isArray(e))return Lf(r,e,Sr.fullFormats,Mf),r;let[t,s]=e.mode==="fast"?[Sr.fastFormats,z1]:[Sr.fullFormats,Mf],i=e.formats||Sr.formatNames;return Lf(r,i,t,s),e.keywords&&(0,G1.default)(r),r};eu.get=(r,e="full")=>{let s=(e==="fast"?Sr.fastFormats:Sr.fullFormats)[r];if(!s)throw new Error(`Unknown format "${r}"`);return s};function Lf(r,e,t,s){var i,n;(i=(n=r.opts.code).formats)!==null&&i!==void 0||(n.formats=(0,Qa._)`require("ajv-formats/dist/formats").${s}`);for(let o of e)r.addFormat(o,t[o])}Vf.exports=bs=eu;Object.defineProperty(bs,"__esModule",{value:!0});bs.default=eu});var ws=d((Ck,Uf)=>{"use strict";var ex="2.0.0",tx=Number.MAX_SAFE_INTEGER||9007199254740991,rx=16,sx=250,ix=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Uf.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rx,MAX_SAFE_BUILD_LENGTH:sx,MAX_SAFE_INTEGER:tx,RELEASE_TYPES:ix,SEMVER_SPEC_VERSION:ex,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var $s=d((Rk,Hf)=>{"use strict";var nx=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Hf.exports=nx});var Or=d((rt,Gf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:su,MAX_SAFE_BUILD_LENGTH:ox,MAX_LENGTH:ax}=ws(),ux=$s();rt=Gf.exports={};var cx=rt.re=[],lx=rt.safeRe=[],v=rt.src=[],hx=rt.safeSrc=[],b=rt.t={},dx=0,iu="[a-zA-Z0-9-]",fx=[["\\s",1],["\\d",ax],[iu,ox]],px=r=>{for(let[e,t]of fx)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},P=(r,e,t)=>{let s=px(e),i=dx++;ux(r,i,e),b[r]=i,v[i]=e,hx[i]=s,cx[i]=new RegExp(e,t?"g":void 0),lx[i]=new RegExp(s,t?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${iu}*`);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",`${iu}+`);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,${su}})(?:\\.(\\d{1,${su}}))?(?:\\.(\\d{1,${su}}))?`);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 Ni=d((Nk,zf)=>{"use strict";var mx=Object.freeze({loose:!0}),gx=Object.freeze({}),yx=r=>r?typeof r!="object"?mx:r:gx;zf.exports=yx});var nu=d((qk,Kf)=>{"use strict";var Bf=/^[0-9]+$/,Wf=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=Bf.test(r),s=Bf.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},_x=(r,e)=>Wf(e,r);Kf.exports={compareIdentifiers:Wf,rcompareIdentifiers:_x}});var fe=d((kk,Xf)=>{"use strict";var qi=$s(),{MAX_LENGTH:Yf,MAX_SAFE_INTEGER:ki}=ws(),{safeRe:ji,t:Di}=Or(),vx=Ni(),{compareIdentifiers:ou}=nu(),au=class r{constructor(e,t){if(t=vx(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>Yf)throw new TypeError(`version is longer than ${Yf} characters`);qi("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?ji[Di.LOOSE]:ji[Di.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>ki||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ki||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ki||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<ki)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(qi("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(qi("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 ou(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(qi("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 ou(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?ji[Di.PRERELEASELOOSE]:ji[Di.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]),ou(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}};Xf.exports=au});var Jt=d((jk,Zf)=>{"use strict";var Jf=fe(),bx=(r,e,t=!1)=>{if(r instanceof Jf)return r;try{return new Jf(r,e)}catch(s){if(!t)return null;throw s}};Zf.exports=bx});var ep=d((Dk,Qf)=>{"use strict";var wx=Jt(),$x=(r,e)=>{let t=wx(r,e);return t?t.version:null};Qf.exports=$x});var rp=d((Mk,tp)=>{"use strict";var Ex=Jt(),Sx=(r,e)=>{let t=Ex(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};tp.exports=Sx});var np=d((Lk,ip)=>{"use strict";var sp=fe(),Ox=(r,e,t,s,i)=>{typeof t=="string"&&(i=s,s=t,t=void 0);try{return new sp(r instanceof sp?r.version:r,t).inc(e,s,i).version}catch{return null}};ip.exports=Ox});var up=d((Vk,ap)=>{"use strict";var op=Jt(),xx=(r,e)=>{let t=op(r,null,!0),s=op(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"};ap.exports=xx});var lp=d((Fk,cp)=>{"use strict";var Tx=fe(),Px=(r,e)=>new Tx(r,e).major;cp.exports=Px});var dp=d((Uk,hp)=>{"use strict";var Ix=fe(),Ax=(r,e)=>new Ix(r,e).minor;hp.exports=Ax});var pp=d((Hk,fp)=>{"use strict";var Cx=fe(),Rx=(r,e)=>new Cx(r,e).patch;fp.exports=Rx});var gp=d((Gk,mp)=>{"use strict";var Nx=Jt(),qx=(r,e)=>{let t=Nx(r,e);return t&&t.prerelease.length?t.prerelease:null};mp.exports=qx});var Ne=d((zk,_p)=>{"use strict";var yp=fe(),kx=(r,e,t)=>new yp(r,t).compare(new yp(e,t));_p.exports=kx});var bp=d((Bk,vp)=>{"use strict";var jx=Ne(),Dx=(r,e,t)=>jx(e,r,t);vp.exports=Dx});var $p=d((Wk,wp)=>{"use strict";var Mx=Ne(),Lx=(r,e)=>Mx(r,e,!0);wp.exports=Lx});var Mi=d((Kk,Sp)=>{"use strict";var Ep=fe(),Vx=(r,e,t)=>{let s=new Ep(r,t),i=new Ep(e,t);return s.compare(i)||s.compareBuild(i)};Sp.exports=Vx});var xp=d((Yk,Op)=>{"use strict";var Fx=Mi(),Ux=(r,e)=>r.sort((t,s)=>Fx(t,s,e));Op.exports=Ux});var Pp=d((Xk,Tp)=>{"use strict";var Hx=Mi(),Gx=(r,e)=>r.sort((t,s)=>Hx(s,t,e));Tp.exports=Gx});var Es=d((Jk,Ip)=>{"use strict";var zx=Ne(),Bx=(r,e,t)=>zx(r,e,t)>0;Ip.exports=Bx});var Li=d((Zk,Ap)=>{"use strict";var Wx=Ne(),Kx=(r,e,t)=>Wx(r,e,t)<0;Ap.exports=Kx});var uu=d((Qk,Cp)=>{"use strict";var Yx=Ne(),Xx=(r,e,t)=>Yx(r,e,t)===0;Cp.exports=Xx});var cu=d((ej,Rp)=>{"use strict";var Jx=Ne(),Zx=(r,e,t)=>Jx(r,e,t)!==0;Rp.exports=Zx});var Vi=d((tj,Np)=>{"use strict";var Qx=Ne(),eT=(r,e,t)=>Qx(r,e,t)>=0;Np.exports=eT});var Fi=d((rj,qp)=>{"use strict";var tT=Ne(),rT=(r,e,t)=>tT(r,e,t)<=0;qp.exports=rT});var lu=d((sj,kp)=>{"use strict";var sT=uu(),iT=cu(),nT=Es(),oT=Vi(),aT=Li(),uT=Fi(),cT=(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 sT(r,t,s);case"!=":return iT(r,t,s);case">":return nT(r,t,s);case">=":return oT(r,t,s);case"<":return aT(r,t,s);case"<=":return uT(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};kp.exports=cT});var Dp=d((ij,jp)=>{"use strict";var lT=fe(),hT=Jt(),{safeRe:Ui,t:Hi}=Or(),dT=(r,e)=>{if(r instanceof lT)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?Ui[Hi.COERCEFULL]:Ui[Hi.COERCE]);else{let u=e.includePrerelease?Ui[Hi.COERCERTLFULL]:Ui[Hi.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 hT(`${s}.${i}.${n}${o}${a}`,e)};jp.exports=dT});var Lp=d((nj,Mp)=>{"use strict";var hu=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}};Mp.exports=hu});var qe=d((oj,Hp)=>{"use strict";var fT=/\s+/g,du=class r{constructor(e,t){if(t=mT(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof fu)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(fT," "),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=>!Fp(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&&$T(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){let s=((this.options.includePrerelease&&bT)|(this.options.loose&&wT))+":"+e,i=Vp.get(s);if(i)return i;let n=this.options.loose,o=n?ye[pe.HYPHENRANGELOOSE]:ye[pe.HYPHENRANGE];e=e.replace(o,RT(this.options.includePrerelease)),K("hyphen replace",e),e=e.replace(ye[pe.COMPARATORTRIM],yT),K("comparator trim",e),e=e.replace(ye[pe.TILDETRIM],_T),K("tilde trim",e),e=e.replace(ye[pe.CARETTRIM],vT),K("caret trim",e);let a=e.split(" ").map(h=>ET(h,this.options)).join(" ").split(/\s+/).map(h=>CT(h,this.options));n&&(a=a.filter(h=>(K("loose invalid filter",h,this.options),!!h.match(ye[pe.COMPARATORLOOSE])))),K("range list",a);let u=new Map,c=a.map(h=>new fu(h,this.options));for(let h of c){if(Fp(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return Vp.set(s,l),l}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(s=>Up(s,t)&&e.set.some(i=>Up(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 gT(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(NT(this.set[t],e,this.options))return!0;return!1}};Hp.exports=du;var pT=Lp(),Vp=new pT,mT=Ni(),fu=Ss(),K=$s(),gT=fe(),{safeRe:ye,t:pe,comparatorTrimReplace:yT,tildeTrimReplace:_T,caretTrimReplace:vT}=Or(),{FLAG_INCLUDE_PRERELEASE:bT,FLAG_LOOSE:wT}=ws(),Fp=r=>r.value==="<0.0.0-0",$T=r=>r.value==="",Up=(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},ET=(r,e)=>(r=r.replace(ye[pe.BUILD],""),K("comp",r,e),r=xT(r,e),K("caret",r),r=ST(r,e),K("tildes",r),r=PT(r,e),K("xrange",r),r=AT(r,e),K("stars",r),r),_e=r=>!r||r.toLowerCase()==="x"||r==="*",ST=(r,e)=>r.trim().split(/\s+/).map(t=>OT(t,e)).join(" "),OT=(r,e)=>{let t=e.loose?ye[pe.TILDELOOSE]:ye[pe.TILDE];return r.replace(t,(s,i,n,o,a)=>{K("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?(K("replaceTilde pr",a),u=`>=${i}.${n}.${o}-${a} <${i}.${+n+1}.0-0`):u=`>=${i}.${n}.${o} <${i}.${+n+1}.0-0`,K("tilde return",u),u})},xT=(r,e)=>r.trim().split(/\s+/).map(t=>TT(t,e)).join(" "),TT=(r,e)=>{K("caret",r,e);let t=e.loose?ye[pe.CARETLOOSE]:ye[pe.CARET],s=e.includePrerelease?"-0":"";return r.replace(t,(i,n,o,a,u)=>{K("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?(K("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`):(K("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`),K("caret return",c),c})},PT=(r,e)=>(K("replaceXRanges",r,e),r.split(/\s+/).map(t=>IT(t,e)).join(" ")),IT=(r,e)=>{r=r.trim();let t=e.loose?ye[pe.XRANGELOOSE]:ye[pe.XRANGE];return r.replace(t,(s,i,n,o,a,u)=>{K("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`),K("xRange return",s),s})},AT=(r,e)=>(K("replaceStars",r,e),r.trim().replace(ye[pe.STAR],"")),CT=(r,e)=>(K("replaceGTE0",r,e),r.trim().replace(ye[e.includePrerelease?pe.GTE0PRE:pe.GTE0],"")),RT=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()),NT=(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(K(r[s].semver),r[s].semver!==fu.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 Ss=d((aj,Yp)=>{"use strict";var Os=Symbol("SemVer ANY"),gu=class r{static get ANY(){return Os}constructor(e,t){if(t=Gp(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),mu("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Os?this.value="":this.value=this.operator+this.semver.version,mu("comp",this)}parse(e){let t=this.options.loose?zp[Bp.COMPARATORLOOSE]:zp[Bp.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 Wp(s[2],this.options.loose):this.semver=Os}toString(){return this.value}test(e){if(mu("Comparator.test",e,this.options.loose),this.semver===Os||e===Os)return!0;if(typeof e=="string")try{e=new Wp(e,this.options)}catch{return!1}return pu(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 Kp(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Kp(this.value,t).test(e.semver):(t=Gp(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("=")||pu(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||pu(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Yp.exports=gu;var Gp=Ni(),{safeRe:zp,t:Bp}=Or(),pu=lu(),mu=$s(),Wp=fe(),Kp=qe()});var xs=d((uj,Xp)=>{"use strict";var qT=qe(),kT=(r,e,t)=>{try{e=new qT(e,t)}catch{return!1}return e.test(r)};Xp.exports=kT});var Zp=d((cj,Jp)=>{"use strict";var jT=qe(),DT=(r,e)=>new jT(r,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));Jp.exports=DT});var em=d((lj,Qp)=>{"use strict";var MT=fe(),LT=qe(),VT=(r,e,t)=>{let s=null,i=null,n=null;try{n=new LT(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new MT(s,t))}),s};Qp.exports=VT});var rm=d((hj,tm)=>{"use strict";var FT=fe(),UT=qe(),HT=(r,e,t)=>{let s=null,i=null,n=null;try{n=new UT(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new FT(s,t))}),s};tm.exports=HT});var nm=d((dj,im)=>{"use strict";var yu=fe(),GT=qe(),sm=Es(),zT=(r,e)=>{r=new GT(r,e);let t=new yu("0.0.0");if(r.test(t)||(t=new yu("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 yu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!n||sm(a,n))&&(n=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),n&&(!t||sm(t,n))&&(t=n)}return t&&r.test(t)?t:null};im.exports=zT});var am=d((fj,om)=>{"use strict";var BT=qe(),WT=(r,e)=>{try{return new BT(r,e).range||"*"}catch{return null}};om.exports=WT});var Gi=d((pj,hm)=>{"use strict";var KT=fe(),lm=Ss(),{ANY:YT}=lm,XT=qe(),JT=xs(),um=Es(),cm=Li(),ZT=Fi(),QT=Vi(),eP=(r,e,t,s)=>{r=new KT(r,s),e=new XT(e,s);let i,n,o,a,u;switch(t){case">":i=um,n=ZT,o=cm,a=">",u=">=";break;case"<":i=cm,n=QT,o=um,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(JT(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===YT&&(p=new lm(">=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};hm.exports=eP});var fm=d((mj,dm)=>{"use strict";var tP=Gi(),rP=(r,e,t)=>tP(r,e,">",t);dm.exports=rP});var mm=d((gj,pm)=>{"use strict";var sP=Gi(),iP=(r,e,t)=>sP(r,e,"<",t);pm.exports=iP});var _m=d((yj,ym)=>{"use strict";var gm=qe(),nP=(r,e,t)=>(r=new gm(r,t),e=new gm(e,t),r.intersects(e,t));ym.exports=nP});var bm=d((_j,vm)=>{"use strict";var oP=xs(),aP=Ne();vm.exports=(r,e,t)=>{let s=[],i=null,n=null,o=r.sort((l,h)=>aP(l,h,t));for(let l of o)oP(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 xm=d((vj,Om)=>{"use strict";var wm=qe(),vu=Ss(),{ANY:_u}=vu,Ts=xs(),bu=Ne(),uP=(r,e,t={})=>{if(r===e)return!0;r=new wm(r,t),e=new wm(e,t);let s=!1;e:for(let i of r.set){for(let n of e.set){let o=lP(i,n,t);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},cP=[new vu(">=0.0.0-0")],$m=[new vu(">=0.0.0")],lP=(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=cP:r=$m}if(e.length===1&&e[0].semver===_u){if(t.includePrerelease)return!0;e=$m}let s=new Set,i,n;for(let p of r)p.operator===">"||p.operator===">="?i=Em(i,p,t):p.operator==="<"||p.operator==="<="?n=Sm(n,p,t):s.add(p.semver);if(s.size>1)return null;let o;if(i&&n){if(o=bu(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&&!Ts(p,String(i),t)||n&&!Ts(p,String(n),t))return null;for(let m of e)if(!Ts(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=Em(i,p,t),a===p&&a!==i)return!1}else if(i.operator===">="&&!Ts(i.semver,String(p),t))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=Sm(n,p,t),u===p&&u!==n)return!1}else if(n.operator==="<="&&!Ts(n.semver,String(p),t))return!1}if(!p.operator&&(n||i)&&o!==0)return!1}return!(i&&c&&!n&&o!==0||n&&l&&!i&&o!==0||f||h)},Em=(r,e,t)=>{if(!r)return e;let s=bu(r.semver,e.semver,t);return s>0?r:s<0||e.operator===">"&&r.operator===">="?e:r},Sm=(r,e,t)=>{if(!r)return e;let s=bu(r.semver,e.semver,t);return s<0?r:s>0||e.operator==="<"&&r.operator==="<="?e:r};Om.exports=uP});var Am=d((bj,Im)=>{"use strict";var wu=Or(),Tm=ws(),hP=fe(),Pm=nu(),dP=Jt(),fP=ep(),pP=rp(),mP=np(),gP=up(),yP=lp(),_P=dp(),vP=pp(),bP=gp(),wP=Ne(),$P=bp(),EP=$p(),SP=Mi(),OP=xp(),xP=Pp(),TP=Es(),PP=Li(),IP=uu(),AP=cu(),CP=Vi(),RP=Fi(),NP=lu(),qP=Dp(),kP=Ss(),jP=qe(),DP=xs(),MP=Zp(),LP=em(),VP=rm(),FP=nm(),UP=am(),HP=Gi(),GP=fm(),zP=mm(),BP=_m(),WP=bm(),KP=xm();Im.exports={parse:dP,valid:fP,clean:pP,inc:mP,diff:gP,major:yP,minor:_P,patch:vP,prerelease:bP,compare:wP,rcompare:$P,compareLoose:EP,compareBuild:SP,sort:OP,rsort:xP,gt:TP,lt:PP,eq:IP,neq:AP,gte:CP,lte:RP,cmp:NP,coerce:qP,Comparator:kP,Range:jP,satisfies:DP,toComparators:MP,maxSatisfying:LP,minSatisfying:VP,minVersion:FP,validRange:UP,outside:HP,gtr:GP,ltr:zP,intersects:BP,simplifyRange:WP,subset:KP,SemVer:hP,re:wu.re,src:wu.src,tokens:wu.t,SEMVER_SPEC_VERSION:Tm.SEMVER_SPEC_VERSION,RELEASE_TYPES:Tm.RELEASE_TYPES,compareIdentifiers:Pm.compareIdentifiers,rcompareIdentifiers:Pm.rcompareIdentifiers}});var ee=d((Ij,Vm)=>{"use strict";var{FORCE_COLOR:aI,NODE_DISABLE_COLORS:uI,TERM:cI}=process.env,L={enabled:!uI&&cI!=="dumb"&&aI!=="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 Lm(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 lI(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?Lm(this.keys,s+""):s+""):s===void 0?lI([r],[t]):L.enabled?Lm([t],s+""):s+""}}Vm.exports=L});var Um=d((Aj,Fm)=>{"use strict";Fm.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 Wi=d((Cj,Hm)=>{"use strict";Hm.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((Rj,Gm)=>{"use strict";var Tu={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"},hI={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},dI={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?Tu.up():"");return r&&(e+=Tu.left),e}};Gm.exports={cursor:Tu,scroll:hI,erase:dI,beep:"\x07"}});var Ym=d((Nj,Km)=>{"use strict";function fI(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=pI(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 pI(r,e){if(r){if(typeof r=="string")return zm(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 zm(r,e)}}function zm(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 mI=Wi(),Wm=te(),Bm=Wm.erase,gI=Wm.cursor,yI=r=>[...mI(r)].length;Km.exports=function(r,e){if(!e)return Bm.line+gI.to(0);let t=0,s=r.split(/\r?\n/);var i=fI(s),n;try{for(i.s();!(n=i.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(yI(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return Bm.lines(t)}});var Pu=d((qj,Xm)=>{"use strict";var Is={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},_I={arrowUp:Is.arrowUp,arrowDown:Is.arrowDown,arrowLeft:Is.arrowLeft,arrowRight:Is.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},vI=process.platform==="win32"?_I:Is;Xm.exports=vI});var Zm=d((kj,Jm)=>{"use strict";var Pr=ee(),Qt=Pu(),Iu=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}`}}),bI=r=>Iu[r]||Iu.default,As=Object.freeze({aborted:Pr.red(Qt.cross),done:Pr.green(Qt.tick),exited:Pr.yellow(Qt.cross),default:Pr.cyan("?")}),wI=(r,e,t)=>e?As.aborted:t?As.exited:r?As.done:As.default,$I=r=>Pr.gray(r?Qt.ellipsis:Qt.pointerSmall),EI=(r,e)=>Pr.gray(r?e?Qt.pointerSmall:"+":Qt.line);Jm.exports={styles:Iu,render:bI,symbols:As,symbol:wI,delimiter:$I,item:EI}});var eg=d((jj,Qm)=>{"use strict";var SI=Wi();Qm.exports=function(r,e){let t=String(SI(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var rg=d((Dj,tg)=>{"use strict";tg.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(`
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 AA(r,e){if(r){if(typeof r=="string")return Jm(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 Jm(r,e)}}function Jm(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 IA=Zi(),Qm=te(),Zm=Qm.erase,CA=Qm.cursor,RA=r=>[...IA(r)].length;eg.exports=function(r,e){if(!e)return Zm.line+CA.to(0);let t=0,s=r.split(/\r?\n/);var i=PA(s),n;try{for(i.s();!(n=i.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(RA(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return Zm.lines(t)}});var Ru=d((Xk,rg)=>{"use strict";var Rs={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},NA={arrowUp:Rs.arrowUp,arrowDown:Rs.arrowDown,arrowLeft:Rs.arrowLeft,arrowRight:Rs.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},qA=process.platform==="win32"?NA:Rs;rg.exports=qA});var ig=d((Jk,sg)=>{"use strict";var Ir=ee(),tr=Ru(),Nu=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}`}}),jA=r=>Nu[r]||Nu.default,Ns=Object.freeze({aborted:Ir.red(tr.cross),done:Ir.green(tr.tick),exited:Ir.yellow(tr.cross),default:Ir.cyan("?")}),kA=(r,e,t)=>e?Ns.aborted:t?Ns.exited:r?Ns.done:Ns.default,DA=r=>Ir.gray(r?tr.ellipsis:tr.pointerSmall),MA=(r,e)=>Ir.gray(r?e?tr.pointerSmall:"+":tr.line);sg.exports={styles:Nu,render:jA,symbols:Ns,symbol:kA,delimiter:DA,item:MA}});var og=d((Zk,ng)=>{"use strict";var LA=Zi();ng.exports=function(r,e){let t=String(LA(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var ug=d((Qk,ag)=>{"use strict";ag.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 ig=d((Mj,sg)=>{"use strict";sg.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 ze=d((Lj,ng)=>{"use strict";ng.exports={action:Um(),clear:Ym(),style:Zm(),strip:Wi(),figures:Pu(),lines:eg(),wrap:rg(),entriesToDisplay:ig()}});var dt=d((Vj,ug)=>{"use strict";var og=require("readline"),OI=ze(),xI=OI.action,TI=require("events"),ag=te(),PI=ag.beep,II=ag.cursor,AI=ee(),Au=class extends TI{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=og.createInterface({input:this.in,escapeCodeTimeout:50});og.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=xI(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(II.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(PI)}render(){this.onRender(AI),this.firstRender&&(this.firstRender=!1)}};ug.exports=Au});var fg=d((Fj,dg)=>{"use strict";function cg(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 lg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){cg(n,s,i,o,a,"next",u)}function a(u){cg(n,s,i,o,a,"throw",u)}o(void 0)})}}var Ki=ee(),CI=dt(),hg=te(),RI=hg.erase,Cs=hg.cursor,Yi=ze(),Cu=Yi.style,Ru=Yi.clear,NI=Yi.lines,qI=Yi.figures,Nu=class extends CI{constructor(e={}){super(e),this.transform=Cu.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=Ru("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Ki.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 lg(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return lg(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(Cs.down(NI(this.outputError,this.out.columns)-1)+Ru(this.outputError,this.out.columns)),this.out.write(Ru(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Cu.symbol(this.done,this.aborted),Ki.bold(this.msg),Cu.delimiter(this.done),this.red?Ki.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
12
+ `)}});var lg=d((eD,cg)=>{"use strict";cg.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 ze=d((tD,hg)=>{"use strict";hg.exports={action:Wm(),clear:tg(),style:ig(),strip:Zi(),figures:Ru(),lines:og(),wrap:ug(),entriesToDisplay:lg()}});var pt=d((rD,pg)=>{"use strict";var dg=require("readline"),VA=ze(),FA=VA.action,UA=require("events"),fg=te(),HA=fg.beep,GA=fg.cursor,zA=ee(),qu=class extends UA{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=dg.createInterface({input:this.in,escapeCodeTimeout:50});dg.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=FA(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(GA.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(HA)}render(){this.onRender(zA),this.firstRender&&(this.firstRender=!1)}};pg.exports=qu});var vg=d((sD,_g)=>{"use strict";function mg(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 gg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){mg(n,s,i,o,a,"next",u)}function a(u){mg(n,s,i,o,a,"throw",u)}o(void 0)})}}var Qi=ee(),BA=pt(),yg=te(),KA=yg.erase,qs=yg.cursor,en=ze(),ju=en.style,ku=en.clear,WA=en.lines,YA=en.figures,Du=class extends BA{constructor(e={}){super(e),this.transform=ju.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=Qi.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 gg(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return gg(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(qs.down(WA(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=[ju.symbol(this.done,this.aborted),Qi.bold(this.msg),ju.delimiter(this.done),this.red?Qi.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
15
15
  `).reduce((e,t,s)=>e+`
16
- ${s?" ":qI.pointerSmall} ${Ki.red().italic(t)}`,"")),this.out.write(RI.line+Cs.to(0)+this.outputText+Cs.save+this.outputError+Cs.restore+Cs.move(this.cursorOffset,0)))}};dg.exports=Nu});var yg=d((Uj,gg)=>{"use strict";var ft=ee(),kI=dt(),Rs=ze(),pg=Rs.style,mg=Rs.clear,Xi=Rs.figures,jI=Rs.wrap,DI=Rs.entriesToDisplay,MI=te(),LI=MI.cursor,qu=class extends kI{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=mg("",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(`
16
+ ${s?" ":YA.pointerSmall} ${Qi.red().italic(t)}`,"")),this.out.write(KA.line+qs.to(0)+this.outputText+qs.save+this.outputError+qs.restore+qs.move(this.cursorOffset,0)))}};_g.exports=Du});var Eg=d((iD,$g)=>{"use strict";var mt=ee(),XA=pt(),js=ze(),bg=js.style,wg=js.clear,tn=js.figures,JA=js.wrap,ZA=js.entriesToDisplay,QA=te(),eI=QA.cursor,Mu=class extends XA{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=wg("",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(LI.hide):this.out.write(mg(this.outputText,this.out.columns)),super.render();let e=DI(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[pg.symbol(this.done,this.aborted),ft.bold(this.msg),pg.delimiter(!1),this.done?this.selection.title:this.selection.disabled?ft.yellow(this.warn):ft.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=Xi.arrowUp:i===s-1&&s<this.choices.length?o=Xi.arrowDown:o=" ",u.disabled?(n=this.cursor===i?ft.gray().underline(u.title):ft.strikethrough().gray(u.title),o=(this.cursor===i?ft.bold().gray(Xi.pointer)+" ":" ")+o):(n=this.cursor===i?ft.cyan().underline(u.title):u.title,o=(this.cursor===i?ft.cyan(Xi.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
- `+jI(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${ft.gray(a)}
21
- `}}this.out.write(this.outputText)}};gg.exports=qu});var Eg=d((Hj,$g)=>{"use strict";var Ji=ee(),VI=dt(),bg=ze(),_g=bg.style,FI=bg.clear,wg=te(),vg=wg.cursor,UI=wg.erase,ku=class extends VI{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(`
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(eI.hide):this.out.write(wg(this.outputText,this.out.columns)),super.render();let e=ZA(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[bg.symbol(this.done,this.aborted),mt.bold(this.msg),bg.delimiter(!1),this.done?this.selection.title:this.selection.disabled?mt.yellow(this.warn):mt.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=tn.arrowUp:i===s-1&&s<this.choices.length?o=tn.arrowDown:o=" ",u.disabled?(n=this.cursor===i?mt.gray().underline(u.title):mt.strikethrough().gray(u.title),o=(this.cursor===i?mt.bold().gray(tn.pointer)+" ":" ")+o):(n=this.cursor===i?mt.cyan().underline(u.title):u.title,o=(this.cursor===i?mt.cyan(tn.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
+ `+JA(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${mt.gray(a)}
21
+ `}}this.out.write(this.outputText)}};$g.exports=Mu});var Ag=d((nD,Pg)=>{"use strict";var rn=ee(),tI=pt(),xg=ze(),Sg=xg.style,rI=xg.clear,Tg=te(),Og=Tg.cursor,sI=Tg.erase,Lu=class extends tI{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(vg.hide):this.out.write(FI(this.outputText,this.out.columns)),super.render(),this.outputText=[_g.symbol(this.done,this.aborted),Ji.bold(this.msg),_g.delimiter(this.done),this.value?this.inactive:Ji.cyan().underline(this.inactive),Ji.gray("/"),this.value?Ji.cyan().underline(this.active):this.active].join(" "),this.out.write(UI.line+vg.to(0)+this.outputText))}};$g.exports=ku});var st=d((Gj,Sg)=>{"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)}};Sg.exports=ju});var xg=d((zj,Og)=>{"use strict";var HI=st(),Du=class extends HI{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}};Og.exports=Du});var Pg=d((Bj,Tg)=>{"use strict";var GI=st(),zI=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Mu=class extends GI{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+zI(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Tg.exports=Mu});var Ag=d((Wj,Ig)=>{"use strict";var BI=st(),Lu=class extends BI{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}};Ig.exports=Lu});var Rg=d((Kj,Cg)=>{"use strict";var WI=st(),Vu=class extends WI{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)}};Cg.exports=Vu});var qg=d((Yj,Ng)=>{"use strict";var KI=st(),Fu=class extends KI{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}};Ng.exports=Fu});var jg=d((Xj,kg)=>{"use strict";var YI=st(),Uu=class extends YI{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)}};kg.exports=Uu});var Mg=d((Jj,Dg)=>{"use strict";var XI=st(),Hu=class extends XI{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}};Dg.exports=Hu});var Vg=d((Zj,Lg)=>{"use strict";var JI=st(),Gu=class extends JI{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}};Lg.exports=Gu});var Ug=d((Qj,Fg)=>{"use strict";Fg.exports={DatePart:st(),Meridiem:xg(),Day:Pg(),Hours:Ag(),Milliseconds:Rg(),Minutes:qg(),Month:jg(),Seconds:Mg(),Year:Vg()}});var Zg=d((eD,Jg)=>{"use strict";function Hg(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 Gg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Hg(n,s,i,o,a,"next",u)}function a(u){Hg(n,s,i,o,a,"throw",u)}o(void 0)})}}var zu=ee(),ZI=dt(),Wu=ze(),zg=Wu.style,Bg=Wu.clear,QI=Wu.figures,Xg=te(),eA=Xg.erase,Wg=Xg.cursor,pt=Ug(),Kg=pt.DatePart,tA=pt.Meridiem,rA=pt.Day,sA=pt.Hours,iA=pt.Milliseconds,nA=pt.Minutes,oA=pt.Month,aA=pt.Seconds,uA=pt.Year,cA=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Yg={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new rA(r),3:r=>new oA(r),4:r=>new uA(r),5:r=>new tA(r),6:r=>new sA(r),7:r=>new nA(r),8:r=>new aA(r),9:r=>new iA(r)},lA={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(",")},Bu=class extends ZI{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(lA,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=Bg("",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=cA.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in Yg?Yg[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 Kg)),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 Gg(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Gg(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 Kg)),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(Wg.hide):this.out.write(Bg(this.outputText,this.out.columns)),super.render(),this.outputText=[zg.symbol(this.done,this.aborted),zu.bold(this.msg),zg.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?zu.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
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(Og.hide):this.out.write(rI(this.outputText,this.out.columns)),super.render(),this.outputText=[Sg.symbol(this.done,this.aborted),rn.bold(this.msg),Sg.delimiter(this.done),this.value?this.inactive:rn.cyan().underline(this.inactive),rn.gray("/"),this.value?rn.cyan().underline(this.active):this.active].join(" "),this.out.write(sI.line+Og.to(0)+this.outputText))}};Pg.exports=Lu});var it=d((oD,Ig)=>{"use strict";var Vu=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)}};Ig.exports=Vu});var Rg=d((aD,Cg)=>{"use strict";var iI=it(),Fu=class extends iI{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}};Cg.exports=Fu});var qg=d((uD,Ng)=>{"use strict";var nI=it(),oI=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Uu=class extends nI{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+oI(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Ng.exports=Uu});var kg=d((cD,jg)=>{"use strict";var aI=it(),Hu=class extends aI{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}};jg.exports=Hu});var Mg=d((lD,Dg)=>{"use strict";var uI=it(),Gu=class extends uI{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)}};Dg.exports=Gu});var Vg=d((hD,Lg)=>{"use strict";var cI=it(),zu=class extends cI{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}};Lg.exports=zu});var Ug=d((dD,Fg)=>{"use strict";var lI=it(),Bu=class extends lI{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)}};Fg.exports=Bu});var Gg=d((fD,Hg)=>{"use strict";var hI=it(),Ku=class extends hI{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}};Hg.exports=Ku});var Bg=d((pD,zg)=>{"use strict";var dI=it(),Wu=class extends dI{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}};zg.exports=Wu});var Wg=d((mD,Kg)=>{"use strict";Kg.exports={DatePart:it(),Meridiem:Rg(),Day:qg(),Hours:kg(),Milliseconds:Mg(),Minutes:Vg(),Month:Ug(),Seconds:Gg(),Year:Bg()}});var iy=d((gD,sy)=>{"use strict";function Yg(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 Xg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Yg(n,s,i,o,a,"next",u)}function a(u){Yg(n,s,i,o,a,"throw",u)}o(void 0)})}}var Yu=ee(),fI=pt(),Ju=ze(),Jg=Ju.style,Zg=Ju.clear,pI=Ju.figures,ry=te(),mI=ry.erase,Qg=ry.cursor,gt=Wg(),ey=gt.DatePart,gI=gt.Meridiem,yI=gt.Day,_I=gt.Hours,vI=gt.Milliseconds,bI=gt.Minutes,wI=gt.Month,$I=gt.Seconds,EI=gt.Year,SI=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ty={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new yI(r),3:r=>new wI(r),4:r=>new EI(r),5:r=>new gI(r),6:r=>new _I(r),7:r=>new bI(r),8:r=>new $I(r),9:r=>new vI(r)},OI={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(",")},Xu=class extends fI{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(OI,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=Zg("",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=SI.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in ty?ty[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 ey)),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 Xg(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Xg(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 ey)),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(Qg.hide):this.out.write(Zg(this.outputText,this.out.columns)),super.render(),this.outputText=[Jg.symbol(this.done,this.aborted),Yu.bold(this.msg),Jg.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Yu.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
26
26
  `).reduce((e,t,s)=>e+`
27
- ${s?" ":QI.pointerSmall} ${zu.red().italic(t)}`,"")),this.out.write(eA.line+Wg.to(0)+this.outputText))}};Jg.exports=Bu});var ny=d((tD,iy)=>{"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 ey(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 Zi=ee(),hA=dt(),sy=te(),Qi=sy.cursor,dA=sy.erase,en=ze(),Ku=en.style,fA=en.figures,ty=en.clear,pA=en.lines,mA=/[0-9]/,Yu=r=>r!==void 0,ry=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Xu=class extends hA{constructor(e={}){super(e),this.transform=Ku.render(e.style),this.msg=e.message,this.initial=Yu(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Yu(e.min)?e.min:-1/0,this.max=Yu(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=Zi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${ry(e,this.round)}`),this._value=ry(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||mA.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 ey(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ey(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(Qi.down(pA(this.outputError,this.out.columns)-1)+ty(this.outputError,this.out.columns)),this.out.write(ty(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ku.symbol(this.done,this.aborted),Zi.bold(this.msg),Ku.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Zi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
27
+ ${s?" ":pI.pointerSmall} ${Yu.red().italic(t)}`,"")),this.out.write(mI.line+Qg.to(0)+this.outputText))}};sy.exports=Xu});var hy=d((yD,ly)=>{"use strict";function ny(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){ny(n,s,i,o,a,"next",u)}function a(u){ny(n,s,i,o,a,"throw",u)}o(void 0)})}}var sn=ee(),xI=pt(),cy=te(),nn=cy.cursor,TI=cy.erase,on=ze(),Zu=on.style,PI=on.figures,ay=on.clear,AI=on.lines,II=/[0-9]/,Qu=r=>r!==void 0,uy=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},ec=class extends xI{constructor(e={}){super(e),this.transform=Zu.render(e.style),this.msg=e.message,this.initial=Qu(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Qu(e.min)?e.min:-1/0,this.max=Qu(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=sn.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${uy(e,this.round)}`),this._value=uy(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||II.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(nn.down(AI(this.outputError,this.out.columns)-1)+ay(this.outputError,this.out.columns)),this.out.write(ay(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Zu.symbol(this.done,this.aborted),sn.bold(this.msg),Zu.delimiter(this.done),!this.done||!this.done&&!this.placeholder?sn[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
30
30
  `).reduce((e,t,s)=>e+`
31
- ${s?" ":fA.pointerSmall} ${Zi.red().italic(t)}`,"")),this.out.write(dA.line+Qi.to(0)+this.outputText+Qi.save+this.outputError+Qi.restore))}};iy.exports=Xu});var Zu=d((rD,uy)=>{"use strict";var it=ee(),gA=te(),yA=gA.cursor,_A=dt(),Ns=ze(),oy=Ns.clear,Nt=Ns.figures,ay=Ns.style,vA=Ns.wrap,bA=Ns.entriesToDisplay,Ju=class extends _A{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=oy("",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(`
31
+ ${s?" ":PI.pointerSmall} ${sn.red().italic(t)}`,"")),this.out.write(TI.line+nn.to(0)+this.outputText+nn.save+this.outputError+nn.restore))}};ly.exports=ec});var rc=d((_D,py)=>{"use strict";var nt=ee(),CI=te(),RI=CI.cursor,NI=pt(),ks=ze(),dy=ks.clear,kt=ks.figures,fy=ks.style,qI=ks.wrap,jI=ks.entriesToDisplay,tc=class extends NI{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=dy("",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
- ${Nt.arrowUp}/${Nt.arrowDown}: Highlight option
36
- ${Nt.arrowLeft}/${Nt.arrowRight}/[space]: Toggle selection
35
+ ${kt.arrowUp}/${kt.arrowDown}: Highlight option
36
+ ${kt.arrowLeft}/${kt.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?it.green(Nt.radioOn):Nt.radioOff)+" "+i+" ",o,a;return t.disabled?o=e===s?it.gray().underline(t.title):it.strikethrough().gray(t.title):(o=e===s?it.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
- `+vA(t.description,{margin:n.length,width:this.out.columns})))),n+o+it.gray(a||"")}paginateOptions(e){if(e.length===0)return it.red("No matches for this query.");let t=bA(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=Nt.arrowUp:a===i-1&&i<e.length?n=Nt.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return`
38
+ `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?nt.green(kt.radioOn):kt.radioOff)+" "+i+" ",o,a;return t.disabled?o=e===s?nt.gray().underline(t.title):nt.strikethrough().gray(t.title):(o=e===s?nt.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
+ `+qI(t.description,{margin:n.length,width:this.out.columns})))),n+o+nt.gray(a||"")}paginateOptions(e){if(e.length===0)return nt.red("No matches for this query.");let t=jI(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=kt.arrowUp:a===i-1&&i<e.length?n=kt.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=[it.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(it.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(yA.hide),super.render();let e=[ay.symbol(this.done,this.aborted),it.bold(this.msg),ay.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=it.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=oy(e,this.out.columns)}};uy.exports=Ju});var my=d((sD,py)=>{"use strict";function cy(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 wA(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){cy(n,s,i,o,a,"next",u)}function a(u){cy(n,s,i,o,a,"throw",u)}o(void 0)})}}var qs=ee(),$A=dt(),fy=te(),EA=fy.erase,ly=fy.cursor,ks=ze(),Qu=ks.style,hy=ks.clear,ec=ks.figures,SA=ks.wrap,OA=ks.entriesToDisplay,dy=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),xA=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),TA=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},tc=class extends $A{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:TA(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=Qu.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=hy("",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=dy(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return wA(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:xA(u,a),value:dy(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(`
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=[nt.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(nt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(RI.hide),super.render();let e=[fy.symbol(this.done,this.aborted),nt.bold(this.msg),fy.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=nt.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=dy(e,this.out.columns)}};py.exports=tc});var wy=d((vD,by)=>{"use strict";function my(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 kI(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){my(n,s,i,o,a,"next",u)}function a(u){my(n,s,i,o,a,"throw",u)}o(void 0)})}}var Ds=ee(),DI=pt(),vy=te(),MI=vy.erase,gy=vy.cursor,Ms=ze(),sc=Ms.style,yy=Ms.clear,ic=Ms.figures,LI=Ms.wrap,VI=Ms.entriesToDisplay,_y=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),FI=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),UI=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},nc=class extends DI{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:UI(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=sc.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=yy("",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=_y(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return kI(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:FI(u,a),value:_y(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?ec.arrowUp:i?ec.arrowDown:" ",a=t?qs.cyan().underline(e.title):e.title;return o=(t?qs.cyan(ec.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
- `+SA(e.description,{margin:3,width:this.out.columns}))),o+" "+a+qs.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ly.hide):this.out.write(hy(this.outputText,this.out.columns)),super.render();let e=OA(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[Qu.symbol(this.done,this.aborted,this.exited),qs.bold(this.msg),Qu.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(`
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?ic.arrowUp:i?ic.arrowDown:" ",a=t?Ds.cyan().underline(e.title):e.title;return o=(t?Ds.cyan(ic.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
+ `+LI(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ds.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(gy.hide):this.out.write(yy(this.outputText,this.out.columns)),super.render();let e=VI(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[sc.symbol(this.done,this.aborted,this.exited),Ds.bold(this.msg),sc.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||qs.gray(this.fallback.title))}this.out.write(EA.line+ly.to(0)+this.outputText)}};py.exports=tc});var vy=d((iD,_y)=>{"use strict";var mt=ee(),PA=te(),IA=PA.cursor,AA=Zu(),sc=ze(),gy=sc.clear,yy=sc.style,Ir=sc.figures,rc=class extends AA{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=gy("",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:`
47
+ `+(i||Ds.gray(this.fallback.title))}this.out.write(MI.line+gy.to(0)+this.outputText)}};by.exports=nc});var Oy=d((bD,Sy)=>{"use strict";var yt=ee(),HI=te(),GI=HI.cursor,zI=rc(),ac=ze(),$y=ac.clear,Ey=ac.style,Cr=ac.figures,oc=class extends zI{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=$y("",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
- ${Ir.arrowUp}/${Ir.arrowDown}: Highlight option
50
- ${Ir.arrowLeft}/${Ir.arrowRight}/[space]: Toggle selection
49
+ ${Cr.arrowUp}/${Cr.arrowDown}: Highlight option
50
+ ${Cr.arrowLeft}/${Cr.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:mt.gray("Enter something to filter")}
55
- `}renderOption(e,t,s){let i;return t.disabled?i=e===s?mt.gray().underline(t.title):mt.strikethrough().gray(t.title):i=e===s?mt.cyan().underline(t.title):t.title,(t.selected?mt.green(Ir.radioOn):Ir.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[mt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(mt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(IA.hide),super.render();let e=[yy.symbol(this.done,this.aborted),mt.bold(this.msg),yy.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=mt.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=gy(e,this.out.columns)}};_y.exports=rc});var xy=d((nD,Oy)=>{"use strict";var by=ee(),CA=dt(),Ey=ze(),wy=Ey.style,RA=Ey.clear,Sy=te(),NA=Sy.erase,$y=Sy.cursor,ic=class extends CA{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(`
54
+ Filtered results for: ${this.inputValue?this.inputValue:yt.gray("Enter something to filter")}
55
+ `}renderOption(e,t,s){let i;return t.disabled?i=e===s?yt.gray().underline(t.title):yt.strikethrough().gray(t.title):i=e===s?yt.cyan().underline(t.title):t.title,(t.selected?yt.green(Cr.radioOn):Cr.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[yt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(yt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(GI.hide),super.render();let e=[Ey.symbol(this.done,this.aborted),yt.bold(this.msg),Ey.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=yt.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=$y(e,this.out.columns)}};Sy.exports=oc});var Ry=d((wD,Cy)=>{"use strict";var xy=ee(),BI=pt(),Ay=ze(),Ty=Ay.style,KI=Ay.clear,Iy=te(),WI=Iy.erase,Py=Iy.cursor,uc=class extends BI{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($y.hide):this.out.write(RA(this.outputText,this.out.columns)),super.render(),this.outputText=[wy.symbol(this.done,this.aborted),by.bold(this.msg),wy.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:by.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(NA.line+$y.to(0)+this.outputText))}};Oy.exports=ic});var Py=d((oD,Ty)=>{"use strict";Ty.exports={TextPrompt:fg(),SelectPrompt:yg(),TogglePrompt:Eg(),DatePrompt:Zg(),NumberPrompt:ny(),MultiselectPrompt:Zu(),AutocompletePrompt:my(),AutocompleteMultiselectPrompt:vy(),ConfirmPrompt:xy()}});var Ay=d(Iy=>{"use strict";var Se=Iy,qA=Py(),tn=r=>r;function nt(r,e,t={}){return new Promise((s,i)=>{let n=new qA[r](e),o=t.onAbort||tn,a=t.onSubmit||tn,u=t.onExit||tn;n.on("state",e.onState||tn),n.on("submit",c=>s(a(c))),n.on("exit",c=>s(u(c))),n.on("abort",c=>i(o(c)))})}Se.text=r=>nt("TextPrompt",r);Se.password=r=>(r.style="password",Se.text(r));Se.invisible=r=>(r.style="invisible",Se.text(r));Se.number=r=>nt("NumberPrompt",r);Se.date=r=>nt("DatePrompt",r);Se.confirm=r=>nt("ConfirmPrompt",r);Se.list=r=>{let e=r.separator||",";return nt("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};Se.toggle=r=>nt("TogglePrompt",r);Se.select=r=>nt("SelectPrompt",r);Se.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return nt("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};Se.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return nt("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var kA=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Se.autocomplete=r=>(r.suggest=r.suggest||kA,r.choices=[].concat(r.choices||[]),nt("AutocompletePrompt",r))});var My=d((uD,Dy)=>{"use strict";function Cy(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 Ry(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cy(Object(t),!0).forEach(function(s){jA(r,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Cy(Object(t)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))})}return r}function jA(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function DA(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=MA(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 MA(r,e){if(r){if(typeof r=="string")return Ny(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 Ny(r,e)}}function Ny(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 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 ky(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 nc=Ay(),LA=["suggest","format","onState","validate","onRender","type"],jy=()=>{};function qt(){return oc.apply(this,arguments)}function oc(){return oc=ky(function*(r=[],{onSubmit:e=jy,onCancel:t=jy}={}){let s={},i=qt._override||{};r=[].concat(r);let n,o,a,u,c,l,h=(function(){var y=ky(function*(_,S,O=!1){if(!(!O&&_.validate&&_.validate(S)!==!0))return _.format?yield _.format(S,s):S});return function(S,O){return y.apply(this,arguments)}})();var f=DA(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,Ry({},s),o),o.type=c),!!c){for(let y in o){if(LA.includes(y))continue;let _=o[y];o[y]=typeof _=="function"?yield _(n,Ry({},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,nc[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=qt._injected?VA(qt._injected,o.initial):yield nc[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}),oc.apply(this,arguments)}function VA(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function FA(r){qt._injected=(qt._injected||[]).concat(r)}function UA(r){qt._override=Object.assign({},r)}Dy.exports=Object.assign(qt,{prompt:qt,prompts:nc,inject:FA,override:UA})});var Vy=d((cD,Ly)=>{"use strict";Ly.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 rn=d((lD,Fy)=>{"use strict";Fy.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 Gy=d((hD,Hy)=>{"use strict";var HA=rn(),{erase:Uy,cursor:GA}=te(),zA=r=>[...HA(r)].length;Hy.exports=function(r,e){if(!e)return Uy.line+GA.to(0);let t=0,s=r.split(/\r?\n/);for(let i of s)t+=1+Math.floor(Math.max(zA(i)-1,0)/e);return Uy.lines(t)}});var ac=d((dD,zy)=>{"use strict";var js={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},BA={arrowUp:js.arrowUp,arrowDown:js.arrowDown,arrowLeft:js.arrowLeft,arrowRight:js.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},WA=process.platform==="win32"?BA:js;zy.exports=WA});var Wy=d((fD,By)=>{"use strict";var Ar=ee(),er=ac(),uc=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}`}}),KA=r=>uc[r]||uc.default,Ds=Object.freeze({aborted:Ar.red(er.cross),done:Ar.green(er.tick),exited:Ar.yellow(er.cross),default:Ar.cyan("?")}),YA=(r,e,t)=>e?Ds.aborted:t?Ds.exited:r?Ds.done:Ds.default,XA=r=>Ar.gray(r?er.ellipsis:er.pointerSmall),JA=(r,e)=>Ar.gray(r?e?er.pointerSmall:"+":er.line);By.exports={styles:uc,render:KA,symbols:Ds,symbol:YA,delimiter:XA,item:JA}});var Yy=d((pD,Ky)=>{"use strict";var ZA=rn();Ky.exports=function(r,e){let t=String(ZA(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var Jy=d((mD,Xy)=>{"use strict";Xy.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(`
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(Py.hide):this.out.write(KI(this.outputText,this.out.columns)),super.render(),this.outputText=[Ty.symbol(this.done,this.aborted),xy.bold(this.msg),Ty.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:xy.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(WI.line+Py.to(0)+this.outputText))}};Cy.exports=uc});var qy=d(($D,Ny)=>{"use strict";Ny.exports={TextPrompt:vg(),SelectPrompt:Eg(),TogglePrompt:Ag(),DatePrompt:iy(),NumberPrompt:hy(),MultiselectPrompt:rc(),AutocompletePrompt:wy(),AutocompleteMultiselectPrompt:Oy(),ConfirmPrompt:Ry()}});var ky=d(jy=>{"use strict";var Se=jy,YI=qy(),an=r=>r;function ot(r,e,t={}){return new Promise((s,i)=>{let n=new YI[r](e),o=t.onAbort||an,a=t.onSubmit||an,u=t.onExit||an;n.on("state",e.onState||an),n.on("submit",c=>s(a(c))),n.on("exit",c=>s(u(c))),n.on("abort",c=>i(o(c)))})}Se.text=r=>ot("TextPrompt",r);Se.password=r=>(r.style="password",Se.text(r));Se.invisible=r=>(r.style="invisible",Se.text(r));Se.number=r=>ot("NumberPrompt",r);Se.date=r=>ot("DatePrompt",r);Se.confirm=r=>ot("ConfirmPrompt",r);Se.list=r=>{let e=r.separator||",";return ot("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};Se.toggle=r=>ot("TogglePrompt",r);Se.select=r=>ot("SelectPrompt",r);Se.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ot("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};Se.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ot("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var XI=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Se.autocomplete=r=>(r.suggest=r.suggest||XI,r.choices=[].concat(r.choices||[]),ot("AutocompletePrompt",r))});var Gy=d((SD,Hy)=>{"use strict";function Dy(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 My(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dy(Object(t),!0).forEach(function(s){JI(r,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dy(Object(t)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))})}return r}function JI(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ZI(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=QI(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 QI(r,e){if(r){if(typeof r=="string")return Ly(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 Ly(r,e)}}function Ly(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 Vy(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 Fy(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Vy(n,s,i,o,a,"next",u)}function a(u){Vy(n,s,i,o,a,"throw",u)}o(void 0)})}}var cc=ky(),eC=["suggest","format","onState","validate","onRender","type"],Uy=()=>{};function Dt(){return lc.apply(this,arguments)}function lc(){return lc=Fy(function*(r=[],{onSubmit:e=Uy,onCancel:t=Uy}={}){let s={},i=Dt._override||{};r=[].concat(r);let n,o,a,u,c,l,h=(function(){var y=Fy(function*(_,S,O=!1){if(!(!O&&_.validate&&_.validate(S)!==!0))return _.format?yield _.format(S,s):S});return function(S,O){return y.apply(this,arguments)}})();var f=ZI(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,My({},s),o),o.type=c),!!c){for(let y in o){if(eC.includes(y))continue;let _=o[y];o[y]=typeof _=="function"?yield _(n,My({},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,cc[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=Dt._injected?tC(Dt._injected,o.initial):yield cc[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}),lc.apply(this,arguments)}function tC(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function rC(r){Dt._injected=(Dt._injected||[]).concat(r)}function sC(r){Dt._override=Object.assign({},r)}Hy.exports=Object.assign(Dt,{prompt:Dt,prompts:cc,inject:rC,override:sC})});var By=d((OD,zy)=>{"use strict";zy.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 un=d((xD,Ky)=>{"use strict";Ky.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 Xy=d((TD,Yy)=>{"use strict";var iC=un(),{erase:Wy,cursor:nC}=te(),oC=r=>[...iC(r)].length;Yy.exports=function(r,e){if(!e)return Wy.line+nC.to(0);let t=0,s=r.split(/\r?\n/);for(let i of s)t+=1+Math.floor(Math.max(oC(i)-1,0)/e);return Wy.lines(t)}});var hc=d((PD,Jy)=>{"use strict";var Ls={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},aC={arrowUp:Ls.arrowUp,arrowDown:Ls.arrowDown,arrowLeft:Ls.arrowLeft,arrowRight:Ls.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},uC=process.platform==="win32"?aC:Ls;Jy.exports=uC});var Qy=d((AD,Zy)=>{"use strict";var Rr=ee(),rr=hc(),dc=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}`}}),cC=r=>dc[r]||dc.default,Vs=Object.freeze({aborted:Rr.red(rr.cross),done:Rr.green(rr.tick),exited:Rr.yellow(rr.cross),default:Rr.cyan("?")}),lC=(r,e,t)=>e?Vs.aborted:t?Vs.exited:r?Vs.done:Vs.default,hC=r=>Rr.gray(r?rr.ellipsis:rr.pointerSmall),dC=(r,e)=>Rr.gray(r?e?rr.pointerSmall:"+":rr.line);Zy.exports={styles:dc,render:cC,symbols:Vs,symbol:lC,delimiter:hC,item:dC}});var t0=d((ID,e0)=>{"use strict";var fC=un();e0.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 s0=d((CD,r0)=>{"use strict";r0.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 Qy=d((gD,Zy)=>{"use strict";Zy.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 Be=d((yD,e0)=>{"use strict";e0.exports={action:Vy(),clear:Gy(),style:Wy(),strip:rn(),figures:ac(),lines:Yy(),wrap:Jy(),entriesToDisplay:Qy()}});var gt=d((_D,r0)=>{"use strict";var t0=require("readline"),{action:QA}=Be(),eC=require("events"),{beep:tC,cursor:rC}=te(),sC=ee(),cc=class extends eC{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=t0.createInterface({input:this.in,escapeCodeTimeout:50});t0.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=QA(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(rC.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(tC)}render(){this.onRender(sC),this.firstRender&&(this.firstRender=!1)}};r0.exports=cc});var i0=d((vD,s0)=>{var sn=ee(),iC=gt(),{erase:nC,cursor:Ms}=te(),{style:lc,clear:hc,lines:oC,figures:aC}=Be(),dc=class extends iC{constructor(e={}){super(e),this.transform=lc.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=hc("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=sn.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(`
60
+ `)}});var n0=d((RD,i0)=>{"use strict";i0.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 Be=d((ND,o0)=>{"use strict";o0.exports={action:By(),clear:Xy(),style:Qy(),strip:un(),figures:hc(),lines:t0(),wrap:s0(),entriesToDisplay:n0()}});var _t=d((qD,u0)=>{"use strict";var a0=require("readline"),{action:pC}=Be(),mC=require("events"),{beep:gC,cursor:yC}=te(),_C=ee(),fc=class extends mC{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=a0.createInterface({input:this.in,escapeCodeTimeout:50});a0.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=pC(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(yC.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(gC)}render(){this.onRender(_C),this.firstRender&&(this.firstRender=!1)}};u0.exports=fc});var l0=d((jD,c0)=>{var cn=ee(),vC=_t(),{erase:bC,cursor:Fs}=te(),{style:pc,clear:mc,lines:wC,figures:$C}=Be(),gc=class extends vC{constructor(e={}){super(e),this.transform=pc.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=mc("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=cn.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(Ms.down(oC(this.outputError,this.out.columns)-1)+hc(this.outputError,this.out.columns)),this.out.write(hc(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[lc.symbol(this.done,this.aborted),sn.bold(this.msg),lc.delimiter(this.done),this.red?sn.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
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(Fs.down(wC(this.outputError,this.out.columns)-1)+mc(this.outputError,this.out.columns)),this.out.write(mc(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[pc.symbol(this.done,this.aborted),cn.bold(this.msg),pc.delimiter(this.done),this.red?cn.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
63
63
  `).reduce((e,t,s)=>e+`
64
- ${s?" ":aC.pointerSmall} ${sn.red().italic(t)}`,"")),this.out.write(nC.line+Ms.to(0)+this.outputText+Ms.save+this.outputError+Ms.restore+Ms.move(this.cursorOffset,0)))}};s0.exports=dc});var u0=d((bD,a0)=>{"use strict";var yt=ee(),uC=gt(),{style:n0,clear:o0,figures:nn,wrap:cC,entriesToDisplay:lC}=Be(),{cursor:hC}=te(),fc=class extends uC{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=o0("",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(`
64
+ ${s?" ":$C.pointerSmall} ${cn.red().italic(t)}`,"")),this.out.write(bC.line+Fs.to(0)+this.outputText+Fs.save+this.outputError+Fs.restore+Fs.move(this.cursorOffset,0)))}};c0.exports=gc});var p0=d((kD,f0)=>{"use strict";var vt=ee(),EC=_t(),{style:h0,clear:d0,figures:ln,wrap:SC,entriesToDisplay:OC}=Be(),{cursor:xC}=te(),yc=class extends EC{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=d0("",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(hC.hide):this.out.write(o0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=lC(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n0.symbol(this.done,this.aborted),yt.bold(this.msg),n0.delimiter(!1),this.done?this.selection.title:this.selection.disabled?yt.yellow(this.warn):yt.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=nn.arrowUp:s===t-1&&t<this.choices.length?n=nn.arrowDown:n=" ",a.disabled?(i=this.cursor===s?yt.gray().underline(a.title):yt.strikethrough().gray(a.title),n=(this.cursor===s?yt.bold().gray(nn.pointer)+" ":" ")+n):(i=this.cursor===s?yt.cyan().underline(a.title):a.title,n=(this.cursor===s?yt.cyan(nn.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
- `+cC(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${i}${yt.gray(o)}
69
- `}}this.out.write(this.outputText)}};a0.exports=fc});var d0=d((wD,h0)=>{var on=ee(),dC=gt(),{style:c0,clear:fC}=Be(),{cursor:l0,erase:pC}=te(),pc=class extends dC{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(`
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(xC.hide):this.out.write(d0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=OC(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[h0.symbol(this.done,this.aborted),vt.bold(this.msg),h0.delimiter(!1),this.done?this.selection.title:this.selection.disabled?vt.yellow(this.warn):vt.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=ln.arrowUp:s===t-1&&t<this.choices.length?n=ln.arrowDown:n=" ",a.disabled?(i=this.cursor===s?vt.gray().underline(a.title):vt.strikethrough().gray(a.title),n=(this.cursor===s?vt.bold().gray(ln.pointer)+" ":" ")+n):(i=this.cursor===s?vt.cyan().underline(a.title):a.title,n=(this.cursor===s?vt.cyan(ln.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
+ `+SC(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${i}${vt.gray(o)}
69
+ `}}this.out.write(this.outputText)}};f0.exports=yc});var _0=d((DD,y0)=>{var hn=ee(),TC=_t(),{style:m0,clear:PC}=Be(),{cursor:g0,erase:AC}=te(),_c=class extends TC{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(l0.hide):this.out.write(fC(this.outputText,this.out.columns)),super.render(),this.outputText=[c0.symbol(this.done,this.aborted),on.bold(this.msg),c0.delimiter(this.done),this.value?this.inactive:on.cyan().underline(this.inactive),on.gray("/"),this.value?on.cyan().underline(this.active):this.active].join(" "),this.out.write(pC.line+l0.to(0)+this.outputText))}};h0.exports=pc});var ot=d(($D,f0)=>{"use strict";var mc=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)}};f0.exports=mc});var m0=d((ED,p0)=>{"use strict";var mC=ot(),gc=class extends mC{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}};p0.exports=gc});var y0=d((SD,g0)=>{"use strict";var gC=ot(),yC=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),yc=class extends gC{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+yC(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};g0.exports=yc});var v0=d((OD,_0)=>{"use strict";var _C=ot(),_c=class extends _C{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}};_0.exports=_c});var w0=d((xD,b0)=>{"use strict";var vC=ot(),vc=class extends vC{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)}};b0.exports=vc});var E0=d((TD,$0)=>{"use strict";var bC=ot(),bc=class extends bC{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}};$0.exports=bc});var O0=d((PD,S0)=>{"use strict";var wC=ot(),wc=class extends wC{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)}};S0.exports=wc});var T0=d((ID,x0)=>{"use strict";var $C=ot(),$c=class extends $C{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}};x0.exports=$c});var I0=d((AD,P0)=>{"use strict";var EC=ot(),Ec=class extends EC{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}};P0.exports=Ec});var C0=d((CD,A0)=>{"use strict";A0.exports={DatePart:ot(),Meridiem:m0(),Day:y0(),Hours:v0(),Milliseconds:w0(),Minutes:E0(),Month:O0(),Seconds:T0(),Year:I0()}});var M0=d((RD,D0)=>{"use strict";var Sc=ee(),SC=gt(),{style:R0,clear:N0,figures:OC}=Be(),{erase:xC,cursor:q0}=te(),{DatePart:k0,Meridiem:TC,Day:PC,Hours:IC,Milliseconds:AC,Minutes:CC,Month:RC,Seconds:NC,Year:qC}=C0(),kC=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,j0={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new PC(r),3:r=>new RC(r),4:r=>new qC(r),5:r=>new TC(r),6:r=>new IC(r),7:r=>new CC(r),8:r=>new NC(r),9:r=>new AC(r)},jC={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(",")},Oc=class extends SC{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(jC,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=N0("",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=kC.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in j0?j0[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 k0)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!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(g0.hide):this.out.write(PC(this.outputText,this.out.columns)),super.render(),this.outputText=[m0.symbol(this.done,this.aborted),hn.bold(this.msg),m0.delimiter(this.done),this.value?this.inactive:hn.cyan().underline(this.inactive),hn.gray("/"),this.value?hn.cyan().underline(this.active):this.active].join(" "),this.out.write(AC.line+g0.to(0)+this.outputText))}};y0.exports=_c});var at=d((MD,v0)=>{"use strict";var vc=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)}};v0.exports=vc});var w0=d((LD,b0)=>{"use strict";var IC=at(),bc=class extends IC{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}};b0.exports=bc});var E0=d((VD,$0)=>{"use strict";var CC=at(),RC=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),wc=class extends CC{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+RC(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$0.exports=wc});var O0=d((FD,S0)=>{"use strict";var NC=at(),$c=class extends NC{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}};S0.exports=$c});var T0=d((UD,x0)=>{"use strict";var qC=at(),Ec=class extends qC{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)}};x0.exports=Ec});var A0=d((HD,P0)=>{"use strict";var jC=at(),Sc=class extends jC{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}};P0.exports=Sc});var C0=d((GD,I0)=>{"use strict";var kC=at(),Oc=class extends kC{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)}};I0.exports=Oc});var N0=d((zD,R0)=>{"use strict";var DC=at(),xc=class extends DC{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}};R0.exports=xc});var j0=d((BD,q0)=>{"use strict";var MC=at(),Tc=class extends MC{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=Tc});var D0=d((KD,k0)=>{"use strict";k0.exports={DatePart:at(),Meridiem:w0(),Day:E0(),Hours:O0(),Milliseconds:T0(),Minutes:A0(),Month:C0(),Seconds:N0(),Year:j0()}});var G0=d((WD,H0)=>{"use strict";var Pc=ee(),LC=_t(),{style:M0,clear:L0,figures:VC}=Be(),{erase:FC,cursor:V0}=te(),{DatePart:F0,Meridiem:UC,Day:HC,Hours:GC,Milliseconds:zC,Minutes:BC,Month:KC,Seconds:WC,Year:YC}=D0(),XC=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,U0={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new HC(r),3:r=>new KC(r),4:r=>new YC(r),5:r=>new UC(r),6:r=>new GC(r),7:r=>new BC(r),8:r=>new WC(r),9:r=>new zC(r)},JC={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 LC{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(JC,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=L0("",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=XC.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in U0?U0[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 F0)),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 k0)),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(q0.hide):this.out.write(N0(this.outputText,this.out.columns)),super.render(),this.outputText=[R0.symbol(this.done,this.aborted),Sc.bold(this.msg),R0.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Sc.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
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 F0)),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(V0.hide):this.out.write(L0(this.outputText,this.out.columns)),super.render(),this.outputText=[M0.symbol(this.done,this.aborted),Pc.bold(this.msg),M0.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Pc.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
74
74
  `).reduce((e,t,s)=>e+`
75
- ${s?" ":OC.pointerSmall} ${Sc.red().italic(t)}`,"")),this.out.write(xC.line+q0.to(0)+this.outputText))}};D0.exports=Oc});var U0=d((ND,F0)=>{var an=ee(),DC=gt(),{cursor:un,erase:MC}=te(),{style:xc,figures:LC,clear:L0,lines:VC}=Be(),FC=/[0-9]/,Tc=r=>r!==void 0,V0=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Pc=class extends DC{constructor(e={}){super(e),this.transform=xc.render(e.style),this.msg=e.message,this.initial=Tc(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Tc(e.min)?e.min:-1/0,this.max=Tc(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=an.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${V0(e,this.round)}`),this._value=V0(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||FC.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(`
75
+ ${s?" ":VC.pointerSmall} ${Pc.red().italic(t)}`,"")),this.out.write(FC.line+V0.to(0)+this.outputText))}};H0.exports=Ac});var W0=d((YD,K0)=>{var dn=ee(),ZC=_t(),{cursor:fn,erase:QC}=te(),{style:Ic,figures:eR,clear:z0,lines:tR}=Be(),rR=/[0-9]/,Cc=r=>r!==void 0,B0=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Rc=class extends ZC{constructor(e={}){super(e),this.transform=Ic.render(e.style),this.msg=e.message,this.initial=Cc(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Cc(e.min)?e.min:-1/0,this.max=Cc(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=dn.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${B0(e,this.round)}`),this._value=B0(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||rR.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(un.down(VC(this.outputError,this.out.columns)-1)+L0(this.outputError,this.out.columns)),this.out.write(L0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xc.symbol(this.done,this.aborted),an.bold(this.msg),xc.delimiter(this.done),!this.done||!this.done&&!this.placeholder?an[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
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(fn.down(tR(this.outputError,this.out.columns)-1)+z0(this.outputError,this.out.columns)),this.out.write(z0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ic.symbol(this.done,this.aborted),dn.bold(this.msg),Ic.delimiter(this.done),!this.done||!this.done&&!this.placeholder?dn[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
78
78
  `).reduce((e,t,s)=>e+`
79
- ${s?" ":LC.pointerSmall} ${an.red().italic(t)}`,"")),this.out.write(MC.line+un.to(0)+this.outputText+un.save+this.outputError+un.restore))}};F0.exports=Pc});var Ac=d((qD,z0)=>{"use strict";var at=ee(),{cursor:UC}=te(),HC=gt(),{clear:H0,figures:kt,style:G0,wrap:GC,entriesToDisplay:zC}=Be(),Ic=class extends HC{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=H0("",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(`
79
+ ${s?" ":eR.pointerSmall} ${dn.red().italic(t)}`,"")),this.out.write(QC.line+fn.to(0)+this.outputText+fn.save+this.outputError+fn.restore))}};K0.exports=Rc});var qc=d((XD,J0)=>{"use strict";var ut=ee(),{cursor:sR}=te(),iR=_t(),{clear:Y0,figures:Mt,style:X0,wrap:nR,entriesToDisplay:oR}=Be(),Nc=class extends iR{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=Y0("",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
- ${kt.arrowUp}/${kt.arrowDown}: Highlight option
84
- ${kt.arrowLeft}/${kt.arrowRight}/[space]: Toggle selection
83
+ ${Mt.arrowUp}/${Mt.arrowDown}: Highlight option
84
+ ${Mt.arrowLeft}/${Mt.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?at.green(kt.radioOn):kt.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=`
87
- `+GC(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{startIndex:t,endIndex:s}=zC(this.cursor,e.length,this.optionsPerPage),i,n=[];for(let o=t;o<s;o++)o===t&&t>0?i=kt.arrowUp:o===s-1&&s<e.length?i=kt.arrowDown:i=" ",n.push(this.renderOption(this.cursor,e[o],o,i));return`
86
+ `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?ut.green(Mt.radioOn):Mt.radioOff)+" "+i+" ",o,a;return t.disabled?o=e===s?ut.gray().underline(t.title):ut.strikethrough().gray(t.title):(o=e===s?ut.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
+ `+nR(t.description,{margin:n.length,width:this.out.columns})))),n+o+ut.gray(a||"")}paginateOptions(e){if(e.length===0)return ut.red("No matches for this query.");let{startIndex:t,endIndex:s}=oR(this.cursor,e.length,this.optionsPerPage),i,n=[];for(let o=t;o<s;o++)o===t&&t>0?i=Mt.arrowUp:o===s-1&&s<e.length?i=Mt.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=[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(UC.hide),super.render();let e=[G0.symbol(this.done,this.aborted),at.bold(this.msg),G0.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=H0(e,this.out.columns)}};z0.exports=Ic});var X0=d((kD,Y0)=>{"use strict";var Ls=ee(),BC=gt(),{erase:WC,cursor:B0}=te(),{style:Cc,clear:W0,figures:Rc,wrap:KC,entriesToDisplay:YC}=Be(),K0=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),XC=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),JC=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Nc=class extends BC{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:JC(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=Cc.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=W0("",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=K0(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:XC(a,o),value:K0(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(`
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=[ut.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(ut.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(sR.hide),super.render();let e=[X0.symbol(this.done,this.aborted),ut.bold(this.msg),X0.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ut.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=Y0(e,this.out.columns)}};J0.exports=Nc});var r_=d((JD,t_)=>{"use strict";var Us=ee(),aR=_t(),{erase:uR,cursor:Z0}=te(),{style:jc,clear:Q0,figures:kc,wrap:cR,entriesToDisplay:lR}=Be(),e_=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),hR=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),dR=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Dc=class extends aR{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:dR(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=jc.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Q0("",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=e_(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:hR(a,o),value:e_(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?Rc.arrowUp:i?Rc.arrowDown:" ",a=t?Ls.cyan().underline(e.title):e.title;return o=(t?Ls.cyan(Rc.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
- `+KC(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ls.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(B0.hide):this.out.write(W0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=YC(this.select,this.choices.length,this.limit);if(this.outputText=[Cc.symbol(this.done,this.aborted,this.exited),Ls.bold(this.msg),Cc.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(`
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?Us.cyan().underline(e.title):e.title;return o=(t?Us.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
+ `+cR(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Us.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Z0.hide):this.out.write(Q0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=lR(this.select,this.choices.length,this.limit);if(this.outputText=[jc.symbol(this.done,this.aborted,this.exited),Us.bold(this.msg),jc.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||Ls.gray(this.fallback.title))}this.out.write(WC.line+B0.to(0)+this.outputText)}};Y0.exports=Nc});var e_=d((jD,Q0)=>{"use strict";var _t=ee(),{cursor:ZC}=te(),QC=Ac(),{clear:J0,style:Z0,figures:Cr}=Be(),qc=class extends QC{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=J0("",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:`
95
+ `+(s||Us.gray(this.fallback.title))}this.out.write(uR.line+Z0.to(0)+this.outputText)}};t_.exports=Dc});var o_=d((ZD,n_)=>{"use strict";var bt=ee(),{cursor:fR}=te(),pR=qc(),{clear:s_,style:i_,figures:Nr}=Be(),Mc=class extends pR{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=s_("",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
- ${Cr.arrowUp}/${Cr.arrowDown}: Highlight option
98
- ${Cr.arrowLeft}/${Cr.arrowRight}/[space]: Toggle selection
97
+ ${Nr.arrowUp}/${Nr.arrowDown}: Highlight option
98
+ ${Nr.arrowLeft}/${Nr.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:_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(Cr.radioOn):Cr.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(ZC.hide),super.render();let e=[Z0.symbol(this.done,this.aborted),_t.bold(this.msg),Z0.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=J0(e,this.out.columns)}};Q0.exports=qc});var n_=d((DD,i_)=>{var t_=ee(),eR=gt(),{style:r_,clear:tR}=Be(),{erase:rR,cursor:s_}=te(),kc=class extends eR{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(`
102
+ Filtered results for: ${this.inputValue?this.inputValue:bt.gray("Enter something to filter")}
103
+ `}renderOption(e,t,s){let i;return t.disabled?i=e===s?bt.gray().underline(t.title):bt.strikethrough().gray(t.title):i=e===s?bt.cyan().underline(t.title):t.title,(t.selected?bt.green(Nr.radioOn):Nr.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[bt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(bt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(fR.hide),super.render();let e=[i_.symbol(this.done,this.aborted),bt.bold(this.msg),i_.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=bt.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=s_(e,this.out.columns)}};n_.exports=Mc});var h_=d((QD,l_)=>{var a_=ee(),mR=_t(),{style:u_,clear:gR}=Be(),{erase:yR,cursor:c_}=te(),Lc=class extends mR{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(s_.hide):this.out.write(tR(this.outputText,this.out.columns)),super.render(),this.outputText=[r_.symbol(this.done,this.aborted),t_.bold(this.msg),r_.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:t_.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(rR.line+s_.to(0)+this.outputText))}};i_.exports=kc});var a_=d((MD,o_)=>{"use strict";o_.exports={TextPrompt:i0(),SelectPrompt:u0(),TogglePrompt:d0(),DatePrompt:M0(),NumberPrompt:U0(),MultiselectPrompt:Ac(),AutocompletePrompt:X0(),AutocompleteMultiselectPrompt:e_(),ConfirmPrompt:n_()}});var c_=d(u_=>{"use strict";var Oe=u_,sR=a_(),cn=r=>r;function ut(r,e,t={}){return new Promise((s,i)=>{let n=new sR[r](e),o=t.onAbort||cn,a=t.onSubmit||cn,u=t.onExit||cn;n.on("state",e.onState||cn),n.on("submit",c=>s(a(c))),n.on("exit",c=>s(u(c))),n.on("abort",c=>i(o(c)))})}Oe.text=r=>ut("TextPrompt",r);Oe.password=r=>(r.style="password",Oe.text(r));Oe.invisible=r=>(r.style="invisible",Oe.text(r));Oe.number=r=>ut("NumberPrompt",r);Oe.date=r=>ut("DatePrompt",r);Oe.confirm=r=>ut("ConfirmPrompt",r);Oe.list=r=>{let e=r.separator||",";return ut("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};Oe.toggle=r=>ut("TogglePrompt",r);Oe.select=r=>ut("SelectPrompt",r);Oe.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})};Oe.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 iR=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Oe.autocomplete=r=>(r.suggest=r.suggest||iR,r.choices=[].concat(r.choices||[]),ut("AutocompletePrompt",r))});var d_=d((VD,h_)=>{"use strict";var jc=c_(),nR=["suggest","format","onState","validate","onRender","type"],l_=()=>{};async function jt(r=[],{onSubmit:e=l_,onCancel:t=l_}={}){let s={},i=jt._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(nR.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=jt._injected?oR(jt._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 oR(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function aR(r){jt._injected=(jt._injected||[]).concat(r)}function uR(r){jt._override=Object.assign({},r)}h_.exports=Object.assign(jt,{prompt:jt,prompts:jc,inject:aR,override:uR})});var p_=d((FD,f_)=>{function cR(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}f_.exports=cR("8.6.0")?My():d_()});var Us=d(Uc=>{var fn=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}},Fc=class extends fn{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Uc.CommanderError=fn;Uc.InvalidArgumentError=Fc});var pn=d(Gc=>{var{InvalidArgumentError:SR}=Us(),Hc=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 SR(`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 OR(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Gc.Argument=Hc;Gc.humanReadableArgName=OR});var Wc=d(Bc=>{var{humanReadableArgName:xR}=pn(),zc=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=>xR(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 x_(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,`
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(c_.hide):this.out.write(gR(this.outputText,this.out.columns)),super.render(),this.outputText=[u_.symbol(this.done,this.aborted),a_.bold(this.msg),u_.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:a_.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(yR.line+c_.to(0)+this.outputText))}};l_.exports=Lc});var f_=d((e2,d_)=>{"use strict";d_.exports={TextPrompt:l0(),SelectPrompt:p0(),TogglePrompt:_0(),DatePrompt:G0(),NumberPrompt:W0(),MultiselectPrompt:qc(),AutocompletePrompt:r_(),AutocompleteMultiselectPrompt:o_(),ConfirmPrompt:h_()}});var m_=d(p_=>{"use strict";var Oe=p_,_R=f_(),pn=r=>r;function ct(r,e,t={}){return new Promise((s,i)=>{let n=new _R[r](e),o=t.onAbort||pn,a=t.onSubmit||pn,u=t.onExit||pn;n.on("state",e.onState||pn),n.on("submit",c=>s(a(c))),n.on("exit",c=>s(u(c))),n.on("abort",c=>i(o(c)))})}Oe.text=r=>ct("TextPrompt",r);Oe.password=r=>(r.style="password",Oe.text(r));Oe.invisible=r=>(r.style="invisible",Oe.text(r));Oe.number=r=>ct("NumberPrompt",r);Oe.date=r=>ct("DatePrompt",r);Oe.confirm=r=>ct("ConfirmPrompt",r);Oe.list=r=>{let e=r.separator||",";return ct("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};Oe.toggle=r=>ct("TogglePrompt",r);Oe.select=r=>ct("SelectPrompt",r);Oe.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ct("MultiselectPrompt",r,{onAbort:e,onSubmit:e})};Oe.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return ct("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var vR=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Oe.autocomplete=r=>(r.suggest=r.suggest||vR,r.choices=[].concat(r.choices||[]),ct("AutocompletePrompt",r))});var __=d((r2,y_)=>{"use strict";var Vc=m_(),bR=["suggest","format","onState","validate","onRender","type"],g_=()=>{};async function Lt(r=[],{onSubmit:e=g_,onCancel:t=g_}={}){let s={},i=Lt._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(bR.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,Vc[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=Lt._injected?wR(Lt._injected,o.initial):await Vc[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 $R(r){Lt._injected=(Lt._injected||[]).concat(r)}function ER(r){Lt._override=Object.assign({},r)}y_.exports=Object.assign(Lt,{prompt:Lt,prompts:Vc,inject:$R,override:ER})});var b_=d((s2,v_)=>{function SR(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}v_.exports=SR("8.6.0")?Gy():__()});var zs=d(Bc=>{var _n=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}},zc=class extends _n{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Bc.CommanderError=_n;Bc.InvalidArgumentError=zc});var vn=d(Wc=>{var{InvalidArgumentError:LR}=zs(),Kc=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 LR(`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 VR(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Wc.Argument=Kc;Wc.humanReadableArgName=VR});var Jc=d(Xc=>{var{humanReadableArgName:FR}=vn(),Yc=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=>FR(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 R_(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 x_(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}Bc.Help=zc;Bc.stripColor=x_});var Jc=d(Xc=>{var{InvalidArgumentError:TR}=Us(),Kc=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=PR(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 TR(`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?T_(this.name().replace(/^no-/,"")):T_(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}},Yc=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 T_(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function PR(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}
109
+ `)}};function R_(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}Xc.Help=Yc;Xc.stripColor=R_});var tl=d(el=>{var{InvalidArgumentError:UR}=zs(),Zc=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=HR(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 UR(`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?N_(this.name().replace(/^no-/,"")):N_(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}},Qc=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 N_(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function HR(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}}Xc.Option=Kc;Xc.DualOptions=Yc});var I_=d(P_=>{function IR(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 AR(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=IR(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?`
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}}el.Option=Zc;el.DualOptions=Qc});var j_=d(q_=>{function GR(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 zR(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=GR(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]}?)`:""}P_.suggestSimilar=AR});var N_=d(rl=>{var CR=require("node:events").EventEmitter,Zc=require("node:child_process"),vt=require("node:path"),mn=require("node:fs"),M=require("node:process"),{Argument:RR,humanReadableArgName:NR}=pn(),{CommanderError:Qc}=Us(),{Help:qR,stripColor:kR}=Wc(),{Option:A_,DualOptions:jR}=Jc(),{suggestSimilar:C_}=I_(),el=class r extends CR{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:()=>tl()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>tl()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:t=>kR(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 qR,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 RR(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 Qc(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 A_(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 A_)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(mn.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
117
+ (Did you mean ${s[0]}?)`:""}q_.suggestSimilar=zR});var L_=d(ol=>{var BR=require("node:events").EventEmitter,rl=require("node:child_process"),wt=require("node:path"),bn=require("node:fs"),M=require("node:process"),{Argument:KR,humanReadableArgName:WR}=vn(),{CommanderError:sl}=zs(),{Help:YR,stripColor:XR}=Jc(),{Option:k_,DualOptions:JR}=tl(),{suggestSimilar:D_}=j_(),il=class r extends BR{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:()=>nl()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>nl()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:t=>XR(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 YR,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 KR(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 sl(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 k_(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 k_)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(bn.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=vt.resolve(l,h);if(mn.existsSync(f))return f;if(i.includes(vt.extname(h)))return;let p=i.find(m=>mn.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=mn.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=vt.resolve(vt.dirname(l),a)}if(a){let l=n(a,o);if(!l&&!e._executableFile&&this._scriptPath){let h=vt.basename(this._scriptPath,vt.extname(this._scriptPath));h!==this._name&&(l=n(a,`${h}-${e._name}`))}o=l||o}s=i.includes(vt.extname(o));let u;M.platform!=="win32"?s?(t.unshift(o),t=R_(M.execArgv).concat(t),u=Zc.spawn(M.argv[0],t,{stdio:"inherit"})):u=Zc.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=R_(M.execArgv).concat(t),u=Zc.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 Qc(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 Qc(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}
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=wt.resolve(l,h);if(bn.existsSync(f))return f;if(i.includes(wt.extname(h)))return;let p=i.find(m=>bn.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=bn.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=wt.resolve(wt.dirname(l),a)}if(a){let l=n(a,o);if(!l&&!e._executableFile&&this._scriptPath){let h=wt.basename(this._scriptPath,wt.extname(this._scriptPath));h!==this._name&&(l=n(a,`${h}-${e._name}`))}o=l||o}s=i.includes(wt.extname(o));let u;M.platform!=="win32"?s?(t.unshift(o),t=M_(M.execArgv).concat(t),u=rl.spawn(M.argv[0],t,{stdio:"inherit"})):u=rl.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=M_(M.execArgv).concat(t),u=rl.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 sl(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 sl(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 jR(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=C_(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=C_(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=>NR(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=vt.basename(e,vt.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.
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 JR(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=D_(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=D_(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=>WR(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=wt.basename(e,wt.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 R_(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 tl(){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}rl.Command=el;rl.useColor=tl});var D_=d(je=>{var{Argument:q_}=pn(),{Command:sl}=N_(),{CommanderError:DR,InvalidArgumentError:k_}=Us(),{Help:MR}=Wc(),{Option:j_}=Jc();je.program=new sl;je.createCommand=r=>new sl(r);je.createOption=(r,e)=>new j_(r,e);je.createArgument=(r,e)=>new q_(r,e);je.Command=sl;je.Option=j_;je.Argument=q_;je.Help=MR;je.CommanderError=DR;je.InvalidArgumentError=k_;je.InvalidOptionArgumentError=k_});var km=require("node:util"),Ou=Y(require("node:process"),1),Rt=Y(require("node:fs"),1),xu=Y(require("node:path"),1),Tr=Y(require("node:crypto"),1),jm=Y(require("node:assert"),1);var Dt=r=>{let e=typeof r;return r!==null&&(e==="object"||e==="function")};var En=new Set(["__proto__","prototype","constructor"]),wv=new Set("0123456789");function Ys(r){let e=[],t="",s="start",i=!1;for(let n of r)switch(n){case"\\":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");i&&(t+=n),s="property",i=!i;break}case".":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="property";break}if(i){i=!1,t+=n;break}if(En.has(t))return[];e.push(t),t="",s="property";break}case"[":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="index";break}if(i){i=!1,t+=n;break}if(s==="property"){if(En.has(t))return[];e.push(t),t=""}s="index";break}case"]":{if(s==="index"){e.push(Number.parseInt(t,10)),t="",s="indexEnd";break}if(s==="indexEnd")throw new Error("Invalid character after an index")}default:{if(s==="index"&&!wv.has(n))throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");s==="start"&&(s="property"),i&&(i=!1,t+="\\"),t+=n}}switch(i&&(t+="\\"),s){case"property":{if(En.has(t))return[];e.push(t);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Sn(r,e){if(typeof e!="number"&&Array.isArray(r)){let t=Number.parseInt(e,10);return Number.isInteger(t)&&r[t]===r[e]}return!1}function ll(r,e){if(Sn(r,e))throw new Error("Cannot use string index")}function hl(r,e,t){if(!Dt(r)||typeof e!="string")return t===void 0?r:t;let s=Ys(e);if(s.length===0)return t;for(let i=0;i<s.length;i++){let n=s[i];if(Sn(r,n)?r=i===s.length-1?void 0:null:r=r[n],r==null){if(i!==s.length-1)return t;break}}return r===void 0?t:r}function On(r,e,t){if(!Dt(r)||typeof e!="string")return r;let s=r,i=Ys(e);for(let n=0;n<i.length;n++){let o=i[n];ll(r,o),n===i.length-1?r[o]=t:Dt(r[o])||(r[o]=typeof i[n+1]=="number"?[]:{}),r=r[o]}return s}function dl(r,e){if(!Dt(r)||typeof e!="string")return!1;let t=Ys(e);for(let s=0;s<t.length;s++){let i=t[s];if(ll(r,i),s===t.length-1)return delete r[i],!0;if(r=r[i],!Dt(r))return!1}}function fl(r,e){if(!Dt(r)||typeof e!="string")return!1;let t=Ys(e);if(t.length===0)return!1;for(let s of t){if(!Dt(r)||!(s in r)||Sn(r,s))return!1;r=r[s]}return!0}var X=Y(require("node:path"),1),xn=Y(require("node:os"),1),Xs=Y(require("node:process"),1),wt=xn.default.homedir(),Tn=xn.default.tmpdir(),{env:rr}=Xs.default,$v=r=>{let e=X.default.join(wt,"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(Tn,r)}},Ev=r=>{let e=rr.APPDATA||X.default.join(wt,"AppData","Roaming"),t=rr.LOCALAPPDATA||X.default.join(wt,"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(Tn,r)}},Sv=r=>{let e=X.default.basename(wt);return{data:X.default.join(rr.XDG_DATA_HOME||X.default.join(wt,".local","share"),r),config:X.default.join(rr.XDG_CONFIG_HOME||X.default.join(wt,".config"),r),cache:X.default.join(rr.XDG_CACHE_HOME||X.default.join(wt,".cache"),r),log:X.default.join(rr.XDG_STATE_HOME||X.default.join(wt,".local","state"),r),temp:X.default.join(Tn,e,r)}};function Pn(r,{suffix:e="nodejs"}={}){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);return e&&(r+=`-${e}`),Xs.default.platform==="darwin"?$v(r):Xs.default.platform==="win32"?Ev(r):Sv(r)}var Pl=Y(require("node:path"),1);var k=Y(require("node:fs"),1),ne=require("node:util");var Ov=(r,e)=>{let{onError:t}=e;return function(...i){return r.apply(void 0,i).catch(t)}},Ke=Ov;var xv=(r,e)=>{let{onError:t}=e;return function(...i){try{return r.apply(void 0,i)}catch(n){return t(n)}}},Le=xv;var Pv=(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=Pv;var Iv=(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=Iv;var An=Y(require("node:process"),1);var Fr={isChangeErrorOk:r=>{if(!Fr.isNodeError(r))return!1;let{code:e}=r;return e==="ENOSYS"||!pl&&(e==="EINVAL"||e==="EPERM")},isNodeError:r=>r instanceof Error,isRetriableError:r=>{if(!Fr.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(!Fr.isNodeError(r))throw r;if(!Fr.isChangeErrorOk(r))throw r}},In=Fr;var Ur={onError:In.onChangeError},ve={onError:()=>{}},pl=An.default.getuid?!An.default.getuid():!1,ie={isRetriable:In.isRetriableError};var Av={attempt:{chmod:Ke((0,ne.promisify)(k.default.chmod),Ur),chown:Ke((0,ne.promisify)(k.default.chown),Ur),close:Ke((0,ne.promisify)(k.default.close),ve),fsync:Ke((0,ne.promisify)(k.default.fsync),ve),mkdir:Ke((0,ne.promisify)(k.default.mkdir),ve),realpath:Ke((0,ne.promisify)(k.default.realpath),ve),stat:Ke((0,ne.promisify)(k.default.stat),ve),unlink:Ke((0,ne.promisify)(k.default.unlink),ve),chmodSync:Le(k.default.chmodSync,Ur),chownSync:Le(k.default.chownSync,Ur),closeSync:Le(k.default.closeSync,ve),existsSync:Le(k.default.existsSync,ve),fsyncSync:Le(k.default.fsync,ve),mkdirSync:Le(k.default.mkdirSync,ve),realpathSync:Le(k.default.realpathSync,ve),statSync:Le(k.default.statSync,ve),unlinkSync:Le(k.default.unlinkSync,ve)},retry:{close:Ye((0,ne.promisify)(k.default.close),ie),fsync:Ye((0,ne.promisify)(k.default.fsync),ie),open:Ye((0,ne.promisify)(k.default.open),ie),readFile:Ye((0,ne.promisify)(k.default.readFile),ie),rename:Ye((0,ne.promisify)(k.default.rename),ie),stat:Ye((0,ne.promisify)(k.default.stat),ie),write:Ye((0,ne.promisify)(k.default.write),ie),writeFile:Ye((0,ne.promisify)(k.default.writeFile),ie),closeSync:Xe(k.default.closeSync,ie),fsyncSync:Xe(k.default.fsyncSync,ie),openSync:Xe(k.default.openSync,ie),readFileSync:Xe(k.default.readFileSync,ie),renameSync:Xe(k.default.renameSync,ie),statSync:Xe(k.default.statSync,ie),writeSync:Xe(k.default.writeSync,ie),writeFileSync:Xe(k.default.writeFileSync,ie)}},se=Av;var $t=Y(require("node:process"),1),ml="utf8",Cn=438,gl=511;var yl={},_l=$t.default.geteuid?$t.default.geteuid():-1,vl=$t.default.getegid?$t.default.getegid():-1;var bl=1e3,wl=!!$t.default.getuid,_N=$t.default.getuid?!$t.default.getuid():!1,Rn=128;var $l=r=>r instanceof Error&&"code"in r;var Nn=r=>typeof r=="string",Js=r=>r===void 0;var Tl=Y(require("node:path"),1);var Mt=Y(require("node:process"),1);var qn=Y(require("node:process"),1),El=qn.default.platform==="linux",Zs=qn.default.platform==="win32";var kn=["SIGHUP","SIGINT","SIGTERM"];Zs||kn.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");El&&kn.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Sl=kn;var jn=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&&(Zs&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Mt.default.kill(Mt.default.pid,"SIGTERM"):Mt.default.kill(Mt.default.pid,e))}},this.hook=()=>{Mt.default.once("exit",()=>this.exit());for(let e of Sl)try{Mt.default.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Ol=new jn;var Cv=Ol.register,xl=Cv;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=Tl.default.basename(r);if(e.length<=Rn)return r;let t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!t)return r;let s=e.length-Rn;return`${r.slice(0,-e.length)}${t[1]}${t[2].slice(0,-s)}${t[3]}`}};xl(Te.purgeSyncAll);var Hr=Te;function Dn(r,e,t=yl){if(Nn(t))return Dn(r,e,{encoding:t});let i={timeout:t.timeout??bl},n=null,o=null,a=null;try{let u=se.attempt.realpathSync(r),c=!!u;r=u||r,[o,n]=Hr.get(r,t.tmpCreate||Hr.create,t.tmpPurge!==!1);let l=wl&&Js(t.chown),h=Js(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=Pl.default.dirname(r);se.attempt.mkdirSync(f,{mode:gl,recursive:!0})}a=se.retry.openSync(i)(o,"w",t.mode||Cn),t.tmpCreated&&t.tmpCreated(o),Nn(e)?se.retry.writeSync(i)(a,e,0,t.encoding||ml):Js(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!==vl)&&se.attempt.chownSync(o,t.chown.uid,t.chown.gid),t.mode&&t.mode!==Cn&&se.attempt.chmodSync(o,t.mode);try{se.retry.renameSync(i)(o,r)}catch(f){if(!$l(f)||f.code!=="ENAMETOOLONG")throw f;se.retry.renameSync(i)(o,Hr.truncate(r))}n(),o=null}finally{a&&se.attempt.closeSync(a),o&&Hr.purge(o)}}var Dm=Y(Ef(),1),Mm=Y(Ff(),1);var B1=(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);!W1(i,n)&&s||Object.defineProperty(r,t,n)},W1=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)},K1=(r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},Y1=(r,e)=>`/* Wrapped ${r}*/
131
- ${e}`,X1=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),J1=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Z1=(r,e,t)=>{let s=t===""?"":`with ${t.trim()}() `,i=Y1.bind(null,s,e.toString());Object.defineProperty(i,"name",J1);let{writable:n,enumerable:o,configurable:a}=X1;Object.defineProperty(r,"toString",{value:i,writable:n,enumerable:o,configurable:a})};function tu(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:s}=r;for(let i of Reflect.ownKeys(e))B1(r,e,i,t);return K1(r,e),Z1(r,e,s),r}var Q1=(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 tu(c,r),c.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},c},ru=Q1;var Zt=Y(Am(),1);var YP=Object.prototype.toString,XP="[object Uint8Array]",JP="[object ArrayBuffer]";function Rm(r,e,t){return r?r.constructor===e?!0:YP.call(r)===t:!1}function Nm(r){return Rm(r,Uint8Array,XP)}function ZP(r){return Rm(r,ArrayBuffer,JP)}function QP(r){return Nm(r)||ZP(r)}function eI(r){if(!Nm(r))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}function tI(r){if(!QP(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}function $u(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)eI(i),t.set(i,s),s+=i.length;return t}var Cm={utf8:new globalThis.TextDecoder("utf8")};function Eu(r,e="utf8"){return tI(r),Cm[e]??=new globalThis.TextDecoder(e),Cm[e].decode(r)}function rI(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}var sI=new globalThis.TextEncoder;function zi(r){return rI(r),sI.encode(r)}var wj=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var iI=Mm.default.default,qm="aes-256-cbc",xr=()=>Object.create(null),nI=r=>r!=null,oI=(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`)},Bi="__internal__",Su=`${Bi}.migrations.version`,Ps=class{path;events;#s;#t;#e;#r={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw new Error("Please specify the `projectName` option.");t.cwd=Pn(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!="object")throw new TypeError("The `schema` option must be an object.");let o=new Dm.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});iI(o);let a={...t.rootSchema,type:"object",properties:t.schema};this.#s=o.compile(a);for(let[u,c]of Object.entries(t.schema??{}))c?.default&&(this.#r[u]=c.default)}t.defaults&&(this.#r={...this.#r,...t.defaults}),t.serialize&&(this._serialize=t.serialize),t.deserialize&&(this._deserialize=t.deserialize),this.events=new EventTarget,this.#t=t.encryptionKey;let s=t.fileExtension?`.${t.fileExtension}`:"";this.path=xu.default.resolve(t.cwd,`${t.configName??"config"}${s}`);let i=this.store,n=Object.assign(xr(),t.defaults,i);if(t.migrations){if(!t.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(n);try{jm.default.deepEqual(i,n)}catch{this.store=n}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 ${Bi} key, as it's used to manage this module internal operations.`);let{store:s}=this,i=(n,o)=>{oI(n,o),this.#e.accessPropertiesByDotNotation?On(s,n,o):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?fl(this.store,e):e in this.store}reset(...e){for(let t of e)nI(this.#r[t])&&this.set(t,this.#r[t])}delete(e){let{store:t}=this;this.#e.accessPropertiesByDotNotation?dl(t,e):delete t[e],this.store=t}clear(){this.store=xr();for(let e of Object.keys(this.#r))this.reset(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._handleChange(()=>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._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=Rt.default.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),s=this._deserialize(t);return this._validate(s),Object.assign(xr(),s)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),xr();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return xr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:Eu(e);try{let t=e.slice(0,16),s=Tr.default.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),i=Tr.default.createDecipheriv(qm,s,t),n=e.slice(17),o=typeof n=="string"?zi(n):n;return Eu($u([i.update(o),i.final()]))}catch{}return e.toString()}_handleChange(e,t){let s=e(),i=()=>{let n=s,o=e();(0,km.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(){Rt.default.mkdirSync(xu.default.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let s=Tr.default.randomBytes(16),i=Tr.default.pbkdf2Sync(this.#t,s.toString(),1e4,32,"sha512"),n=Tr.default.createCipheriv(qm,i,s);t=$u([s,zi(":"),n.update(zi(t)),n.final()])}if(Ou.default.env.SNAP)Rt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Dn(this.path,t,{mode:this.#e.configFileMode})}catch(s){if(s?.code==="EXDEV"){Rt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw s}}_watch(){this._ensureDirectory(),Rt.default.existsSync(this.path)||this._write(xr()),Ou.default.platform==="win32"?Rt.default.watch(this.path,{persistent:!1},ru(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):Rt.default.watchFile(this.path,{persistent:!1},ru(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,t,s){let i=this._get(Su,"0.0.0"),n=Object.keys(e).filter(a=>this._shouldPerformMigration(a,i,t)),o={...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(Su,a),i=a,o={...this.store}}catch(u){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(i)||!Zt.default.eq(i,t))&&this._set(Su,t)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Bi?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${Bi}.`):!1}_isVersionInRangeFormat(e){return Zt.default.clean(e)===null}_shouldPerformMigration(e,t,s){return this._isVersionInRangeFormat(e)?t!=="0.0.0"&&Zt.default.satisfies(t,e)?!1:Zt.default.satisfies(s,e):!(Zt.default.lte(e,t)||Zt.default.gt(e,s))}_get(e,t){return hl(this.store,e,t)}_set(e,t){let{store:s}=this;On(s,e,t),this.store=s}};var $n=Y(p_());var m_=(r=0)=>e=>`\x1B[${e+r}m`,g_=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,y_=(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]}},UD=Object.keys(J.modifier),lR=Object.keys(J.color),hR=Object.keys(J.bgColor),HD=[...lR,...hR];function dR(){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=m_(),J.color.ansi256=g_(),J.color.ansi16m=y_(),J.bgColor.ansi=m_(10),J.bgColor.ansi256=g_(10),J.bgColor.ansi16m=y_(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 fR=dR(),We=fR;var hn=Y(require("node:process"),1),v_=Y(require("node:os"),1),Dc=Y(require("node:tty"),1);function ke(r,e=globalThis.Deno?globalThis.Deno.args:hn.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}=hn.default,ln;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?ln=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(ln=1);function pR(){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 mR(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function gR(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=pR();s!==void 0&&(ln=s);let i=t?ln: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(hn.default.platform==="win32"){let o=v_.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 __(r,e={}){let t=gR(r,{streamIsTTY:r&&r.isTTY,...e});return mR(t)}var yR={stdout:__({isTTY:Dc.default.isatty(1)}),stderr:__({isTTY:Dc.default.isatty(2)})},b_=yR;function w_(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 $_(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 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
132
132
  `:`
133
133
  `)+t,i=s+1,s=r.indexOf(`
134
- `,i)}while(s!==-1);return n+=r.slice(i),n}var{stdout:E_,stderr:S_}=b_,Mc=Symbol("GENERATOR"),Rr=Symbol("STYLER"),Vs=Symbol("IS_EMPTY"),O_=["ansi","ansi","ansi256","ansi16m"],Nr=Object.create(null),_R=(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=E_?E_.level:0;r.level=e.level===void 0?t:e.level};var vR=r=>{let e=(...t)=>t.join(" ");return _R(e,r),Object.setPrototypeOf(e,Fs.prototype),e};function Fs(r){return vR(r)}Object.setPrototypeOf(Fs.prototype,Function.prototype);for(let[r,e]of Object.entries(We))Nr[r]={get(){let t=dn(this,Vc(e.open,e.close,this[Rr]),this[Vs]);return Object.defineProperty(this,r,{value:t}),t}};Nr.visible={get(){let r=dn(this,this[Rr],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Lc=(r,e,t,...s)=>r==="rgb"?e==="ansi16m"?We[t].ansi16m(...s):e==="ansi256"?We[t].ansi256(We.rgbToAnsi256(...s)):We[t].ansi(We.rgbToAnsi(...s)):r==="hex"?Lc("rgb",e,t,...We.hexToRgb(...s)):We[t][r](...s),bR=["rgb","hex","ansi256"];for(let r of bR){Nr[r]={get(){let{level:t}=this;return function(...s){let i=Vc(Lc(r,O_[t],"color",...s),We.color.close,this[Rr]);return dn(this,i,this[Vs])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Nr[e]={get(){let{level:t}=this;return function(...s){let i=Vc(Lc(r,O_[t],"bgColor",...s),We.bgColor.close,this[Rr]);return dn(this,i,this[Vs])}}}}var wR=Object.defineProperties(()=>{},{...Nr,level:{enumerable:!0,get(){return this[Mc].level},set(r){this[Mc].level=r}}}),Vc=(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}},dn=(r,e,t)=>{let s=(...i)=>$R(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,wR),s[Mc]=r,s[Rr]=e,s[Vs]=t,s},$R=(r,e)=>{if(r.level<=0||!e)return r[Vs]?"":e;let t=r[Rr];if(t===void 0)return e;let{openAll:s,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=w_(e,t.close,t.open),t=t.parent;let n=e.indexOf(`
135
- `);return n!==-1&&(e=$_(e,i,s,n)),s+e+i};Object.defineProperties(Fs.prototype,Nr);var ER=Fs(),XD=Fs({level:S_?S_.level:0});var ue=ER;var M_=Y(D_(),1),{program:L_,createCommand:n2,createArgument:o2,createOption:a2,CommanderError:u2,InvalidArgumentError:c2,InvalidOptionArgumentError:l2,Command:h2,Argument:d2,Option:f2,Help:p2}=M_.default;var V_=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/i;function F_(){let r,e,t=new Promise((s,i)=>{r=s,e=i});return t.resolve=r,t.reject=e,t}var qr=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 bt(r){return r.toLocaleString("en-US",{useGrouping:!0})}function gn(r){if(r.length<=24)return{service:"",user:"",token:r};let e=Buffer.from(LR(r),"base64").toString("utf8").split("#");return{service:e[0]??"",user:e[1]??"",token:e[2]??""}}function LR(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 lv=require("net"),hv=Y(require("tls"));var yn=(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))(yn||{});function U_(r){return{name:Object.keys(yn).find(e=>yn[e]===r)??"UNKNOWN",isBinary:!!(r&64)}}var H_=1;var VR="service";var il=VR+".",G_=5e3;var FR=1*1024*1024,Hs=12,z_=70,B_=80,W_=0,K_=1,Y_=2,X_=4,J_=8,Z_=!!process.env.DERTUNNEL_DEBUG,_n=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+Hs)return this.buffer=t.subarray(s),!0;if(t[s+W_]!=z_||t[s+K_]!=B_)return this.reset(),!1;let i=t.readUint16LE(s+Y_),n=t.readUint32LE(s+X_),o=t.readUint32LE(s+J_),u=o+Hs+s;if(o>FR)return this.reset(),!1;if(t.length>=u)try{let c=t.subarray(s+Hs,u);Z_&&Q_(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 kr(r,e,t,s){let i=Buffer.isBuffer(s)?s:s?Buffer.from(JSON.stringify(s)):void 0,n=Buffer.allocUnsafe(Hs+(i?i.length:0));n.writeUint8(z_,W_),n.writeUint8(B_,K_),n.writeUint16LE(e,Y_),n.writeUint32LE(t,X_),n.writeUint32LE(i?i.length:0,J_),i?.copy(n,Hs,0);let o=r.write(n);return Z_&&Q_(e,t,i,!0),o}function Gs(r){return JSON.parse(r.toString("utf8"))}function Q_(r,e,t,s){let{name:i,isBinary:n}=U_(r);console.debug(`[msg-${s?"out":"in"} ${i} ${e>0?e:""}] ${t?n?`- ${t.length} payload bytes`:t.toString("utf8"):"- empty"}`)}var nl=require("node:crypto");var UR=128,tr,jr;function HR(r){if(r<0||r>1024)throw new RangeError("Wrong ID size");!tr||tr.length<r?(tr=Buffer.allocUnsafe(r*UR),nl.webcrypto.getRandomValues(tr),jr=0):jr+r>tr.length&&(nl.webcrypto.getRandomValues(tr),jr=0),jr+=r}function GR(r){return HR(r|=0),tr.subarray(jr-r,jr)}function zR(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 ol(r,e=21){return zR(r,e,GR)}var vn=ol("0123456789abcdef",8),O2=ol("0123456789abcdefghijklmnopqrstuvwxyz",24);var nv=4096,Dr=13,Mr=10,ev=new Uint8Array([72,84,84,80,47,49,46,49,Dr,Mr]),BR=new Uint8Array([72,84,84,80,47,49,46,49,32]),al=0,bn=1,wn=2,ul=3,tv=4,ov=5,zs=class{constructor(e){this.onParsed=e}onParsed;state=al;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===al||this.state===bn||this.state===wn){this.contentData=void 0;let n=s;if((s=e.indexOf(ev,n))>=0)for(let o=0;o<1;o++){let a=s+ev.length;for(;s>0&&e[s-1]!==Mr&&e[s-1]!==Dr;)s--;let u=e.subarray(s,a).toString("ascii").split(" ");if(u.length!==3){s=a;break}let c=sv(e,a);if(c){s=a+c.length,this.headers=iv(c);let{nextState:l,len:h}=rv(this.headers,!0);this.state=l,this.expectedBodyLen=h}else break;this.isRequest=!0,this.id=vn(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(BR,n))>=0){let o=s,a=e.length;for(;s<a&&!(e[s+1]===Dr&&e[s+2]===Mr);)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=sv(e,o);if(l){s=o+l.length,this.headers=iv(l);let{nextState:f,len:p}=rv(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===ul){let{ok:n,p:o,size:a}=WR(e,s);s=o,a>0?(this.expectedBodyLen=a,this.state=n?tv:al):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?wn:bn)}else if(this.state===tv){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=ul)}else if(this.state===ov){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?wn:bn)}if(i>=100)throw new Error("Internal parser error: "+this.state)}};function rv(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:ul,isChunked:!0,len:0}:t>0?{nextState:ov,isChunked:!1,len:t}:{nextState:e?wn:bn,isChunked:!1,len:0}}function sv(r,e){let t=e,s=Math.min(r.length-3,e+nv);for(;t<s&&!(r[t]===Dr&&r[t+1]===Mr&&r[t+2]===Dr&&r[t+3]===Mr);)t++;return t<s?r.slice(e,t+4):void 0}function iv(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 WR(r,e){let t=0,s=e,i=!1,n=KR(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 KR(r,e){let t=e,s=Math.min(r.length-1,e+nv);for(;t<s&&!(r[t]===Dr&&r[t+1]===Mr);)t++;return t<s?r.slice(e,t).toString("ascii"):void 0}var av="0.7.13";var Q={headerLines:[`/__\\ DERTUNNEL v${av} /__\\`,""],logLines:[],inspectedRequests:[],statusLines:[]};function Bs(){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=ue.blue(n.status):n.status<500?o=ue.yellow(n.status):o=ue.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=ue.white(n.content?" "+bt(n.content.length)+"b ":"");return`${ue.cyan(`${c} -`)} ${o} ${ue.green(n.method)} ${ue.white(f)} ${n.content?ue.gray(h):""} ${p} ${ue.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 Lr(r,e){process.stdout.isTTY?(e!==void 0?Q.headerLines[e]=r:Q.headerLines.push(r),Bs()):console.log(r)}function Ws(r){process.stdout.isTTY?(Q.logLines.push(r),Q.logLines.length>20&&Q.logLines.splice(0,1),Bs()):console.log(r)}var YR=new qr(200,()=>Bs());function uv(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}}}YR.update(void 0)}function cv(r){return["STATS | SENT chunks bytes | RECV chunks bytes | CONN active total errors |",` |${bt(r.chunksSent).padStart(14)}${bt(r.bytesSent).padStart(14)} |${bt(r.chunksReceived).padStart(14)}${bt(r.bytesReceived).padStart(14)} |${bt(r.currentConnections).padStart(14)}${bt(r.totalConnections).padStart(8)}${bt(r.connectionErrors).padStart(9)} |`,""]}async function dv(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=gn(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=F_(),m=r.serviceHost;m.startsWith(il)||(m=il+m);let g=()=>{let y=new qr(200,()=>S("data")),_={bytesReceived:0,bytesSent:0,chunksReceived:0,chunksSent:0,currentConnections:0,totalConnections:0,connectionErrors:0};function S(U,De){try{r.onEndpoint?.(U,_,De??"")}catch{}}s?.destroy(),r.ignoreCertErrors&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),s=hv.default.connect({timeout:1e4,host:m,port:r.servicePort||443,servername:m,...r.ignoreCertErrors?{checkServerIdentity:()=>{}}:{}},()=>{s&&(s.setKeepAlive(!0,G_),kr(s,1,0,{version:H_,user:c,token:l,endpoint:r.endpoint,endpointPrefix:r.endpointPrefix}))}),s.setMaxListeners(0);let O=new Map,E,$,ce=new _n(async(U,De,xe)=>{if(!e&&U===2){let G=Gs(xe);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,E=setInterval(()=>{if(!s){E&&clearInterval(E),$&&clearTimeout($);return}try{kr(s,7,0)}catch{E&&clearInterval(E)}$=setTimeout(()=>{r.onError?.("Server pong timeout"),s?.destroy()},7e3).unref()},15e3).unref()}if(U===3){s?.destroy();let G=Gs(xe);G.error&&r.onError?.(G.error);return}if(e){if(U===7)kr(s,8,0);else if(U===8)$&&clearTimeout($);else if(U===65){let G=O.get(De);if(G){if(_.bytesSent+=xe.length,_.chunksSent++,G.bytesSent+=xe.length,G.parserOut)try{G.parserOut.onData(xe)}catch(N){S("error",N?.message)}G.write(xe),y.update(void 0,!1)}}else if(U===4){let G=Gs(xe),N=(0,lv.createConnection)({host:h,port:f,allowHalfOpen:!1});N.channelId=G.channelId,N.wasConnected=!1;let Ks=vn(),Vr=Me=>{try{r.onProtocolData?.(Me.type,Ks,Me)}catch{}};r.protocols?.inspect&&(N.parserIn=new zs(Vr),N.parserOut=new zs(Vr)),N.bytesReceived=N.bytesSent=0,O.set(G.channelId,N),N.on("connect",()=>{N.wasConnected=!0,_.currentConnections++,_.totalConnections++,S("connect"),y.update(void 0,!0)}),N.on("close",()=>{N.wasConnected&&(_.currentConnections=Math.max(0,_.currentConnections-1)),O.delete(G.channelId),kr(s,6,0,{channelId:N.channelId}),S("disconnect"),y.update(void 0,!0)}),N.on("data",Me=>{if(N.bytesReceived+=Me.length,_.bytesReceived+=Me.length,_.chunksReceived++,N.parserIn)try{N.parserIn.onData(Me)}catch(pv){S("error",pv?.message)}!kr(s,66,N.channelId,Me)&&!N.isPaused()&&(N.pause(),s.once("drain",()=>{N.resume()})),y.update(void 0,!1)}),N.on("error",Me=>{_.connectionErrors++,S("error",Me?.message),y.update(void 0,!0)})}else if(U===5){let G=Gs(xe),N=O.get(G.channelId);N&&(O.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,E&&clearInterval(E),$&&clearTimeout($),O.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(),ce.receive(U).then(De=>{De||s?.destroy(),s?.resume()}).catch(De=>Ws(`Unexpected parser error: ${De.message}`)))})};return g(),r.waitForInitialConnection!==!1&&await p,()=>{t=!0,s?.destroy()}}(async function(){let e=new Ps({projectName:"dertunnel",defaults:{configured:!1,serviceUrl:"",user:"",token:""}}),t=e.get("configured"),s=L_.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,$n.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}=gn(a);c=o||c;let[l,h]=s.args;if(!l&&(l=(await(0,$n.default)({name:"value",type:"text",message:"Public endpoint name",validate:E=>V_.test(E)})).value,!l))throw new Error("Must specify a public endpoint name");if(!h&&(h=(await(0,$n.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 E=new URL(h);if(E.protocol!=="http:")throw new Error("Ony http protocol is supported for local endpoints");m=E.toString()}else f="127.0.0.1",p=g;Lr(`Service: ${ue.cyanBright(n||u)}`,3),Lr(`User: ${ue.cyanBright(c)}`,4),Lr(`Local: ${ue.cyanBright(m??`${f} ${p}`)}`,5);let y=!!i.inspect,_,S;if(n){let E=new URL(n);_=E.hostname,S=Number.parseInt(E.port||"443")}let O=await dv({clientToken:a,localServer:f,localPort:p,localUrl:m,serviceHost:_,servicePort:S,endpoint:l,endpointPrefix:void 0,ignoreCertErrors:!!i.ignoreCertErrors,waitForInitialConnection:!0,protocols:{inspect:y},onConnected:E=>{Lr(`Connected - public endpoint: ${ue.green(E)}`,6)},onError:E=>{Lr(ue.redBright(E),6)},onEndpoint(E,$,ce){Q.statusLines=cv($),E==="error"&&Ws(ue.redBright(ce)),Bs()},onProtocolData(E,$,ce){uv(E,$,ce)}});["SIGINT","SIGTERM","SIGQUIT"].forEach(E=>{process.on(E,()=>{Ws("Shutting down"),O(),process.exit(0)})})})().catch(r=>{console.error(r)});
134
+ `,i)}while(s!==-1);return n+=r.slice(i),n}var{stdout:A_,stderr:I_}=x_,Uc=Symbol("GENERATOR"),qr=Symbol("STYLER"),Hs=Symbol("IS_EMPTY"),C_=["ansi","ansi","ansi256","ansi16m"],jr=Object.create(null),NR=(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=A_?A_.level:0;r.level=e.level===void 0?t:e.level};var qR=r=>{let e=(...t)=>t.join(" ");return NR(e,r),Object.setPrototypeOf(e,Gs.prototype),e};function Gs(r){return qR(r)}Object.setPrototypeOf(Gs.prototype,Function.prototype);for(let[r,e]of Object.entries(Ke))jr[r]={get(){let t=yn(this,Gc(e.open,e.close,this[qr]),this[Hs]);return Object.defineProperty(this,r,{value:t}),t}};jr.visible={get(){let r=yn(this,this[qr],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Hc=(r,e,t,...s)=>r==="rgb"?e==="ansi16m"?Ke[t].ansi16m(...s):e==="ansi256"?Ke[t].ansi256(Ke.rgbToAnsi256(...s)):Ke[t].ansi(Ke.rgbToAnsi(...s)):r==="hex"?Hc("rgb",e,t,...Ke.hexToRgb(...s)):Ke[t][r](...s),jR=["rgb","hex","ansi256"];for(let r of jR){jr[r]={get(){let{level:t}=this;return function(...s){let i=Gc(Hc(r,C_[t],"color",...s),Ke.color.close,this[qr]);return yn(this,i,this[Hs])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);jr[e]={get(){let{level:t}=this;return function(...s){let i=Gc(Hc(r,C_[t],"bgColor",...s),Ke.bgColor.close,this[qr]);return yn(this,i,this[Hs])}}}}var kR=Object.defineProperties(()=>{},{...jr,level:{enumerable:!0,get(){return this[Uc].level},set(r){this[Uc].level=r}}}),Gc=(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}},yn=(r,e,t)=>{let s=(...i)=>DR(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,kR),s[Uc]=r,s[qr]=e,s[Hs]=t,s},DR=(r,e)=>{if(r.level<=0||!e)return r[Hs]?"":e;let t=r[qr];if(t===void 0)return e;let{openAll:s,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=T_(e,t.close,t.open),t=t.parent;let n=e.indexOf(`
135
+ `);return n!==-1&&(e=P_(e,i,s,n)),s+e+i};Object.defineProperties(Gs.prototype,jr);var MR=Gs(),d2=Gs({level:I_?I_.level:0});var le=MR;var G_=Y(H_(),1),{program:z_,createCommand:w2,createArgument:$2,createOption:E2,CommanderError:S2,InvalidArgumentError:O2,InvalidOptionArgumentError:x2,Command:T2,Argument:P2,Option:A2,Help:I2}=G_.default;var B_=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/i;function K_(){let r,e,t=new Promise((s,i)=>{r=s,e=i});return t.resolve=r,t.reject=e,t}var kr=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 $t(r){return r.toLocaleString("en-US",{useGrouping:!0})}function wn(r){if(r.length<=24)return{service:"",user:"",token:r};let e=Buffer.from(eN(r),"base64").toString("utf8").split("#");return{service:e[0]??"",user:e[1]??"",token:e[2]??""}}function eN(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 gv=require("net"),yv=Y(require("tls"));var $n=(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))($n||{});function W_(r){return{name:Object.keys($n).find(e=>$n[e]===r)??"UNKNOWN",isBinary:!!(r&64)}}var Y_=1;var tN="service";var ul=tN+".",X_=5e3;var rN=1*1024*1024,Bs=12,J_=70,Z_=80,Q_=0,ev=1,tv=2,rv=4,sv=8,iv=!!process.env.DERTUNNEL_DEBUG,En=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+Bs)return this.buffer=t.subarray(s),!0;if(t[s+Q_]!=J_||t[s+ev]!=Z_)return this.reset(),!1;let i=t.readUint16LE(s+tv),n=t.readUint32LE(s+rv),o=t.readUint32LE(s+sv),u=o+Bs+s;if(o>rN)return this.reset(),!1;if(t.length>=u)try{let c=t.subarray(s+Bs,u);iv&&nv(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 Dr(r,e,t,s){let i=Buffer.isBuffer(s)?s:s?Buffer.from(JSON.stringify(s)):void 0,n=Buffer.allocUnsafe(Bs+(i?i.length:0));n.writeUint8(J_,Q_),n.writeUint8(Z_,ev),n.writeUint16LE(e,tv),n.writeUint32LE(t,rv),n.writeUint32LE(i?i.length:0,sv),i?.copy(n,Bs,0);let o=r.write(n);return iv&&nv(e,t,i,!0),o}function Ks(r){return JSON.parse(r.toString("utf8"))}function nv(r,e,t,s){let{name:i,isBinary:n}=W_(r);console.debug(`[msg-${s?"out":"in"} ${i} ${e>0?e:""}] ${t?n?`- ${t.length} payload bytes`:t.toString("utf8"):"- empty"}`)}var cl=require("node:crypto");var sN=128,sr,Mr;function iN(r){if(r<0||r>1024)throw new RangeError("Wrong ID size");!sr||sr.length<r?(sr=Buffer.allocUnsafe(r*sN),cl.webcrypto.getRandomValues(sr),Mr=0):Mr+r>sr.length&&(cl.webcrypto.getRandomValues(sr),Mr=0),Mr+=r}function nN(r){return iN(r|=0),sr.subarray(Mr-r,Mr)}function oN(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 ll(r,e=21){return oN(r,e,nN)}var Sn=ll("0123456789abcdef",8),F2=ll("0123456789abcdefghijklmnopqrstuvwxyz",24);var hv=4096,Lr=13,Vr=10,ov=new Uint8Array([72,84,84,80,47,49,46,49,Lr,Vr]),aN=new Uint8Array([72,84,84,80,47,49,46,49,32]),hl=0,On=1,xn=2,dl=3,av=4,dv=5,Ws=class{constructor(e){this.onParsed=e}onParsed;state=hl;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===hl||this.state===On||this.state===xn){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]!==Vr&&e[s-1]!==Lr;)s--;let u=e.subarray(s,a).toString("ascii").split(" ");if(u.length!==3){s=a;break}let c=cv(e,a);if(c){s=a+c.length,this.headers=lv(c);let{nextState:l,len:h}=uv(this.headers,!0);this.state=l,this.expectedBodyLen=h}else break;this.isRequest=!0,this.id=Sn(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(aN,n))>=0){let o=s,a=e.length;for(;s<a&&!(e[s+1]===Lr&&e[s+2]===Vr);)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=cv(e,o);if(l){s=o+l.length,this.headers=lv(l);let{nextState:f,len:p}=uv(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===dl){let{ok:n,p:o,size:a}=uN(e,s);s=o,a>0?(this.expectedBodyLen=a,this.state=n?av:hl):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?xn:On)}else if(this.state===av){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=dl)}else if(this.state===dv){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?xn:On)}if(i>=100)throw new Error("Internal parser error: "+this.state)}};function uv(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:dl,isChunked:!0,len:0}:t>0?{nextState:dv,isChunked:!1,len:t}:{nextState:e?xn:On,isChunked:!1,len:0}}function cv(r,e){let t=e,s=Math.min(r.length-3,e+hv);for(;t<s&&!(r[t]===Lr&&r[t+1]===Vr&&r[t+2]===Lr&&r[t+3]===Vr);)t++;return t<s?r.slice(e,t+4):void 0}function lv(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 uN(r,e){let t=0,s=e,i=!1,n=cN(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 cN(r,e){let t=e,s=Math.min(r.length-1,e+hv);for(;t<s&&!(r[t]===Lr&&r[t+1]===Vr);)t++;return t<s?r.slice(e,t).toString("ascii"):void 0}var fv="0.7.14";var Q={headerLines:[`/__\\ DERTUNNEL v${fv} /__\\`,""],logLines:[],inspectedRequests:[],statusLines:[]};function Ys(){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?" "+$t(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 Fr(r,e){process.stdout.isTTY?(e!==void 0?Q.headerLines[e]=r:Q.headerLines.push(r),Ys()):console.log(r)}function Xs(r){process.stdout.isTTY?(Q.logLines.push(r),Q.logLines.length>20&&Q.logLines.splice(0,1),Ys()):console.log(r)}var lN=new kr(200,()=>Ys());function pv(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}}}lN.update(void 0)}function mv(r){return["STATS | SENT chunks bytes | RECV chunks bytes | CONN active total errors |",` |${$t(r.chunksSent).padStart(14)}${$t(r.bytesSent).padStart(14)} |${$t(r.chunksReceived).padStart(14)}${$t(r.bytesReceived).padStart(14)} |${$t(r.currentConnections).padStart(14)}${$t(r.totalConnections).padStart(8)}${$t(r.connectionErrors).padStart(9)} |`,""]}async function _v(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=wn(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=K_(),m=r.serviceHost;m.startsWith(ul)||(m=ul+m);let g=()=>{let y=new kr(200,()=>S("data")),_={bytesReceived:0,bytesSent:0,chunksReceived:0,chunksSent:0,currentConnections:0,totalConnections:0,connectionErrors:0};function S(U,De){try{r.onEndpoint?.(U,_,De??"")}catch{}}s?.destroy(),r.ignoreCertErrors&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"),s=yv.default.connect({timeout:1e4,host:m,port:r.servicePort||443,servername:m,...r.ignoreCertErrors?{checkServerIdentity:()=>{}}:{}},()=>{s&&(s.setKeepAlive(!0,X_),Dr(s,1,0,{version:Y_,user:c,token:l,endpoint:r.endpoint,endpointPrefix:r.endpointPrefix}))}),s.setMaxListeners(0);let O=new Map,E,$,he=new En(async(U,De,xe)=>{if(!e&&U===2){let G=Ks(xe);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,E=setInterval(()=>{if(!s){E&&clearInterval(E),$&&clearTimeout($);return}try{Dr(s,7,0)}catch{E&&clearInterval(E)}$=setTimeout(()=>{r.onError?.("Server pong timeout"),s?.destroy()},7e3).unref()},15e3).unref()}if(U===3){s?.destroy();let G=Ks(xe);G.error&&r.onError?.(G.error);return}if(e){if(U===7)Dr(s,8,0);else if(U===8)$&&clearTimeout($);else if(U===65){let G=O.get(De);if(G){if(_.bytesSent+=xe.length,_.chunksSent++,G.bytesSent+=xe.length,G.parserOut)try{G.parserOut.onData(xe)}catch(N){S("error",N?.message)}G.write(xe),y.update(void 0,!1)}}else if(U===4){let G=Ks(xe),N=(0,gv.createConnection)({host:h,port:f,allowHalfOpen:!1});N.channelId=G.channelId,N.wasConnected=!1;let Js=Sn(),Ur=Me=>{try{r.onProtocolData?.(Me.type,Js,Me)}catch{}};r.protocols?.inspect&&(N.parserIn=new Ws(Ur),N.parserOut=new Ws(Ur)),N.bytesReceived=N.bytesSent=0,O.set(G.channelId,N),N.on("connect",()=>{N.wasConnected=!0,_.currentConnections++,_.totalConnections++,S("connect"),y.update(void 0,!0)}),N.on("close",()=>{N.wasConnected&&(_.currentConnections=Math.max(0,_.currentConnections-1)),O.delete(G.channelId),Dr(s,6,0,{channelId:N.channelId}),S("disconnect"),y.update(void 0,!0)}),N.on("data",Me=>{if(N.bytesReceived+=Me.length,_.bytesReceived+=Me.length,_.chunksReceived++,N.parserIn)try{N.parserIn.onData(Me)}catch(bv){S("error",bv?.message)}!Dr(s,66,N.channelId,Me)&&!N.isPaused()&&(N.pause(),s.once("drain",()=>{N.resume()})),y.update(void 0,!1)}),N.on("error",Me=>{_.connectionErrors++,S("error",Me?.message),y.update(void 0,!0)})}else if(U===5){let G=Ks(xe),N=O.get(G.channelId);N&&(O.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,E&&clearInterval(E),$&&clearTimeout($),O.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(De=>{De||s?.destroy(),s?.resume()}).catch(De=>Xs(`Unexpected parser error: ${De.message}`)))})};return g(),r.waitForInitialConnection!==!1&&await p,()=>{t=!0,s?.destroy()}}(async function(){let e=new Cs({projectName:"dertunnel",defaults:{configured:!1,serviceUrl:"",user:"",token:""}}),t=e.get("configured"),s=z_.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,Tn.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}=wn(a);c=o||c;let[l,h]=s.args;if(!l&&(l=(await(0,Tn.default)({name:"value",type:"text",message:"Public endpoint name",validate:E=>B_.test(E)})).value,!l))throw new Error("Must specify a public endpoint name");if(!h&&(h=(await(0,Tn.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 E=new URL(h);if(E.protocol!=="http:")throw new Error("Ony http protocol is supported for local endpoints");m=E.toString()}else f="127.0.0.1",p=g;Fr(`Service: ${le.cyanBright(n||u)}`,3),Fr(`User: ${le.cyanBright(c)}`,4),Fr(`Local: ${le.cyanBright(m??`${f} ${p}`)}`,5);let y=!!i.inspect,_,S;if(n){let E=new URL(n);_=E.hostname,S=Number.parseInt(E.port||"443")}let O=await _v({clientToken:a,localServer:f,localPort:p,localUrl:m,serviceHost:_,servicePort:S,endpoint:l,endpointPrefix:void 0,ignoreCertErrors:!!i.ignoreCertErrors,waitForInitialConnection:!0,protocols:{inspect:y},onConnected:E=>{Fr(`Connected - public endpoint: ${le.green(E)}`,6)},onError:E=>{Fr(le.redBright(E),6)},onEndpoint(E,$,he){Q.statusLines=mv($),E==="error"&&Xs(le.redBright(he)),Ys()},onProtocolData(E,$,he){pv(E,$,he)}});["SIGINT","SIGTERM","SIGQUIT"].forEach(E=>{process.on(E,()=>{Xs("Shutting down"),O(),process.exit(0)})})})().catch(r=>{console.error(r)});