@faulpeltz/dertunnel 0.7.8 → 0.7.10

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,34 +1,34 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var lv=Object.create;var cl=Object.defineProperty;var hv=Object.getOwnPropertyDescriptor;var dv=Object.getOwnPropertyNames;var fv=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty;var d=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var mv=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dv(e))!pv.call(r,i)&&i!==t&&cl(r,i,{get:()=>e[i],enumerable:!(s=hv(e,i))||s.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?lv(fv(r)):{},mv(e||!r||!r.__esModule?cl(t,"default",{value:r,enumerable:!0}):t,r));var zr=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 Hr=class{};D._CodeOrName=Hr;D.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ft=class extends Hr{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=Ft;var Pe=class extends Hr{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 Ft&&(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;)Vn(t,e[s]),t.push(r[++s]);return new Pe(t)}D._=Il;var Ln=new Pe("+");function Al(r,...e){let t=[Gr(r[0])],s=0;for(;s<e.length;)t.push(Ln),Vn(t,e[s]),t.push(Ln,Gr(r[++s]));return Tv(t),new Pe(t)}D.str=Al;function Vn(r,e){e instanceof Pe?r.push(...e._items):e instanceof Ft?r.push(e):r.push(Av(e))}D.addCodeArg=Vn;function Tv(r){let e=1;for(;e<r.length-1;){if(r[e]===Ln){let t=Pv(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Pv(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof Ft||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 Ft))return`"${r}${e.slice(1)}`}function Iv(r,e){return e.emptyStr()?r:r.emptyStr()?e:Al`${r}${e}`}D.strConcat=Iv;function Av(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:Gr(Array.isArray(r)?r.join(","):r)}function Cv(r){return new Pe(Gr(r))}D.stringify=Cv;function Gr(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}D.safeStringify=Gr;function Rv(r){return typeof r=="string"&&D.IDENTIFIER.test(r)?new Pe(`.${r}`):Il`[${r}]`}D.getProperty=Rv;function Nv(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=Nv;function qv(r){return new Pe(r.toString())}D.regexpCode=qv});var Hn=d(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ValueScope=we.ValueScopeName=we.Scope=we.varKinds=we.UsedValueState=void 0;var be=zr(),Fn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Zs;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Zs||(we.UsedValueState=Zs={}));we.varKinds={const:new be.Name("const"),let:new be.Name("let"),var:new be.Name("var")};var Qs=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=Qs;var ei=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=ei;var kv=(0,be._)`\n`,Un=class extends Qs{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 ei(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,Zs.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 Fn(c);u.set(c,Zs.Completed)})}return n}};we.ValueScope=Un});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=zr(),Ve=Hn(),Ot=zr();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return Ot._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return Ot.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return Ot.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return Ot.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return Ot.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return Ot.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return Ot.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return Ot.Name}});var ii=Hn();Object.defineProperty(A,"Scope",{enumerable:!0,get:function(){return ii.Scope}});Object.defineProperty(A,"ValueScope",{enumerable:!0,get:function(){return ii.ValueScope}});Object.defineProperty(A,"ValueScopeName",{enumerable:!0,get:function(){return ii.ValueScopeName}});Object.defineProperty(A,"varKinds",{enumerable:!0,get:function(){return ii.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 lt=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Gn=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=nr(this.rhs,e,t)),this}get names(){return this.rhs instanceof q._CodeOrName?this.rhs.names:{}}},ti=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=nr(this.rhs,e,t),this}get names(){let e=this.lhs instanceof q.Name?{}:{...this.lhs.names};return si(e,this.rhs)}},zn=class extends ti{constructor(e,t,s,i){super(e,s,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Bn=class extends lt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Kn=class extends lt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Wn=class extends lt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Yn=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=nr(this.code,e,t),this}get names(){return this.code instanceof q._CodeOrName?this.code.names:{}}},Br=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)||(jv(e,n.names),s.splice(i,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Gt(e,t.names),{})}},ht=class extends Br{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Xn=class extends Br{},ir=class extends ht{};ir.kind="else";var Ut=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 ir(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=nr(this.condition,e,t),this}get names(){let e=super.names;return si(e,this.condition),this.else&&Gt(e,this.else.names),e}};Ut.kind="if";var Ht=class extends ht{};Ht.kind="for";var Jn=class extends Ht{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=nr(this.iteration,e,t),this}get names(){return Gt(super.names,this.iteration.names)}},Zn=class extends Ht{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=si(super.names,this.from);return si(e,this.to)}},ri=class extends Ht{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=nr(this.iterable,e,t),this}get names(){return Gt(super.names,this.iterable.names)}},Kr=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)}};Kr.kind="func";var Wr=class extends Br{render(e){return"return "+super.render(e)}};Wr.kind="return";var Qn=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&&Gt(e,this.catch.names),this.finally&&Gt(e,this.finally.names),e}},Yr=class extends ht{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yr.kind="catch";var Xr=class extends ht{render(e){return"finally"+super.render(e)}};Xr.kind="finally";var eo=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 Xn]}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 Gn(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 ti(e,t,s))}add(e,t){return this._leafNode(new zn(e,A.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==q.nil&&this._leafNode(new Yn(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 Ut(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 Ut(e))}else(){return this._elseNode(new ir)}endIf(){return this._endBlockNode(Ut,ir)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Jn(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 Zn(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 ri("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 ri("in",i,n,t),()=>s(n))}endFor(){return this._endBlockNode(Ht)}label(e){return this._leafNode(new Bn(e))}break(e){return this._leafNode(new Kn(e))}return(e){let t=new Wr;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Wr)}try(e,t,s){if(!t&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Qn;if(this._blockNode(i),this.code(e),t){let n=this.name("e");this._currNode=i.catch=new Yr(n),t(n)}return s&&(this._currNode=i.finally=new Xr,this.code(s)),this._endBlockNode(Yr,Xr)}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 Ut))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=eo;function Gt(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function si(r,e){return e instanceof q._CodeOrName?Gt(r,e.names):r}function nr(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 jv(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._)`!${to(r)}`}A.not=Cl;var Dv=Rl(A.operators.AND);function Mv(...r){return r.reduce(Dv)}A.and=Mv;var Lv=Rl(A.operators.OR);function Vv(...r){return r.reduce(Lv)}A.or=Vv;function Rl(r){return(e,t)=>e===q.nil?t:t===q.nil?e:(0,q._)`${to(e)} ${r} ${to(t)}`}function to(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(),Fv=zr();function Uv(r){let e={};for(let t of r)e[t]=!0;return e}C.toHash=Uv;function Hv(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(kl(r,e),!jl(e,r.self.RULES.all))}C.alwaysValidSchema=Hv;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 Gv(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=Gv;function zv({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=zv;function Bv(r){return Dl(decodeURIComponent(r))}C.unescapeFragment=Bv;function Kv(r){return encodeURIComponent(so(r))}C.escapeFragment=Kv;function so(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}C.escapeJsonPointer=so;function Dl(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}C.unescapeJsonPointer=Dl;function Wv(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}C.eachItem=Wv;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} || {}`),io(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&&io(r,t,e),t}C.evaluatedPropsToName=Ml;function io(r,e,t){Object.keys(t).forEach(s=>r.assign((0,F._)`${e}${(0,F.getProperty)(s)}`,!0))}C.setEvaluated=io;var ql={};function Yv(r,e){return r.scopeValue("func",{ref:e,code:ql[e.code]||(ql[e.code]=new Fv._Code(e.code))})}C.useFunc=Yv;var ro;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(ro||(C.Type=ro={}));function Xv(r,e,t){if(r instanceof F.Name){let s=e===ro.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():"/"+so(r)}C.getErrorPath=Xv;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(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var le=T(),Jv={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")};no.default=Jv});var Jr=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(),ni=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 Zv(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=Zv;function Qv(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=Qv;function eb(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=eb;function tb({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=tb;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 zt={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._)`{}`:rb(r,e,t)}function rb(r,e,t={}){let{gen:s,it:i}=r,n=[sb(i,t),ib(r,t)];return nb(r,e,n),s.object(...n)}function sb({errorPath:r},{instancePath:e}){let t=e?(0,j.str)`${r}${(0,ni.getErrorPath)(e,ni.Type.Str)}`:r;return[me.default.instancePath,(0,j.strConcat)(me.default.instancePath,t)]}function ib({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,ni.getErrorPath)(t,ni.Type.Str)}`),[zt.schemaPath,i]}function nb(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([zt.keyword,i],[zt.params,typeof e=="function"?e(r):e||(0,j._)`{}`]),u.messages&&s.push([zt.message,typeof t=="function"?t(r):t]),u.verbose&&s.push([zt.schema,o],[zt.parentSchema,(0,j._)`${l}${h}`],[me.default.data,n]),c&&s.push([zt.propertyName,c])}});var Gl=d(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.boolOrEmptySchema=or.topBoolOrEmptySchema=void 0;var ob=Jr(),ab=T(),ub=Ie(),cb={message:"boolean schema is false"};function lb(r){let{gen:e,schema:t,validateName:s}=r;t===!1?Hl(r,!1):typeof t=="object"&&t.$async===!0?e.return(ub.default.data):(e.assign((0,ab._)`${s}.errors`,null),e.return(!0))}or.topBoolOrEmptySchema=lb;function hb(r,e){let{gen:t,schema:s}=r;s===!1?(t.var(e,!1),Hl(r)):t.var(e,!0)}or.boolOrEmptySchema=hb;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,ob.reportError)(i,cb,void 0,e)}});var oo=d(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.getRules=ar.isJSONType=void 0;var db=["string","number","integer","boolean","null","object","array"],fb=new Set(db);function pb(r){return typeof r=="string"&&fb.has(r)}ar.isJSONType=pb;function mb(){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:{}}}ar.getRules=mb});var ao=d(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.shouldUseRule=xt.shouldUseGroup=xt.schemaHasRulesForType=void 0;function gb({schema:r,self:e},t){let s=e.RULES.types[t];return s&&s!==!0&&zl(r,s)}xt.schemaHasRulesForType=gb;function zl(r,e){return e.rules.some(t=>Bl(r,t))}xt.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))}xt.shouldUseRule=Bl});var Zr=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 yb=oo(),_b=ao(),vb=Jr(),I=T(),Kl=R(),ur;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(ur||(de.DataType=ur={}));function bb(r){let e=Wl(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=bb;function Wl(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(yb.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}de.getJSONTypes=Wl;function wb(r,e){let{gen:t,data:s,opts:i}=r,n=$b(e,i.coerceTypes),o=e.length>0&&!(n.length===0&&e.length===1&&(0,_b.schemaHasRulesForType)(r,e[0]));if(o){let a=co(e,s,i.strictNumbers,ur.Wrong);t.if(a,()=>{n.length?Eb(r,e,n):lo(r)})}return o}de.coerceAndCheckDataType=wb;var Yl=new Set(["string","number","integer","boolean","null"]);function $b(r,e){return e?r.filter(t=>Yl.has(t)||e==="array"&&t==="array"):[]}function Eb(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(co(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(),lo(r),s.endIf(),s.if((0,I._)`${a} !== undefined`,()=>{s.assign(i,a),Sb(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
2
+ "use strict";var cv=Object.create;var lc=Object.defineProperty;var hv=Object.getOwnPropertyDescriptor;var dv=Object.getOwnPropertyNames;var fv=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty;var d=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var mv=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dv(e))!pv.call(r,i)&&i!==t&&lc(r,i,{get:()=>e[i],enumerable:!(s=hv(e,i))||s.enumerable});return r};var Y=(r,e,t)=>(t=r!=null?cv(fv(r)):{},mv(e||!r||!r.__esModule?lc(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 Ft=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=Ft;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 Ft&&(t[s.str]=(t[s.str]||0)+1),t),{})}};D._Code=Pe;D.nil=new Pe("");function Ic(r,...e){let t=[r[0]],s=0;for(;s<e.length;)Vn(t,e[s]),t.push(r[++s]);return new Pe(t)}D._=Ic;var Ln=new Pe("+");function Ac(r,...e){let t=[zr(r[0])],s=0;for(;s<e.length;)t.push(Ln),Vn(t,e[s]),t.push(Ln,zr(r[++s]));return Tv(t),new Pe(t)}D.str=Ac;function Vn(r,e){e instanceof Pe?r.push(...e._items):e instanceof Ft?r.push(e):r.push(Av(e))}D.addCodeArg=Vn;function Tv(r){let e=1;for(;e<r.length-1;){if(r[e]===Ln){let t=Pv(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Pv(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof Ft||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 Ft))return`"${r}${e.slice(1)}`}function Iv(r,e){return e.emptyStr()?r:r.emptyStr()?e:Ac`${r}${e}`}D.strConcat=Iv;function Av(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:zr(Array.isArray(r)?r.join(","):r)}function Cv(r){return new Pe(zr(r))}D.stringify=Cv;function zr(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}D.safeStringify=zr;function Rv(r){return typeof r=="string"&&D.IDENTIFIER.test(r)?new Pe(`.${r}`):Ic`[${r}]`}D.getProperty=Rv;function Nv(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=Nv;function qv(r){return new Pe(r.toString())}D.regexpCode=qv});var Hn=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(),Fn=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 kv=(0,be._)`\n`,Un=class extends ei{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 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 c=a.get(o);if(c)return c}else a=this._values[n]=new Map;a.set(o,i);let u=this._scope[n]||(this._scope[n]=[]),l=u.length;return u[l]=t.ref,i.setValue(t,{property:n,itemIndex:l}),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(l=>{if(u.has(l))return;u.set(l,Qs.Started);let c=t(l);if(c){let h=this.opts.es5?we.varKinds.var:we.varKinds.const;n=(0,be._)`${n}${h} ${l} = ${c};${this.opts._n}`}else if(c=i?.(l))n=(0,be._)`${n}${c}${this.opts._n}`;else throw new Fn(l);u.set(l,Qs.Completed)})}return n}};we.ValueScope=Un});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=Hn(),Ot=Br();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return Ot._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return Ot.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return Ot.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return Ot.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return Ot.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return Ot.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return Ot.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return Ot.Name}});var ni=Hn();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}},Gn=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=nr(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=nr(this.rhs,e,t),this}get names(){let e=this.lhs instanceof q.Name?{}:{...this.lhs.names};return ii(e,this.rhs)}},zn=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}},Bn=class extends ct{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Kn=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}},Yn=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=nr(this.code,e,t),this}get names(){return this.code instanceof q._CodeOrName?this.code.names:{}}},Kr=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)||(jv(e,n.names),s.splice(i,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Gt(e,t.names),{})}},ht=class extends Kr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Xn=class extends Kr{},ir=class extends ht{};ir.kind="else";var Ut=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 ir(s):s}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(Cc(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=nr(this.condition,e,t),this}get names(){let e=super.names;return ii(e,this.condition),this.else&&Gt(e,this.else.names),e}};Ut.kind="if";var Ht=class extends ht{};Ht.kind="for";var Jn=class extends Ht{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=nr(this.iteration,e,t),this}get names(){return Gt(super.names,this.iteration.names)}},Zn=class extends Ht{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 Ht{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=nr(this.iterable,e,t),this}get names(){return Gt(super.names,this.iterable.names)}},Wr=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)}};Wr.kind="func";var Yr=class extends Kr{render(e){return"return "+super.render(e)}};Yr.kind="return";var Qn=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&&Gt(e,this.catch.names),this.finally&&Gt(e,this.finally.names),e}},Xr=class extends ht{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Xr.kind="catch";var Jr=class extends ht{render(e){return"finally"+super.render(e)}};Jr.kind="finally";var eo=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 Xn]}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 Gn(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 zn(e,A.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==q.nil&&this._leafNode(new Yn(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 Ut(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 Ut(e))}else(){return this._elseNode(new ir)}endIf(){return this._endBlockNode(Ut,ir)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Jn(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 Zn(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(Ht)}label(e){return this._leafNode(new Bn(e))}break(e){return this._leafNode(new Kn(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 Qn;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 Wr(e,t,s)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Wr)}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 Ut))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=eo;function Gt(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?Gt(r,e.names):r}function nr(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 jv(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function Cc(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,q._)`!${to(r)}`}A.not=Cc;var Dv=Rc(A.operators.AND);function Mv(...r){return r.reduce(Dv)}A.and=Mv;var Lv=Rc(A.operators.OR);function Vv(...r){return r.reduce(Lv)}A.or=Vv;function Rc(r){return(e,t)=>e===q.nil?t:t===q.nil?e:(0,q._)`${to(e)} ${r} ${to(t)}`}function to(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(),Fv=Br();function Uv(r){let e={};for(let t of r)e[t]=!0;return e}C.toHash=Uv;function Hv(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(kc(r,e),!jc(e,r.self.RULES.all))}C.alwaysValidSchema=Hv;function kc(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]||Lc(r,`unknown keyword: "${n}"`)}C.checkUnknownRules=kc;function jc(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}C.schemaHasRules=jc;function Gv(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=Gv;function zv({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=zv;function Bv(r){return Dc(decodeURIComponent(r))}C.unescapeFragment=Bv;function Kv(r){return encodeURIComponent(so(r))}C.escapeFragment=Kv;function so(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}C.escapeJsonPointer=so;function Dc(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}C.unescapeJsonPointer=Dc;function Wv(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}C.eachItem=Wv;function Nc({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:Nc({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} || {}`),io(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:Mc}),items:Nc({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 Mc(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,F._)`{}`);return e!==void 0&&io(r,t,e),t}C.evaluatedPropsToName=Mc;function io(r,e,t){Object.keys(t).forEach(s=>r.assign((0,F._)`${e}${(0,F.getProperty)(s)}`,!0))}C.setEvaluated=io;var qc={};function Yv(r,e){return r.scopeValue("func",{ref:e,code:qc[e.code]||(qc[e.code]=new Fv._Code(e.code))})}C.useFunc=Yv;var ro;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(ro||(C.Type=ro={}));function Xv(r,e,t){if(r instanceof F.Name){let s=e===ro.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():"/"+so(r)}C.getErrorPath=Xv;function Lc(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=Lc});var Ie=d(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});var ce=T(),Jv={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};no.default=Jv});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 Zv(r,e=he.keywordError,t,s){let{it:i}=r,{gen:n,compositeRule:o,allErrors:a}=i,u=Uc(r,e,t);s??(o||a)?Vc(n,u):Fc(i,(0,j._)`[${u}]`)}he.reportError=Zv;function Qv(r,e=he.keywordError,t){let{it:s}=r,{gen:i,compositeRule:n,allErrors:o}=s,a=Uc(r,e,t);Vc(i,a),n||o||Fc(s,me.default.vErrors)}he.reportExtraError=Qv;function eb(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=eb;function tb({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=tb;function Vc(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 Fc(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 zt={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 Uc(r,e,t){let{createErrors:s}=r.it;return s===!1?(0,j._)`{}`:rb(r,e,t)}function rb(r,e,t={}){let{gen:s,it:i}=r,n=[sb(i,t),ib(r,t)];return nb(r,e,n),s.object(...n)}function sb({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 ib({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)}`),[zt.schemaPath,i]}function nb(r,{params:e,message:t},s){let{keyword:i,data:n,schemaValue:o,it:a}=r,{opts:u,propertyName:l,topSchemaRef:c,schemaPath:h}=a;s.push([zt.keyword,i],[zt.params,typeof e=="function"?e(r):e||(0,j._)`{}`]),u.messages&&s.push([zt.message,typeof t=="function"?t(r):t]),u.verbose&&s.push([zt.schema,o],[zt.parentSchema,(0,j._)`${c}${h}`],[me.default.data,n]),l&&s.push([zt.propertyName,l])}});var Gc=d(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.boolOrEmptySchema=or.topBoolOrEmptySchema=void 0;var ob=Zr(),ab=T(),ub=Ie(),lb={message:"boolean schema is false"};function cb(r){let{gen:e,schema:t,validateName:s}=r;t===!1?Hc(r,!1):typeof t=="object"&&t.$async===!0?e.return(ub.default.data):(e.assign((0,ab._)`${s}.errors`,null),e.return(!0))}or.topBoolOrEmptySchema=cb;function hb(r,e){let{gen:t,schema:s}=r;s===!1?(t.var(e,!1),Hc(r)):t.var(e,!0)}or.boolOrEmptySchema=hb;function Hc(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,ob.reportError)(i,lb,void 0,e)}});var oo=d(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.getRules=ar.isJSONType=void 0;var db=["string","number","integer","boolean","null","object","array"],fb=new Set(db);function pb(r){return typeof r=="string"&&fb.has(r)}ar.isJSONType=pb;function mb(){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:{}}}ar.getRules=mb});var ao=d(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.shouldUseRule=xt.shouldUseGroup=xt.schemaHasRulesForType=void 0;function gb({schema:r,self:e},t){let s=e.RULES.types[t];return s&&s!==!0&&zc(r,s)}xt.schemaHasRulesForType=gb;function zc(r,e){return e.rules.some(t=>Bc(r,t))}xt.shouldUseGroup=zc;function Bc(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=Bc});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 yb=oo(),_b=ao(),vb=Zr(),I=T(),Kc=R(),ur;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(ur||(de.DataType=ur={}));function bb(r){let e=Wc(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=bb;function Wc(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(yb.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}de.getJSONTypes=Wc;function wb(r,e){let{gen:t,data:s,opts:i}=r,n=$b(e,i.coerceTypes),o=e.length>0&&!(n.length===0&&e.length===1&&(0,_b.schemaHasRulesForType)(r,e[0]));if(o){let a=lo(e,s,i.strictNumbers,ur.Wrong);t.if(a,()=>{n.length?Eb(r,e,n):co(r)})}return o}de.coerceAndCheckDataType=wb;var Yc=new Set(["string","number","integer","boolean","null"]);function $b(r,e){return e?r.filter(t=>Yc.has(t)||e==="array"&&t==="array"):[]}function Eb(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(lo(e,i,n.strictNumbers),()=>s.assign(a,i))),s.if((0,I._)`${a} !== undefined`);for(let l of t)(Yc.has(l)||l==="array"&&n.coerceTypes==="array")&&u(l);s.else(),co(r),s.endIf(),s.if((0,I._)`${a} !== undefined`,()=>{s.assign(i,a),Sb(r,a)});function u(l){switch(l){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
4
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,I._)`+${i}`);return;case"integer":s.elseIf((0,I._)`${o} === "boolean" || ${i} === null
5
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 Sb({gen:r,parentData:e,parentDataProperty:t},s){r.if((0,I._)`${e} !== undefined`,()=>r.assign((0,I._)`${e}[${t}]`,s))}function uo(r,e,t,s=ur.Correct){let i=s===ur.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===ur.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=uo;function co(r,e,t,s){if(r.length===1)return uo(r[0],e,t,s);let i,n=(0,Kl.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,uo(o,e,t,s));return i}de.checkDataTypes=co;var Ob={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,I._)`{type: ${r}}`:(0,I._)`{type: ${e}}`};function lo(r){let e=xb(r);(0,vb.reportError)(e,Ob)}de.reportTypeError=lo;function xb(r){let{gen:e,data:t,schema:s}=r,i=(0,Kl.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(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.assignDefaults=void 0;var cr=T(),Tb=R();function Pb(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))}oi.assignDefaults=Pb;function Xl(r,e,t){let{gen:s,compositeRule:i,data:n,opts:o}=r;if(t===void 0)return;let a=(0,cr._)`${n}${(0,cr.getProperty)(e)}`;if(i){(0,Tb.checkStrictMode)(r,`default is ignored for: ${a}`);return}let u=(0,cr._)`${a} === undefined`;o.useDefaults==="empty"&&(u=(0,cr._)`${u} || ${a} === null || ${a} === ""`),s.if(u,(0,cr._)`${a} = ${(0,cr.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(),ho=R(),Tt=Ie(),Ib=R();function Ab(r,e){let{gen:t,data:s,it:i}=r;t.if(po(t,s,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,z._)`${e}`},!0),r.error()})}V.checkReportMissingProp=Ab;function Cb({gen:r,data:e,it:{opts:t}},s,i){return(0,z.or)(...s.map(n=>(0,z.and)(po(r,e,n,t.ownProperties),(0,z._)`${i} = ${n}`)))}V.checkMissingProp=Cb;function Rb(r,e){r.setParams({missingProperty:e},!0),r.error()}V.reportMissingProp=Rb;function Zl(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,z._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=Zl;function fo(r,e,t){return(0,z._)`${Zl(r)}.call(${e}, ${t})`}V.isOwnProperty=fo;function Nb(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} !== undefined`;return s?(0,z._)`${i} && ${fo(r,e,t)}`:i}V.propertyInData=Nb;function po(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} === undefined`;return s?(0,z.or)(i,(0,z.not)(fo(r,e,t))):i}V.noPropertyInData=po;function Ql(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=Ql;function qb(r,e){return Ql(e).filter(t=>!(0,ho.alwaysValidSchema)(r,e[t]))}V.schemaProperties=qb;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 jb=(0,z._)`new RegExp`;function Db({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"?jb:(0,Ib.useFunc)(r,i)}(${t}, ${s})`})}V.usePattern=Db;function Mb(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:ho.Type.Num},n),e.if((0,z.not)(n),a)})}}V.validateArray=Mb;function Lb(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,ho.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=Lb});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(),Bt=Ie(),Vb=Ae(),Fb=Jr();function Ub(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=Ub;function Hb(r,e){var t;let{gen:s,keyword:i,schema:n,parentSchema:o,$data:a,it:u}=r;zb(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(()=>Gb(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?Bt.default.this:Bt.default.self,O=!("compile"in e&&!a||e.schema===!1);s.assign(h,(0,ge._)`${_}${(0,Vb.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=Hb;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 Gb(r,e){let{gen:t}=r;t.if((0,ge._)`Array.isArray(${e})`,()=>{t.assign(Bt.default.vErrors,(0,ge._)`${Bt.default.vErrors} === null ? ${e} : ${Bt.default.vErrors}.concat(${e})`).assign(Bt.default.errors,(0,ge._)`${Bt.default.vErrors}.length`),(0,Fb.extendErrors)(r)},()=>r.error())}function zb({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 Bb(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=Bb;function Kb({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=Kb});var ih=d(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.extendSubschemaMode=Pt.extendSubschemaData=Pt.getSubschema=void 0;var Ze=T(),sh=R();function Wb(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')}Pt.getSubschema=Wb;function Yb(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]}}Pt.extendSubschemaData=Yb;function Xb(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=Xb});var mo=d((FN,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((UN,oh)=>{"use strict";var It=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(){};ai(e,s,i,r,"",r)};It.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};It.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};It.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};It.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 ai(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 It.arrayKeywords)for(var f=0;f<h.length;f++)ai(r,e,t,h[f],i+"/"+l+"/"+f,n,i,l,s,f)}else if(l in It.propsKeywords){if(h&&typeof h=="object")for(var p in h)ai(r,e,t,h[p],i+"/"+l+"/"+Jb(p),n,i,l,s,p)}else(l in It.keywords||r.allKeys&&!(l in It.skipKeywords))&&ai(r,e,t,h,i+"/"+l,n,i,l,s)}t(s,i,n,o,a,u,c)}}function Jb(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qr=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 Zb=R(),Qb=mo(),ew=ah(),tw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function rw(r,e=!0){return typeof r=="boolean"?!0:e===!0?!go(r):e?uh(r)<=e:!1}$e.inlineRef=rw;var sw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function go(r){for(let e in r){if(sw.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(go)||typeof t=="object"&&go(t))return!0}return!1}function uh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!tw.has(t)&&(typeof r[t]=="object"&&(0,Zb.eachItem)(r[t],s=>e+=uh(s)),e===1/0))return 1/0}return e}function ch(r,e="",t){t!==!1&&(e=lr(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 iw=/#\/?$/;function lr(r){return r?r.replace(iw,""):""}$e.normalizeId=lr;function nw(r,e,t){return t=lr(t),r.resolve(e,t)}$e.resolveUrl=nw;var ow=/^[a-z_][-a-z0-9._]*$/i;function aw(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:s}=this.opts,i=lr(r[t]||e),n={"":i},o=ch(s,i,!1),a={},u=new Set;return ew(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=lr(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!==lr(g)&&(O[0]==="#"?(c(h,a[O],O),a[O]=h):this.refs[O]=g),O}function S(O){if(typeof O=="string"){if(!ow.test(O))throw new Error(`invalid anchor "${O}"`);_.call(this,`#${O}`)}}}),a;function c(h,f,p){if(f!==void 0&&!Qb(h,f))throw l(p)}function l(h){return new Error(`reference "${h}" resolves to more than one schema`)}}$e.getSchemaRefs=aw});var hr=d(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.getData=At.KeywordCxt=At.validateFunctionCode=void 0;var mh=Gl(),hh=Zr(),_o=ao(),ui=Zr(),uw=Jl(),ts=rh(),yo=ih(),w=T(),x=Ie(),cw=Qr(),dt=R(),es=Jr();function lw(r){if(_h(r)&&(vh(r),yh(r))){fw(r);return}gh(r,()=>(0,mh.topBoolOrEmptySchema)(r))}At.validateFunctionCode=lw;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)}`),dw(r,i),r.code(n)}):r.func(e,(0,w._)`${x.default.data}, ${hw(i)}`,s.$async,()=>r.code(dh(t,i)).code(n))}function hw(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 dw(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 fw(r){let{schema:e,opts:t,gen:s}=r;gh(r,()=>{t.$comment&&e.$comment&&wh(r),_w(r),s.let(x.default.vErrors,null),s.let(x.default.errors,0),t.unevaluated&&pw(r),bh(r),ww(r)})}function pw(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 mw(r,e){if(_h(r)&&(vh(r),yh(r))){gw(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 gw(r,e){let{schema:t,gen:s,opts:i}=r;i.$comment&&t.$comment&&wh(r),vw(r),bw(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,dt.checkUnknownRules)(r),yw(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 yw(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 _w(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 vw(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,cw.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function bw(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 ww(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&&$w(r),e.return((0,w._)`${x.default.errors} === 0`))}function $w({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,dt.schemaHasRulesButRef)(n,l))){i.block(()=>Eh(r,"$ref",l.all.$ref.definition));return}u.jtd||Ew(r,e),i.block(()=>{for(let f of l.rules)h(f);h(l.post)});function h(f){(0,_o.shouldUseGroup)(n,f)&&(f.type?(i.if((0,ui.checkDataType)(f.type,o,u.strictNumbers)),ph(r,f),e.length===1&&e[0]===f.type&&t&&(i.else(),(0,ui.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,uw.assignDefaults)(r,e.type),t.block(()=>{for(let n of e.rules)(0,_o.shouldUseRule)(s,n)&&Eh(r,n.keyword,n.definition,e.type)})}function Ew(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(Sw(r,e),r.opts.allowUnionTypes||Ow(r,e),xw(r,r.dataTypes))}function Sw(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{$h(r.dataTypes,t)||vo(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),Pw(r,e)}}function Ow(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&vo(r,"use allowUnionTypes to allow union type keyword")}function xw(r,e){let t=r.self.RULES.all;for(let s in t){let i=t[s];if(typeof i=="object"&&(0,_o.shouldUseRule)(r.schema,i)){let{type:n}=i.definition;n.length&&!n.some(o=>Tw(e,o))&&vo(r,`missing type "${n.join(",")}" for keyword "${s}"`)}}}function Tw(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 Pw(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 vo(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,dt.checkStrictMode)(r,e,r.opts.strictTypes)}var ci=class{constructor(e,t,s){if((0,ts.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",Sh(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ts.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?es.reportExtraError:es.reportError)(this,this.def.error,t)}$dataError(){(0,es.reportError)(this,this.def.$dataError||es.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,es.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,ui.checkDataTypes)(u,t,n.opts.strictNumbers,ui.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,yo.getSubschema)(this.it,e);(0,yo.extendSubschemaData)(s,this.it,e),(0,yo.extendSubschemaMode)(s,e);let i={...this.it,...s,items:void 0,props:void 0};return mw(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}};At.KeywordCxt=ci;function Eh(r,e,t,s){let i=new ci(r,t,e);"code"in t?t.code(i,s):i.$data&&t.validate?(0,ts.funcKeywordCode)(i,t):"macro"in t?(0,ts.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,ts.funcKeywordCode)(i,t)}var Iw=/^\/(?:[^~]|~0|~1)*$/,Aw=/^([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(!Iw.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,n=x.default.rootData}else{let c=Aw.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}`}}At.getData=Sh});var rs=d(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});var bo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};wo.default=bo});var dr=d(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});var $o=Qr(),Eo=class extends Error{constructor(e,t,s,i){super(i||`can't resolve reference ${s} from id ${t}`),this.missingRef=(0,$o.resolveUrl)(e,t,s),this.missingSchema=(0,$o.normalizeId)((0,$o.getFullPath)(e,this.missingRef))}};So.default=Eo});var ss=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(),Cw=rs(),Kt=Ie(),Ue=Qr(),Oh=R(),Rw=hr(),fr=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=fr;function xo(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:Cw.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:Kt.default.data,parentData:Kt.default.parentData,parentDataProperty:Kt.default.parentDataProperty,dataNames:[Kt.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,Rw.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();l=`${o.scopeRefs(Kt.default.scope)}return ${h}`,this.opts.code.process&&(l=this.opts.code.process(l,r));let p=new Function(`${Kt.default.self}`,`${Kt.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=xo;function Nw(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=jw.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 fr({schema:o,schemaId:a,root:r,baseId:e}))}if(n!==void 0)return r.refs[t]=qw.call(this,n)}Ce.resolveRef=Nw;function qw(r){return(0,Ue.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:xo.call(this,r)}function xh(r){for(let e of this._compilations)if(kw(e,r))return e}Ce.getCompilingSchema=xh;function kw(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function jw(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||li.call(this,r,e)}function li(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 Oo.call(this,t,r);let n=(0,Ue.normalizeId)(s),o=this.refs[n]||this.schemas[n];if(typeof o=="string"){let a=li.call(this,r,o);return typeof a?.schema!="object"?void 0:Oo.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||xo.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 fr({schema:a,schemaId:u,root:r,baseId:i})}return Oo.call(this,t,o)}}Ce.resolveSchema=li;var Dw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Oo(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];!Dw.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=li.call(this,s,a)}let{schemaId:o}=this.opts;if(n=n||new fr({schema:t,schemaId:o,root:s,baseId:e}),n.schema!==n.root.schema)return n}});var Th=d((WN,Mw)=>{Mw.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((YN,Ch)=>{"use strict";var Lw=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);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 Vw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Ph(r){return r.length=0,!0}function Fw(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 Uw(r){let e=0,t={error:!1,address:"",zone:""},s=[],i=[],n=!1,o=!1,a=Fw;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 Ah(r){if(Hw(r,":")<2)return{host:r,isIPV6:!1};let e=Uw(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 Hw(r,e){let t=0;for(let s=0;s<r.length;s++)r[s]===e&&t++;return t}function Gw(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("")}function zw(r,e){let t=e!==!0?escape:unescape;return r.scheme!==void 0&&(r.scheme=t(r.scheme)),r.userinfo!==void 0&&(r.userinfo=t(r.userinfo)),r.host!==void 0&&(r.host=t(r.host)),r.path!==void 0&&(r.path=t(r.path)),r.query!==void 0&&(r.query=t(r.query)),r.fragment!==void 0&&(r.fragment=t(r.fragment)),r}function Bw(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=Ah(t);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=r.host}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}Ch.exports={nonSimpleDomain:Vw,recomposeAuthority:Bw,normalizeComponentEncoding:zw,removeDotSegments:Gw,isIPv4:Ih,isUUID:Lw,normalizeIPv6:Ah,stringArrayToHexStripped:To}});var jh=d((XN,kh)=>{"use strict";var{isUUID:Kw}=Po(),Ww=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Yw=["http","https","ws","wss","urn","urn:uuid"];function Xw(r){return Yw.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 Rh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function Nh(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 Jw(r){return r.secure=Io(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function Zw(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 Qw(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(Ww);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 e$(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 t$(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!Kw(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function r$(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var qh={scheme:"http",domainHost:!0,parse:Rh,serialize:Nh},s$={scheme:"https",domainHost:qh.domainHost,parse:Rh,serialize:Nh},hi={scheme:"ws",domainHost:!0,parse:Jw,serialize:Zw},i$={scheme:"wss",domainHost:hi.domainHost,parse:hi.parse,serialize:hi.serialize},n$={scheme:"urn",parse:Qw,serialize:e$,skipNormalize:!0},o$={scheme:"urn:uuid",parse:t$,serialize:r$,skipNormalize:!0},di={http:qh,https:s$,ws:hi,wss:i$,urn:n$,"urn:uuid":o$};Object.setPrototypeOf(di,null);function Ao(r){return r&&(di[r]||di[r.toLowerCase()])||void 0}kh.exports={wsIsSecure:Io,SCHEMES:di,isValidSchemeName:Xw,getSchemeHandler:Ao}});var Lh=d((JN,pi)=>{"use strict";var{normalizeIPv6:a$,removeDotSegments:is,recomposeAuthority:u$,normalizeComponentEncoding:fi,isIPv4:c$,nonSimpleDomain:l$}=Po(),{SCHEMES:h$,getSchemeHandler:Dh}=jh();function d$(r,e){return typeof r=="string"?r=Qe(ft(r,e),e):typeof r=="object"&&(r=ft(Qe(r,e),e)),r}function f$(r,e,t){let s=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=Mh(ft(r,s),ft(e,s),s,!0);return s.skipEscape=!0,Qe(i,s)}function Mh(r,e,t,s){let i={};return s||(r=ft(Qe(r,t),t),e=ft(Qe(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=is(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=is(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=is(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=is(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 p$(r,e,t){return typeof r=="string"?(r=unescape(r),r=Qe(fi(ft(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=Qe(fi(r,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Qe(fi(ft(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=Qe(fi(e,!0),{...t,skipEscape:!0})),r.toLowerCase()===e.toLowerCase()}function Qe(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=Dh(s.scheme||t.scheme);n&&n.serialize&&n.serialize(t,s),t.path!==void 0&&(s.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),s.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let o=u$(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=is(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 m$=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ft(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;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let n=r.match(m$);if(n){if(s.scheme=n[1],s.userinfo=n[3],s.host=n[4],s.port=parseInt(n[5],10),s.path=n[6]||"",s.query=n[7],s.fragment=n[8],isNaN(s.port)&&(s.port=n[5]),s.host)if(c$(s.host)===!1){let u=a$(s.host);s.host=u.host.toLowerCase(),i=u.isIPV6}else i=!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 o=Dh(t.scheme||s.scheme);if(!t.unicodeSupport&&(!o||!o.unicodeSupport)&&s.host&&(t.domainHost||o&&o.domainHost)&&i===!1&&l$(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(a){s.error=s.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(r.indexOf("%")!==-1&&(s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),s.host!==void 0&&(s.host=unescape(s.host))),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),o&&o.parse&&o.parse(s,t)}else s.error=s.error||"URI can not be parsed.";return s}var Co={SCHEMES:h$,normalize:d$,resolve:f$,resolveComponent:Mh,equal:p$,serialize:Qe,parse:ft};pi.exports=Co;pi.exports.default=Co;pi.exports.fastUri=Co});var Fh=d(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});var Vh=Lh();Vh.code='require("ajv/dist/runtime/uri").default';Ro.default=Vh});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 g$=hr();Object.defineProperty(oe,"KeywordCxt",{enumerable:!0,get:function(){return g$.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 y$=rs(),Bh=dr(),_$=oo(),ns=ss(),v$=T(),os=Qr(),mi=Zr(),qo=R(),Uh=Th(),b$=Fh(),Kh=(r,e)=>new RegExp(r,e);Kh.code="new RegExp";var w$=["removeAdditional","useDefaults","coerceTypes"],$$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E$={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."},S$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Hh=200;function O$(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,Lr=(s=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&s!==void 0?s:Kh,Me=(i=r.uriResolver)!==null&&i!==void 0?i:b$.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:Lr}:{optimize:Ks,regExp:Lr},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:Hh,loopEnum:(y=r.loopEnum)!==null&&y!==void 0?y:Hh,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 as=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...O$(e)};let{es5:t,lines:s}=this.opts.code;this.scope=new v$.ValueScope({scope:{},prefixes:$$,es5:t,lines:s}),this.logger=C$(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,_$.getRules)(),Gh.call(this,E$,e,"NOT SUPPORTED"),Gh.call(this,S$,e,"DEPRECATED","warn"),this._metaOpts=I$.call(this),e.formats&&T$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&P$.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=Uh;s==="id"&&(i={...Uh},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 Bh.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,os.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=zh.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:s}=this.opts,i=new ns.SchemaEnv({schema:{},schemaId:s});if(t=ns.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=zh.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,os.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(N$.call(this,s,t),!t)return(0,qo.eachItem)(s,n=>No.call(this,n)),this;k$.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]=Wh(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,os.normalizeId)(o||s);let c=os.getSchemaRefs.call(this,e,s);return u=new ns.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):ns.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{ns.compileSchema.call(this,e)}finally{this.opts=t}}};as.ValidationError=y$.default;as.MissingRefError=Bh.default;oe.default=as;function Gh(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 zh(r){return r=(0,os.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 T$(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function P$(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 I$(){let r={...this.opts};for(let e of w$)delete r[e];return r}var A$={log(){},warn(){},error(){}};function C$(r){if(r===!1)return A$;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 R$=/^[a-z_$][a-z0-9_$:-]*$/i;function N$(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(!R$.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?q$.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 q$(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 k$(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=Wh(e)),r.validateSchema=this.compile(e,!0))}var j$={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Wh(r){return{anyOf:[r,j$]}}});var Yh=d(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});var D$={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};jo.default=D$});var _i=d(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.callRef=Wt.getValidate=void 0;var M$=dr(),Xh=Ae(),Ee=T(),mr=Ie(),Jh=ss(),gi=R(),L$={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=Jh.resolveRef.call(u,c,i,t);if(l===void 0)throw new M$.default(s.opts.uriResolver,i,t);if(l instanceof Jh.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=Zh(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 Zh(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=Zh;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,Xh.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,Xh.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=L$});var Mo=d(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var V$=Yh(),F$=_i(),U$=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",V$.default,F$.default];Do.default=U$});var Qh=d(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});var vi=T(),Ct=vi.operators,bi={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}},H$={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}}`},G$={keyword:Object.keys(bi),type:"number",schemaType:"number",$data:!0,error:H$,code(r){let{keyword:e,data:t,schemaCode:s}=r;r.fail$data((0,vi._)`${t} ${bi[e].fail} ${s} || isNaN(${t})`)}};Lo.default=G$});var ed=d(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var us=T(),z$={message:({schemaCode:r})=>(0,us.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,us._)`{multipleOf: ${r}}`},B$={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:z$,code(r){let{gen:e,data:t,schemaCode:s,it:i}=r,n=i.opts.multipleOfPrecision,o=e.let("res"),a=n?(0,us._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,us._)`${o} !== parseInt(${o})`;r.fail$data((0,us._)`(${s} === 0 || (${o} = ${t}/${s}, ${a}))`)}};Vo.default=B$});var rd=d(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});function td(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=td;td.code='require("ajv/dist/runtime/ucs2length").default'});var sd=d(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});var Yt=T(),K$=R(),W$=rd(),Y$={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Yt.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Yt._)`{limit: ${r}}`},X$={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Y$,code(r){let{keyword:e,data:t,schemaCode:s,it:i}=r,n=e==="maxLength"?Yt.operators.GT:Yt.operators.LT,o=i.opts.unicode===!1?(0,Yt._)`${t}.length`:(0,Yt._)`${(0,K$.useFunc)(r.gen,W$.default)}(${t})`;r.fail$data((0,Yt._)`${o} ${n} ${s}`)}};Uo.default=X$});var id=d(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var J$=Ae(),wi=T(),Z$={message:({schemaCode:r})=>(0,wi.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,wi._)`{pattern: ${r}}`},Q$={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Z$,code(r){let{data:e,$data:t,schema:s,schemaCode:i,it:n}=r,o=n.opts.unicodeRegExp?"u":"",a=t?(0,wi._)`(new RegExp(${i}, ${o}))`:(0,J$.usePattern)(r,s);r.fail$data((0,wi._)`!${a}.test(${e})`)}};Ho.default=Q$});var nd=d(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var cs=T(),eE={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,cs.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,cs._)`{limit: ${r}}`},tE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:eE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxProperties"?cs.operators.GT:cs.operators.LT;r.fail$data((0,cs._)`Object.keys(${t}).length ${i} ${s}`)}};Go.default=tE});var od=d(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});var ls=Ae(),hs=T(),rE=R(),sE={message:({params:{missingProperty:r}})=>(0,hs.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,hs._)`{missingProperty: ${r}}`},iE={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sE,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,rE.checkStrictMode)(o,_,o.opts.strictRequired)}}function c(){if(u||n)r.block$data(hs.nil,h);else for(let p of t)(0,ls.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,ls.checkMissingProp)(r,t,p)),(0,ls.reportMissingProp)(r,p),e.else()}function h(){e.forOf("prop",s,p=>{r.setParams({missingProperty:p}),e.if((0,ls.noPropertyInData)(e,i,p,a.ownProperties),()=>r.error())})}function f(p,m){r.setParams({missingProperty:p}),e.forOf(p,s,()=>{e.assign(m,(0,ls.propertyInData)(e,i,p,a.ownProperties)),e.if((0,hs.not)(m),()=>{r.error(),e.break()})},hs.nil)}}};zo.default=iE});var ad=d(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});var ds=T(),nE={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,ds.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,ds._)`{limit: ${r}}`},oE={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:nE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxItems"?ds.operators.GT:ds.operators.LT;r.fail$data((0,ds._)`${t}.length ${i} ${s}`)}};Bo.default=oE});var $i=d(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var ud=mo();ud.code='require("ajv/dist/runtime/equal").default';Ko.default=ud});var cd=d(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var Wo=Zr(),ae=T(),aE=R(),uE=$i(),cE={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}}`},lE={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:cE,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,Wo.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,Wo.checkDataTypes)(c,y,a.opts.strictNumbers,Wo.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,aE.useFunc)(e,uE.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=lE});var ld=d(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var Xo=T(),hE=R(),dE=$i(),fE={message:"must be equal to constant",params:({schemaCode:r})=>(0,Xo._)`{allowedValue: ${r}}`},pE={keyword:"const",$data:!0,error:fE,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,hE.useFunc)(e,dE.default)}(${t}, ${i})`):r.fail((0,Xo._)`${n} !== ${t}`)}};Jo.default=pE});var hd=d(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});var fs=T(),mE=R(),gE=$i(),yE={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,fs._)`{allowedValues: ${r}}`},_E={keyword:"enum",schemaType:"array",$data:!0,error:yE,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,mE.useFunc)(e,gE.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,fs.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,fs._)`${c()}(${t}, ${p})`,()=>e.assign(l,!0).break()))}function f(p,m){let g=i[m];return typeof g=="object"&&g!==null?(0,fs._)`${c()}(${t}, ${p}[${m}])`:(0,fs._)`${t} === ${g}`}}};Zo.default=_E});var ea=d(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var vE=Qh(),bE=ed(),wE=sd(),$E=id(),EE=nd(),SE=od(),OE=ad(),xE=cd(),TE=ld(),PE=hd(),IE=[vE.default,bE.default,wE.default,$E.default,EE.default,SE.default,OE.default,xE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},TE.default,PE.default];Qo.default=IE});var ra=d(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.validateAdditionalItems=void 0;var Xt=T(),ta=R(),AE={message:({params:{len:r}})=>(0,Xt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Xt._)`{limit: ${r}}`},CE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:AE,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}dd(r,s)}};function dd(r,e){let{gen:t,schema:s,data:i,keyword:n,it:o}=r;o.items=!0;let a=t.const("len",(0,Xt._)`${i}.length`);if(s===!1)r.setParams({len:e.length}),r.pass((0,Xt._)`${a} <= ${e.length}`);else if(typeof s=="object"&&!(0,ta.alwaysValidSchema)(o,s)){let c=t.var("valid",(0,Xt._)`${a} <= ${e.length}`);t.if((0,Xt.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,Xt.not)(c),()=>t.break())})}}ps.validateAdditionalItems=dd;ps.default=CE});var sa=d(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.validateTuple=void 0;var fd=T(),Ei=R(),RE=Ae(),NE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return pd(r,"additionalItems",e);t.items=!0,!(0,Ei.alwaysValidSchema)(t,e)&&r.ok((0,RE.validateArray)(r))}};function pd(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=Ei.mergeEvaluated.items(s,t.length,a.items));let u=s.name("valid"),c=s.const("len",(0,fd._)`${n}.length`);t.forEach((h,f)=>{(0,Ei.alwaysValidSchema)(a,h)||(s.if((0,fd._)`${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,Ei.checkStrictMode)(a,y,f.strictTuples)}}}ms.validateTuple=pd;ms.default=NE});var md=d(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var qE=sa(),kE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,qE.validateTuple)(r,"items")};ia.default=kE});var yd=d(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var gd=T(),jE=R(),DE=Ae(),ME=ra(),LE={message:({params:{len:r}})=>(0,gd.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,gd._)`{limit: ${r}}`},VE={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:LE,code(r){let{schema:e,parentSchema:t,it:s}=r,{prefixItems:i}=t;s.items=!0,!(0,jE.alwaysValidSchema)(s,e)&&(i?(0,ME.validateAdditionalItems)(r,i):r.ok((0,DE.validateArray)(r)))}};na.default=VE});var _d=d(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var Re=T(),Si=R(),FE={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}}`},UE={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:FE,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,Si.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Si.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Si.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:Si.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=UE});var Oi=d(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.validateSchemaDeps=et.validatePropertyDeps=et.error=void 0;var aa=T(),HE=R(),gs=Ae();et.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},
6
+ || ${o} === "boolean" || ${i} === null`).assign(a,(0,I._)`[${i}]`)}}}function Sb({gen:r,parentData:e,parentDataProperty:t},s){r.if((0,I._)`${e} !== undefined`,()=>r.assign((0,I._)`${e}[${t}]`,s))}function uo(r,e,t,s=ur.Correct){let i=s===ur.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===ur.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=uo;function lo(r,e,t,s){if(r.length===1)return uo(r[0],e,t,s);let i,n=(0,Kc.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,uo(o,e,t,s));return i}de.checkDataTypes=lo;var Ob={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=xb(r);(0,vb.reportError)(e,Ob)}de.reportTypeError=co;function xb(r){let{gen:e,data:t,schema:s}=r,i=(0,Kc.schemaRefOrVal)(r,s,"type");return{gen:e,keyword:"type",data:t,schema:s.type,schemaCode:i,schemaValue:i,parentSchema:s,params:{},it:r}}});var Jc=d(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.assignDefaults=void 0;var lr=T(),Tb=R();function Pb(r,e){let{properties:t,items:s}=r.schema;if(e==="object"&&t)for(let i in t)Xc(r,i,t[i].default);else e==="array"&&Array.isArray(s)&&s.forEach((i,n)=>Xc(r,n,i.default))}ai.assignDefaults=Pb;function Xc(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,Tb.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 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(),ho=R(),Tt=Ie(),Ib=R();function Ab(r,e){let{gen:t,data:s,it:i}=r;t.if(po(t,s,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,z._)`${e}`},!0),r.error()})}V.checkReportMissingProp=Ab;function Cb({gen:r,data:e,it:{opts:t}},s,i){return(0,z.or)(...s.map(n=>(0,z.and)(po(r,e,n,t.ownProperties),(0,z._)`${i} = ${n}`)))}V.checkMissingProp=Cb;function Rb(r,e){r.setParams({missingProperty:e},!0),r.error()}V.reportMissingProp=Rb;function Zc(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,z._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=Zc;function fo(r,e,t){return(0,z._)`${Zc(r)}.call(${e}, ${t})`}V.isOwnProperty=fo;function Nb(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} !== undefined`;return s?(0,z._)`${i} && ${fo(r,e,t)}`:i}V.propertyInData=Nb;function po(r,e,t,s){let i=(0,z._)`${e}${(0,z.getProperty)(t)} === undefined`;return s?(0,z.or)(i,(0,z.not)(fo(r,e,t))):i}V.noPropertyInData=po;function Qc(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=Qc;function qb(r,e){return Qc(e).filter(t=>!(0,ho.alwaysValidSchema)(r,e[t]))}V.schemaProperties=qb;function kb({schemaCode:r,data:e,it:{gen:t,topSchemaRef:s,schemaPath:i,errorPath:n},it:o},a,u,l){let c=l?(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._)`${c}, ${t.object(...h)}`;return u!==z.nil?(0,z._)`${a}.call(${u}, ${f})`:(0,z._)`${a}(${f})`}V.callValidateCode=kb;var jb=(0,z._)`new RegExp`;function Db({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"?jb:(0,Ib.useFunc)(r,i)}(${t}, ${s})`})}V.usePattern=Db;function Mb(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,l=>{r.subschema({keyword:s,dataProp:l,dataPropType:ho.Type.Num},n),e.if((0,z.not)(n),a)})}}V.validateArray=Mb;function Lb(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,ho.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((u,l)=>{let c=r.subschema({keyword:s,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,z._)`${o} || ${a}`),r.mergeValidEvaluated(c,a)||e.if((0,z.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}V.validateUnion=Lb});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(),Bt=Ie(),Vb=Ae(),Fb=Zr();function Ub(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 l=t.name("valid");r.subschema({schema:a,schemaPath:ge.nil,errSchemaPath:`${o.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},l),r.pass(l,()=>r.error(!0))}Je.macroKeywordCode=Ub;function Hb(r,e){var t;let{gen:s,keyword:i,schema:n,parentSchema:o,$data:a,it:u}=r;zb(u,e);let l=!a&&e.compile?e.compile.call(u.self,n,o,u):e.validate,c=th(s,i,l),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(()=>Gb(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._)`${c}.errors`;return s.assign(_,null),g(ge.nil),_}function g(_=e.async?(0,ge._)`await `:ge.nil){let S=u.opts.passContext?Bt.default.this:Bt.default.self,O=!("compile"in e&&!a||e.schema===!1);s.assign(h,(0,ge._)`${_}${(0,Vb.callValidateCode)(r,c,S,O)}`,e.modifying)}function y(_){var S;s.if((0,ge.not)((S=e.valid)!==null&&S!==void 0?S:h),_)}}Je.funcKeywordCode=Hb;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 Gb(r,e){let{gen:t}=r;t.if((0,ge._)`Array.isArray(${e})`,()=>{t.assign(Bt.default.vErrors,(0,ge._)`${Bt.default.vErrors} === null ? ${e} : ${Bt.default.vErrors}.concat(${e})`).assign(Bt.default.errors,(0,ge._)`${Bt.default.vErrors}.length`),(0,Fb.extendErrors)(r)},()=>r.error())}function zb({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 Bb(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=Bb;function Kb({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=Kb});var ih=d(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.extendSubschemaMode=Pt.extendSubschemaData=Pt.getSubschema=void 0;var Ze=T(),sh=R();function Wb(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')}Pt.getSubschema=Wb;function Yb(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:l,dataPathArr:c,opts:h}=e,f=a.let("data",(0,Ze._)`${e.data}${(0,Ze.getProperty)(t)}`,!0);u(f),r.errorPath=(0,Ze.str)`${l}${(0,sh.getErrorPath)(t,s,h.jsPropertySyntax)}`,r.parentDataProperty=(0,Ze._)`${t}`,r.dataPathArr=[...c,r.parentDataProperty]}if(i!==void 0){let l=i instanceof Ze.Name?i:a.let("data",i,!0);u(l),o!==void 0&&(r.propertyName=o)}n&&(r.dataTypes=n);function u(l){r.data=l,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,l]}}Pt.extendSubschemaData=Yb;function Xb(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=Xb});var mo=d((UN,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((HN,oh)=>{"use strict";var It=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)};It.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};It.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};It.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};It.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,l){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,i,n,o,a,u,l);for(var c in s){var h=s[c];if(Array.isArray(h)){if(c in It.arrayKeywords)for(var f=0;f<h.length;f++)ui(r,e,t,h[f],i+"/"+c+"/"+f,n,i,c,s,f)}else if(c in It.propsKeywords){if(h&&typeof h=="object")for(var p in h)ui(r,e,t,h[p],i+"/"+c+"/"+Jb(p),n,i,c,s,p)}else(c in It.keywords||r.allKeys&&!(c in It.skipKeywords))&&ui(r,e,t,h,i+"/"+c,n,i,c,s)}t(s,i,n,o,a,u,l)}}function Jb(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 Zb=R(),Qb=mo(),ew=ah(),tw=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function rw(r,e=!0){return typeof r=="boolean"?!0:e===!0?!go(r):e?uh(r)<=e:!1}$e.inlineRef=rw;var sw=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function go(r){for(let e in r){if(sw.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(go)||typeof t=="object"&&go(t))return!0}return!1}function uh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!tw.has(t)&&(typeof r[t]=="object"&&(0,Zb.eachItem)(r[t],s=>e+=uh(s)),e===1/0))return 1/0}return e}function lh(r,e="",t){t!==!1&&(e=cr(e));let s=r.parse(e);return ch(r,s)}$e.getFullPath=lh;function ch(r,e){return r.serialize(e).split("#")[0]+"#"}$e._getFullPath=ch;var iw=/#\/?$/;function cr(r){return r?r.replace(iw,""):""}$e.normalizeId=cr;function nw(r,e,t){return t=cr(t),r.resolve(e,t)}$e.resolveUrl=nw;var ow=/^[a-z_][-a-z0-9._]*$/i;function aw(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:s}=this.opts,i=cr(r[t]||e),n={"":i},o=lh(s,i,!1),a={},u=new Set;return ew(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 c(O);u.add(O);let $=this.refs[O];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?l(h,$.schema,O):O!==cr(g)&&(O[0]==="#"?(l(h,a[O],O),a[O]=h):this.refs[O]=g),O}function S(O){if(typeof O=="string"){if(!ow.test(O))throw new Error(`invalid anchor "${O}"`);_.call(this,`#${O}`)}}}),a;function l(h,f,p){if(f!==void 0&&!Qb(h,f))throw c(p)}function c(h){return new Error(`reference "${h}" resolves to more than one schema`)}}$e.getSchemaRefs=aw});var hr=d(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.getData=At.KeywordCxt=At.validateFunctionCode=void 0;var mh=Gc(),hh=Qr(),_o=ao(),li=Qr(),uw=Jc(),rs=rh(),yo=ih(),w=T(),x=Ie(),lw=es(),dt=R(),ts=Zr();function cw(r){if(_h(r)&&(vh(r),yh(r))){fw(r);return}gh(r,()=>(0,mh.topBoolOrEmptySchema)(r))}At.validateFunctionCode=cw;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)}`),dw(r,i),r.code(n)}):r.func(e,(0,w._)`${x.default.data}, ${hw(i)}`,s.$async,()=>r.code(dh(t,i)).code(n))}function hw(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 dw(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 fw(r){let{schema:e,opts:t,gen:s}=r;gh(r,()=>{t.$comment&&e.$comment&&wh(r),_w(r),s.let(x.default.vErrors,null),s.let(x.default.errors,0),t.unevaluated&&pw(r),bh(r),ww(r)})}function pw(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 mw(r,e){if(_h(r)&&(vh(r),yh(r))){gw(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 gw(r,e){let{schema:t,gen:s,opts:i}=r;i.$comment&&t.$comment&&wh(r),vw(r),bw(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,dt.checkUnknownRules)(r),yw(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 yw(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 _w(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 vw(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,lw.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function bw(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 ww(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&&$w(r),e.return((0,w._)`${x.default.errors} === 0`))}function $w({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:l}=r,{RULES:c}=l;if(n.$ref&&(u.ignoreKeywordsWithRef||!(0,dt.schemaHasRulesButRef)(n,c))){i.block(()=>Eh(r,"$ref",c.all.$ref.definition));return}u.jtd||Ew(r,e),i.block(()=>{for(let f of c.rules)h(f);h(c.post)});function h(f){(0,_o.shouldUseGroup)(n,f)&&(f.type?(i.if((0,li.checkDataType)(f.type,o,u.strictNumbers)),ph(r,f),e.length===1&&e[0]===f.type&&t&&(i.else(),(0,li.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,uw.assignDefaults)(r,e.type),t.block(()=>{for(let n of e.rules)(0,_o.shouldUseRule)(s,n)&&Eh(r,n.keyword,n.definition,e.type)})}function Ew(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(Sw(r,e),r.opts.allowUnionTypes||Ow(r,e),xw(r,r.dataTypes))}function Sw(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{$h(r.dataTypes,t)||vo(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),Pw(r,e)}}function Ow(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&vo(r,"use allowUnionTypes to allow union type keyword")}function xw(r,e){let t=r.self.RULES.all;for(let s in t){let i=t[s];if(typeof i=="object"&&(0,_o.shouldUseRule)(r.schema,i)){let{type:n}=i.definition;n.length&&!n.some(o=>Tw(e,o))&&vo(r,`missing type "${n.join(",")}" for keyword "${s}"`)}}}function Tw(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 Pw(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 vo(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,dt.checkStrictMode)(r,e,r.opts.strictTypes)}var ci=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,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",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,li.checkDataTypes)(u,t,n.opts.strictNumbers,li.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,yo.getSubschema)(this.it,e);(0,yo.extendSubschemaData)(s,this.it,e),(0,yo.extendSubschemaMode)(s,e);let i={...this.it,...s,items:void 0,props:void 0};return mw(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}};At.KeywordCxt=ci;function Eh(r,e,t,s){let i=new ci(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 Iw=/^\/(?:[^~]|~0|~1)*$/,Aw=/^([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(!Iw.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,n=x.default.rootData}else{let l=Aw.exec(r);if(!l)throw new Error(`Invalid JSON-pointer: ${r}`);let c=+l[1];if(i=l[2],i==="#"){if(c>=e)throw new Error(u("property/index",c));return s[e-c]}if(c>e)throw new Error(u("data",c));if(n=t[e-c],!i)return n}let o=n,a=i.split("/");for(let l of a)l&&(n=(0,w._)`${n}${(0,w.getProperty)((0,dt.unescapeJsonPointer)(l))}`,o=(0,w._)`${o} && ${n}`);return o;function u(l,c){return`Cannot access ${l} ${c} levels up, current level is ${e}`}}At.getData=Sh});var ss=d(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});var bo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};wo.default=bo});var dr=d(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});var $o=es(),Eo=class extends Error{constructor(e,t,s,i){super(i||`can't resolve reference ${s} from id ${t}`),this.missingRef=(0,$o.resolveUrl)(e,t,s),this.missingSchema=(0,$o.normalizeId)((0,$o.getFullPath)(e,this.missingRef))}};So.default=Eo});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(),Cw=ss(),Kt=Ie(),Ue=es(),Oh=R(),Rw=hr(),fr=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=fr;function xo(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:Cw.default,code:(0,Fe._)`require("ajv/dist/runtime/validation_error").default`}));let u=o.scopeName("validate");r.validateName=u;let l={gen:o,allErrors:this.opts.allErrors,data:Kt.default.data,parentData:Kt.default.parentData,parentDataProperty:Kt.default.parentDataProperty,dataNames:[Kt.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},c;try{this._compilations.add(r),(0,Rw.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let h=o.toString();c=`${o.scopeRefs(Kt.default.scope)}return ${h}`,this.opts.code.process&&(c=this.opts.code.process(c,r));let p=new Function(`${Kt.default.self}`,`${Kt.default.scope}`,c)(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}=l;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,c&&this.logger.error("Error compiling schema, function code:",c),h}finally{this._compilations.delete(r)}}Ce.compileSchema=xo;function Nw(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=jw.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 fr({schema:o,schemaId:a,root:r,baseId:e}))}if(n!==void 0)return r.refs[t]=qw.call(this,n)}Ce.resolveRef=Nw;function qw(r){return(0,Ue.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:xo.call(this,r)}function xh(r){for(let e of this._compilations)if(kw(e,r))return e}Ce.getCompilingSchema=xh;function kw(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function jw(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 Oo.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:Oo.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||xo.call(this,o),n===(0,Ue.normalizeId)(e)){let{schema:a}=o,{schemaId:u}=this.opts,l=a[u];return l&&(i=(0,Ue.resolveUrl)(this.opts.uriResolver,i,l)),new fr({schema:a,schemaId:u,root:r,baseId:i})}return Oo.call(this,t,o)}}Ce.resolveSchema=hi;var Dw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Oo(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 l=typeof t=="object"&&t[this.opts.schemaId];!Dw.has(a)&&l&&(e=(0,Ue.resolveUrl)(this.opts.uriResolver,e,l))}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 fr({schema:t,schemaId:o,root:s,baseId:e}),n.schema!==n.root.schema)return n}});var Th=d((YN,Mw)=>{Mw.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((XN,Ch)=>{"use strict";var Lw=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);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 Vw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Ph(r){return r.length=0,!0}function Fw(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 Uw(r){let e=0,t={error:!1,address:"",zone:""},s=[],i=[],n=!1,o=!1,a=Fw;for(let u=0;u<r.length;u++){let l=r[u];if(!(l==="["||l==="]"))if(l===":"){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(l==="%"){if(!a(i,s,t))break;a=Ph}else{i.push(l);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 Ah(r){if(Hw(r,":")<2)return{host:r,isIPV6:!1};let e=Uw(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 Hw(r,e){let t=0;for(let s=0;s<r.length;s++)r[s]===e&&t++;return t}function Gw(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("")}function zw(r,e){let t=e!==!0?escape:unescape;return r.scheme!==void 0&&(r.scheme=t(r.scheme)),r.userinfo!==void 0&&(r.userinfo=t(r.userinfo)),r.host!==void 0&&(r.host=t(r.host)),r.path!==void 0&&(r.path=t(r.path)),r.query!==void 0&&(r.query=t(r.query)),r.fragment!==void 0&&(r.fragment=t(r.fragment)),r}function Bw(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=Ah(t);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=r.host}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}Ch.exports={nonSimpleDomain:Vw,recomposeAuthority:Bw,normalizeComponentEncoding:zw,removeDotSegments:Gw,isIPv4:Ih,isUUID:Lw,normalizeIPv6:Ah,stringArrayToHexStripped:To}});var jh=d((JN,kh)=>{"use strict";var{isUUID:Kw}=Po(),Ww=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Yw=["http","https","ws","wss","urn","urn:uuid"];function Xw(r){return Yw.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 Rh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function Nh(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 Jw(r){return r.secure=Io(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function Zw(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 Qw(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(Ww);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 e$(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 t$(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!Kw(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function r$(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var qh={scheme:"http",domainHost:!0,parse:Rh,serialize:Nh},s$={scheme:"https",domainHost:qh.domainHost,parse:Rh,serialize:Nh},di={scheme:"ws",domainHost:!0,parse:Jw,serialize:Zw},i$={scheme:"wss",domainHost:di.domainHost,parse:di.parse,serialize:di.serialize},n$={scheme:"urn",parse:Qw,serialize:e$,skipNormalize:!0},o$={scheme:"urn:uuid",parse:t$,serialize:r$,skipNormalize:!0},fi={http:qh,https:s$,ws:di,wss:i$,urn:n$,"urn:uuid":o$};Object.setPrototypeOf(fi,null);function Ao(r){return r&&(fi[r]||fi[r.toLowerCase()])||void 0}kh.exports={wsIsSecure:Io,SCHEMES:fi,isValidSchemeName:Xw,getSchemeHandler:Ao}});var Lh=d((ZN,mi)=>{"use strict";var{normalizeIPv6:a$,removeDotSegments:ns,recomposeAuthority:u$,normalizeComponentEncoding:pi,isIPv4:l$,nonSimpleDomain:c$}=Po(),{SCHEMES:h$,getSchemeHandler:Dh}=jh();function d$(r,e){return typeof r=="string"?r=Qe(ft(r,e),e):typeof r=="object"&&(r=ft(Qe(r,e),e)),r}function f$(r,e,t){let s=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=Mh(ft(r,s),ft(e,s),s,!0);return s.skipEscape=!0,Qe(i,s)}function Mh(r,e,t,s){let i={};return s||(r=ft(Qe(r,t),t),e=ft(Qe(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 p$(r,e,t){return typeof r=="string"?(r=unescape(r),r=Qe(pi(ft(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=Qe(pi(r,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Qe(pi(ft(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=Qe(pi(e,!0),{...t,skipEscape:!0})),r.toLowerCase()===e.toLowerCase()}function Qe(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=Dh(s.scheme||t.scheme);n&&n.serialize&&n.serialize(t,s),t.path!==void 0&&(s.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),s.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let o=u$(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 m$=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ft(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;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let n=r.match(m$);if(n){if(s.scheme=n[1],s.userinfo=n[3],s.host=n[4],s.port=parseInt(n[5],10),s.path=n[6]||"",s.query=n[7],s.fragment=n[8],isNaN(s.port)&&(s.port=n[5]),s.host)if(l$(s.host)===!1){let u=a$(s.host);s.host=u.host.toLowerCase(),i=u.isIPV6}else i=!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 o=Dh(t.scheme||s.scheme);if(!t.unicodeSupport&&(!o||!o.unicodeSupport)&&s.host&&(t.domainHost||o&&o.domainHost)&&i===!1&&c$(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(a){s.error=s.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(r.indexOf("%")!==-1&&(s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),s.host!==void 0&&(s.host=unescape(s.host))),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),o&&o.parse&&o.parse(s,t)}else s.error=s.error||"URI can not be parsed.";return s}var Co={SCHEMES:h$,normalize:d$,resolve:f$,resolveComponent:Mh,equal:p$,serialize:Qe,parse:ft};mi.exports=Co;mi.exports.default=Co;mi.exports.fastUri=Co});var Fh=d(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});var Vh=Lh();Vh.code='require("ajv/dist/runtime/uri").default';Ro.default=Vh});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 g$=hr();Object.defineProperty(oe,"KeywordCxt",{enumerable:!0,get:function(){return g$.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 y$=ss(),Bh=dr(),_$=oo(),os=is(),v$=T(),as=es(),gi=Qr(),qo=R(),Uh=Th(),b$=Fh(),Kh=(r,e)=>new RegExp(r,e);Kh.code="new RegExp";var w$=["removeAdditional","useDefaults","coerceTypes"],$$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E$={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."},S$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Hh=200;function O$(r){var e,t,s,i,n,o,a,u,l,c,h,f,p,m,g,y,_,S,O,E,$,le,U,De,xe;let G=r.strict,N=(e=r.code)===null||e===void 0?void 0:e.optimize,Ws=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:Kh,Me=(i=r.uriResolver)!==null&&i!==void 0?i:b$.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:(c=(l=r.strictTypes)!==null&&l!==void 0?l:G)!==null&&c!==void 0?c:"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:Ws,regExp:Vr}:{optimize:Ws,regExp:Vr},loopRequired:(g=r.loopRequired)!==null&&g!==void 0?g:Hh,loopEnum:(y=r.loopEnum)!==null&&y!==void 0?y:Hh,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:(le=r.validateSchema)!==null&&le!==void 0?le:!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,...O$(e)};let{es5:t,lines:s}=this.opts.code;this.scope=new v$.ValueScope({scope:{},prefixes:$$,es5:t,lines:s}),this.logger=C$(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,_$.getRules)(),Gh.call(this,E$,e,"NOT SUPPORTED"),Gh.call(this,S$,e,"DEPRECATED","warn"),this._metaOpts=I$.call(this),e.formats&&T$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&P$.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=Uh;s==="id"&&(i={...Uh},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(c,h){await n.call(this,c.$schema);let f=this._addSchema(c,h);return f.validate||o.call(this,f)}async function n(c){c&&!this.getSchema(c)&&await i.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(h){if(!(h instanceof Bh.default))throw h;return a.call(this,h),await u.call(this,h.missingSchema),o.call(this,c)}}function a({missingSchema:c,missingRef:h}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${h} cannot be resolved`)}async function u(c){let h=await l.call(this,c);this.refs[c]||await n.call(this,h.$schema),this.refs[c]||this.addSchema(h,c,t)}async function l(c){let h=this._loading[c];if(h)return h;try{return await(this._loading[c]=s(c))}finally{delete this._loading[c]}}}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=zh.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=zh.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(N$.call(this,s,t),!t)return(0,qo.eachItem)(s,n=>No.call(this,n)),this;k$.call(this,t);let i={...t,type:(0,gi.getJSONTypes)(t.type),schemaType:(0,gi.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:l}=u.definition,c=o[a];l&&c&&(o[a]=Wh(c))}}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 l=as.getSchemaRefs.call(this,e,s);return u=new os.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:s,localRefs:l}),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=y$.default;us.MissingRefError=Bh.default;oe.default=us;function Gh(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 zh(r){return r=(0,as.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 T$(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function P$(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 I$(){let r={...this.opts};for(let e of w$)delete r[e];return r}var A$={log(){},warn(){},error(){}};function C$(r){if(r===!1)return A$;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 R$=/^[a-z_$][a-z0-9_$:-]*$/i;function N$(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(!R$.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,gi.getJSONTypes)(e.type),schemaType:(0,gi.getJSONTypes)(e.schemaType)}};e.before?q$.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 q$(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 k$(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=Wh(e)),r.validateSchema=this.compile(e,!0))}var j$={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Wh(r){return{anyOf:[r,j$]}}});var Yh=d(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});var D$={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};jo.default=D$});var vi=d(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.callRef=Wt.getValidate=void 0;var M$=dr(),Xh=Ae(),Ee=T(),mr=Ie(),Jh=is(),yi=R(),L$={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:l}=n;if((t==="#"||t==="#/")&&i===l.baseId)return h();let c=Jh.resolveRef.call(u,l,i,t);if(c===void 0)throw new M$.default(s.opts.uriResolver,i,t);if(c instanceof Jh.SchemaEnv)return f(c);return p(c);function h(){if(n===l)return _i(r,o,n,n.$async);let m=e.scopeValue("root",{ref:l});return _i(r,(0,Ee._)`${m}.validate`,l,l.$async)}function f(m){let g=Zh(r,m);_i(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 Zh(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=Zh;function _i(r,e,t,s){let{gen:i,it:n}=r,{allErrors:o,schemaEnv:a,opts:u}=n,l=u.passContext?mr.default.this:Ee.nil;s?c():h();function c(){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,Xh.callValidateCode)(r,e,l)}`),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,Xh.callValidateCode)(r,e,l),()=>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=yi.mergeEvaluated.props(i,y.props,n.props));else{let _=i.var("props",(0,Ee._)`${m}.evaluated.props`);n.props=yi.mergeEvaluated.props(i,_,n.props,Ee.Name)}if(n.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(n.items=yi.mergeEvaluated.items(i,y.items,n.items));else{let _=i.var("items",(0,Ee._)`${m}.evaluated.items`);n.items=yi.mergeEvaluated.items(i,_,n.items,Ee.Name)}}}Wt.callRef=_i;Wt.default=L$});var Mo=d(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var V$=Yh(),F$=vi(),U$=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",V$.default,F$.default];Do.default=U$});var Qh=d(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});var bi=T(),Ct=bi.operators,wi={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}},H$={message:({keyword:r,schemaCode:e})=>(0,bi.str)`must be ${wi[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,bi._)`{comparison: ${wi[r].okStr}, limit: ${e}}`},G$={keyword:Object.keys(wi),type:"number",schemaType:"number",$data:!0,error:H$,code(r){let{keyword:e,data:t,schemaCode:s}=r;r.fail$data((0,bi._)`${t} ${wi[e].fail} ${s} || isNaN(${t})`)}};Lo.default=G$});var ed=d(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var ls=T(),z$={message:({schemaCode:r})=>(0,ls.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,ls._)`{multipleOf: ${r}}`},B$={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:z$,code(r){let{gen:e,data:t,schemaCode:s,it:i}=r,n=i.opts.multipleOfPrecision,o=e.let("res"),a=n?(0,ls._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${n}`:(0,ls._)`${o} !== parseInt(${o})`;r.fail$data((0,ls._)`(${s} === 0 || (${o} = ${t}/${s}, ${a}))`)}};Vo.default=B$});var rd=d(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});function td(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=td;td.code='require("ajv/dist/runtime/ucs2length").default'});var sd=d(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});var Yt=T(),K$=R(),W$=rd(),Y$={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Yt.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Yt._)`{limit: ${r}}`},X$={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Y$,code(r){let{keyword:e,data:t,schemaCode:s,it:i}=r,n=e==="maxLength"?Yt.operators.GT:Yt.operators.LT,o=i.opts.unicode===!1?(0,Yt._)`${t}.length`:(0,Yt._)`${(0,K$.useFunc)(r.gen,W$.default)}(${t})`;r.fail$data((0,Yt._)`${o} ${n} ${s}`)}};Uo.default=X$});var id=d(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var J$=Ae(),Z$=R(),gr=T(),Q$={message:({schemaCode:r})=>(0,gr.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,gr._)`{pattern: ${r}}`},eE={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Q$,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,l=u.code==="new RegExp"?(0,gr._)`new RegExp`:(0,Z$.useFunc)(e,u),c=e.let("valid");e.try(()=>e.assign(c,(0,gr._)`${l}(${n}, ${a}).test(${t})`),()=>e.assign(c,!1)),r.fail$data((0,gr._)`!${c}`)}else{let u=(0,J$.usePattern)(r,i);r.fail$data((0,gr._)`!${u}.test(${t})`)}}};Ho.default=eE});var nd=d(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var cs=T(),tE={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,cs.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,cs._)`{limit: ${r}}`},rE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:tE,code(r){let{keyword:e,data:t,schemaCode:s}=r,i=e==="maxProperties"?cs.operators.GT:cs.operators.LT;r.fail$data((0,cs._)`Object.keys(${t}).length ${i} ${s}`)}};Go.default=rE});var od=d(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});var hs=Ae(),ds=T(),sE=R(),iE={message:({params:{missingProperty:r}})=>(0,ds.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,ds._)`{missingProperty: ${r}}`},nE={keyword:"required",type:"object",schemaType:"array",$data:!0,error:iE,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?l():c(),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,sE.checkStrictMode)(o,_,o.opts.strictRequired)}}function l(){if(u||n)r.block$data(ds.nil,h);else for(let p of t)(0,hs.checkReportMissingProp)(r,p)}function c(){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=nE});var ad=d(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});var fs=T(),oE={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}}`},aE={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:oE,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=aE});var $i=d(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var ud=mo();ud.code='require("ajv/dist/runtime/equal").default';Ko.default=ud});var ld=d(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var Wo=Qr(),ae=T(),uE=R(),lE=$i(),cE={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}}`},hE={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:cE,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"),l=n.items?(0,Wo.getSchemaTypes)(n.items):[];r.block$data(u,c,(0,ae._)`${o} === false`),r.ok(u);function c(){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 l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,g){let y=e.name("item"),_=(0,Wo.checkDataTypes)(l,y,a.opts.strictNumbers,Wo.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`),l.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,uE.useFunc)(e,lE.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=hE});var cd=d(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});var Xo=T(),dE=R(),fE=$i(),pE={message:"must be equal to constant",params:({schemaCode:r})=>(0,Xo._)`{allowedValue: ${r}}`},mE={keyword:"const",$data:!0,error:pE,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,dE.useFunc)(e,fE.default)}(${t}, ${i})`):r.fail((0,Xo._)`${n} !== ${t}`)}};Jo.default=mE});var hd=d(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});var ps=T(),gE=R(),yE=$i(),_E={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,ps._)`{allowedValues: ${r}}`},vE={keyword:"enum",schemaType:"array",$data:!0,error:_E,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,l=()=>u??(u=(0,gE.useFunc)(e,yE.default)),c;if(a||s)c=e.let("valid"),r.block$data(c,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",n);c=(0,ps.or)(...i.map((m,g)=>f(p,g)))}r.pass(c);function h(){e.assign(c,!1),e.forOf("v",n,p=>e.if((0,ps._)`${l()}(${t}, ${p})`,()=>e.assign(c,!0).break()))}function f(p,m){let g=i[m];return typeof g=="object"&&g!==null?(0,ps._)`${l()}(${t}, ${p}[${m}])`:(0,ps._)`${t} === ${g}`}}};Zo.default=vE});var ea=d(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var bE=Qh(),wE=ed(),$E=sd(),EE=id(),SE=nd(),OE=od(),xE=ad(),TE=ld(),PE=cd(),IE=hd(),AE=[bE.default,wE.default,$E.default,EE.default,SE.default,OE.default,xE.default,TE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},PE.default,IE.default];Qo.default=AE});var ra=d(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.validateAdditionalItems=void 0;var Xt=T(),ta=R(),CE={message:({params:{len:r}})=>(0,Xt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Xt._)`{limit: ${r}}`},RE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:CE,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}dd(r,s)}};function dd(r,e){let{gen:t,schema:s,data:i,keyword:n,it:o}=r;o.items=!0;let a=t.const("len",(0,Xt._)`${i}.length`);if(s===!1)r.setParams({len:e.length}),r.pass((0,Xt._)`${a} <= ${e.length}`);else if(typeof s=="object"&&!(0,ta.alwaysValidSchema)(o,s)){let l=t.var("valid",(0,Xt._)`${a} <= ${e.length}`);t.if((0,Xt.not)(l),()=>u(l)),r.ok(l)}function u(l){t.forRange("i",e.length,a,c=>{r.subschema({keyword:n,dataProp:c,dataPropType:ta.Type.Num},l),o.allErrors||t.if((0,Xt.not)(l),()=>t.break())})}}ms.validateAdditionalItems=dd;ms.default=RE});var sa=d(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.validateTuple=void 0;var fd=T(),Ei=R(),NE=Ae(),qE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return pd(r,"additionalItems",e);t.items=!0,!(0,Ei.alwaysValidSchema)(t,e)&&r.ok((0,NE.validateArray)(r))}};function pd(r,e,t=r.schema){let{gen:s,parentSchema:i,data:n,keyword:o,it:a}=r;c(i),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=Ei.mergeEvaluated.items(s,t.length,a.items));let u=s.name("valid"),l=s.const("len",(0,fd._)`${n}.length`);t.forEach((h,f)=>{(0,Ei.alwaysValidSchema)(a,h)||(s.if((0,fd._)`${l} > ${f}`,()=>r.subschema({keyword:o,schemaProp:f,dataProp:f},u)),r.ok(u))});function c(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,Ei.checkStrictMode)(a,y,f.strictTuples)}}}gs.validateTuple=pd;gs.default=qE});var md=d(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var kE=sa(),jE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,kE.validateTuple)(r,"items")};ia.default=jE});var yd=d(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var gd=T(),DE=R(),ME=Ae(),LE=ra(),VE={message:({params:{len:r}})=>(0,gd.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,gd._)`{limit: ${r}}`},FE={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:VE,code(r){let{schema:e,parentSchema:t,it:s}=r,{prefixItems:i}=t;s.items=!0,!(0,DE.alwaysValidSchema)(s,e)&&(i?(0,LE.validateAdditionalItems)(r,i):r.ok((0,ME.validateArray)(r)))}};na.default=FE});var _d=d(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var Re=T(),Si=R(),UE={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}}`},HE={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:UE,code(r){let{gen:e,schema:t,parentSchema:s,data:i,it:n}=r,o,a,{minContains:u,maxContains:l}=s;n.opts.next?(o=u===void 0?1:u,a=l):o=1;let c=e.const("len",(0,Re._)`${i}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,Si.checkStrictMode)(n,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Si.checkStrictMode)(n,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,Si.alwaysValidSchema)(n,t)){let g=(0,Re._)`${c} >= ${o}`;a!==void 0&&(g=(0,Re._)`${g} && ${c} <= ${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,c,_=>{r.subschema({keyword:"contains",dataProp:_,dataPropType:Si.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=HE});var Oi=d(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.validateSchemaDeps=et.validatePropertyDeps=et.error=void 0;var aa=T(),GE=R(),ys=Ae();et.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},
7
7
  missingProperty: ${s},
8
8
  depsCount: ${e},
9
- deps: ${t}}`};var GE={keyword:"dependencies",type:"object",schemaType:"object",error:et.error,code(r){let[e,t]=zE(r);vd(r,e),bd(r,t)}};function zE({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 vd(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,gs.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,gs.checkReportMissingProp)(r,c)}):(t.if((0,aa._)`${u} && (${(0,gs.checkMissingProp)(r,a,n)})`),(0,gs.reportMissingProp)(r,n),t.else())}}et.validatePropertyDeps=vd;function bd(r,e=r.schema){let{gen:t,data:s,keyword:i,it:n}=r,o=t.name("valid");for(let a in e)(0,HE.alwaysValidSchema)(n,e[a])||(t.if((0,gs.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))}et.validateSchemaDeps=bd;et.default=GE});var $d=d(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var wd=T(),BE=R(),KE={message:"property name must be valid",params:({params:r})=>(0,wd._)`{propertyName: ${r.propertyName}}`},WE={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KE,code(r){let{gen:e,schema:t,data:s,it:i}=r;if((0,BE.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,wd.not)(n),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(n)}};ua.default=WE});var la=d(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var xi=Ae(),He=T(),YE=Ie(),Ti=R(),XE={message:"must NOT have additional properties",params:({params:r})=>(0,He._)`{additionalProperty: ${r.additionalProperty}}`},JE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:XE,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,Ti.alwaysValidSchema)(o,t))return;let c=(0,xi.allSchemaProperties)(s.properties),l=(0,xi.allSchemaProperties)(s.patternProperties);h(),r.ok((0,He._)`${n} === ${YE.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,Ti.schemaRefOrVal)(o,s.properties,"properties");_=(0,xi.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,xi.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,Ti.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:Ti.Type.Str};S===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(O,_)}}};ca.default=JE});var Od=d(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var ZE=hr(),Ed=Ae(),ha=R(),Sd=la(),QE={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&&Sd.default.code(new ZE.KeywordCxt(n,Sd.default,"additionalProperties"));let o=(0,Ed.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,Ed.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=QE});var Id=d(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var xd=Ae(),Pi=T(),Td=R(),Pd=R(),eS={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,xd.allSchemaProperties)(t),u=a.filter(g=>(0,Td.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 Pi.Name)&&(n.props=(0,Pd.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,Td.checkStrictMode)(n,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){e.forIn("key",s,y=>{e.if((0,Pi._)`${(0,xd.usePattern)(r,g)}.test(${y})`,()=>{let _=u.includes(g);_||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:Pd.Type.Str},l),n.opts.unevaluated&&h!==!0?e.assign((0,Pi._)`${h}[${y}]`,!0):!_&&!n.allErrors&&e.if((0,Pi.not)(l),()=>e.break())})})}}};fa.default=eS});var Ad=d(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var tS=R(),rS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:s}=r;if((0,tS.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=rS});var Cd=d(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var sS=Ae(),iS={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sS.validateUnion,error:{message:"must match a schema in anyOf"}};ma.default=iS});var Rd=d(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Ii=T(),nS=R(),oS={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,Ii._)`{passingSchemas: ${r.passing}}`},aS={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:oS,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,nS.alwaysValidSchema)(i,l)?e.var(u,!0):f=r.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Ii._)`${u} && ${o}`).assign(o,!1).assign(a,(0,Ii._)`[${a}, ${h}]`).else(),e.if(u,()=>{e.assign(o,!0),e.assign(a,h),f&&r.mergeEvaluated(f,Ii.Name)})})}}};ga.default=aS});var Nd=d(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var uS=R(),cS={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,uS.alwaysValidSchema)(s,n))return;let a=r.subschema({keyword:"allOf",schemaProp:o},i);r.ok(i),r.mergeEvaluated(a)})}};ya.default=cS});var jd=d(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var Ai=T(),kd=R(),lS={message:({params:r})=>(0,Ai.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Ai._)`{failingKeyword: ${r.ifClause}}`},hS={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lS,code(r){let{gen:e,parentSchema:t,it:s}=r;t.then===void 0&&t.else===void 0&&(0,kd.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let i=qd(s,"then"),n=qd(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,Ai.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,Ai._)`${l}`):r.setParams({ifClause:l})}}}};function qd(r,e){let t=r.schema[e];return t!==void 0&&!(0,kd.alwaysValidSchema)(r,t)}_a.default=hS});var Dd=d(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var dS=R(),fS={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`)}};va.default=fS});var wa=d(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var pS=ra(),mS=md(),gS=sa(),yS=yd(),_S=_d(),vS=Oi(),bS=$d(),wS=la(),$S=Od(),ES=Id(),SS=Ad(),OS=Cd(),xS=Rd(),TS=Nd(),PS=jd(),IS=Dd();function AS(r=!1){let e=[SS.default,OS.default,xS.default,TS.default,PS.default,IS.default,bS.default,wS.default,vS.default,$S.default,ES.default];return r?e.push(mS.default,yS.default):e.push(pS.default,gS.default),e.push(_S.default),e}ba.default=AS});var Ea=d(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.dynamicAnchor=void 0;var $a=T(),CS=Ie(),Md=ss(),RS=_i(),NS={keyword:"$dynamicAnchor",schemaType:"string",code:r=>Ld(r,r.schema)};function Ld(r,e){let{gen:t,it:s}=r;s.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,$a._)`${CS.default.dynamicAnchors}${(0,$a.getProperty)(e)}`,n=s.errSchemaPath==="#"?s.validateName:qS(r);t.if((0,$a._)`!${i}`,()=>t.assign(i,n))}ys.dynamicAnchor=Ld;function qS(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 Md.SchemaEnv({schema:t,schemaId:u,root:i,baseId:n,localRefs:o,meta:a});return Md.compileSchema.call(s,c),(0,RS.getValidate)(r,c)}ys.default=NS});var Sa=d(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.dynamicRef=void 0;var Vd=T(),kS=Ie(),Fd=_i(),jS={keyword:"$dynamicRef",schemaType:"string",code:r=>Ud(r,r.schema)};function Ud(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,Vd._)`${kS.default.dynamicAnchors}${(0,Vd.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,Fd.callRef)(r,u),t.let(c,!0)}):()=>(0,Fd.callRef)(r,u)}}_s.dynamicRef=Ud;_s.default=jS});var Hd=d(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var DS=Ea(),MS=R(),LS={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,DS.dynamicAnchor)(r,""):(0,MS.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Oa.default=LS});var Gd=d(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var VS=Sa(),FS={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,VS.dynamicRef)(r,r.schema)};xa.default=FS});var zd=d(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var US=Ea(),HS=Sa(),GS=Hd(),zS=Gd(),BS=[US.default,HS.default,GS.default,zS.default];Ta.default=BS});var Kd=d(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Bd=Oi(),KS={keyword:"dependentRequired",type:"object",schemaType:"object",error:Bd.error,code:r=>(0,Bd.validatePropertyDeps)(r)};Pa.default=KS});var Wd=d(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var WS=Oi(),YS={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,WS.validateSchemaDeps)(r)};Ia.default=YS});var Yd=d(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var XS=R(),JS={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,XS.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};Aa.default=JS});var Xd=d(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var ZS=Kd(),QS=Wd(),eO=Yd(),tO=[ZS.default,QS.default,eO.default];Ca.default=tO});var Zd=d(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var Rt=T(),Jd=R(),rO=Ie(),sO={message:"must NOT have unevaluated properties",params:({params:r})=>(0,Rt._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},iO={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:sO,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} === ${rO.default.errors}`);function u(h){if(t===!1){r.setParams({unevaluatedProperty:h}),r.error(),o||e.break();return}if(!(0,Jd.alwaysValidSchema)(n,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:Jd.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)}}};Ra.default=iO});var ef=d(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Jt=T(),Qd=R(),nO={message:({params:{len:r}})=>(0,Jt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Jt._)`{limit: ${r}}`},oO={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:nO,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,Jt._)`${s}.length`);if(t===!1)r.setParams({len:n}),r.fail((0,Jt._)`${o} > ${n}`);else if(typeof t=="object"&&!(0,Qd.alwaysValidSchema)(i,t)){let u=e.var("valid",(0,Jt._)`${o} <= ${n}`);e.if((0,Jt.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:Qd.Type.Num},u),i.allErrors||e.if((0,Jt.not)(u),()=>e.break())})}}};Na.default=oO});var tf=d(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var aO=Zd(),uO=ef(),cO=[aO.default,uO.default];qa.default=cO});var rf=d(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var re=T(),lO={message:({schemaCode:r})=>(0,re.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,re._)`{format: ${r}}`},hO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lO,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=hO});var Da=d(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var dO=rf(),fO=[dO.default];ja.default=fO});var Ma=d(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.contentVocabulary=gr.metadataVocabulary=void 0;gr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];gr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var nf=d(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var pO=Mo(),mO=ea(),gO=wa(),yO=zd(),_O=Xd(),vO=tf(),bO=Da(),sf=Ma(),wO=[yO.default,pO.default,mO.default,(0,gO.default)(!0),bO.default,sf.metadataVocabulary,sf.contentVocabulary,_O.default,vO.default];La.default=wO});var af=d(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DiscrError=void 0;var of;(function(r){r.Tag="tag",r.Mapping="mapping"})(of||(Ci.DiscrError=of={}))});var Ua=d(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var yr=T(),Va=af(),uf=ss(),$O=dr(),EO=R(),SO={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,yr._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},OO={keyword:"discriminator",type:"object",schemaType:"object",error:SO,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,yr._)`${t}${(0,yr.getProperty)(a)}`);e.if((0,yr._)`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,yr._)`${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,yr.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,EO.schemaHasRulesButRef)($,n.self.RULES)){let U=$.$ref;if($=uf.resolveRef.call(n.self,n.schemaEnv.root,n.baseId,U),$ instanceof uf.SchemaEnv&&($=$.schema),$===void 0)throw new $O.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=OO});var cf=d((Jq,xO)=>{xO.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 lf=d((Zq,TO)=>{TO.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 hf=d((Qq,PO)=>{PO.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 df=d((ek,IO)=>{IO.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 ff=d((tk,AO)=>{AO.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 pf=d((rk,CO)=>{CO.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 mf=d((sk,RO)=>{RO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var gf=d((ik,NO)=>{NO.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 yf=d(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var qO=cf(),kO=lf(),jO=hf(),DO=df(),MO=ff(),LO=pf(),VO=mf(),FO=gf(),UO=["/properties"];function HO(r){return[qO,kO,jO,DO,MO,e(this,LO),VO,e(this,FO)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,s){return r?t.$dataMetaSchema(s,UO):s}}Ha.default=HO});var _f=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 GO=ko(),zO=nf(),BO=Ua(),KO=yf(),Ga="https://json-schema.org/draft/2020-12/schema",_r=class extends GO.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),zO.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(BO.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(KO.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=_r;za.exports=B=_r;za.exports.Ajv2020=_r;Object.defineProperty(B,"__esModule",{value:!0});B.default=_r;var WO=hr();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return WO.KeywordCxt}});var vr=T();Object.defineProperty(B,"_",{enumerable:!0,get:function(){return vr._}});Object.defineProperty(B,"str",{enumerable:!0,get:function(){return vr.str}});Object.defineProperty(B,"stringify",{enumerable:!0,get:function(){return vr.stringify}});Object.defineProperty(B,"nil",{enumerable:!0,get:function(){return vr.nil}});Object.defineProperty(B,"Name",{enumerable:!0,get:function(){return vr.Name}});Object.defineProperty(B,"CodeGen",{enumerable:!0,get:function(){return vr.CodeGen}});var YO=rs();Object.defineProperty(B,"ValidationError",{enumerable:!0,get:function(){return YO.default}});var XO=dr();Object.defineProperty(B,"MissingRefError",{enumerable:!0,get:function(){return XO.default}})});var xf=d(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.formatNames=rt.fastFormats=rt.fullFormats=void 0;function tt(r,e){return{validate:r,compare:e}}rt.fullFormats={date:tt($f,Ya),time:tt(Ka(!0),Xa),"date-time":tt(vf(!0),Sf),"iso-time":tt(Ka(),Ef),"iso-date-time":tt(vf(),Of),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:r1,"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:c1,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:s1,int32:{type:"number",validate:o1},int64:{type:"number",validate:a1},float:{type:"number",validate:wf},double:{type:"number",validate:wf},password:!0,binary:!0};rt.fastFormats={...rt.fullFormats,date:tt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ya),time:tt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xa),"date-time":tt(/^\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,Sf),"iso-time":tt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ef),"iso-date-time":tt(/^\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,Of),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};rt.formatNames=Object.keys(rt.fullFormats);function JO(r){return r%4===0&&(r%100!==0||r%400===0)}var ZO=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,QO=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $f(r){let e=ZO.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&&JO(t)?29:QO[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 Ka(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 Ef(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 Wa=/t|\s/i;function vf(r){let e=Ka(r);return function(s){let i=s.split(Wa);return i.length===2&&$f(i[0])&&e(i[1])}}function Sf(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}function Of(r,e){if(!(r&&e))return;let[t,s]=r.split(Wa),[i,n]=e.split(Wa),o=Ya(t,i);if(o!==void 0)return o||Xa(s,n)}var e1=/\/|:/,t1=/^(?:[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 r1(r){return e1.test(r)&&t1.test(r)}var bf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function s1(r){return bf.lastIndex=0,bf.test(r)}var i1=-(2**31),n1=2**31-1;function o1(r){return Number.isInteger(r)&&r<=n1&&r>=i1}function a1(r){return Number.isInteger(r)}function wf(){return!0}var u1=/[^\\]\\Z/;function c1(r){if(u1.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var Pf=d(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});var l1=Mo(),h1=ea(),d1=wa(),f1=Da(),Tf=Ma(),p1=[l1.default,h1.default,(0,d1.default)(),f1.default,Tf.metadataVocabulary,Tf.contentVocabulary];Ja.default=p1});var If=d((uk,m1)=>{m1.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 Cf=d((K,Za)=>{"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 g1=ko(),y1=Pf(),_1=Ua(),Af=If(),v1=["/properties"],Ri="http://json-schema.org/draft-07/schema",br=class extends g1.default{_addVocabularies(){super._addVocabularies(),y1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(_1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Af,v1):Af;this.addMetaSchema(e,Ri,!1),this.refs["http://json-schema.org/schema"]=Ri}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ri)?Ri:void 0)}};K.Ajv=br;Za.exports=K=br;Za.exports.Ajv=br;Object.defineProperty(K,"__esModule",{value:!0});K.default=br;var b1=hr();Object.defineProperty(K,"KeywordCxt",{enumerable:!0,get:function(){return b1.KeywordCxt}});var wr=T();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return wr._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return wr.str}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return wr.stringify}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return wr.nil}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return wr.Name}});Object.defineProperty(K,"CodeGen",{enumerable:!0,get:function(){return wr.CodeGen}});var w1=rs();Object.defineProperty(K,"ValidationError",{enumerable:!0,get:function(){return w1.default}});var $1=dr();Object.defineProperty(K,"MissingRefError",{enumerable:!0,get:function(){return $1.default}})});var Rf=d($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.formatLimitDefinition=void 0;var E1=Cf(),Ge=T(),Nt=Ge.operators,Ni={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}},S1={message:({keyword:r,schemaCode:e})=>(0,Ge.str)`should be ${Ni[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Ge._)`{comparison: ${Ni[r].okStr}, limit: ${e}}`};$r.formatLimitDefinition={keyword:Object.keys(Ni),type:"string",schemaType:"string",$data:!0,error:S1,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 E1.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}) ${Ni[i].fail} 0`}},dependencies:["format"]};var O1=r=>(r.addKeyword($r.formatLimitDefinition),r);$r.default=O1});var jf=d((vs,kf)=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var Er=xf(),x1=Rf(),Qa=T(),Nf=new Qa.Name("fullFormats"),T1=new Qa.Name("fastFormats"),eu=(r,e={keywords:!0})=>{if(Array.isArray(e))return qf(r,e,Er.fullFormats,Nf),r;let[t,s]=e.mode==="fast"?[Er.fastFormats,T1]:[Er.fullFormats,Nf],i=e.formats||Er.formatNames;return qf(r,i,t,s),e.keywords&&(0,x1.default)(r),r};eu.get=(r,e="full")=>{let s=(e==="fast"?Er.fastFormats:Er.fullFormats)[r];if(!s)throw new Error(`Unknown format "${r}"`);return s};function qf(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])}kf.exports=vs=eu;Object.defineProperty(vs,"__esModule",{value:!0});vs.default=eu});var bs=d((fk,Df)=>{"use strict";var j1="2.0.0",D1=Number.MAX_SAFE_INTEGER||9007199254740991,M1=16,L1=250,V1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Df.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:M1,MAX_SAFE_BUILD_LENGTH:L1,MAX_SAFE_INTEGER:D1,RELEASE_TYPES:V1,SEMVER_SPEC_VERSION:j1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ws=d((pk,Mf)=>{"use strict";var F1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Mf.exports=F1});var Sr=d((st,Lf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:su,MAX_SAFE_BUILD_LENGTH:U1,MAX_LENGTH:H1}=bs(),G1=ws();st=Lf.exports={};var z1=st.re=[],B1=st.safeRe=[],v=st.src=[],K1=st.safeSrc=[],b=st.t={},W1=0,iu="[a-zA-Z0-9-]",Y1=[["\\s",1],["\\d",H1],[iu,U1]],X1=r=>{for(let[e,t]of Y1)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},P=(r,e,t)=>{let s=X1(e),i=W1++;G1(r,i,e),b[r]=i,v[i]=e,K1[i]=s,z1[i]=new RegExp(e,t?"g":void 0),B1[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);st.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);st.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);st.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 qi=d((mk,Vf)=>{"use strict";var J1=Object.freeze({loose:!0}),Z1=Object.freeze({}),Q1=r=>r?typeof r!="object"?J1:r:Z1;Vf.exports=Q1});var nu=d((gk,Hf)=>{"use strict";var Ff=/^[0-9]+$/,Uf=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=Ff.test(r),s=Ff.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},ex=(r,e)=>Uf(e,r);Hf.exports={compareIdentifiers:Uf,rcompareIdentifiers:ex}});var fe=d((yk,zf)=>{"use strict";var ki=ws(),{MAX_LENGTH:Gf,MAX_SAFE_INTEGER:ji}=bs(),{safeRe:Di,t:Mi}=Sr(),tx=qi(),{compareIdentifiers:ou}=nu(),au=class r{constructor(e,t){if(t=tx(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>Gf)throw new TypeError(`version is longer than ${Gf} characters`);ki("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?Di[Mi.LOOSE]:Di[Mi.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>ji||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ji||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ji||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<ji)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(ki("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(ki("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(ki("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?Di[Mi.PRERELEASELOOSE]:Di[Mi.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}};zf.exports=au});var Zt=d((_k,Kf)=>{"use strict";var Bf=fe(),rx=(r,e,t=!1)=>{if(r instanceof Bf)return r;try{return new Bf(r,e)}catch(s){if(!t)return null;throw s}};Kf.exports=rx});var Yf=d((vk,Wf)=>{"use strict";var sx=Zt(),ix=(r,e)=>{let t=sx(r,e);return t?t.version:null};Wf.exports=ix});var Jf=d((bk,Xf)=>{"use strict";var nx=Zt(),ox=(r,e)=>{let t=nx(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Xf.exports=ox});var ep=d((wk,Qf)=>{"use strict";var Zf=fe(),ax=(r,e,t,s,i)=>{typeof t=="string"&&(i=s,s=t,t=void 0);try{return new Zf(r instanceof Zf?r.version:r,t).inc(e,s,i).version}catch{return null}};Qf.exports=ax});var sp=d(($k,rp)=>{"use strict";var tp=Zt(),ux=(r,e)=>{let t=tp(r,null,!0),s=tp(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"};rp.exports=ux});var np=d((Ek,ip)=>{"use strict";var cx=fe(),lx=(r,e)=>new cx(r,e).major;ip.exports=lx});var ap=d((Sk,op)=>{"use strict";var hx=fe(),dx=(r,e)=>new hx(r,e).minor;op.exports=dx});var cp=d((Ok,up)=>{"use strict";var fx=fe(),px=(r,e)=>new fx(r,e).patch;up.exports=px});var hp=d((xk,lp)=>{"use strict";var mx=Zt(),gx=(r,e)=>{let t=mx(r,e);return t&&t.prerelease.length?t.prerelease:null};lp.exports=gx});var Ne=d((Tk,fp)=>{"use strict";var dp=fe(),yx=(r,e,t)=>new dp(r,t).compare(new dp(e,t));fp.exports=yx});var mp=d((Pk,pp)=>{"use strict";var _x=Ne(),vx=(r,e,t)=>_x(e,r,t);pp.exports=vx});var yp=d((Ik,gp)=>{"use strict";var bx=Ne(),wx=(r,e)=>bx(r,e,!0);gp.exports=wx});var Li=d((Ak,vp)=>{"use strict";var _p=fe(),$x=(r,e,t)=>{let s=new _p(r,t),i=new _p(e,t);return s.compare(i)||s.compareBuild(i)};vp.exports=$x});var wp=d((Ck,bp)=>{"use strict";var Ex=Li(),Sx=(r,e)=>r.sort((t,s)=>Ex(t,s,e));bp.exports=Sx});var Ep=d((Rk,$p)=>{"use strict";var Ox=Li(),xx=(r,e)=>r.sort((t,s)=>Ox(s,t,e));$p.exports=xx});var $s=d((Nk,Sp)=>{"use strict";var Tx=Ne(),Px=(r,e,t)=>Tx(r,e,t)>0;Sp.exports=Px});var Vi=d((qk,Op)=>{"use strict";var Ix=Ne(),Ax=(r,e,t)=>Ix(r,e,t)<0;Op.exports=Ax});var uu=d((kk,xp)=>{"use strict";var Cx=Ne(),Rx=(r,e,t)=>Cx(r,e,t)===0;xp.exports=Rx});var cu=d((jk,Tp)=>{"use strict";var Nx=Ne(),qx=(r,e,t)=>Nx(r,e,t)!==0;Tp.exports=qx});var Fi=d((Dk,Pp)=>{"use strict";var kx=Ne(),jx=(r,e,t)=>kx(r,e,t)>=0;Pp.exports=jx});var Ui=d((Mk,Ip)=>{"use strict";var Dx=Ne(),Mx=(r,e,t)=>Dx(r,e,t)<=0;Ip.exports=Mx});var lu=d((Lk,Ap)=>{"use strict";var Lx=uu(),Vx=cu(),Fx=$s(),Ux=Fi(),Hx=Vi(),Gx=Ui(),zx=(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 Lx(r,t,s);case"!=":return Vx(r,t,s);case">":return Fx(r,t,s);case">=":return Ux(r,t,s);case"<":return Hx(r,t,s);case"<=":return Gx(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};Ap.exports=zx});var Rp=d((Vk,Cp)=>{"use strict";var Bx=fe(),Kx=Zt(),{safeRe:Hi,t:Gi}=Sr(),Wx=(r,e)=>{if(r instanceof Bx)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?Hi[Gi.COERCEFULL]:Hi[Gi.COERCE]);else{let u=e.includePrerelease?Hi[Gi.COERCERTLFULL]:Hi[Gi.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 Kx(`${s}.${i}.${n}${o}${a}`,e)};Cp.exports=Wx});var qp=d((Fk,Np)=>{"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}};Np.exports=hu});var qe=d((Uk,Mp)=>{"use strict";var Yx=/\s+/g,du=class r{constructor(e,t){if(t=Jx(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(Yx," "),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=>!jp(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&&iT(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&&rT)|(this.options.loose&&sT))+":"+e,i=kp.get(s);if(i)return i;let n=this.options.loose,o=n?ye[pe.HYPHENRANGELOOSE]:ye[pe.HYPHENRANGE];e=e.replace(o,pT(this.options.includePrerelease)),W("hyphen replace",e),e=e.replace(ye[pe.COMPARATORTRIM],Qx),W("comparator trim",e),e=e.replace(ye[pe.TILDETRIM],eT),W("tilde trim",e),e=e.replace(ye[pe.CARETTRIM],tT),W("caret trim",e);let a=e.split(" ").map(h=>nT(h,this.options)).join(" ").split(/\s+/).map(h=>fT(h,this.options));n&&(a=a.filter(h=>(W("loose invalid filter",h,this.options),!!h.match(ye[pe.COMPARATORLOOSE])))),W("range list",a);let u=new Map,c=a.map(h=>new fu(h,this.options));for(let h of c){if(jp(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return kp.set(s,l),l}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(s=>Dp(s,t)&&e.set.some(i=>Dp(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 Zx(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(mT(this.set[t],e,this.options))return!0;return!1}};Mp.exports=du;var Xx=qp(),kp=new Xx,Jx=qi(),fu=Es(),W=ws(),Zx=fe(),{safeRe:ye,t:pe,comparatorTrimReplace:Qx,tildeTrimReplace:eT,caretTrimReplace:tT}=Sr(),{FLAG_INCLUDE_PRERELEASE:rT,FLAG_LOOSE:sT}=bs(),jp=r=>r.value==="<0.0.0-0",iT=r=>r.value==="",Dp=(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},nT=(r,e)=>(r=r.replace(ye[pe.BUILD],""),W("comp",r,e),r=uT(r,e),W("caret",r),r=oT(r,e),W("tildes",r),r=lT(r,e),W("xrange",r),r=dT(r,e),W("stars",r),r),_e=r=>!r||r.toLowerCase()==="x"||r==="*",oT=(r,e)=>r.trim().split(/\s+/).map(t=>aT(t,e)).join(" "),aT=(r,e)=>{let t=e.loose?ye[pe.TILDELOOSE]:ye[pe.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=>cT(t,e)).join(" "),cT=(r,e)=>{W("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)=>{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})},lT=(r,e)=>(W("replaceXRanges",r,e),r.split(/\s+/).map(t=>hT(t,e)).join(" ")),hT=(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)=>{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})},dT=(r,e)=>(W("replaceStars",r,e),r.trim().replace(ye[pe.STAR],"")),fT=(r,e)=>(W("replaceGTE0",r,e),r.trim().replace(ye[e.includePrerelease?pe.GTE0PRE:pe.GTE0],"")),pT=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()),mT=(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!==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 Es=d((Hk,Gp)=>{"use strict";var Ss=Symbol("SemVer ANY"),gu=class r{static get ANY(){return Ss}constructor(e,t){if(t=Lp(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===Ss?this.value="":this.value=this.operator+this.semver.version,mu("comp",this)}parse(e){let t=this.options.loose?Vp[Fp.COMPARATORLOOSE]:Vp[Fp.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 Up(s[2],this.options.loose):this.semver=Ss}toString(){return this.value}test(e){if(mu("Comparator.test",e,this.options.loose),this.semver===Ss||e===Ss)return!0;if(typeof e=="string")try{e=new Up(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 Hp(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Hp(this.value,t).test(e.semver):(t=Lp(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(">")))}};Gp.exports=gu;var Lp=qi(),{safeRe:Vp,t:Fp}=Sr(),pu=lu(),mu=ws(),Up=fe(),Hp=qe()});var Os=d((Gk,zp)=>{"use strict";var gT=qe(),yT=(r,e,t)=>{try{e=new gT(e,t)}catch{return!1}return e.test(r)};zp.exports=yT});var Kp=d((zk,Bp)=>{"use strict";var _T=qe(),vT=(r,e)=>new _T(r,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));Bp.exports=vT});var Yp=d((Bk,Wp)=>{"use strict";var bT=fe(),wT=qe(),$T=(r,e,t)=>{let s=null,i=null,n=null;try{n=new wT(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new bT(s,t))}),s};Wp.exports=$T});var Jp=d((Kk,Xp)=>{"use strict";var ET=fe(),ST=qe(),OT=(r,e,t)=>{let s=null,i=null,n=null;try{n=new ST(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new ET(s,t))}),s};Xp.exports=OT});var em=d((Wk,Qp)=>{"use strict";var yu=fe(),xT=qe(),Zp=$s(),TT=(r,e)=>{r=new xT(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||Zp(a,n))&&(n=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),n&&(!t||Zp(t,n))&&(t=n)}return t&&r.test(t)?t:null};Qp.exports=TT});var rm=d((Yk,tm)=>{"use strict";var PT=qe(),IT=(r,e)=>{try{return new PT(r,e).range||"*"}catch{return null}};tm.exports=IT});var zi=d((Xk,om)=>{"use strict";var AT=fe(),nm=Es(),{ANY:CT}=nm,RT=qe(),NT=Os(),sm=$s(),im=Vi(),qT=Ui(),kT=Fi(),jT=(r,e,t,s)=>{r=new AT(r,s),e=new RT(e,s);let i,n,o,a,u;switch(t){case">":i=sm,n=qT,o=im,a=">",u=">=";break;case"<":i=im,n=kT,o=sm,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(NT(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===CT&&(p=new nm(">=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};om.exports=jT});var um=d((Jk,am)=>{"use strict";var DT=zi(),MT=(r,e,t)=>DT(r,e,">",t);am.exports=MT});var lm=d((Zk,cm)=>{"use strict";var LT=zi(),VT=(r,e,t)=>LT(r,e,"<",t);cm.exports=VT});var fm=d((Qk,dm)=>{"use strict";var hm=qe(),FT=(r,e,t)=>(r=new hm(r,t),e=new hm(e,t),r.intersects(e,t));dm.exports=FT});var mm=d((ej,pm)=>{"use strict";var UT=Os(),HT=Ne();pm.exports=(r,e,t)=>{let s=[],i=null,n=null,o=r.sort((l,h)=>HT(l,h,t));for(let l of o)UT(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 wm=d((tj,bm)=>{"use strict";var gm=qe(),vu=Es(),{ANY:_u}=vu,xs=Os(),bu=Ne(),GT=(r,e,t={})=>{if(r===e)return!0;r=new gm(r,t),e=new gm(e,t);let s=!1;e:for(let i of r.set){for(let n of e.set){let o=BT(i,n,t);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},zT=[new vu(">=0.0.0-0")],ym=[new vu(">=0.0.0")],BT=(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=zT:r=ym}if(e.length===1&&e[0].semver===_u){if(t.includePrerelease)return!0;e=ym}let s=new Set,i,n;for(let p of r)p.operator===">"||p.operator===">="?i=_m(i,p,t):p.operator==="<"||p.operator==="<="?n=vm(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&&!xs(p,String(i),t)||n&&!xs(p,String(n),t))return null;for(let m of e)if(!xs(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=_m(i,p,t),a===p&&a!==i)return!1}else if(i.operator===">="&&!xs(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=vm(n,p,t),u===p&&u!==n)return!1}else if(n.operator==="<="&&!xs(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)},_m=(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},vm=(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};bm.exports=GT});var Om=d((rj,Sm)=>{"use strict";var wu=Sr(),$m=bs(),KT=fe(),Em=nu(),WT=Zt(),YT=Yf(),XT=Jf(),JT=ep(),ZT=sp(),QT=np(),eP=ap(),tP=cp(),rP=hp(),sP=Ne(),iP=mp(),nP=yp(),oP=Li(),aP=wp(),uP=Ep(),cP=$s(),lP=Vi(),hP=uu(),dP=cu(),fP=Fi(),pP=Ui(),mP=lu(),gP=Rp(),yP=Es(),_P=qe(),vP=Os(),bP=Kp(),wP=Yp(),$P=Jp(),EP=em(),SP=rm(),OP=zi(),xP=um(),TP=lm(),PP=fm(),IP=mm(),AP=wm();Sm.exports={parse:WT,valid:YT,clean:XT,inc:JT,diff:ZT,major:QT,minor:eP,patch:tP,prerelease:rP,compare:sP,rcompare:iP,compareLoose:nP,compareBuild:oP,sort:aP,rsort:uP,gt:cP,lt:lP,eq:hP,neq:dP,gte:fP,lte:pP,cmp:mP,coerce:gP,Comparator:yP,Range:_P,satisfies:vP,toComparators:bP,maxSatisfying:wP,minSatisfying:$P,minVersion:EP,validRange:SP,outside:OP,gtr:xP,ltr:TP,intersects:PP,simplifyRange:IP,subset:AP,SemVer:KT,re:wu.re,src:wu.src,tokens:wu.t,SEMVER_SPEC_VERSION:$m.SEMVER_SPEC_VERSION,RELEASE_TYPES:$m.RELEASE_TYPES,compareIdentifiers:Em.compareIdentifiers,rcompareIdentifiers:Em.rcompareIdentifiers}});var ee=d((hj,km)=>{"use strict";var{FORCE_COLOR:HP,NODE_DISABLE_COLORS:GP,TERM:zP}=process.env,L={enabled:!GP&&zP!=="dumb"&&HP!=="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 qm(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 BP(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?qm(this.keys,s+""):s+""):s===void 0?BP([r],[t]):L.enabled?qm([t],s+""):s+""}}km.exports=L});var Dm=d((dj,jm)=>{"use strict";jm.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((fj,Mm)=>{"use strict";Mm.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((pj,Lm)=>{"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"},KP={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},WP={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}};Lm.exports={cursor:Tu,scroll:KP,erase:WP,beep:"\x07"}});var Gm=d((mj,Hm)=>{"use strict";function YP(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=XP(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 XP(r,e){if(r){if(typeof r=="string")return Vm(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 Vm(r,e)}}function Vm(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 JP=Wi(),Um=te(),Fm=Um.erase,ZP=Um.cursor,QP=r=>[...JP(r)].length;Hm.exports=function(r,e){if(!e)return Fm.line+ZP.to(0);let t=0,s=r.split(/\r?\n/);var i=YP(s),n;try{for(i.s();!(n=i.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(QP(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return Fm.lines(t)}});var Pu=d((gj,zm)=>{"use strict";var Ps={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},eI={arrowUp:Ps.arrowUp,arrowDown:Ps.arrowDown,arrowLeft:Ps.arrowLeft,arrowRight:Ps.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},tI=process.platform==="win32"?eI:Ps;zm.exports=tI});var Km=d((yj,Bm)=>{"use strict";var Tr=ee(),er=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}`}}),rI=r=>Iu[r]||Iu.default,Is=Object.freeze({aborted:Tr.red(er.cross),done:Tr.green(er.tick),exited:Tr.yellow(er.cross),default:Tr.cyan("?")}),sI=(r,e,t)=>e?Is.aborted:t?Is.exited:r?Is.done:Is.default,iI=r=>Tr.gray(r?er.ellipsis:er.pointerSmall),nI=(r,e)=>Tr.gray(r?e?er.pointerSmall:"+":er.line);Bm.exports={styles:Iu,render:rI,symbols:Is,symbol:sI,delimiter:iI,item:nI}});var Ym=d((_j,Wm)=>{"use strict";var oI=Wi();Wm.exports=function(r,e){let t=String(oI(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var Jm=d((vj,Xm)=>{"use strict";Xm.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 zE={keyword:"dependencies",type:"object",schemaType:"object",error:et.error,code(r){let[e,t]=BE(r);vd(r,e),bd(r,t)}};function BE({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 vd(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 l of a)(0,ys.checkReportMissingProp)(r,l)}):(t.if((0,aa._)`${u} && (${(0,ys.checkMissingProp)(r,a,n)})`),(0,ys.reportMissingProp)(r,n),t.else())}}et.validatePropertyDeps=vd;function bd(r,e=r.schema){let{gen:t,data:s,keyword:i,it:n}=r,o=t.name("valid");for(let a in e)(0,GE.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))}et.validateSchemaDeps=bd;et.default=zE});var $d=d(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var wd=T(),KE=R(),WE={message:"property name must be valid",params:({params:r})=>(0,wd._)`{propertyName: ${r.propertyName}}`},YE={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:WE,code(r){let{gen:e,schema:t,data:s,it:i}=r;if((0,KE.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,wd.not)(n),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(n)}};ua.default=YE});var ca=d(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var xi=Ae(),He=T(),XE=Ie(),Ti=R(),JE={message:"must NOT have additional properties",params:({params:r})=>(0,He._)`{additionalProperty: ${r.additionalProperty}}`},ZE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:JE,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,Ti.alwaysValidSchema)(o,t))return;let l=(0,xi.allSchemaProperties)(s.properties),c=(0,xi.allSchemaProperties)(s.patternProperties);h(),r.ok((0,He._)`${n} === ${XE.default.errors}`);function h(){e.forIn("key",i,y=>{!l.length&&!c.length?m(y):e.if(f(y),()=>m(y))})}function f(y){let _;if(l.length>8){let S=(0,Ti.schemaRefOrVal)(o,s.properties,"properties");_=(0,xi.isOwnProperty)(e,S,y)}else l.length?_=(0,He.or)(...l.map(S=>(0,He._)`${y} === ${S}`)):_=He.nil;return c.length&&(_=(0,He.or)(_,...c.map(S=>(0,He._)`${(0,xi.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,Ti.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:Ti.Type.Str};S===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(O,_)}}};la.default=ZE});var Od=d(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var QE=hr(),Ed=Ae(),ha=R(),Sd=ca(),eS={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&&Sd.default.code(new QE.KeywordCxt(n,Sd.default,"additionalProperties"));let o=(0,Ed.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)l(h)?c(h):(e.if((0,Ed.propertyInData)(e,i,h,n.opts.ownProperties)),c(h),n.allErrors||e.else().var(u,!0),e.endIf()),r.it.definedProperties.add(h),r.ok(u);function l(h){return n.opts.useDefaults&&!n.compositeRule&&t[h].default!==void 0}function c(h){r.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}}};da.default=eS});var Id=d(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var xd=Ae(),Pi=T(),Td=R(),Pd=R(),tS={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,xd.allSchemaProperties)(t),u=a.filter(g=>(0,Td.alwaysValidSchema)(n,t[g]));if(a.length===0||u.length===a.length&&(!n.opts.unevaluated||n.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,c=e.name("valid");n.props!==!0&&!(n.props instanceof Pi.Name)&&(n.props=(0,Pd.evaluatedPropsToName)(e,n.props));let{props:h}=n;f();function f(){for(let g of a)l&&p(g),n.allErrors?m(g):(e.var(c,!0),m(g),e.if(c))}function p(g){for(let y in l)new RegExp(g).test(y)&&(0,Td.checkStrictMode)(n,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){e.forIn("key",s,y=>{e.if((0,Pi._)`${(0,xd.usePattern)(r,g)}.test(${y})`,()=>{let _=u.includes(g);_||r.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:Pd.Type.Str},c),n.opts.unevaluated&&h!==!0?e.assign((0,Pi._)`${h}[${y}]`,!0):!_&&!n.allErrors&&e.if((0,Pi.not)(c),()=>e.break())})})}}};fa.default=tS});var Ad=d(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var rS=R(),sS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:s}=r;if((0,rS.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=sS});var Cd=d(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var iS=Ae(),nS={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:iS.validateUnion,error:{message:"must match a schema in anyOf"}};ma.default=nS});var Rd=d(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Ii=T(),oS=R(),aS={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,Ii._)`{passingSchemas: ${r.passing}}`},uS={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:aS,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(l),r.result(o,()=>r.reset(),()=>r.error(!0));function l(){n.forEach((c,h)=>{let f;(0,oS.alwaysValidSchema)(i,c)?e.var(u,!0):f=r.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Ii._)`${u} && ${o}`).assign(o,!1).assign(a,(0,Ii._)`[${a}, ${h}]`).else(),e.if(u,()=>{e.assign(o,!0),e.assign(a,h),f&&r.mergeEvaluated(f,Ii.Name)})})}}};ga.default=uS});var Nd=d(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var lS=R(),cS={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,lS.alwaysValidSchema)(s,n))return;let a=r.subschema({keyword:"allOf",schemaProp:o},i);r.ok(i),r.mergeEvaluated(a)})}};ya.default=cS});var jd=d(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});var Ai=T(),kd=R(),hS={message:({params:r})=>(0,Ai.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,Ai._)`{failingKeyword: ${r.ifClause}}`},dS={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:hS,code(r){let{gen:e,parentSchema:t,it:s}=r;t.then===void 0&&t.else===void 0&&(0,kd.checkStrictMode)(s,'"if" without "then" and "else" is ignored');let i=qd(s,"then"),n=qd(s,"else");if(!i&&!n)return;let o=e.let("valid",!0),a=e.name("_valid");if(u(),r.reset(),i&&n){let c=e.let("ifClause");r.setParams({ifClause:c}),e.if(a,l("then",c),l("else",c))}else i?e.if(a,l("then")):e.if((0,Ai.not)(a),l("else"));r.pass(o,()=>r.error(!0));function u(){let c=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(c)}function l(c,h){return()=>{let f=r.subschema({keyword:c},a);e.assign(o,a),r.mergeValidEvaluated(f,o),h?e.assign(h,(0,Ai._)`${c}`):r.setParams({ifClause:c})}}}};function qd(r,e){let t=r.schema[e];return t!==void 0&&!(0,kd.alwaysValidSchema)(r,t)}_a.default=dS});var Dd=d(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var fS=R(),pS={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,fS.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};va.default=pS});var wa=d(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var mS=ra(),gS=md(),yS=sa(),_S=yd(),vS=_d(),bS=Oi(),wS=$d(),$S=ca(),ES=Od(),SS=Id(),OS=Ad(),xS=Cd(),TS=Rd(),PS=Nd(),IS=jd(),AS=Dd();function CS(r=!1){let e=[OS.default,xS.default,TS.default,PS.default,IS.default,AS.default,wS.default,$S.default,bS.default,ES.default,SS.default];return r?e.push(gS.default,_S.default):e.push(mS.default,yS.default),e.push(vS.default),e}ba.default=CS});var Ea=d(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.dynamicAnchor=void 0;var $a=T(),RS=Ie(),Md=is(),NS=vi(),qS={keyword:"$dynamicAnchor",schemaType:"string",code:r=>Ld(r,r.schema)};function Ld(r,e){let{gen:t,it:s}=r;s.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,$a._)`${RS.default.dynamicAnchors}${(0,$a.getProperty)(e)}`,n=s.errSchemaPath==="#"?s.validateName:kS(r);t.if((0,$a._)`!${i}`,()=>t.assign(i,n))}_s.dynamicAnchor=Ld;function kS(r){let{schemaEnv:e,schema:t,self:s}=r.it,{root:i,baseId:n,localRefs:o,meta:a}=e.root,{schemaId:u}=s.opts,l=new Md.SchemaEnv({schema:t,schemaId:u,root:i,baseId:n,localRefs:o,meta:a});return Md.compileSchema.call(s,l),(0,NS.getValidate)(r,l)}_s.default=qS});var Sa=d(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.dynamicRef=void 0;var Vd=T(),jS=Ie(),Fd=vi(),DS={keyword:"$dynamicRef",schemaType:"string",code:r=>Ud(r,r.schema)};function Ud(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 l=t.let("_v",(0,Vd._)`${jS.default.dynamicAnchors}${(0,Vd.getProperty)(n)}`);t.if(l,a(l,u),a(i.validateName,u))}else a(i.validateName,u)()}function a(u,l){return l?()=>t.block(()=>{(0,Fd.callRef)(r,u),t.let(l,!0)}):()=>(0,Fd.callRef)(r,u)}}vs.dynamicRef=Ud;vs.default=DS});var Hd=d(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var MS=Ea(),LS=R(),VS={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,MS.dynamicAnchor)(r,""):(0,LS.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Oa.default=VS});var Gd=d(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var FS=Sa(),US={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,FS.dynamicRef)(r,r.schema)};xa.default=US});var zd=d(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var HS=Ea(),GS=Sa(),zS=Hd(),BS=Gd(),KS=[HS.default,GS.default,zS.default,BS.default];Ta.default=KS});var Kd=d(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Bd=Oi(),WS={keyword:"dependentRequired",type:"object",schemaType:"object",error:Bd.error,code:r=>(0,Bd.validatePropertyDeps)(r)};Pa.default=WS});var Wd=d(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var YS=Oi(),XS={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,YS.validateSchemaDeps)(r)};Ia.default=XS});var Yd=d(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var JS=R(),ZS={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,JS.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};Aa.default=ZS});var Xd=d(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var QS=Kd(),eO=Wd(),tO=Yd(),rO=[QS.default,eO.default,tO.default];Ca.default=rO});var Zd=d(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});var Rt=T(),Jd=R(),sO=Ie(),iO={message:"must NOT have unevaluated properties",params:({params:r})=>(0,Rt._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},nO={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:iO,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(l(a,h),()=>u(h)))):a!==!0&&e.forIn("key",s,h=>a===void 0?u(h):e.if(c(a,h),()=>u(h))),n.props=!0,r.ok((0,Rt._)`${i} === ${sO.default.errors}`);function u(h){if(t===!1){r.setParams({unevaluatedProperty:h}),r.error(),o||e.break();return}if(!(0,Jd.alwaysValidSchema)(n,t)){let f=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:Jd.Type.Str},f),o||e.if((0,Rt.not)(f),()=>e.break())}}function l(h,f){return(0,Rt._)`!${h} || !${h}[${f}]`}function c(h,f){let p=[];for(let m in h)h[m]===!0&&p.push((0,Rt._)`${f} !== ${m}`);return(0,Rt.and)(...p)}}};Ra.default=nO});var ef=d(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var Jt=T(),Qd=R(),oO={message:({params:{len:r}})=>(0,Jt.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Jt._)`{limit: ${r}}`},aO={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:oO,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,Jt._)`${s}.length`);if(t===!1)r.setParams({len:n}),r.fail((0,Jt._)`${o} > ${n}`);else if(typeof t=="object"&&!(0,Qd.alwaysValidSchema)(i,t)){let u=e.var("valid",(0,Jt._)`${o} <= ${n}`);e.if((0,Jt.not)(u),()=>a(u,n)),r.ok(u)}i.items=!0;function a(u,l){e.forRange("i",l,o,c=>{r.subschema({keyword:"unevaluatedItems",dataProp:c,dataPropType:Qd.Type.Num},u),i.allErrors||e.if((0,Jt.not)(u),()=>e.break())})}}};Na.default=aO});var tf=d(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var uO=Zd(),lO=ef(),cO=[uO.default,lO.default];qa.default=cO});var rf=d(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});var re=T(),hO={message:({schemaCode:r})=>(0,re.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,re._)`{format: ${r}}`},dO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hO,code(r,e){let{gen:t,data:s,$data:i,schema:n,schemaCode:o,it:a}=r,{opts:u,errSchemaPath:l,schemaEnv:c,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=c.$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 "${l}"`}}function O($){let le=$ 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:le});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(!c.$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=dO});var Da=d(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var fO=rf(),pO=[fO.default];ja.default=pO});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 nf=d(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var mO=Mo(),gO=ea(),yO=wa(),_O=zd(),vO=Xd(),bO=tf(),wO=Da(),sf=Ma(),$O=[_O.default,mO.default,gO.default,(0,yO.default)(!0),wO.default,sf.metadataVocabulary,sf.contentVocabulary,vO.default,bO.default];La.default=$O});var af=d(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DiscrError=void 0;var of;(function(r){r.Tag="tag",r.Mapping="mapping"})(of||(Ci.DiscrError=of={}))});var Ua=d(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var _r=T(),Va=af(),uf=is(),EO=dr(),SO=R(),OO={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}}`},xO={keyword:"discriminator",type:"object",schemaType:"object",error:OO,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),l=e.const("tag",(0,_r._)`${t}${(0,_r.getProperty)(a)}`);e.if((0,_r._)`typeof ${l} == "string"`,()=>c(),()=>r.error(!1,{discrError:Va.DiscrError.Tag,tag:l,tagName:a})),r.ok(u);function c(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,_r._)`${l} === ${m}`),e.assign(u,h(p[m]));e.else(),r.error(!1,{discrError:Va.DiscrError.Mapping,tag:l,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,SO.schemaHasRulesButRef)($,n.self.RULES)){let U=$.$ref;if($=uf.resolveRef.call(n.self,n.schemaEnv.root,n.baseId,U),$ instanceof uf.SchemaEnv&&($=$.schema),$===void 0)throw new EO.default(n.opts.uriResolver,n.baseId,U)}let le=(p=$?.properties)===null||p===void 0?void 0:p[a];if(typeof le!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(g||_($)),S(le,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 le of E.enum)O(le,$);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=xO});var lf=d((Zq,TO)=>{TO.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 cf=d((Qq,PO)=>{PO.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 hf=d((ek,IO)=>{IO.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 df=d((tk,AO)=>{AO.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 ff=d((rk,CO)=>{CO.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 pf=d((sk,RO)=>{RO.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 mf=d((ik,NO)=>{NO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var gf=d((nk,qO)=>{qO.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 yf=d(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var kO=lf(),jO=cf(),DO=hf(),MO=df(),LO=ff(),VO=pf(),FO=mf(),UO=gf(),HO=["/properties"];function GO(r){return[kO,jO,DO,MO,LO,e(this,VO),FO,e(this,UO)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,s){return r?t.$dataMetaSchema(s,HO):s}}Ha.default=GO});var _f=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 zO=ko(),BO=nf(),KO=Ua(),WO=yf(),Ga="https://json-schema.org/draft/2020-12/schema",vr=class extends zO.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),BO.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(KO.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(WO.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 YO=hr();Object.defineProperty(B,"KeywordCxt",{enumerable:!0,get:function(){return YO.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 XO=ss();Object.defineProperty(B,"ValidationError",{enumerable:!0,get:function(){return XO.default}});var JO=dr();Object.defineProperty(B,"MissingRefError",{enumerable:!0,get:function(){return JO.default}})});var xf=d(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.formatNames=rt.fastFormats=rt.fullFormats=void 0;function tt(r,e){return{validate:r,compare:e}}rt.fullFormats={date:tt($f,Ya),time:tt(Ka(!0),Xa),"date-time":tt(vf(!0),Sf),"iso-time":tt(Ka(),Ef),"iso-date-time":tt(vf(),Of),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:s1,"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:c1,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:i1,int32:{type:"number",validate:a1},int64:{type:"number",validate:u1},float:{type:"number",validate:wf},double:{type:"number",validate:wf},password:!0,binary:!0};rt.fastFormats={...rt.fullFormats,date:tt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ya),time:tt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xa),"date-time":tt(/^\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,Sf),"iso-time":tt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ef),"iso-date-time":tt(/^\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,Of),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};rt.formatNames=Object.keys(rt.fullFormats);function ZO(r){return r%4===0&&(r%100!==0||r%400===0)}var QO=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,e1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function $f(r){let e=QO.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&&ZO(t)?29:e1[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 Ka(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,l=+(s[6]||0),c=+(s[7]||0);if(l>23||c>59||r&&!a)return!1;if(i<=23&&n<=59&&o<60)return!0;let h=n-c*u,f=i-l*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 Ef(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 Wa=/t|\s/i;function vf(r){let e=Ka(r);return function(s){let i=s.split(Wa);return i.length===2&&$f(i[0])&&e(i[1])}}function Sf(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),s=new Date(e).valueOf();if(t&&s)return t-s}function Of(r,e){if(!(r&&e))return;let[t,s]=r.split(Wa),[i,n]=e.split(Wa),o=Ya(t,i);if(o!==void 0)return o||Xa(s,n)}var t1=/\/|:/,r1=/^(?:[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 s1(r){return t1.test(r)&&r1.test(r)}var bf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i1(r){return bf.lastIndex=0,bf.test(r)}var n1=-(2**31),o1=2**31-1;function a1(r){return Number.isInteger(r)&&r<=o1&&r>=n1}function u1(r){return Number.isInteger(r)}function wf(){return!0}var l1=/[^\\]\\Z/;function c1(r){if(l1.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var Pf=d(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});var h1=Mo(),d1=ea(),f1=wa(),p1=Da(),Tf=Ma(),m1=[h1.default,d1.default,(0,f1.default)(),p1.default,Tf.metadataVocabulary,Tf.contentVocabulary];Ja.default=m1});var If=d((lk,g1)=>{g1.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 Cf=d((K,Za)=>{"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 y1=ko(),_1=Pf(),v1=Ua(),Af=If(),b1=["/properties"],Ri="http://json-schema.org/draft-07/schema",wr=class extends y1.default{_addVocabularies(){super._addVocabularies(),_1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(v1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Af,b1):Af;this.addMetaSchema(e,Ri,!1),this.refs["http://json-schema.org/schema"]=Ri}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ri)?Ri:void 0)}};K.Ajv=wr;Za.exports=K=wr;Za.exports.Ajv=wr;Object.defineProperty(K,"__esModule",{value:!0});K.default=wr;var w1=hr();Object.defineProperty(K,"KeywordCxt",{enumerable:!0,get:function(){return w1.KeywordCxt}});var $r=T();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return $r._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return $r.str}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return $r.stringify}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return $r.nil}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return $r.Name}});Object.defineProperty(K,"CodeGen",{enumerable:!0,get:function(){return $r.CodeGen}});var $1=ss();Object.defineProperty(K,"ValidationError",{enumerable:!0,get:function(){return $1.default}});var E1=dr();Object.defineProperty(K,"MissingRefError",{enumerable:!0,get:function(){return E1.default}})});var Rf=d(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.formatLimitDefinition=void 0;var S1=Cf(),Ge=T(),Nt=Ge.operators,Ni={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}},O1={message:({keyword:r,schemaCode:e})=>(0,Ge.str)`should be ${Ni[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,Ge._)`{comparison: ${Ni[r].okStr}, limit: ${e}}`};Er.formatLimitDefinition={keyword:Object.keys(Ni),type:"string",schemaType:"string",$data:!0,error:O1,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 S1.KeywordCxt(n,a.RULES.all.format.definition,"format");u.$data?l():c();function l(){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 c(){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}) ${Ni[i].fail} 0`}},dependencies:["format"]};var x1=r=>(r.addKeyword(Er.formatLimitDefinition),r);Er.default=x1});var jf=d((bs,kf)=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var Sr=xf(),T1=Rf(),Qa=T(),Nf=new Qa.Name("fullFormats"),P1=new Qa.Name("fastFormats"),eu=(r,e={keywords:!0})=>{if(Array.isArray(e))return qf(r,e,Sr.fullFormats,Nf),r;let[t,s]=e.mode==="fast"?[Sr.fastFormats,P1]:[Sr.fullFormats,Nf],i=e.formats||Sr.formatNames;return qf(r,i,t,s),e.keywords&&(0,T1.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 qf(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])}kf.exports=bs=eu;Object.defineProperty(bs,"__esModule",{value:!0});bs.default=eu});var ws=d((pk,Df)=>{"use strict";var D1="2.0.0",M1=Number.MAX_SAFE_INTEGER||9007199254740991,L1=16,V1=250,F1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Df.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:L1,MAX_SAFE_BUILD_LENGTH:V1,MAX_SAFE_INTEGER:M1,RELEASE_TYPES:F1,SEMVER_SPEC_VERSION:D1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var $s=d((mk,Mf)=>{"use strict";var U1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Mf.exports=U1});var Or=d((st,Lf)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:su,MAX_SAFE_BUILD_LENGTH:H1,MAX_LENGTH:G1}=ws(),z1=$s();st=Lf.exports={};var B1=st.re=[],K1=st.safeRe=[],v=st.src=[],W1=st.safeSrc=[],b=st.t={},Y1=0,iu="[a-zA-Z0-9-]",X1=[["\\s",1],["\\d",G1],[iu,H1]],J1=r=>{for(let[e,t]of X1)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},P=(r,e,t)=>{let s=J1(e),i=Y1++;z1(r,i,e),b[r]=i,v[i]=e,W1[i]=s,B1[i]=new RegExp(e,t?"g":void 0),K1[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);st.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);st.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);st.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 qi=d((gk,Vf)=>{"use strict";var Z1=Object.freeze({loose:!0}),Q1=Object.freeze({}),ex=r=>r?typeof r!="object"?Z1:r:Q1;Vf.exports=ex});var nu=d((yk,Hf)=>{"use strict";var Ff=/^[0-9]+$/,Uf=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=Ff.test(r),s=Ff.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},tx=(r,e)=>Uf(e,r);Hf.exports={compareIdentifiers:Uf,rcompareIdentifiers:tx}});var fe=d((_k,zf)=>{"use strict";var ki=$s(),{MAX_LENGTH:Gf,MAX_SAFE_INTEGER:ji}=ws(),{safeRe:Di,t:Mi}=Or(),rx=qi(),{compareIdentifiers:ou}=nu(),au=class r{constructor(e,t){if(t=rx(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>Gf)throw new TypeError(`version is longer than ${Gf} characters`);ki("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?Di[Mi.LOOSE]:Di[Mi.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>ji||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ji||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ji||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<ji)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(ki("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(ki("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(ki("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?Di[Mi.PRERELEASELOOSE]:Di[Mi.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}};zf.exports=au});var Zt=d((vk,Kf)=>{"use strict";var Bf=fe(),sx=(r,e,t=!1)=>{if(r instanceof Bf)return r;try{return new Bf(r,e)}catch(s){if(!t)return null;throw s}};Kf.exports=sx});var Yf=d((bk,Wf)=>{"use strict";var ix=Zt(),nx=(r,e)=>{let t=ix(r,e);return t?t.version:null};Wf.exports=nx});var Jf=d((wk,Xf)=>{"use strict";var ox=Zt(),ax=(r,e)=>{let t=ox(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Xf.exports=ax});var ep=d(($k,Qf)=>{"use strict";var Zf=fe(),ux=(r,e,t,s,i)=>{typeof t=="string"&&(i=s,s=t,t=void 0);try{return new Zf(r instanceof Zf?r.version:r,t).inc(e,s,i).version}catch{return null}};Qf.exports=ux});var sp=d((Ek,rp)=>{"use strict";var tp=Zt(),lx=(r,e)=>{let t=tp(r,null,!0),s=tp(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 c=u?"pre":"";return t.major!==s.major?c+"major":t.minor!==s.minor?c+"minor":t.patch!==s.patch?c+"patch":"prerelease"};rp.exports=lx});var np=d((Sk,ip)=>{"use strict";var cx=fe(),hx=(r,e)=>new cx(r,e).major;ip.exports=hx});var ap=d((Ok,op)=>{"use strict";var dx=fe(),fx=(r,e)=>new dx(r,e).minor;op.exports=fx});var lp=d((xk,up)=>{"use strict";var px=fe(),mx=(r,e)=>new px(r,e).patch;up.exports=mx});var hp=d((Tk,cp)=>{"use strict";var gx=Zt(),yx=(r,e)=>{let t=gx(r,e);return t&&t.prerelease.length?t.prerelease:null};cp.exports=yx});var Ne=d((Pk,fp)=>{"use strict";var dp=fe(),_x=(r,e,t)=>new dp(r,t).compare(new dp(e,t));fp.exports=_x});var mp=d((Ik,pp)=>{"use strict";var vx=Ne(),bx=(r,e,t)=>vx(e,r,t);pp.exports=bx});var yp=d((Ak,gp)=>{"use strict";var wx=Ne(),$x=(r,e)=>wx(r,e,!0);gp.exports=$x});var Li=d((Ck,vp)=>{"use strict";var _p=fe(),Ex=(r,e,t)=>{let s=new _p(r,t),i=new _p(e,t);return s.compare(i)||s.compareBuild(i)};vp.exports=Ex});var wp=d((Rk,bp)=>{"use strict";var Sx=Li(),Ox=(r,e)=>r.sort((t,s)=>Sx(t,s,e));bp.exports=Ox});var Ep=d((Nk,$p)=>{"use strict";var xx=Li(),Tx=(r,e)=>r.sort((t,s)=>xx(s,t,e));$p.exports=Tx});var Es=d((qk,Sp)=>{"use strict";var Px=Ne(),Ix=(r,e,t)=>Px(r,e,t)>0;Sp.exports=Ix});var Vi=d((kk,Op)=>{"use strict";var Ax=Ne(),Cx=(r,e,t)=>Ax(r,e,t)<0;Op.exports=Cx});var uu=d((jk,xp)=>{"use strict";var Rx=Ne(),Nx=(r,e,t)=>Rx(r,e,t)===0;xp.exports=Nx});var lu=d((Dk,Tp)=>{"use strict";var qx=Ne(),kx=(r,e,t)=>qx(r,e,t)!==0;Tp.exports=kx});var Fi=d((Mk,Pp)=>{"use strict";var jx=Ne(),Dx=(r,e,t)=>jx(r,e,t)>=0;Pp.exports=Dx});var Ui=d((Lk,Ip)=>{"use strict";var Mx=Ne(),Lx=(r,e,t)=>Mx(r,e,t)<=0;Ip.exports=Lx});var cu=d((Vk,Ap)=>{"use strict";var Vx=uu(),Fx=lu(),Ux=Es(),Hx=Fi(),Gx=Vi(),zx=Ui(),Bx=(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 Vx(r,t,s);case"!=":return Fx(r,t,s);case">":return Ux(r,t,s);case">=":return Hx(r,t,s);case"<":return Gx(r,t,s);case"<=":return zx(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};Ap.exports=Bx});var Rp=d((Fk,Cp)=>{"use strict";var Kx=fe(),Wx=Zt(),{safeRe:Hi,t:Gi}=Or(),Yx=(r,e)=>{if(r instanceof Kx)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?Hi[Gi.COERCEFULL]:Hi[Gi.COERCE]);else{let u=e.includePrerelease?Hi[Gi.COERCERTLFULL]:Hi[Gi.COERCERTL],l;for(;(l=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),u.lastIndex=l.index+l[1].length+l[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 Wx(`${s}.${i}.${n}${o}${a}`,e)};Cp.exports=Yx});var qp=d((Uk,Np)=>{"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}};Np.exports=hu});var qe=d((Hk,Mp)=>{"use strict";var Xx=/\s+/g,du=class r{constructor(e,t){if(t=Zx(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(Xx," "),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=>!jp(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&&nT(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&&sT)|(this.options.loose&&iT))+":"+e,i=kp.get(s);if(i)return i;let n=this.options.loose,o=n?ye[pe.HYPHENRANGELOOSE]:ye[pe.HYPHENRANGE];e=e.replace(o,mT(this.options.includePrerelease)),W("hyphen replace",e),e=e.replace(ye[pe.COMPARATORTRIM],eT),W("comparator trim",e),e=e.replace(ye[pe.TILDETRIM],tT),W("tilde trim",e),e=e.replace(ye[pe.CARETTRIM],rT),W("caret trim",e);let a=e.split(" ").map(h=>oT(h,this.options)).join(" ").split(/\s+/).map(h=>pT(h,this.options));n&&(a=a.filter(h=>(W("loose invalid filter",h,this.options),!!h.match(ye[pe.COMPARATORLOOSE])))),W("range list",a);let u=new Map,l=a.map(h=>new fu(h,this.options));for(let h of l){if(jp(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return kp.set(s,c),c}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(s=>Dp(s,t)&&e.set.some(i=>Dp(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 Qx(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(gT(this.set[t],e,this.options))return!0;return!1}};Mp.exports=du;var Jx=qp(),kp=new Jx,Zx=qi(),fu=Ss(),W=$s(),Qx=fe(),{safeRe:ye,t:pe,comparatorTrimReplace:eT,tildeTrimReplace:tT,caretTrimReplace:rT}=Or(),{FLAG_INCLUDE_PRERELEASE:sT,FLAG_LOOSE:iT}=ws(),jp=r=>r.value==="<0.0.0-0",nT=r=>r.value==="",Dp=(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},oT=(r,e)=>(r=r.replace(ye[pe.BUILD],""),W("comp",r,e),r=lT(r,e),W("caret",r),r=aT(r,e),W("tildes",r),r=hT(r,e),W("xrange",r),r=fT(r,e),W("stars",r),r),_e=r=>!r||r.toLowerCase()==="x"||r==="*",aT=(r,e)=>r.trim().split(/\s+/).map(t=>uT(t,e)).join(" "),uT=(r,e)=>{let t=e.loose?ye[pe.TILDELOOSE]:ye[pe.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})},lT=(r,e)=>r.trim().split(/\s+/).map(t=>cT(t,e)).join(" "),cT=(r,e)=>{W("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)=>{W("caret",r,i,n,o,a,u);let l;return _e(n)?l="":_e(o)?l=`>=${n}.0.0${s} <${+n+1}.0.0-0`:_e(a)?n==="0"?l=`>=${n}.${o}.0${s} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.0${s} <${+n+1}.0.0-0`:u?(W("replaceCaret pr",u),n==="0"?o==="0"?l=`>=${n}.${o}.${a}-${u} <${n}.${o}.${+a+1}-0`:l=`>=${n}.${o}.${a}-${u} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${a}-${u} <${+n+1}.0.0-0`):(W("no pr"),n==="0"?o==="0"?l=`>=${n}.${o}.${a}${s} <${n}.${o}.${+a+1}-0`:l=`>=${n}.${o}.${a}${s} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${a} <${+n+1}.0.0-0`),W("caret return",l),l})},hT=(r,e)=>(W("replaceXRanges",r,e),r.split(/\s+/).map(t=>dT(t,e)).join(" ")),dT=(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)=>{W("xRange",r,s,i,n,o,a,u);let l=_e(n),c=l||_e(o),h=c||_e(a),f=h;return i==="="&&f&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?s="<0.0.0-0":s="*":i&&f?(c&&(o=0),a=0,i===">"?(i=">=",c?(n=+n+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",c?n=+n+1:o=+o+1),i==="<"&&(u="-0"),s=`${i+n}.${o}.${a}${u}`):c?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})},fT=(r,e)=>(W("replaceStars",r,e),r.trim().replace(ye[pe.STAR],"")),pT=(r,e)=>(W("replaceGTE0",r,e),r.trim().replace(ye[e.includePrerelease?pe.GTE0PRE:pe.GTE0],"")),mT=r=>(e,t,s,i,n,o,a,u,l,c,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(l)?u="":_e(c)?u=`<${+l+1}.0.0-0`:_e(h)?u=`<${l}.${+c+1}.0-0`:f?u=`<=${l}.${c}.${h}-${f}`:r?u=`<${l}.${c}.${+h+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),gT=(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!==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((Gk,Gp)=>{"use strict";var Os=Symbol("SemVer ANY"),gu=class r{static get ANY(){return Os}constructor(e,t){if(t=Lp(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?Vp[Fp.COMPARATORLOOSE]:Vp[Fp.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 Up(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 Up(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 Hp(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Hp(this.value,t).test(e.semver):(t=Lp(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(">")))}};Gp.exports=gu;var Lp=qi(),{safeRe:Vp,t:Fp}=Or(),pu=cu(),mu=$s(),Up=fe(),Hp=qe()});var xs=d((zk,zp)=>{"use strict";var yT=qe(),_T=(r,e,t)=>{try{e=new yT(e,t)}catch{return!1}return e.test(r)};zp.exports=_T});var Kp=d((Bk,Bp)=>{"use strict";var vT=qe(),bT=(r,e)=>new vT(r,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));Bp.exports=bT});var Yp=d((Kk,Wp)=>{"use strict";var wT=fe(),$T=qe(),ET=(r,e,t)=>{let s=null,i=null,n=null;try{n=new $T(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new wT(s,t))}),s};Wp.exports=ET});var Jp=d((Wk,Xp)=>{"use strict";var ST=fe(),OT=qe(),xT=(r,e,t)=>{let s=null,i=null,n=null;try{n=new OT(e,t)}catch{return null}return r.forEach(o=>{n.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new ST(s,t))}),s};Xp.exports=xT});var em=d((Yk,Qp)=>{"use strict";var yu=fe(),TT=qe(),Zp=Es(),PT=(r,e)=>{r=new TT(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||Zp(a,n))&&(n=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),n&&(!t||Zp(t,n))&&(t=n)}return t&&r.test(t)?t:null};Qp.exports=PT});var rm=d((Xk,tm)=>{"use strict";var IT=qe(),AT=(r,e)=>{try{return new IT(r,e).range||"*"}catch{return null}};tm.exports=AT});var zi=d((Jk,om)=>{"use strict";var CT=fe(),nm=Ss(),{ANY:RT}=nm,NT=qe(),qT=xs(),sm=Es(),im=Vi(),kT=Ui(),jT=Fi(),DT=(r,e,t,s)=>{r=new CT(r,s),e=new NT(e,s);let i,n,o,a,u;switch(t){case">":i=sm,n=kT,o=im,a=">",u=">=";break;case"<":i=im,n=jT,o=sm,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(qT(r,e,s))return!1;for(let l=0;l<e.set.length;++l){let c=e.set[l],h=null,f=null;if(c.forEach(p=>{p.semver===RT&&(p=new nm(">=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};om.exports=DT});var um=d((Zk,am)=>{"use strict";var MT=zi(),LT=(r,e,t)=>MT(r,e,">",t);am.exports=LT});var cm=d((Qk,lm)=>{"use strict";var VT=zi(),FT=(r,e,t)=>VT(r,e,"<",t);lm.exports=FT});var fm=d((ej,dm)=>{"use strict";var hm=qe(),UT=(r,e,t)=>(r=new hm(r,t),e=new hm(e,t),r.intersects(e,t));dm.exports=UT});var mm=d((tj,pm)=>{"use strict";var HT=xs(),GT=Ne();pm.exports=(r,e,t)=>{let s=[],i=null,n=null,o=r.sort((c,h)=>GT(c,h,t));for(let c of o)HT(c,e,t)?(n=c,i||(i=c)):(n&&s.push([i,n]),n=null,i=null);i&&s.push([i,null]);let a=[];for(let[c,h]of s)c===h?a.push(c):!h&&c===o[0]?a.push("*"):h?c===o[0]?a.push(`<=${h}`):a.push(`${c} - ${h}`):a.push(`>=${c}`);let u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var wm=d((rj,bm)=>{"use strict";var gm=qe(),vu=Ss(),{ANY:_u}=vu,Ts=xs(),bu=Ne(),zT=(r,e,t={})=>{if(r===e)return!0;r=new gm(r,t),e=new gm(e,t);let s=!1;e:for(let i of r.set){for(let n of e.set){let o=KT(i,n,t);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},BT=[new vu(">=0.0.0-0")],ym=[new vu(">=0.0.0")],KT=(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=BT:r=ym}if(e.length===1&&e[0].semver===_u){if(t.includePrerelease)return!0;e=ym}let s=new Set,i,n;for(let p of r)p.operator===">"||p.operator===">="?i=_m(i,p,t):p.operator==="<"||p.operator==="<="?n=vm(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,l,c,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(c=c||p.operator===">"||p.operator===">=",l=l||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=_m(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=vm(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&&l&&!n&&o!==0||n&&c&&!i&&o!==0||f||h)},_m=(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},vm=(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};bm.exports=zT});var Om=d((sj,Sm)=>{"use strict";var wu=Or(),$m=ws(),WT=fe(),Em=nu(),YT=Zt(),XT=Yf(),JT=Jf(),ZT=ep(),QT=sp(),eP=np(),tP=ap(),rP=lp(),sP=hp(),iP=Ne(),nP=mp(),oP=yp(),aP=Li(),uP=wp(),lP=Ep(),cP=Es(),hP=Vi(),dP=uu(),fP=lu(),pP=Fi(),mP=Ui(),gP=cu(),yP=Rp(),_P=Ss(),vP=qe(),bP=xs(),wP=Kp(),$P=Yp(),EP=Jp(),SP=em(),OP=rm(),xP=zi(),TP=um(),PP=cm(),IP=fm(),AP=mm(),CP=wm();Sm.exports={parse:YT,valid:XT,clean:JT,inc:ZT,diff:QT,major:eP,minor:tP,patch:rP,prerelease:sP,compare:iP,rcompare:nP,compareLoose:oP,compareBuild:aP,sort:uP,rsort:lP,gt:cP,lt:hP,eq:dP,neq:fP,gte:pP,lte:mP,cmp:gP,coerce:yP,Comparator:_P,Range:vP,satisfies:bP,toComparators:wP,maxSatisfying:$P,minSatisfying:EP,minVersion:SP,validRange:OP,outside:xP,gtr:TP,ltr:PP,intersects:IP,simplifyRange:AP,subset:CP,SemVer:WT,re:wu.re,src:wu.src,tokens:wu.t,SEMVER_SPEC_VERSION:$m.SEMVER_SPEC_VERSION,RELEASE_TYPES:$m.RELEASE_TYPES,compareIdentifiers:Em.compareIdentifiers,rcompareIdentifiers:Em.rcompareIdentifiers}});var ee=d((dj,km)=>{"use strict";var{FORCE_COLOR:GP,NODE_DISABLE_COLORS:zP,TERM:BP}=process.env,L={enabled:!zP&&BP!=="dumb"&&GP!=="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 qm(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 KP(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?qm(this.keys,s+""):s+""):s===void 0?KP([r],[t]):L.enabled?qm([t],s+""):s+""}}km.exports=L});var Dm=d((fj,jm)=>{"use strict";jm.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((pj,Mm)=>{"use strict";Mm.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((mj,Lm)=>{"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"},WP={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},YP={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}};Lm.exports={cursor:Tu,scroll:WP,erase:YP,beep:"\x07"}});var Gm=d((gj,Hm)=>{"use strict";function XP(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=JP(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(l){throw l},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 l=t.next();return n=l.done,l},e:function(l){o=!0,a=l},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function JP(r,e){if(r){if(typeof r=="string")return Vm(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 Vm(r,e)}}function Vm(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 ZP=Wi(),Um=te(),Fm=Um.erase,QP=Um.cursor,eI=r=>[...ZP(r)].length;Hm.exports=function(r,e){if(!e)return Fm.line+QP.to(0);let t=0,s=r.split(/\r?\n/);var i=XP(s),n;try{for(i.s();!(n=i.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(eI(o)-1,0)/e)}}catch(o){i.e(o)}finally{i.f()}return Fm.lines(t)}});var Pu=d((yj,zm)=>{"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"},tI={arrowUp:Is.arrowUp,arrowDown:Is.arrowDown,arrowLeft:Is.arrowLeft,arrowRight:Is.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},rI=process.platform==="win32"?tI:Is;zm.exports=rI});var Km=d((_j,Bm)=>{"use strict";var Pr=ee(),er=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}`}}),sI=r=>Iu[r]||Iu.default,As=Object.freeze({aborted:Pr.red(er.cross),done:Pr.green(er.tick),exited:Pr.yellow(er.cross),default:Pr.cyan("?")}),iI=(r,e,t)=>e?As.aborted:t?As.exited:r?As.done:As.default,nI=r=>Pr.gray(r?er.ellipsis:er.pointerSmall),oI=(r,e)=>Pr.gray(r?e?er.pointerSmall:"+":er.line);Bm.exports={styles:Iu,render:sI,symbols:As,symbol:iI,delimiter:nI,item:oI}});var Ym=d((vj,Wm)=>{"use strict";var aI=Wi();Wm.exports=function(r,e){let t=String(aI(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var Jm=d((bj,Xm)=>{"use strict";Xm.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 Qm=d((bj,Zm)=>{"use strict";Zm.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((wj,eg)=>{"use strict";eg.exports={action:Dm(),clear:Gm(),style:Km(),strip:Wi(),figures:Pu(),lines:Ym(),wrap:Jm(),entriesToDisplay:Qm()}});var pt=d(($j,sg)=>{"use strict";var tg=require("readline"),aI=ze(),uI=aI.action,cI=require("events"),rg=te(),lI=rg.beep,hI=rg.cursor,dI=ee(),Au=class extends cI{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=tg.createInterface({input:this.in,escapeCodeTimeout:50});tg.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=uI(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(hI.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(lI)}render(){this.onRender(dI),this.firstRender&&(this.firstRender=!1)}};sg.exports=Au});var ug=d((Ej,ag)=>{"use strict";function ig(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 ng(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){ig(n,s,i,o,a,"next",u)}function a(u){ig(n,s,i,o,a,"throw",u)}o(void 0)})}}var Yi=ee(),fI=pt(),og=te(),pI=og.erase,As=og.cursor,Xi=ze(),Cu=Xi.style,Ru=Xi.clear,mI=Xi.lines,gI=Xi.figures,Nu=class extends fI{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=Yi.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(`
12
+ `)}});var Qm=d((wj,Zm)=>{"use strict";Zm.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(($j,eg)=>{"use strict";eg.exports={action:Dm(),clear:Gm(),style:Km(),strip:Wi(),figures:Pu(),lines:Ym(),wrap:Jm(),entriesToDisplay:Qm()}});var pt=d((Ej,sg)=>{"use strict";var tg=require("readline"),uI=ze(),lI=uI.action,cI=require("events"),rg=te(),hI=rg.beep,dI=rg.cursor,fI=ee(),Au=class extends cI{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=tg.createInterface({input:this.in,escapeCodeTimeout:50});tg.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=lI(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(dI.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(hI)}render(){this.onRender(fI),this.firstRender&&(this.firstRender=!1)}};sg.exports=Au});var ug=d((Sj,ag)=>{"use strict";function ig(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(s,i)}function ng(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){ig(n,s,i,o,a,"next",u)}function a(u){ig(n,s,i,o,a,"throw",u)}o(void 0)})}}var Yi=ee(),pI=pt(),og=te(),mI=og.erase,Cs=og.cursor,Xi=ze(),Cu=Xi.style,Ru=Xi.clear,gI=Xi.lines,yI=Xi.figures,Nu=class extends pI{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=Yi.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
13
  `),this.close()}validate(){var e=this;return ng(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ng(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(As.down(mI(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),Yi.bold(this.msg),Cu.delimiter(this.done),this.red?Yi.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
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(gI(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),Yi.bold(this.msg),Cu.delimiter(this.done),this.red?Yi.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
15
15
  `).reduce((e,t,s)=>e+`
16
- ${s?" ":gI.pointerSmall} ${Yi.red().italic(t)}`,"")),this.out.write(pI.line+As.to(0)+this.outputText+As.save+this.outputError+As.restore+As.move(this.cursorOffset,0)))}};ag.exports=Nu});var dg=d((Sj,hg)=>{"use strict";var mt=ee(),yI=pt(),Cs=ze(),cg=Cs.style,lg=Cs.clear,Ji=Cs.figures,_I=Cs.wrap,vI=Cs.entriesToDisplay,bI=te(),wI=bI.cursor,qu=class extends yI{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=lg("",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?" ":yI.pointerSmall} ${Yi.red().italic(t)}`,"")),this.out.write(mI.line+Cs.to(0)+this.outputText+Cs.save+this.outputError+Cs.restore+Cs.move(this.cursorOffset,0)))}};ag.exports=Nu});var dg=d((Oj,hg)=>{"use strict";var mt=ee(),_I=pt(),Rs=ze(),lg=Rs.style,cg=Rs.clear,Ji=Rs.figures,vI=Rs.wrap,bI=Rs.entriesToDisplay,wI=te(),$I=wI.cursor,qu=class extends _I{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=cg("",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(wI.hide):this.out.write(lg(this.outputText,this.out.columns)),super.render();let e=vI(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[cg.symbol(this.done,this.aborted),mt.bold(this.msg),cg.delimiter(!1),this.done?this.selection.title:this.selection.disabled?mt.yellow(this.warn):mt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write($I.hide):this.out.write(cg(this.outputText,this.out.columns)),super.render();let e=bI(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[lg.symbol(this.done,this.aborted),mt.bold(this.msg),lg.delimiter(!1),this.done?this.selection.title:this.selection.disabled?mt.yellow(this.warn):mt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
19
19
  `;for(let i=t;i<s;i++){let n,o,a="",u=this.choices[i];i===t&&t>0?o=Ji.arrowUp:i===s-1&&s<this.choices.length?o=Ji.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(Ji.pointer)+" ":" ")+o):(n=this.cursor===i?mt.cyan().underline(u.title):u.title,o=(this.cursor===i?mt.cyan(Ji.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
- `+_I(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${mt.gray(a)}
21
- `}}this.out.write(this.outputText)}};hg.exports=qu});var _g=d((Oj,yg)=>{"use strict";var Zi=ee(),$I=pt(),mg=ze(),fg=mg.style,EI=mg.clear,gg=te(),pg=gg.cursor,SI=gg.erase,ku=class extends $I{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(`
20
+ `+vI(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${mt.gray(a)}
21
+ `}}this.out.write(this.outputText)}};hg.exports=qu});var _g=d((xj,yg)=>{"use strict";var Zi=ee(),EI=pt(),mg=ze(),fg=mg.style,SI=mg.clear,gg=te(),pg=gg.cursor,OI=gg.erase,ku=class extends EI{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(pg.hide):this.out.write(EI(this.outputText,this.out.columns)),super.render(),this.outputText=[fg.symbol(this.done,this.aborted),Zi.bold(this.msg),fg.delimiter(this.done),this.value?this.inactive:Zi.cyan().underline(this.inactive),Zi.gray("/"),this.value?Zi.cyan().underline(this.active):this.active].join(" "),this.out.write(SI.line+pg.to(0)+this.outputText))}};yg.exports=ku});var it=d((xj,vg)=>{"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)}};vg.exports=ju});var wg=d((Tj,bg)=>{"use strict";var OI=it(),Du=class extends OI{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}};bg.exports=Du});var Eg=d((Pj,$g)=>{"use strict";var xI=it(),TI=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Mu=class extends xI{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+TI(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$g.exports=Mu});var Og=d((Ij,Sg)=>{"use strict";var PI=it(),Lu=class extends PI{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}};Sg.exports=Lu});var Tg=d((Aj,xg)=>{"use strict";var II=it(),Vu=class extends II{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)}};xg.exports=Vu});var Ig=d((Cj,Pg)=>{"use strict";var AI=it(),Fu=class extends AI{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}};Pg.exports=Fu});var Cg=d((Rj,Ag)=>{"use strict";var CI=it(),Uu=class extends CI{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)}};Ag.exports=Uu});var Ng=d((Nj,Rg)=>{"use strict";var RI=it(),Hu=class extends RI{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}};Rg.exports=Hu});var kg=d((qj,qg)=>{"use strict";var NI=it(),Gu=class extends NI{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}};qg.exports=Gu});var Dg=d((kj,jg)=>{"use strict";jg.exports={DatePart:it(),Meridiem:wg(),Day:Eg(),Hours:Og(),Milliseconds:Tg(),Minutes:Ig(),Month:Cg(),Seconds:Ng(),Year:kg()}});var Kg=d((jj,Bg)=>{"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 Lg(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 zu=ee(),qI=pt(),Ku=ze(),Vg=Ku.style,Fg=Ku.clear,kI=Ku.figures,zg=te(),jI=zg.erase,Ug=zg.cursor,gt=Dg(),Hg=gt.DatePart,DI=gt.Meridiem,MI=gt.Day,LI=gt.Hours,VI=gt.Milliseconds,FI=gt.Minutes,UI=gt.Month,HI=gt.Seconds,GI=gt.Year,zI=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Gg={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new MI(r),3:r=>new UI(r),4:r=>new GI(r),5:r=>new DI(r),6:r=>new LI(r),7:r=>new FI(r),8:r=>new HI(r),9:r=>new VI(r)},BI={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 qI{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(BI,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=Fg("",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=zI.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in Gg?Gg[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 Hg)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!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(pg.hide):this.out.write(SI(this.outputText,this.out.columns)),super.render(),this.outputText=[fg.symbol(this.done,this.aborted),Zi.bold(this.msg),fg.delimiter(this.done),this.value?this.inactive:Zi.cyan().underline(this.inactive),Zi.gray("/"),this.value?Zi.cyan().underline(this.active):this.active].join(" "),this.out.write(OI.line+pg.to(0)+this.outputText))}};yg.exports=ku});var it=d((Tj,vg)=>{"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)}};vg.exports=ju});var wg=d((Pj,bg)=>{"use strict";var xI=it(),Du=class extends xI{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}};bg.exports=Du});var Eg=d((Ij,$g)=>{"use strict";var TI=it(),PI=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),Mu=class extends TI{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+PI(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$g.exports=Mu});var Og=d((Aj,Sg)=>{"use strict";var II=it(),Lu=class extends II{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}};Sg.exports=Lu});var Tg=d((Cj,xg)=>{"use strict";var AI=it(),Vu=class extends AI{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)}};xg.exports=Vu});var Ig=d((Rj,Pg)=>{"use strict";var CI=it(),Fu=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}};Pg.exports=Fu});var Cg=d((Nj,Ag)=>{"use strict";var RI=it(),Uu=class extends RI{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)}};Ag.exports=Uu});var Ng=d((qj,Rg)=>{"use strict";var NI=it(),Hu=class extends NI{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}};Rg.exports=Hu});var kg=d((kj,qg)=>{"use strict";var qI=it(),Gu=class extends qI{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}};qg.exports=Gu});var Dg=d((jj,jg)=>{"use strict";jg.exports={DatePart:it(),Meridiem:wg(),Day:Eg(),Hours:Og(),Milliseconds:Tg(),Minutes:Ig(),Month:Cg(),Seconds:Ng(),Year:kg()}});var Kg=d((Dj,Bg)=>{"use strict";function Mg(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(l){t(l);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){Mg(n,s,i,o,a,"next",u)}function a(u){Mg(n,s,i,o,a,"throw",u)}o(void 0)})}}var zu=ee(),kI=pt(),Ku=ze(),Vg=Ku.style,Fg=Ku.clear,jI=Ku.figures,zg=te(),DI=zg.erase,Ug=zg.cursor,gt=Dg(),Hg=gt.DatePart,MI=gt.Meridiem,LI=gt.Day,VI=gt.Hours,FI=gt.Milliseconds,UI=gt.Minutes,HI=gt.Month,GI=gt.Seconds,zI=gt.Year,BI=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Gg={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new LI(r),3:r=>new HI(r),4:r=>new zI(r),5:r=>new MI(r),6:r=>new VI(r),7:r=>new UI(r),8:r=>new GI(r),9:r=>new FI(r)},KI={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 kI{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(KI,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=Fg("",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=BI.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in Gg?Gg[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 Hg)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
24
24
  `),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(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
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 Hg)),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(Ug.hide):this.out.write(Fg(this.outputText,this.out.columns)),super.render(),this.outputText=[Vg.symbol(this.done,this.aborted),zu.bold(this.msg),Vg.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(`
26
26
  `).reduce((e,t,s)=>e+`
27
- ${s?" ":kI.pointerSmall} ${zu.red().italic(t)}`,"")),this.out.write(jI.line+Ug.to(0)+this.outputText))}};Bg.exports=Bu});var ey=d((Dj,Qg)=>{"use strict";function Wg(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 Yg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Wg(n,s,i,o,a,"next",u)}function a(u){Wg(n,s,i,o,a,"throw",u)}o(void 0)})}}var Qi=ee(),KI=pt(),Zg=te(),en=Zg.cursor,WI=Zg.erase,tn=ze(),Wu=tn.style,YI=tn.figures,Xg=tn.clear,XI=tn.lines,JI=/[0-9]/,Yu=r=>r!==void 0,Jg=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Xu=class extends KI{constructor(e={}){super(e),this.transform=Wu.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=Qi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Jg(e,this.round)}`),this._value=Jg(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||JI.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(`
27
+ ${s?" ":jI.pointerSmall} ${zu.red().italic(t)}`,"")),this.out.write(DI.line+Ug.to(0)+this.outputText))}};Bg.exports=Bu});var ey=d((Mj,Qg)=>{"use strict";function Wg(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(s,i)}function Yg(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Wg(n,s,i,o,a,"next",u)}function a(u){Wg(n,s,i,o,a,"throw",u)}o(void 0)})}}var Qi=ee(),WI=pt(),Zg=te(),en=Zg.cursor,YI=Zg.erase,tn=ze(),Wu=tn.style,XI=tn.figures,Xg=tn.clear,JI=tn.lines,ZI=/[0-9]/,Yu=r=>r!==void 0,Jg=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Xu=class extends WI{constructor(e={}){super(e),this.transform=Wu.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=Qi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Jg(e,this.round)}`),this._value=Jg(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||ZI.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
28
  `),this.close()}validate(){var e=this;return Yg(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Yg(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(en.down(XI(this.outputError,this.out.columns)-1)+Xg(this.outputError,this.out.columns)),this.out.write(Xg(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Wu.symbol(this.done,this.aborted),Qi.bold(this.msg),Wu.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Qi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
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(en.down(JI(this.outputError,this.out.columns)-1)+Xg(this.outputError,this.out.columns)),this.out.write(Xg(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Wu.symbol(this.done,this.aborted),Qi.bold(this.msg),Wu.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Qi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
30
30
  `).reduce((e,t,s)=>e+`
31
- ${s?" ":YI.pointerSmall} ${Qi.red().italic(t)}`,"")),this.out.write(WI.line+en.to(0)+this.outputText+en.save+this.outputError+en.restore))}};Qg.exports=Xu});var Zu=d((Mj,sy)=>{"use strict";var nt=ee(),ZI=te(),QI=ZI.cursor,eA=pt(),Rs=ze(),ty=Rs.clear,kt=Rs.figures,ry=Rs.style,tA=Rs.wrap,rA=Rs.entriesToDisplay,Ju=class extends eA{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=ty("",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?" ":XI.pointerSmall} ${Qi.red().italic(t)}`,"")),this.out.write(YI.line+en.to(0)+this.outputText+en.save+this.outputError+en.restore))}};Qg.exports=Xu});var Zu=d((Lj,sy)=>{"use strict";var nt=ee(),QI=te(),eA=QI.cursor,tA=pt(),Ns=ze(),ty=Ns.clear,kt=Ns.figures,ry=Ns.style,rA=Ns.wrap,sA=Ns.entriesToDisplay,Ju=class extends tA{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=ty("",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:
@@ -36,47 +36,47 @@ Instructions:
36
36
  ${kt.arrowLeft}/${kt.arrowRight}/[space]: Toggle selection
37
37
  `+(this.maxChoices===void 0?` a: Toggle all
38
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
- `+tA(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=rA(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`
39
+ `+rA(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=sA(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=[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(QI.hide),super.render();let e=[ry.symbol(this.done,this.aborted),nt.bold(this.msg),ry.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=ty(e,this.out.columns)}};sy.exports=Ju});var ly=d((Lj,cy)=>{"use strict";function iy(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 sA(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){iy(n,s,i,o,a,"next",u)}function a(u){iy(n,s,i,o,a,"throw",u)}o(void 0)})}}var Ns=ee(),iA=pt(),uy=te(),nA=uy.erase,ny=uy.cursor,qs=ze(),Qu=qs.style,oy=qs.clear,ec=qs.figures,oA=qs.wrap,aA=qs.entriesToDisplay,ay=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),uA=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),cA=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},tc=class extends iA{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:cA(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=oy("",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=ay(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return sA(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:uA(u,a),value:ay(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(eA.hide),super.render();let e=[ry.symbol(this.done,this.aborted),nt.bold(this.msg),ry.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=ty(e,this.out.columns)}};sy.exports=Ju});var cy=d((Vj,ly)=>{"use strict";function iy(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(s,i)}function iA(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){iy(n,s,i,o,a,"next",u)}function a(u){iy(n,s,i,o,a,"throw",u)}o(void 0)})}}var qs=ee(),nA=pt(),uy=te(),oA=uy.erase,ny=uy.cursor,ks=ze(),Qu=ks.style,oy=ks.clear,el=ks.figures,aA=ks.wrap,uA=ks.entriesToDisplay,ay=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),lA=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),cA=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},tl=class extends nA{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:cA(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=oy("",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=ay(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return iA(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:lA(u,a),value:ay(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?Ns.cyan().underline(e.title):e.title;return o=(t?Ns.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
- `+oA(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ns.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ny.hide):this.out.write(oy(this.outputText,this.out.columns)),super.render();let e=aA(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[Qu.symbol(this.done,this.aborted,this.exited),Ns.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?el.arrowUp:i?el.arrowDown:" ",a=t?qs.cyan().underline(e.title):e.title;return o=(t?qs.cyan(el.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
+ `+aA(e.description,{margin:3,width:this.out.columns}))),o+" "+a+qs.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ny.hide):this.out.write(oy(this.outputText,this.out.columns)),super.render();let e=uA(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(`
46
46
  `);this.outputText+=`
47
- `+(i||Ns.gray(this.fallback.title))}this.out.write(nA.line+ny.to(0)+this.outputText)}};cy.exports=tc});var py=d((Vj,fy)=>{"use strict";var yt=ee(),lA=te(),hA=lA.cursor,dA=Zu(),sc=ze(),hy=sc.clear,dy=sc.style,Pr=sc.figures,rc=class extends dA{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=hy("",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||qs.gray(this.fallback.title))}this.out.write(oA.line+ny.to(0)+this.outputText)}};ly.exports=tl});var py=d((Fj,fy)=>{"use strict";var yt=ee(),hA=te(),dA=hA.cursor,fA=Zu(),sl=ze(),hy=sl.clear,dy=sl.style,Ir=sl.figures,rl=class extends fA{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=hy("",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
- ${Pr.arrowUp}/${Pr.arrowDown}: Highlight option
50
- ${Pr.arrowLeft}/${Pr.arrowRight}/[space]: Toggle selection
49
+ ${Ir.arrowUp}/${Ir.arrowDown}: Highlight option
50
+ ${Ir.arrowLeft}/${Ir.arrowRight}/[space]: Toggle selection
51
51
  [a,b,c]/delete: Filter choices
52
52
  enter/return: Complete answer
53
53
  `:""}renderCurrentInput(){return`
54
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(Pr.radioOn):Pr.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(hA.hide),super.render();let e=[dy.symbol(this.done,this.aborted),yt.bold(this.msg),dy.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=hy(e,this.out.columns)}};fy.exports=rc});var wy=d((Fj,by)=>{"use strict";var my=ee(),fA=pt(),_y=ze(),gy=_y.style,pA=_y.clear,vy=te(),mA=vy.erase,yy=vy.cursor,ic=class extends fA{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(`
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(Ir.radioOn):Ir.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(dA.hide),super.render();let e=[dy.symbol(this.done,this.aborted),yt.bold(this.msg),dy.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=hy(e,this.out.columns)}};fy.exports=rl});var wy=d((Uj,by)=>{"use strict";var my=ee(),pA=pt(),_y=ze(),gy=_y.style,mA=_y.clear,vy=te(),gA=vy.erase,yy=vy.cursor,il=class extends pA{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(yy.hide):this.out.write(pA(this.outputText,this.out.columns)),super.render(),this.outputText=[gy.symbol(this.done,this.aborted),my.bold(this.msg),gy.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:my.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(mA.line+yy.to(0)+this.outputText))}};by.exports=ic});var Ey=d((Uj,$y)=>{"use strict";$y.exports={TextPrompt:ug(),SelectPrompt:dg(),TogglePrompt:_g(),DatePrompt:Kg(),NumberPrompt:ey(),MultiselectPrompt:Zu(),AutocompletePrompt:ly(),AutocompleteMultiselectPrompt:py(),ConfirmPrompt:wy()}});var Oy=d(Sy=>{"use strict";var Se=Sy,gA=Ey(),rn=r=>r;function ot(r,e,t={}){return new Promise((s,i)=>{let n=new gA[r](e),o=t.onAbort||rn,a=t.onSubmit||rn,u=t.onExit||rn;n.on("state",e.onState||rn),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 yA=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Se.autocomplete=r=>(r.suggest=r.suggest||yA,r.choices=[].concat(r.choices||[]),ot("AutocompletePrompt",r))});var Ny=d((Gj,Ry)=>{"use strict";function xy(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 Ty(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xy(Object(t),!0).forEach(function(s){_A(r,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xy(Object(t)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))})}return r}function _A(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vA(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=bA(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 bA(r,e){if(r){if(typeof r=="string")return Py(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 Py(r,e)}}function Py(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 Iy(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 Ay(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Iy(n,s,i,o,a,"next",u)}function a(u){Iy(n,s,i,o,a,"throw",u)}o(void 0)})}}var nc=Oy(),wA=["suggest","format","onState","validate","onRender","type"],Cy=()=>{};function jt(){return oc.apply(this,arguments)}function oc(){return oc=Ay(function*(r=[],{onSubmit:e=Cy,onCancel:t=Cy}={}){let s={},i=jt._override||{};r=[].concat(r);let n,o,a,u,c,l,h=(function(){var y=Ay(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=vA(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,Ty({},s),o),o.type=c),!!c){for(let y in o){if(wA.includes(y))continue;let _=o[y];o[y]=typeof _=="function"?yield _(n,Ty({},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=jt._injected?$A(jt._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 $A(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function EA(r){jt._injected=(jt._injected||[]).concat(r)}function SA(r){jt._override=Object.assign({},r)}Ry.exports=Object.assign(jt,{prompt:jt,prompts:nc,inject:EA,override:SA})});var ky=d((zj,qy)=>{"use strict";qy.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var sn=d((Bj,jy)=>{"use strict";jy.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 Ly=d((Kj,My)=>{"use strict";var OA=sn(),{erase:Dy,cursor:xA}=te(),TA=r=>[...OA(r)].length;My.exports=function(r,e){if(!e)return Dy.line+xA.to(0);let t=0,s=r.split(/\r?\n/);for(let i of s)t+=1+Math.floor(Math.max(TA(i)-1,0)/e);return Dy.lines(t)}});var ac=d((Wj,Vy)=>{"use strict";var ks={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},PA={arrowUp:ks.arrowUp,arrowDown:ks.arrowDown,arrowLeft:ks.arrowLeft,arrowRight:ks.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},IA=process.platform==="win32"?PA:ks;Vy.exports=IA});var Uy=d((Yj,Fy)=>{"use strict";var Ir=ee(),tr=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}`}}),AA=r=>uc[r]||uc.default,js=Object.freeze({aborted:Ir.red(tr.cross),done:Ir.green(tr.tick),exited:Ir.yellow(tr.cross),default:Ir.cyan("?")}),CA=(r,e,t)=>e?js.aborted:t?js.exited:r?js.done:js.default,RA=r=>Ir.gray(r?tr.ellipsis:tr.pointerSmall),NA=(r,e)=>Ir.gray(r?e?tr.pointerSmall:"+":tr.line);Fy.exports={styles:uc,render:AA,symbols:js,symbol:CA,delimiter:RA,item:NA}});var Gy=d((Xj,Hy)=>{"use strict";var qA=sn();Hy.exports=function(r,e){let t=String(qA(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var By=d((Jj,zy)=>{"use strict";zy.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(yy.hide):this.out.write(mA(this.outputText,this.out.columns)),super.render(),this.outputText=[gy.symbol(this.done,this.aborted),my.bold(this.msg),gy.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:my.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(gA.line+yy.to(0)+this.outputText))}};by.exports=il});var Ey=d((Hj,$y)=>{"use strict";$y.exports={TextPrompt:ug(),SelectPrompt:dg(),TogglePrompt:_g(),DatePrompt:Kg(),NumberPrompt:ey(),MultiselectPrompt:Zu(),AutocompletePrompt:cy(),AutocompleteMultiselectPrompt:py(),ConfirmPrompt:wy()}});var Oy=d(Sy=>{"use strict";var Se=Sy,yA=Ey(),rn=r=>r;function ot(r,e,t={}){return new Promise((s,i)=>{let n=new yA[r](e),o=t.onAbort||rn,a=t.onSubmit||rn,u=t.onExit||rn;n.on("state",e.onState||rn),n.on("submit",l=>s(a(l))),n.on("exit",l=>s(u(l))),n.on("abort",l=>i(o(l)))})}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 _A=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Se.autocomplete=r=>(r.suggest=r.suggest||_A,r.choices=[].concat(r.choices||[]),ot("AutocompletePrompt",r))});var Ny=d((zj,Ry)=>{"use strict";function xy(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 Ty(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xy(Object(t),!0).forEach(function(s){vA(r,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xy(Object(t)).forEach(function(s){Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(t,s))})}return r}function vA(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function bA(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=wA(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(l){throw l},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 l=t.next();return n=l.done,l},e:function(l){o=!0,a=l},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function wA(r,e){if(r){if(typeof r=="string")return Py(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 Py(r,e)}}function Py(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 Iy(r,e,t,s,i,n,o){try{var a=r[n](o),u=a.value}catch(l){t(l);return}a.done?e(u):Promise.resolve(u).then(s,i)}function Ay(r){return function(){var e=this,t=arguments;return new Promise(function(s,i){var n=r.apply(e,t);function o(u){Iy(n,s,i,o,a,"next",u)}function a(u){Iy(n,s,i,o,a,"throw",u)}o(void 0)})}}var nl=Oy(),$A=["suggest","format","onState","validate","onRender","type"],Cy=()=>{};function jt(){return ol.apply(this,arguments)}function ol(){return ol=Ay(function*(r=[],{onSubmit:e=Cy,onCancel:t=Cy}={}){let s={},i=jt._override||{};r=[].concat(r);let n,o,a,u,l,c,h=(function(){var y=Ay(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=bA(r),p;try{for(f.s();!(p=f.n()).done;){o=p.value;var m=o;if(u=m.name,l=m.type,typeof l=="function"&&(l=yield l(n,Ty({},s),o),o.type=l),!!l){for(let y in o){if($A.includes(y))continue;let _=o[y];o[y]=typeof _=="function"?yield _(n,Ty({},s),c):_}if(c=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(u=g.name,l=g.type,nl[l]===void 0)throw new Error(`prompt type (${l}) 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=jt._injected?EA(jt._injected,o.initial):yield nl[l](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}),ol.apply(this,arguments)}function EA(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function SA(r){jt._injected=(jt._injected||[]).concat(r)}function OA(r){jt._override=Object.assign({},r)}Ry.exports=Object.assign(jt,{prompt:jt,prompts:nl,inject:SA,override:OA})});var ky=d((Bj,qy)=>{"use strict";qy.exports=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}}});var sn=d((Kj,jy)=>{"use strict";jy.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 Ly=d((Wj,My)=>{"use strict";var xA=sn(),{erase:Dy,cursor:TA}=te(),PA=r=>[...xA(r)].length;My.exports=function(r,e){if(!e)return Dy.line+TA.to(0);let t=0,s=r.split(/\r?\n/);for(let i of s)t+=1+Math.floor(Math.max(PA(i)-1,0)/e);return Dy.lines(t)}});var al=d((Yj,Vy)=>{"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"},IA={arrowUp:js.arrowUp,arrowDown:js.arrowDown,arrowLeft:js.arrowLeft,arrowRight:js.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},AA=process.platform==="win32"?IA:js;Vy.exports=AA});var Uy=d((Xj,Fy)=>{"use strict";var Ar=ee(),tr=al(),ul=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}`}}),CA=r=>ul[r]||ul.default,Ds=Object.freeze({aborted:Ar.red(tr.cross),done:Ar.green(tr.tick),exited:Ar.yellow(tr.cross),default:Ar.cyan("?")}),RA=(r,e,t)=>e?Ds.aborted:t?Ds.exited:r?Ds.done:Ds.default,NA=r=>Ar.gray(r?tr.ellipsis:tr.pointerSmall),qA=(r,e)=>Ar.gray(r?e?tr.pointerSmall:"+":tr.line);Fy.exports={styles:ul,render:CA,symbols:Ds,symbol:RA,delimiter:NA,item:qA}});var Gy=d((Jj,Hy)=>{"use strict";var kA=sn();Hy.exports=function(r,e){let t=String(kA(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,i)=>s+i):t.length}});var By=d((Zj,zy)=>{"use strict";zy.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 Wy=d((Zj,Ky)=>{"use strict";Ky.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((Qj,Yy)=>{"use strict";Yy.exports={action:ky(),clear:Ly(),style:Uy(),strip:sn(),figures:ac(),lines:Gy(),wrap:By(),entriesToDisplay:Wy()}});var _t=d((eD,Jy)=>{"use strict";var Xy=require("readline"),{action:kA}=Be(),jA=require("events"),{beep:DA,cursor:MA}=te(),LA=ee(),cc=class extends jA{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=Xy.createInterface({input:this.in,escapeCodeTimeout:50});Xy.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=kA(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(MA.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(DA)}render(){this.onRender(LA),this.firstRender&&(this.firstRender=!1)}};Jy.exports=cc});var Qy=d((tD,Zy)=>{var nn=ee(),VA=_t(),{erase:FA,cursor:Ds}=te(),{style:lc,clear:hc,lines:UA,figures:HA}=Be(),dc=class extends VA{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=nn.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
60
+ `)}});var Wy=d((Qj,Ky)=>{"use strict";Ky.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((eD,Yy)=>{"use strict";Yy.exports={action:ky(),clear:Ly(),style:Uy(),strip:sn(),figures:al(),lines:Gy(),wrap:By(),entriesToDisplay:Wy()}});var _t=d((tD,Jy)=>{"use strict";var Xy=require("readline"),{action:jA}=Be(),DA=require("events"),{beep:MA,cursor:LA}=te(),VA=ee(),ll=class extends DA{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=Xy.createInterface({input:this.in,escapeCodeTimeout:50});Xy.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=jA(o,s);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(LA.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(MA)}render(){this.onRender(VA),this.firstRender&&(this.firstRender=!1)}};Jy.exports=ll});var Qy=d((rD,Zy)=>{var nn=ee(),FA=_t(),{erase:UA,cursor:Ms}=te(),{style:cl,clear:hl,lines:HA,figures:GA}=Be(),dl=class extends FA{constructor(e={}){super(e),this.transform=cl.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=hl("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=nn.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
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(Ds.down(UA(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),nn.bold(this.msg),lc.delimiter(this.done),this.red?nn.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(Ms.down(HA(this.outputError,this.out.columns)-1)+hl(this.outputError,this.out.columns)),this.out.write(hl(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[cl.symbol(this.done,this.aborted),nn.bold(this.msg),cl.delimiter(this.done),this.red?nn.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
63
63
  `).reduce((e,t,s)=>e+`
64
- ${s?" ":HA.pointerSmall} ${nn.red().italic(t)}`,"")),this.out.write(FA.line+Ds.to(0)+this.outputText+Ds.save+this.outputError+Ds.restore+Ds.move(this.cursorOffset,0)))}};Zy.exports=dc});var s0=d((rD,r0)=>{"use strict";var vt=ee(),GA=_t(),{style:e0,clear:t0,figures:on,wrap:zA,entriesToDisplay:BA}=Be(),{cursor:KA}=te(),fc=class extends GA{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=t0("",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?" ":GA.pointerSmall} ${nn.red().italic(t)}`,"")),this.out.write(UA.line+Ms.to(0)+this.outputText+Ms.save+this.outputError+Ms.restore+Ms.move(this.cursorOffset,0)))}};Zy.exports=dl});var s0=d((sD,r0)=>{"use strict";var vt=ee(),zA=_t(),{style:e0,clear:t0,figures:on,wrap:BA,entriesToDisplay:KA}=Be(),{cursor:WA}=te(),fl=class extends zA{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=t0("",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(KA.hide):this.out.write(t0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=BA(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[e0.symbol(this.done,this.aborted),vt.bold(this.msg),e0.delimiter(!1),this.done?this.selection.title:this.selection.disabled?vt.yellow(this.warn):vt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(WA.hide):this.out.write(t0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=KA(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[e0.symbol(this.done,this.aborted),vt.bold(this.msg),e0.delimiter(!1),this.done?this.selection.title:this.selection.disabled?vt.yellow(this.warn):vt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
67
67
  `;for(let s=e;s<t;s++){let i,n,o="",a=this.choices[s];s===e&&e>0?n=on.arrowUp:s===t-1&&t<this.choices.length?n=on.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(on.pointer)+" ":" ")+n):(i=this.cursor===s?vt.cyan().underline(a.title):a.title,n=(this.cursor===s?vt.cyan(on.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
- `+zA(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${i}${vt.gray(o)}
69
- `}}this.out.write(this.outputText)}};r0.exports=fc});var a0=d((sD,o0)=>{var an=ee(),WA=_t(),{style:i0,clear:YA}=Be(),{cursor:n0,erase:XA}=te(),pc=class extends WA{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(`
68
+ `+BA(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${i}${vt.gray(o)}
69
+ `}}this.out.write(this.outputText)}};r0.exports=fl});var a0=d((iD,o0)=>{var an=ee(),YA=_t(),{style:i0,clear:XA}=Be(),{cursor:n0,erase:JA}=te(),pl=class extends YA{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(n0.hide):this.out.write(YA(this.outputText,this.out.columns)),super.render(),this.outputText=[i0.symbol(this.done,this.aborted),an.bold(this.msg),i0.delimiter(this.done),this.value?this.inactive:an.cyan().underline(this.inactive),an.gray("/"),this.value?an.cyan().underline(this.active):this.active].join(" "),this.out.write(XA.line+n0.to(0)+this.outputText))}};o0.exports=pc});var at=d((iD,u0)=>{"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)}};u0.exports=mc});var l0=d((nD,c0)=>{"use strict";var JA=at(),gc=class extends JA{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}};c0.exports=gc});var d0=d((oD,h0)=>{"use strict";var ZA=at(),QA=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),yc=class extends ZA{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+QA(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};h0.exports=yc});var p0=d((aD,f0)=>{"use strict";var eC=at(),_c=class extends eC{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}};f0.exports=_c});var g0=d((uD,m0)=>{"use strict";var tC=at(),vc=class extends tC{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)}};m0.exports=vc});var _0=d((cD,y0)=>{"use strict";var rC=at(),bc=class extends rC{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}};y0.exports=bc});var b0=d((lD,v0)=>{"use strict";var sC=at(),wc=class extends sC{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)}};v0.exports=wc});var $0=d((hD,w0)=>{"use strict";var iC=at(),$c=class extends iC{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}};w0.exports=$c});var S0=d((dD,E0)=>{"use strict";var nC=at(),Ec=class extends nC{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}};E0.exports=Ec});var x0=d((fD,O0)=>{"use strict";O0.exports={DatePart:at(),Meridiem:l0(),Day:d0(),Hours:p0(),Milliseconds:g0(),Minutes:_0(),Month:b0(),Seconds:$0(),Year:S0()}});var N0=d((pD,R0)=>{"use strict";var Sc=ee(),oC=_t(),{style:T0,clear:P0,figures:aC}=Be(),{erase:uC,cursor:I0}=te(),{DatePart:A0,Meridiem:cC,Day:lC,Hours:hC,Milliseconds:dC,Minutes:fC,Month:pC,Seconds:mC,Year:gC}=x0(),yC=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,C0={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new lC(r),3:r=>new pC(r),4:r=>new gC(r),5:r=>new cC(r),6:r=>new hC(r),7:r=>new fC(r),8:r=>new mC(r),9:r=>new dC(r)},_C={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 oC{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(_C,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=P0("",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=yC.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in C0?C0[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 A0)),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(n0.hide):this.out.write(XA(this.outputText,this.out.columns)),super.render(),this.outputText=[i0.symbol(this.done,this.aborted),an.bold(this.msg),i0.delimiter(this.done),this.value?this.inactive:an.cyan().underline(this.inactive),an.gray("/"),this.value?an.cyan().underline(this.active):this.active].join(" "),this.out.write(JA.line+n0.to(0)+this.outputText))}};o0.exports=pl});var at=d((nD,u0)=>{"use strict";var ml=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)}};u0.exports=ml});var c0=d((oD,l0)=>{"use strict";var ZA=at(),gl=class extends ZA{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};l0.exports=gl});var d0=d((aD,h0)=>{"use strict";var QA=at(),eC=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th"),yl=class extends QA{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+eC(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};h0.exports=yl});var p0=d((uD,f0)=>{"use strict";var tC=at(),_l=class extends tC{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}};f0.exports=_l});var g0=d((lD,m0)=>{"use strict";var rC=at(),vl=class extends rC{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)}};m0.exports=vl});var _0=d((cD,y0)=>{"use strict";var sC=at(),bl=class extends sC{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}};y0.exports=bl});var b0=d((hD,v0)=>{"use strict";var iC=at(),wl=class extends iC{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)}};v0.exports=wl});var $0=d((dD,w0)=>{"use strict";var nC=at(),$l=class extends nC{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}};w0.exports=$l});var S0=d((fD,E0)=>{"use strict";var oC=at(),El=class extends oC{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}};E0.exports=El});var x0=d((pD,O0)=>{"use strict";O0.exports={DatePart:at(),Meridiem:c0(),Day:d0(),Hours:p0(),Milliseconds:g0(),Minutes:_0(),Month:b0(),Seconds:$0(),Year:S0()}});var N0=d((mD,R0)=>{"use strict";var Sl=ee(),aC=_t(),{style:T0,clear:P0,figures:uC}=Be(),{erase:lC,cursor:I0}=te(),{DatePart:A0,Meridiem:cC,Day:hC,Hours:dC,Milliseconds:fC,Minutes:pC,Month:mC,Seconds:gC,Year:yC}=x0(),_C=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,C0={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new hC(r),3:r=>new mC(r),4:r=>new yC(r),5:r=>new cC(r),6:r=>new dC(r),7:r=>new pC(r),8:r=>new gC(r),9:r=>new fC(r)},vC={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(",")},Ol=class extends aC{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(vC,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=P0("",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=_C.exec(e);){let i=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in C0?C0[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 A0)),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 A0)),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(I0.hide):this.out.write(P0(this.outputText,this.out.columns)),super.render(),this.outputText=[T0.symbol(this.done,this.aborted),Sc.bold(this.msg),T0.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 A0)),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(I0.hide):this.out.write(P0(this.outputText,this.out.columns)),super.render(),this.outputText=[T0.symbol(this.done,this.aborted),Sl.bold(this.msg),T0.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Sl.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
74
74
  `).reduce((e,t,s)=>e+`
75
- ${s?" ":aC.pointerSmall} ${Sc.red().italic(t)}`,"")),this.out.write(uC.line+I0.to(0)+this.outputText))}};R0.exports=Oc});var D0=d((mD,j0)=>{var un=ee(),vC=_t(),{cursor:cn,erase:bC}=te(),{style:xc,figures:wC,clear:q0,lines:$C}=Be(),EC=/[0-9]/,Tc=r=>r!==void 0,k0=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Pc=class extends vC{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=un.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${k0(e,this.round)}`),this._value=k0(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||EC.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?" ":uC.pointerSmall} ${Sl.red().italic(t)}`,"")),this.out.write(lC.line+I0.to(0)+this.outputText))}};R0.exports=Ol});var D0=d((gD,j0)=>{var un=ee(),bC=_t(),{cursor:ln,erase:wC}=te(),{style:xl,figures:$C,clear:q0,lines:EC}=Be(),SC=/[0-9]/,Tl=r=>r!==void 0,k0=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t},Pl=class extends bC{constructor(e={}){super(e),this.transform=xl.render(e.style),this.msg=e.message,this.initial=Tl(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Tl(e.min)?e.min:-1/0,this.max=Tl(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=un.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${k0(e,this.round)}`),this._value=k0(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||SC.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
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(cn.down($C(this.outputError,this.out.columns)-1)+q0(this.outputError,this.out.columns)),this.out.write(q0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xc.symbol(this.done,this.aborted),un.bold(this.msg),xc.delimiter(this.done),!this.done||!this.done&&!this.placeholder?un[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(ln.down(EC(this.outputError,this.out.columns)-1)+q0(this.outputError,this.out.columns)),this.out.write(q0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xl.symbol(this.done,this.aborted),un.bold(this.msg),xl.delimiter(this.done),!this.done||!this.done&&!this.placeholder?un[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
78
78
  `).reduce((e,t,s)=>e+`
79
- ${s?" ":wC.pointerSmall} ${un.red().italic(t)}`,"")),this.out.write(bC.line+cn.to(0)+this.outputText+cn.save+this.outputError+cn.restore))}};j0.exports=Pc});var Ac=d((gD,V0)=>{"use strict";var ut=ee(),{cursor:SC}=te(),OC=_t(),{clear:M0,figures:Dt,style:L0,wrap:xC,entriesToDisplay:TC}=Be(),Ic=class extends OC{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=M0("",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?" ":$C.pointerSmall} ${un.red().italic(t)}`,"")),this.out.write(wC.line+ln.to(0)+this.outputText+ln.save+this.outputError+ln.restore))}};j0.exports=Pl});var Al=d((yD,V0)=>{"use strict";var ut=ee(),{cursor:OC}=te(),xC=_t(),{clear:M0,figures:Dt,style:L0,wrap:TC,entriesToDisplay:PC}=Be(),Il=class extends xC{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=M0("",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:
@@ -84,54 +84,54 @@ Instructions:
84
84
  ${Dt.arrowLeft}/${Dt.arrowRight}/[space]: Toggle selection
85
85
  `+(this.maxChoices===void 0?` a: Toggle all
86
86
  `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,i){let n=(t.selected?ut.green(Dt.radioOn):Dt.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
- `+xC(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}=TC(this.cursor,e.length,this.optionsPerPage),i,n=[];for(let o=t;o<s;o++)o===t&&t>0?i=Dt.arrowUp:o===s-1&&s<e.length?i=Dt.arrowDown:i=" ",n.push(this.renderOption(this.cursor,e[o],o,i));return`
87
+ `+TC(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}=PC(this.cursor,e.length,this.optionsPerPage),i,n=[];for(let o=t;o<s;o++)o===t&&t>0?i=Dt.arrowUp:o===s-1&&s<e.length?i=Dt.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=[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(SC.hide),super.render();let e=[L0.symbol(this.done,this.aborted),ut.bold(this.msg),L0.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=M0(e,this.out.columns)}};V0.exports=Ic});var z0=d((yD,G0)=>{"use strict";var Ms=ee(),PC=_t(),{erase:IC,cursor:F0}=te(),{style:Cc,clear:U0,figures:Rc,wrap:AC,entriesToDisplay:CC}=Be(),H0=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),RC=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),NC=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Nc=class extends PC{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:NC(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=U0("",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=H0(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:RC(a,o),value:H0(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(OC.hide),super.render();let e=[L0.symbol(this.done,this.aborted),ut.bold(this.msg),L0.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=M0(e,this.out.columns)}};V0.exports=Il});var z0=d((_D,G0)=>{"use strict";var Ls=ee(),IC=_t(),{erase:AC,cursor:F0}=te(),{style:Cl,clear:U0,figures:Rl,wrap:CC,entriesToDisplay:RC}=Be(),H0=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),NC=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),qC=(r,e)=>{let t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Nl=class extends IC{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:qC(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=Cl.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=U0("",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=H0(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:NC(a,o),value:H0(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?Ms.cyan().underline(e.title):e.title;return o=(t?Ms.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
- `+AC(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ms.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(F0.hide):this.out.write(U0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=CC(this.select,this.choices.length,this.limit);if(this.outputText=[Cc.symbol(this.done,this.aborted,this.exited),Ms.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?Rl.arrowUp:i?Rl.arrowDown:" ",a=t?Ls.cyan().underline(e.title):e.title;return o=(t?Ls.cyan(Rl.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
+ `+CC(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ls.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(F0.hide):this.out.write(U0(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=RC(this.select,this.choices.length,this.limit);if(this.outputText=[Cl.symbol(this.done,this.aborted,this.exited),Ls.bold(this.msg),Cl.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||Ms.gray(this.fallback.title))}this.out.write(IC.line+F0.to(0)+this.outputText)}};G0.exports=Nc});var Y0=d((_D,W0)=>{"use strict";var bt=ee(),{cursor:qC}=te(),kC=Ac(),{clear:B0,style:K0,figures:Ar}=Be(),qc=class extends kC{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=B0("",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||Ls.gray(this.fallback.title))}this.out.write(AC.line+F0.to(0)+this.outputText)}};G0.exports=Nl});var Y0=d((vD,W0)=>{"use strict";var bt=ee(),{cursor:kC}=te(),jC=Al(),{clear:B0,style:K0,figures:Cr}=Be(),ql=class extends jC{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=B0("",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
- ${Ar.arrowUp}/${Ar.arrowDown}: Highlight option
98
- ${Ar.arrowLeft}/${Ar.arrowRight}/[space]: Toggle selection
97
+ ${Cr.arrowUp}/${Cr.arrowDown}: Highlight option
98
+ ${Cr.arrowLeft}/${Cr.arrowRight}/[space]: Toggle selection
99
99
  [a,b,c]/delete: Filter choices
100
100
  enter/return: Complete answer
101
101
  `:""}renderCurrentInput(){return`
102
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(Ar.radioOn):Ar.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(qC.hide),super.render();let e=[K0.symbol(this.done,this.aborted),bt.bold(this.msg),K0.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=B0(e,this.out.columns)}};W0.exports=qc});var e_=d((vD,Q0)=>{var X0=ee(),jC=_t(),{style:J0,clear:DC}=Be(),{erase:MC,cursor:Z0}=te(),kc=class extends jC{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(`
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(Cr.radioOn):Cr.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(kC.hide),super.render();let e=[K0.symbol(this.done,this.aborted),bt.bold(this.msg),K0.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=B0(e,this.out.columns)}};W0.exports=ql});var e_=d((bD,Q0)=>{var X0=ee(),DC=_t(),{style:J0,clear:MC}=Be(),{erase:LC,cursor:Z0}=te(),kl=class extends DC{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(Z0.hide):this.out.write(DC(this.outputText,this.out.columns)),super.render(),this.outputText=[J0.symbol(this.done,this.aborted),X0.bold(this.msg),J0.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:X0.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(MC.line+Z0.to(0)+this.outputText))}};Q0.exports=kc});var r_=d((bD,t_)=>{"use strict";t_.exports={TextPrompt:Qy(),SelectPrompt:s0(),TogglePrompt:a0(),DatePrompt:N0(),NumberPrompt:D0(),MultiselectPrompt:Ac(),AutocompletePrompt:z0(),AutocompleteMultiselectPrompt:Y0(),ConfirmPrompt:e_()}});var i_=d(s_=>{"use strict";var Oe=s_,LC=r_(),ln=r=>r;function ct(r,e,t={}){return new Promise((s,i)=>{let n=new LC[r](e),o=t.onAbort||ln,a=t.onSubmit||ln,u=t.onExit||ln;n.on("state",e.onState||ln),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 VC=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Oe.autocomplete=r=>(r.suggest=r.suggest||VC,r.choices=[].concat(r.choices||[]),ct("AutocompletePrompt",r))});var a_=d(($D,o_)=>{"use strict";var jc=i_(),FC=["suggest","format","onState","validate","onRender","type"],n_=()=>{};async function Mt(r=[],{onSubmit:e=n_,onCancel:t=n_}={}){let s={},i=Mt._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(FC.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=Mt._injected?UC(Mt._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 UC(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function HC(r){Mt._injected=(Mt._injected||[]).concat(r)}function GC(r){Mt._override=Object.assign({},r)}o_.exports=Object.assign(Mt,{prompt:Mt,prompts:jc,inject:HC,override:GC})});var c_=d((ED,u_)=>{function zC(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}u_.exports=zC("8.6.0")?Ny():a_()});var Fs=d(Uc=>{var pn=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 pn{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Uc.CommanderError=pn;Uc.InvalidArgumentError=Fc});var mn=d(Gc=>{var{InvalidArgumentError:oR}=Fs(),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 oR(`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 aR(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Gc.Argument=Hc;Gc.humanReadableArgName=aR});var Kc=d(Bc=>{var{humanReadableArgName:uR}=mn(),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=>uR(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 w_(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(Z0.hide):this.out.write(MC(this.outputText,this.out.columns)),super.render(),this.outputText=[J0.symbol(this.done,this.aborted),X0.bold(this.msg),J0.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:X0.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(LC.line+Z0.to(0)+this.outputText))}};Q0.exports=kl});var r_=d((wD,t_)=>{"use strict";t_.exports={TextPrompt:Qy(),SelectPrompt:s0(),TogglePrompt:a0(),DatePrompt:N0(),NumberPrompt:D0(),MultiselectPrompt:Al(),AutocompletePrompt:z0(),AutocompleteMultiselectPrompt:Y0(),ConfirmPrompt:e_()}});var i_=d(s_=>{"use strict";var Oe=s_,VC=r_(),cn=r=>r;function lt(r,e,t={}){return new Promise((s,i)=>{let n=new VC[r](e),o=t.onAbort||cn,a=t.onSubmit||cn,u=t.onExit||cn;n.on("state",e.onState||cn),n.on("submit",l=>s(a(l))),n.on("exit",l=>s(u(l))),n.on("abort",l=>i(o(l)))})}Oe.text=r=>lt("TextPrompt",r);Oe.password=r=>(r.style="password",Oe.text(r));Oe.invisible=r=>(r.style="invisible",Oe.text(r));Oe.number=r=>lt("NumberPrompt",r);Oe.date=r=>lt("DatePrompt",r);Oe.confirm=r=>lt("ConfirmPrompt",r);Oe.list=r=>{let e=r.separator||",";return lt("TextPrompt",r,{onSubmit:t=>t.split(e).map(s=>s.trim())})};Oe.toggle=r=>lt("TogglePrompt",r);Oe.select=r=>lt("SelectPrompt",r);Oe.multiselect=r=>{r.choices=[].concat(r.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return lt("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 lt("AutocompleteMultiselectPrompt",r,{onAbort:e,onSubmit:e})};var FC=(r,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));Oe.autocomplete=r=>(r.suggest=r.suggest||FC,r.choices=[].concat(r.choices||[]),lt("AutocompletePrompt",r))});var a_=d((ED,o_)=>{"use strict";var jl=i_(),UC=["suggest","format","onState","validate","onRender","type"],n_=()=>{};async function Mt(r=[],{onSubmit:e=n_,onCancel:t=n_}={}){let s={},i=Mt._override||{};r=[].concat(r);let n,o,a,u,l,c,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:l}=o,typeof l=="function"&&(l=await l(n,{...s},o),o.type=l),!!l){for(let f in o){if(UC.includes(f))continue;let p=o[f];o[f]=typeof p=="function"?await p(n,{...s},c):p}if(c=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:u,type:l}=o,jl[l]===void 0)throw new Error(`prompt type (${l}) 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=Mt._injected?HC(Mt._injected,o.initial):await jl[l](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 HC(r,e){let t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function GC(r){Mt._injected=(Mt._injected||[]).concat(r)}function zC(r){Mt._override=Object.assign({},r)}o_.exports=Object.assign(Mt,{prompt:Mt,prompts:jl,inject:GC,override:zC})});var l_=d((SD,u_)=>{function BC(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}u_.exports=BC("8.6.0")?Ny():a_()});var Us=d(Ul=>{var pn=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}},Fl=class extends pn{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ul.CommanderError=pn;Ul.InvalidArgumentError=Fl});var mn=d(Gl=>{var{InvalidArgumentError:aR}=Us(),Hl=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 aR(`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 uR(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Gl.Argument=Hl;Gl.humanReadableArgName=uR});var Kl=d(Bl=>{var{humanReadableArgName:lR}=mn(),zl=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=>lR(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 w_(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,c=(this.helpWidth??80)-t-u-2,h;return c<this.minWidthToWrap||i.preformatted(s)?h=s:h=i.boxWrap(s,c).replace(/\n/g,`
107
107
  `+" ".repeat(t+u)),o+a+" ".repeat(u)+h.replace(/\n/g,`
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 w_(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}Bc.Help=zc;Bc.stripColor=w_});var Jc=d(Xc=>{var{InvalidArgumentError:cR}=Fs(),Wc=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=lR(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 cR(`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?$_(this.name().replace(/^no-/,"")):$_(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 $_(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function lR(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}
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()],l=this.displayWidth(u[0]);a.forEach(c=>{let h=this.displayWidth(c);if(l+h<=t){u.push(c),l+=h;return}n.push(u.join(""));let f=c.trimStart();u=[f],l=this.displayWidth(f)}),n.push(u.join(""))}),n.join(`
109
+ `)}};function w_(r){let e=/\x1b\[\d*(;\d*)*m/g;return r.replace(e,"")}Bl.Help=zl;Bl.stripColor=w_});var Jl=d(Xl=>{var{InvalidArgumentError:cR}=Us(),Wl=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 cR(`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?$_(this.name().replace(/^no-/,"")):$_(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}},Yl=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 $_(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=Wc;Xc.DualOptions=Yc});var S_=d(E_=>{function hR(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 dR(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=hR(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}}Xl.Option=Wl;Xl.DualOptions=Yl});var S_=d(E_=>{function dR(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 fR(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=dR(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]}?)`:""}E_.suggestSimilar=dR});var P_=d(rl=>{var fR=require("node:events").EventEmitter,Zc=require("node:child_process"),wt=require("node:path"),gn=require("node:fs"),M=require("node:process"),{Argument:pR,humanReadableArgName:mR}=mn(),{CommanderError:Qc}=Fs(),{Help:gR,stripColor:yR}=Kc(),{Option:O_,DualOptions:_R}=Jc(),{suggestSimilar:x_}=S_(),el=class r extends fR{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=>yR(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 gR,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 pR(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 O_(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 O_)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.
117
+ (Did you mean ${s[0]}?)`:""}E_.suggestSimilar=fR});var P_=d(rc=>{var pR=require("node:events").EventEmitter,Zl=require("node:child_process"),wt=require("node:path"),gn=require("node:fs"),M=require("node:process"),{Argument:mR,humanReadableArgName:gR}=mn(),{CommanderError:Ql}=Us(),{Help:yR,stripColor:_R}=Kl(),{Option:O_,DualOptions:vR}=Jl(),{suggestSimilar:x_}=S_(),ec=class r extends pR{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:()=>tc()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>tc()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:t=>_R(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 mR(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 Ql(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 O_(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 O_)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,l)=>{let c=a.exec(u);return c?c[0]:l},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
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(gn.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=wt.resolve(l,h);if(gn.existsSync(f))return f;if(i.includes(wt.extname(h)))return;let p=i.find(m=>gn.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=gn.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=T_(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=T_(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(c,h){let f=wt.resolve(c,h);if(gn.existsSync(f))return f;if(i.includes(wt.extname(h)))return;let p=i.find(m=>gn.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 c;try{c=gn.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=wt.resolve(wt.dirname(c),a)}if(a){let c=n(a,o);if(!c&&!e._executableFile&&this._scriptPath){let h=wt.basename(this._scriptPath,wt.extname(this._scriptPath));h!==this._name&&(c=n(a,`${h}-${e._name}`))}o=c||o}s=i.includes(wt.extname(o));let u;M.platform!=="win32"?s?(t.unshift(o),t=T_(M.execArgv).concat(t),u=Zl.spawn(M.argv[0],t,{stdio:"inherit"})):u=Zl.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=T_(M.execArgv).concat(t),u=Zl.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 l=this._exitCallback;u.on("close",c=>{c=c??1,l?l(new Ql(c,"commander.executeSubCommandAsync","(close)")):M.exit(c)}),u.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)M.exit(1);else{let h=new Ql(1,"commander.executeSubCommandAsync","(error)");h.nestedError=c,l(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(c){return c.length>1&&c[0]==="-"}let o=c=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c)?!this._getCommandAndAncestors().some(h=>h.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,u=null,l=0;for(;l<e.length||u;){let c=u??e[l++];if(u=null,c==="--"){i===s&&i.push(c),i.push(...e.slice(l));break}if(a&&(!n(c)||o(c))){this.emit(`option:${a.name()}`,c);continue}if(a=null,n(c)){let h=this._findOption(c);if(h){if(h.required){let f=e[l++];f===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,f)}else if(h.optional){let f=null;l<e.length&&(!n(e[l])||o(e[l]))&&(f=e[l++]),this.emit(`option:${h.name()}`,f)}else this.emit(`option:${h.name()}`);a=h.variadic?h:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let h=this._findOption(`-${c[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,c.slice(2)):(this.emit(`option:${h.name()}`),u=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let h=c.indexOf("="),f=this._findOption(c.slice(0,h));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,c.slice(h+1));continue}}if(i===t&&n(c)&&!(this.commands.length===0&&o(c))&&(i=s),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&s.length===0){if(this._findCommand(c)){t.push(c),s.push(...e.slice(l));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){t.push(c,...e.slice(l));break}else if(this._defaultCommandName){s.push(c,...e.slice(l));break}}if(this._passThroughOptions){i.push(c,...e.slice(l));break}i.push(c)}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 _R(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=x_(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=x_(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=>mR(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.
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 vR(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),l=this.options.find(h=>h.negate&&a===h.attributeName()),c=this.options.find(h=>!h.negate&&a===h.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:c||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=x_(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=x_(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=>gR(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 T_(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 R_=d(je=>{var{Argument:I_}=mn(),{Command:sl}=P_(),{CommanderError:vR,InvalidArgumentError:A_}=Fs(),{Help:bR}=Kc(),{Option:C_}=Jc();je.program=new sl;je.createCommand=r=>new sl(r);je.createOption=(r,e)=>new C_(r,e);je.createArgument=(r,e)=>new I_(r,e);je.Command=sl;je.Option=C_;je.Argument=I_;je.Help=bR;je.CommanderError=vR;je.InvalidArgumentError=A_;je.InvalidOptionArgumentError=A_});var Am=require("node:util"),Ou=Y(require("node:process"),1),qt=Y(require("node:fs"),1),xu=Y(require("node:path"),1),xr=Y(require("node:crypto"),1),Cm=Y(require("node:assert"),1);var Lt=r=>{let e=typeof r;return r!==null&&(e==="object"||e==="function")};var Sn=new Set(["__proto__","prototype","constructor"]),gv=new Set("0123456789");function Ws(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(Sn.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(Sn.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"&&!gv.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(Sn.has(t))return[];e.push(t);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function On(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(On(r,e))throw new Error("Cannot use string index")}function hl(r,e,t){if(!Lt(r)||typeof e!="string")return t===void 0?r:t;let s=Ws(e);if(s.length===0)return t;for(let i=0;i<s.length;i++){let n=s[i];if(On(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 xn(r,e,t){if(!Lt(r)||typeof e!="string")return r;let s=r,i=Ws(e);for(let n=0;n<i.length;n++){let o=i[n];ll(r,o),n===i.length-1?r[o]=t:Lt(r[o])||(r[o]=typeof i[n+1]=="number"?[]:{}),r=r[o]}return s}function dl(r,e){if(!Lt(r)||typeof e!="string")return!1;let t=Ws(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],!Lt(r))return!1}}function fl(r,e){if(!Lt(r)||typeof e!="string")return!1;let t=Ws(e);if(t.length===0)return!1;for(let s of t){if(!Lt(r)||!(s in r)||On(r,s))return!1;r=r[s]}return!0}var X=Y(require("node:path"),1),Tn=Y(require("node:os"),1),Ys=Y(require("node:process"),1),Et=Tn.default.homedir(),Pn=Tn.default.tmpdir(),{env:sr}=Ys.default,yv=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(Pn,r)}},_v=r=>{let e=sr.APPDATA||X.default.join(Et,"AppData","Roaming"),t=sr.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(Pn,r)}},vv=r=>{let e=X.default.basename(Et);return{data:X.default.join(sr.XDG_DATA_HOME||X.default.join(Et,".local","share"),r),config:X.default.join(sr.XDG_CONFIG_HOME||X.default.join(Et,".config"),r),cache:X.default.join(sr.XDG_CACHE_HOME||X.default.join(Et,".cache"),r),log:X.default.join(sr.XDG_STATE_HOME||X.default.join(Et,".local","state"),r),temp:X.default.join(Pn,e,r)}};function In(r,{suffix:e="nodejs"}={}){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);return e&&(r+=`-${e}`),Ys.default.platform==="darwin"?yv(r):Ys.default.platform==="win32"?_v(r):vv(r)}var Pl=Y(require("node:path"),1);var k=Y(require("node:fs"),1),ne=require("node:util");var bv=(r,e)=>{let{onError:t}=e;return function(...i){return r.apply(void 0,i).catch(t)}},We=bv;var wv=(r,e)=>{let{onError:t}=e;return function(...i){try{return r.apply(void 0,i)}catch(n){return t(n)}}},Le=wv;var Ev=(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=Ev;var Sv=(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=Sv;var Cn=Y(require("node:process"),1);var Vr={isChangeErrorOk:r=>{if(!Vr.isNodeError(r))return!1;let{code:e}=r;return e==="ENOSYS"||!pl&&(e==="EINVAL"||e==="EPERM")},isNodeError:r=>r instanceof Error,isRetriableError:r=>{if(!Vr.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(!Vr.isNodeError(r))throw r;if(!Vr.isChangeErrorOk(r))throw r}},An=Vr;var Fr={onError:An.onChangeError},ve={onError:()=>{}},pl=Cn.default.getuid?!Cn.default.getuid():!1,ie={isRetriable:An.isRetriableError};var Ov={attempt:{chmod:We((0,ne.promisify)(k.default.chmod),Fr),chown:We((0,ne.promisify)(k.default.chown),Fr),close:We((0,ne.promisify)(k.default.close),ve),fsync:We((0,ne.promisify)(k.default.fsync),ve),mkdir:We((0,ne.promisify)(k.default.mkdir),ve),realpath:We((0,ne.promisify)(k.default.realpath),ve),stat:We((0,ne.promisify)(k.default.stat),ve),unlink:We((0,ne.promisify)(k.default.unlink),ve),chmodSync:Le(k.default.chmodSync,Fr),chownSync:Le(k.default.chownSync,Fr),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=Ov;var St=Y(require("node:process"),1),ml="utf8",Rn=438,gl=511;var yl={},_l=St.default.geteuid?St.default.geteuid():-1,vl=St.default.getegid?St.default.getegid():-1;var bl=1e3,wl=!!St.default.getuid,eN=St.default.getuid?!St.default.getuid():!1,Nn=128;var $l=r=>r instanceof Error&&"code"in r;var qn=r=>typeof r=="string",Xs=r=>r===void 0;var Tl=Y(require("node:path"),1);var Vt=Y(require("node:process"),1);var kn=Y(require("node:process"),1),El=kn.default.platform==="linux",Js=kn.default.platform==="win32";var jn=["SIGHUP","SIGINT","SIGTERM"];Js||jn.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");El&&jn.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Sl=jn;var Dn=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&&(Js&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Vt.default.kill(Vt.default.pid,"SIGTERM"):Vt.default.kill(Vt.default.pid,e))}},this.hook=()=>{Vt.default.once("exit",()=>this.exit());for(let e of Sl)try{Vt.default.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Ol=new Dn;var xv=Ol.register,xl=xv;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<=Nn)return r;let t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!t)return r;let s=e.length-Nn;return`${r.slice(0,-e.length)}${t[1]}${t[2].slice(0,-s)}${t[3]}`}};xl(Te.purgeSyncAll);var Ur=Te;function Mn(r,e,t=yl){if(qn(t))return Mn(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]=Ur.get(r,t.tmpCreate||Ur.create,t.tmpPurge!==!1);let l=wl&&Xs(t.chown),h=Xs(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||Rn),t.tmpCreated&&t.tmpCreated(o),qn(e)?se.retry.writeSync(i)(a,e,0,t.encoding||ml):Xs(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!==Rn&&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,Ur.truncate(r))}n(),o=null}finally{a&&se.attempt.closeSync(a),o&&Ur.purge(o)}}var Rm=Y(_f(),1),Nm=Y(jf(),1);var P1=(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);!I1(i,n)&&s||Object.defineProperty(r,t,n)},I1=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)},A1=(r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},C1=(r,e)=>`/* Wrapped ${r}*/
131
- ${e}`,R1=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),N1=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),q1=(r,e,t)=>{let s=t===""?"":`with ${t.trim()}() `,i=C1.bind(null,s,e.toString());Object.defineProperty(i,"name",N1);let{writable:n,enumerable:o,configurable:a}=R1;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))P1(r,e,i,t);return A1(r,e),q1(r,e,s),r}var k1=(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=k1;var Qt=Y(Om(),1);var CP=Object.prototype.toString,RP="[object Uint8Array]",NP="[object ArrayBuffer]";function Tm(r,e,t){return r?r.constructor===e?!0:CP.call(r)===t:!1}function Pm(r){return Tm(r,Uint8Array,RP)}function qP(r){return Tm(r,ArrayBuffer,NP)}function kP(r){return Pm(r)||qP(r)}function jP(r){if(!Pm(r))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}function DP(r){if(!kP(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)jP(i),t.set(i,s),s+=i.length;return t}var xm={utf8:new globalThis.TextDecoder("utf8")};function Eu(r,e="utf8"){return DP(r),xm[e]??=new globalThis.TextDecoder(e),xm[e].decode(r)}function MP(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}var LP=new globalThis.TextEncoder;function Bi(r){return MP(r),LP.encode(r)}var sj=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var VP=Nm.default.default,Im="aes-256-cbc",Or=()=>Object.create(null),FP=r=>r!=null,UP=(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`)},Ki="__internal__",Su=`${Ki}.migrations.version`,Ts=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=In(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 Rm.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});VP(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(Or(),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{Cm.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 ${Ki} key, as it's used to manage this module internal operations.`);let{store:s}=this,i=(n,o)=>{UP(n,o),this.#e.accessPropertiesByDotNotation?xn(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)FP(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=Or();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=qt.default.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),s=this._deserialize(t);return this._validate(s),Object.assign(Or(),s)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Or();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Or();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=xr.default.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),i=xr.default.createDecipheriv(Im,s,t),n=e.slice(17),o=typeof n=="string"?Bi(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,Am.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(){qt.default.mkdirSync(xu.default.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let s=xr.default.randomBytes(16),i=xr.default.pbkdf2Sync(this.#t,s.toString(),1e4,32,"sha512"),n=xr.default.createCipheriv(Im,i,s);t=$u([s,Bi(":"),n.update(Bi(t)),n.final()])}if(Ou.default.env.SNAP)qt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Mn(this.path,t,{mode:this.#e.configFileMode})}catch(s){if(s?.code==="EXDEV"){qt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw s}}_watch(){this._ensureDirectory(),qt.default.existsSync(this.path)||this._write(Or()),Ou.default.platform==="win32"?qt.default.watch(this.path,{persistent:!1},ru(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):qt.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)||!Qt.default.eq(i,t))&&this._set(Su,t)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Ki?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${Ki}.`):!1}_isVersionInRangeFormat(e){return Qt.default.clean(e)===null}_shouldPerformMigration(e,t,s){return this._isVersionInRangeFormat(e)?t!=="0.0.0"&&Qt.default.satisfies(t,e)?!1:Qt.default.satisfies(s,e):!(Qt.default.lte(e,t)||Qt.default.gt(e,s))}_get(e,t){return hl(this.store,e,t)}_set(e,t){let{store:s}=this;xn(s,e,t),this.store=s}};var En=Y(c_());var l_=(r=0)=>e=>`\x1B[${e+r}m`,h_=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,d_=(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]}},SD=Object.keys(J.modifier),BC=Object.keys(J.color),KC=Object.keys(J.bgColor),OD=[...BC,...KC];function WC(){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=l_(),J.color.ansi256=h_(),J.color.ansi16m=d_(),J.bgColor.ansi=l_(10),J.bgColor.ansi256=h_(10),J.bgColor.ansi16m=d_(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 YC=WC(),Ke=YC;var dn=Y(require("node:process"),1),p_=Y(require("node:os"),1),Dc=Y(require("node:tty"),1);function ke(r,e=globalThis.Deno?globalThis.Deno.args:dn.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}=dn.default,hn;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?hn=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(hn=1);function XC(){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 JC(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function ZC(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=XC();s!==void 0&&(hn=s);let i=t?hn: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(dn.default.platform==="win32"){let o=p_.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 f_(r,e={}){let t=ZC(r,{streamIsTTY:r&&r.isTTY,...e});return JC(t)}var QC={stdout:f_({isTTY:Dc.default.isatty(1)}),stderr:f_({isTTY:Dc.default.isatty(2)})},m_=QC;function g_(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 y_(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 T_(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 tc(){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}rc.Command=ec;rc.useColor=tc});var R_=d(je=>{var{Argument:I_}=mn(),{Command:sc}=P_(),{CommanderError:bR,InvalidArgumentError:A_}=Us(),{Help:wR}=Kl(),{Option:C_}=Jl();je.program=new sc;je.createCommand=r=>new sc(r);je.createOption=(r,e)=>new C_(r,e);je.createArgument=(r,e)=>new I_(r,e);je.Command=sc;je.Option=C_;je.Argument=I_;je.Help=wR;je.CommanderError=bR;je.InvalidArgumentError=A_;je.InvalidOptionArgumentError=A_});var Am=require("node:util"),Ou=Y(require("node:process"),1),qt=Y(require("node:fs"),1),xu=Y(require("node:path"),1),Tr=Y(require("node:crypto"),1),Cm=Y(require("node:assert"),1);var Lt=r=>{let e=typeof r;return r!==null&&(e==="object"||e==="function")};var Sn=new Set(["__proto__","prototype","constructor"]),gv=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(Sn.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(Sn.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"&&!gv.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(Sn.has(t))return[];e.push(t);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function On(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 cc(r,e){if(On(r,e))throw new Error("Cannot use string index")}function hc(r,e,t){if(!Lt(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(On(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 xn(r,e,t){if(!Lt(r)||typeof e!="string")return r;let s=r,i=Ys(e);for(let n=0;n<i.length;n++){let o=i[n];cc(r,o),n===i.length-1?r[o]=t:Lt(r[o])||(r[o]=typeof i[n+1]=="number"?[]:{}),r=r[o]}return s}function dc(r,e){if(!Lt(r)||typeof e!="string")return!1;let t=Ys(e);for(let s=0;s<t.length;s++){let i=t[s];if(cc(r,i),s===t.length-1)return delete r[i],!0;if(r=r[i],!Lt(r))return!1}}function fc(r,e){if(!Lt(r)||typeof e!="string")return!1;let t=Ys(e);if(t.length===0)return!1;for(let s of t){if(!Lt(r)||!(s in r)||On(r,s))return!1;r=r[s]}return!0}var X=Y(require("node:path"),1),Tn=Y(require("node:os"),1),Xs=Y(require("node:process"),1),Et=Tn.default.homedir(),Pn=Tn.default.tmpdir(),{env:sr}=Xs.default,yv=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(Pn,r)}},_v=r=>{let e=sr.APPDATA||X.default.join(Et,"AppData","Roaming"),t=sr.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(Pn,r)}},vv=r=>{let e=X.default.basename(Et);return{data:X.default.join(sr.XDG_DATA_HOME||X.default.join(Et,".local","share"),r),config:X.default.join(sr.XDG_CONFIG_HOME||X.default.join(Et,".config"),r),cache:X.default.join(sr.XDG_CACHE_HOME||X.default.join(Et,".cache"),r),log:X.default.join(sr.XDG_STATE_HOME||X.default.join(Et,".local","state"),r),temp:X.default.join(Pn,e,r)}};function In(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"?yv(r):Xs.default.platform==="win32"?_v(r):vv(r)}var Pc=Y(require("node:path"),1);var k=Y(require("node:fs"),1),ne=require("node:util");var bv=(r,e)=>{let{onError:t}=e;return function(...i){return r.apply(void 0,i).catch(t)}},We=bv;var wv=(r,e)=>{let{onError:t}=e;return function(...i){try{return r.apply(void 0,i)}catch(n){return t(n)}}},Le=wv;var Ev=(r,e)=>{let{isRetriable:t}=e;return function(i){let{timeout:n}=i,o=i.interval??250,a=Date.now()+n;return function u(...l){return r.apply(void 0,l).catch(c=>{if(!t(c)||Date.now()>=a)throw c;let h=Math.round(o*Math.random());return h>0?new Promise(p=>setTimeout(p,h)).then(()=>u.apply(void 0,l)):u.apply(void 0,l)})}}},Ye=Ev;var Sv=(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(l){if(!t(l)||Date.now()>=o)throw l;continue}}}},Xe=Sv;var Cn=Y(require("node:process"),1);var Fr={isChangeErrorOk:r=>{if(!Fr.isNodeError(r))return!1;let{code:e}=r;return e==="ENOSYS"||!pc&&(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}},An=Fr;var Ur={onError:An.onChangeError},ve={onError:()=>{}},pc=Cn.default.getuid?!Cn.default.getuid():!1,ie={isRetriable:An.isRetriableError};var Ov={attempt:{chmod:We((0,ne.promisify)(k.default.chmod),Ur),chown:We((0,ne.promisify)(k.default.chown),Ur),close:We((0,ne.promisify)(k.default.close),ve),fsync:We((0,ne.promisify)(k.default.fsync),ve),mkdir:We((0,ne.promisify)(k.default.mkdir),ve),realpath:We((0,ne.promisify)(k.default.realpath),ve),stat:We((0,ne.promisify)(k.default.stat),ve),unlink:We((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=Ov;var St=Y(require("node:process"),1),mc="utf8",Rn=438,gc=511;var yc={},_c=St.default.geteuid?St.default.geteuid():-1,vc=St.default.getegid?St.default.getegid():-1;var bc=1e3,wc=!!St.default.getuid,tN=St.default.getuid?!St.default.getuid():!1,Nn=128;var $c=r=>r instanceof Error&&"code"in r;var qn=r=>typeof r=="string",Js=r=>r===void 0;var Tc=Y(require("node:path"),1);var Vt=Y(require("node:process"),1);var kn=Y(require("node:process"),1),Ec=kn.default.platform==="linux",Zs=kn.default.platform==="win32";var jn=["SIGHUP","SIGINT","SIGTERM"];Zs||jn.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Ec&&jn.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Sc=jn;var Dn=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"?Vt.default.kill(Vt.default.pid,"SIGTERM"):Vt.default.kill(Vt.default.pid,e))}},this.hook=()=>{Vt.default.once("exit",()=>this.exit());for(let e of Sc)try{Vt.default.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}},Oc=new Dn;var xv=Oc.register,xc=xv;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=Tc.default.basename(r);if(e.length<=Nn)return r;let t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!t)return r;let s=e.length-Nn;return`${r.slice(0,-e.length)}${t[1]}${t[2].slice(0,-s)}${t[3]}`}};xc(Te.purgeSyncAll);var Hr=Te;function Mn(r,e,t=yc){if(qn(t))return Mn(r,e,{encoding:t});let i={timeout:t.timeout??bc},n=null,o=null,a=null;try{let u=se.attempt.realpathSync(r),l=!!u;r=u||r,[o,n]=Hr.get(r,t.tmpCreate||Hr.create,t.tmpPurge!==!1);let c=wc&&Js(t.chown),h=Js(t.mode);if(l&&(c||h)){let f=se.attempt.statSync(r);f&&(t={...t},c&&(t.chown={uid:f.uid,gid:f.gid}),h&&(t.mode=f.mode))}if(!l){let f=Pc.default.dirname(r);se.attempt.mkdirSync(f,{mode:gc,recursive:!0})}a=se.retry.openSync(i)(o,"w",t.mode||Rn),t.tmpCreated&&t.tmpCreated(o),qn(e)?se.retry.writeSync(i)(a,e,0,t.encoding||mc):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!==_c||t.chown.gid!==vc)&&se.attempt.chownSync(o,t.chown.uid,t.chown.gid),t.mode&&t.mode!==Rn&&se.attempt.chmodSync(o,t.mode);try{se.retry.renameSync(i)(o,r)}catch(f){if(!$c(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 Rm=Y(_f(),1),Nm=Y(jf(),1);var I1=(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);!A1(i,n)&&s||Object.defineProperty(r,t,n)},A1=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)},C1=(r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},R1=(r,e)=>`/* Wrapped ${r}*/
131
+ ${e}`,N1=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),q1=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),k1=(r,e,t)=>{let s=t===""?"":`with ${t.trim()}() `,i=R1.bind(null,s,e.toString());Object.defineProperty(i,"name",q1);let{writable:n,enumerable:o,configurable:a}=N1;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))I1(r,e,i,t);return C1(r,e),k1(r,e,s),r}var j1=(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,l=function(...c){let h=this,f=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),n&&(u=r.apply(h,c))},p=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),n&&(u=r.apply(h,c))},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,c)),u};return tu(l,r),l.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},l},ru=j1;var Qt=Y(Om(),1);var RP=Object.prototype.toString,NP="[object Uint8Array]",qP="[object ArrayBuffer]";function Tm(r,e,t){return r?r.constructor===e?!0:RP.call(r)===t:!1}function Pm(r){return Tm(r,Uint8Array,NP)}function kP(r){return Tm(r,ArrayBuffer,qP)}function jP(r){return Pm(r)||kP(r)}function DP(r){if(!Pm(r))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}function MP(r){if(!jP(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)DP(i),t.set(i,s),s+=i.length;return t}var xm={utf8:new globalThis.TextDecoder("utf8")};function Eu(r,e="utf8"){return MP(r),xm[e]??=new globalThis.TextDecoder(e),xm[e].decode(r)}function LP(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}var VP=new globalThis.TextEncoder;function Bi(r){return LP(r),VP.encode(r)}var ij=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var FP=Nm.default.default,Im="aes-256-cbc",xr=()=>Object.create(null),UP=r=>r!=null,HP=(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`)},Ki="__internal__",Su=`${Ki}.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=In(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 Rm.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});FP(o);let a={...t.rootSchema,type:"object",properties:t.schema};this.#s=o.compile(a);for(let[u,l]of Object.entries(t.schema??{}))l?.default&&(this.#r[u]=l.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{Cm.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 ${Ki} key, as it's used to manage this module internal operations.`);let{store:s}=this,i=(n,o)=>{HP(n,o),this.#e.accessPropertiesByDotNotation?xn(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?fc(this.store,e):e in this.store}reset(...e){for(let t of e)UP(this.#r[t])&&this.set(t,this.#r[t])}delete(e){let{store:t}=this;this.#e.accessPropertiesByDotNotation?dc(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=qt.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(Im,s,t),n=e.slice(17),o=typeof n=="string"?Bi(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,Am.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(){qt.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(Im,i,s);t=$u([s,Bi(":"),n.update(Bi(t)),n.final()])}if(Ou.default.env.SNAP)qt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Mn(this.path,t,{mode:this.#e.configFileMode})}catch(s){if(s?.code==="EXDEV"){qt.default.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw s}}_watch(){this._ensureDirectory(),qt.default.existsSync(this.path)||this._write(xr()),Ou.default.platform==="win32"?qt.default.watch(this.path,{persistent:!1},ru(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):qt.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)||!Qt.default.eq(i,t))&&this._set(Su,t)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Ki?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${Ki}.`):!1}_isVersionInRangeFormat(e){return Qt.default.clean(e)===null}_shouldPerformMigration(e,t,s){return this._isVersionInRangeFormat(e)?t!=="0.0.0"&&Qt.default.satisfies(t,e)?!1:Qt.default.satisfies(s,e):!(Qt.default.lte(e,t)||Qt.default.gt(e,s))}_get(e,t){return hc(this.store,e,t)}_set(e,t){let{store:s}=this;xn(s,e,t),this.store=s}};var En=Y(l_());var c_=(r=0)=>e=>`\x1B[${e+r}m`,h_=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,d_=(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]}},OD=Object.keys(J.modifier),KC=Object.keys(J.color),WC=Object.keys(J.bgColor),xD=[...KC,...WC];function YC(){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=c_(),J.color.ansi256=h_(),J.color.ansi16m=d_(),J.bgColor.ansi=c_(10),J.bgColor.ansi256=h_(10),J.bgColor.ansi16m=d_(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 XC=YC(),Ke=XC;var dn=Y(require("node:process"),1),p_=Y(require("node:os"),1),Dl=Y(require("node:tty"),1);function ke(r,e=globalThis.Deno?globalThis.Deno.args:dn.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}=dn.default,hn;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?hn=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(hn=1);function JC(){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 ZC(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function QC(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=JC();s!==void 0&&(hn=s);let i=t?hn: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(dn.default.platform==="win32"){let o=p_.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 f_(r,e={}){let t=QC(r,{streamIsTTY:r&&r.isTTY,...e});return ZC(t)}var eR={stdout:f_({isTTY:Dl.default.isatty(1)}),stderr:f_({isTTY:Dl.default.isatty(2)})},m_=eR;function g_(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 y_(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:__,stderr:v_}=m_,Mc=Symbol("GENERATOR"),Cr=Symbol("STYLER"),Ls=Symbol("IS_EMPTY"),b_=["ansi","ansi","ansi256","ansi16m"],Rr=Object.create(null),eR=(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=__?__.level:0;r.level=e.level===void 0?t:e.level};var tR=r=>{let e=(...t)=>t.join(" ");return eR(e,r),Object.setPrototypeOf(e,Vs.prototype),e};function Vs(r){return tR(r)}Object.setPrototypeOf(Vs.prototype,Function.prototype);for(let[r,e]of Object.entries(Ke))Rr[r]={get(){let t=fn(this,Vc(e.open,e.close,this[Cr]),this[Ls]);return Object.defineProperty(this,r,{value:t}),t}};Rr.visible={get(){let r=fn(this,this[Cr],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Lc=(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"?Lc("rgb",e,t,...Ke.hexToRgb(...s)):Ke[t][r](...s),rR=["rgb","hex","ansi256"];for(let r of rR){Rr[r]={get(){let{level:t}=this;return function(...s){let i=Vc(Lc(r,b_[t],"color",...s),Ke.color.close,this[Cr]);return fn(this,i,this[Ls])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Rr[e]={get(){let{level:t}=this;return function(...s){let i=Vc(Lc(r,b_[t],"bgColor",...s),Ke.bgColor.close,this[Cr]);return fn(this,i,this[Ls])}}}}var sR=Object.defineProperties(()=>{},{...Rr,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}},fn=(r,e,t)=>{let s=(...i)=>iR(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,sR),s[Mc]=r,s[Cr]=e,s[Ls]=t,s},iR=(r,e)=>{if(r.level<=0||!e)return r[Ls]?"":e;let t=r[Cr];if(t===void 0)return e;let{openAll:s,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=g_(e,t.close,t.open),t=t.parent;let n=e.indexOf(`
135
- `);return n!==-1&&(e=y_(e,i,s,n)),s+e+i};Object.defineProperties(Vs.prototype,Rr);var nR=Vs(),RD=Vs({level:v_?v_.level:0});var ue=nR;var N_=Y(R_(),1),{program:q_,createCommand:FD,createArgument:UD,createOption:HD,CommanderError:GD,InvalidArgumentError:zD,InvalidOptionArgumentError:BD,Command:KD,Argument:WD,Option:YD,Help:XD}=N_.default;var k_=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/i;function j_(){let r,e,t=new Promise((s,i)=>{r=s,e=i});return t.resolve=r,t.reject=e,t}var Nr=class{constructor(e,t){this.interval=e;this.func=t}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 yn(r){if(r.length<=24)return{service:"",user:"",token:r};let e=Buffer.from(wR(r),"base64").toString("utf8").split("#");return{service:e[0]??"",user:e[1]??"",token:e[2]??""}}function wR(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 nv=require("net"),ov=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 D_(r){return{name:Object.keys(_n).find(e=>_n[e]===r)??"UNKNOWN",isBinary:!!(r&64)}}var M_=1;var $R="service";var il=$R+".",L_=5e3;var ER=1*1024*1024,Us=12,V_=70,F_=80,U_=0,H_=1,G_=2,z_=4,B_=8,K_=!!process.env.DERTUNNEL_DEBUG,vn=class{constructor(e){this.onMessage=e}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+Us)return this.buffer=t.subarray(s),!0;if(t[s+U_]!=V_||t[s+H_]!=F_)return this.reset(),!1;let i=t.readUint16LE(s+G_),n=t.readUint32LE(s+z_),o=t.readUint32LE(s+B_),u=o+Us+s;if(o>ER)return this.reset(),!1;if(t.length>=u)try{let c=t.subarray(s+Us,u);K_&&W_(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 qr(r,e,t,s){let i=Buffer.isBuffer(s)?s:s?Buffer.from(JSON.stringify(s)):void 0,n=Buffer.allocUnsafe(Us+(i?i.length:0));n.writeUint8(V_,U_),n.writeUint8(F_,H_),n.writeUint16LE(e,G_),n.writeUint32LE(t,z_),n.writeUint32LE(i?i.length:0,B_),i?.copy(n,Us,0);let o=r.write(n);return K_&&W_(e,t,i,!0),o}function Hs(r){return JSON.parse(r.toString("utf8"))}function W_(r,e,t,s){let{name:i,isBinary:n}=D_(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 SR=128,rr,kr;function OR(r){!rr||rr.length<r?(rr=Buffer.allocUnsafe(r*SR),nl.webcrypto.getRandomValues(rr),kr=0):kr+r>rr.length&&(nl.webcrypto.getRandomValues(rr),kr=0),kr+=r}function xR(r){return OR(r|=0),rr.subarray(kr-r,kr)}function TR(r,e,t){let s=(2<<31-Math.clz32(r.length-1|1))-1,i=Math.ceil(1.6*s*e/r.length);return(n=e)=>{if(!n)return"";let o="";for(;;){let a=t(i),u=i;for(;u--;)if(o+=r[a[u]&s]||"",o.length>=n)return o}}}function ol(r,e=21){return TR(r,e,xR)}var bn=ol("0123456789abcdef",8),a2=ol("0123456789abcdefghijklmnopqrstuvwxyz",24);var ev=4096,jr=13,Dr=10,Y_=new Uint8Array([72,84,84,80,47,49,46,49,jr,Dr]),PR=new Uint8Array([72,84,84,80,47,49,46,49,32]),al=0,wn=1,$n=2,ul=3,X_=4,tv=5,Gs=class{constructor(e){this.onParsed=e}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===wn||this.state===$n){this.contentData=void 0;let n=s;if((s=e.indexOf(Y_,n))>=0)for(let o=0;o<1;o++){let a=s+Y_.length;for(;s>0&&e[s-1]!==Dr&&e[s-1]!==jr;)s--;let u=e.subarray(s,a).toString("ascii").split(" ");if(u.length!==3){s=a;break}let c=Z_(e,a);if(c){s=a+c.length,this.headers=Q_(c);let{nextState:l,len:h}=J_(this.headers,!0);this.state=l,this.expectedBodyLen=h}else break;this.isRequest=!0,this.id=bn(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(PR,n))>=0){let o=s,a=e.length;for(;s<a&&!(e[s+1]===jr&&e[s+2]===Dr);)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=Z_(e,o);if(l){s=o+l.length,this.headers=Q_(l);let{nextState:f,len:p}=J_(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}=IR(e,s);s=o,a>0?(this.expectedBodyLen=a,this.state=n?X_: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?$n:wn)}else if(this.state===X_){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===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&&(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?$n:wn)}if(i>=100)throw new Error("Internal parser error: "+this.state)}};function J_(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:tv,isChunked:!1,len:t}:{nextState:e?$n:wn,isChunked:!1,len:0}}function Z_(r,e){let t=e,s=Math.min(r.length-3,e+ev);for(;t<s&&!(r[t]===jr&&r[t+1]===Dr&&r[t+2]===jr&&r[t+3]===Dr);)t++;return t<s?r.slice(e,t+4):void 0}function Q_(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 IR(r,e){let t=0,s=e,i=!1,n=AR(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 AR(r,e){let t=e,s=Math.min(r.length-1,e+ev);for(;t<s&&!(r[t]===jr&&r[t+1]===Dr);)t++;return t<s?r.slice(e,t).toString("ascii"):void 0}var rv="0.7.8";var Q={headerLines:[`/__\\ DERTUNNEL v${rv} /__\\`,""],logLines:[],inspectedRequests:[],statusLines:[]};function zs(){let r=process.stdout,[e,t]=r.getWindowSize();if(Q.inspectedRequests.length>t-15){let n=Q.inspectedRequests.findIndex(o=>o.type==="http-response-body"||o.type==="http-response-header");Q.inspectedRequests.splice(n>=0?n:0,1)}let s=Q.inspectedRequests.map(n=>{let o;n.status===0?o="...":n.status<400?o=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?" "+$t(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 Mr(r,e){process.stdout.isTTY?(e!==void 0?Q.headerLines[e]=r:Q.headerLines.push(r),zs()):console.log(r)}function Bs(r){process.stdout.isTTY?(Q.logLines.push(r),Q.logLines.length>20&&Q.logLines.splice(0,1),zs()):console.log(r)}var CR=new Nr(200,()=>zs());function sv(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}}}CR.update(void 0)}function iv(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 av(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=yn(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=j_(),m=r.serviceHost;m.startsWith(il)||(m=il+m);let g=()=>{let y=new Nr(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=ov.default.connect({timeout:1e4,host:m,port:r.servicePort||443,servername:m,...r.ignoreCertErrors?{checkServerIdentity:()=>{}}:{}},()=>{s&&(s.setKeepAlive(!0,L_),qr(s,1,0,{version:M_,user:c,token:l,endpoint:r.endpoint,endpointPrefix:r.endpointPrefix}))}),s.setMaxListeners(0);let O=new Map,E,$,ce=new vn(async(U,De,xe)=>{if(!e&&U===2){let G=Hs(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{qr(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=Hs(xe);G.error&&r.onError?.(G.error);return}if(e){if(U===7)qr(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=Hs(xe),N=(0,nv.createConnection)({host:h,port:f,allowHalfOpen:!1});N.channelId=G.channelId,N.wasConnected=!1;let Ks=bn(),Lr=Me=>{try{r.onProtocolData?.(Me.type,Ks,Me)}catch{}};r.protocols?.inspect&&(N.parserIn=new Gs(Lr),N.parserOut=new Gs(Lr)),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),qr(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(cv){S("error",cv?.message)}!qr(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=Hs(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=>Bs(`Unexpected parser error: ${De.message}`)))})};return g(),r.waitForInitialConnection!==!1&&await p,()=>{t=!0,s?.destroy()}}(async function(){let e=new Ts({projectName:"dertunnel",defaults:{configured:!1,serviceUrl:"",user:"",token:""}}),t=e.get("configured"),s=q_.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,En.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}=yn(a);c=o||c;let[l,h]=s.args;if(!l&&(l=(await(0,En.default)({name:"value",type:"text",message:"Public endpoint name",validate:E=>k_.test(E)})).value,!l))throw new Error("Must specify a public endpoint name");if(!h&&(h=(await(0,En.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;Mr(`Service: ${ue.cyanBright(n||u)}`,3),Mr(`User: ${ue.cyanBright(c)}`,4),Mr(`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 av({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=>{Mr(`Connected - public endpoint: ${ue.green(E)}`,6)},onError:E=>{Mr(ue.redBright(E),6)},onEndpoint(E,$,ce){Q.statusLines=iv($),E==="error"&&Bs(ue.redBright(ce)),zs()},onProtocolData(E,$,ce){sv(E,$,ce)}});["SIGINT","SIGTERM","SIGQUIT"].forEach(E=>{process.on(E,()=>{Bs("Shutting down"),O(),process.exit(0)})})})().catch(r=>{console.error(r)});
134
+ `,i)}while(s!==-1);return n+=r.slice(i),n}var{stdout:__,stderr:v_}=m_,Ml=Symbol("GENERATOR"),Rr=Symbol("STYLER"),Vs=Symbol("IS_EMPTY"),b_=["ansi","ansi","ansi256","ansi16m"],Nr=Object.create(null),tR=(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=__?__.level:0;r.level=e.level===void 0?t:e.level};var rR=r=>{let e=(...t)=>t.join(" ");return tR(e,r),Object.setPrototypeOf(e,Fs.prototype),e};function Fs(r){return rR(r)}Object.setPrototypeOf(Fs.prototype,Function.prototype);for(let[r,e]of Object.entries(Ke))Nr[r]={get(){let t=fn(this,Vl(e.open,e.close,this[Rr]),this[Vs]);return Object.defineProperty(this,r,{value:t}),t}};Nr.visible={get(){let r=fn(this,this[Rr],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Ll=(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"?Ll("rgb",e,t,...Ke.hexToRgb(...s)):Ke[t][r](...s),sR=["rgb","hex","ansi256"];for(let r of sR){Nr[r]={get(){let{level:t}=this;return function(...s){let i=Vl(Ll(r,b_[t],"color",...s),Ke.color.close,this[Rr]);return fn(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=Vl(Ll(r,b_[t],"bgColor",...s),Ke.bgColor.close,this[Rr]);return fn(this,i,this[Vs])}}}}var iR=Object.defineProperties(()=>{},{...Nr,level:{enumerable:!0,get(){return this[Ml].level},set(r){this[Ml].level=r}}}),Vl=(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}},fn=(r,e,t)=>{let s=(...i)=>nR(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,iR),s[Ml]=r,s[Rr]=e,s[Vs]=t,s},nR=(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=g_(e,t.close,t.open),t=t.parent;let n=e.indexOf(`
135
+ `);return n!==-1&&(e=y_(e,i,s,n)),s+e+i};Object.defineProperties(Fs.prototype,Nr);var oR=Fs(),ND=Fs({level:v_?v_.level:0});var ue=oR;var N_=Y(R_(),1),{program:q_,createCommand:UD,createArgument:HD,createOption:GD,CommanderError:zD,InvalidArgumentError:BD,InvalidOptionArgumentError:KD,Command:WD,Argument:YD,Option:XD,Help:JD}=N_.default;var k_=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/i;function j_(){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}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 yn(r){if(r.length<=24)return{service:"",user:"",token:r};let e=Buffer.from($R(r),"base64").toString("utf8").split("#");return{service:e[0]??"",user:e[1]??"",token:e[2]??""}}function $R(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 nv=require("net"),ov=Y(require("tls"));var _n=(c=>(c[c.HELLO_REQ=1]="HELLO_REQ",c[c.HELLO_RESP=2]="HELLO_RESP",c[c.END=3]="END",c[c.SERVER_OPEN=4]="SERVER_OPEN",c[c.SERVER_CLOSE=5]="SERVER_CLOSE",c[c.CLIENT_CLOSE=6]="CLIENT_CLOSE",c[c.PING=7]="PING",c[c.PONG=8]="PONG",c[c.SERVER_DATA=65]="SERVER_DATA",c[c.CLIENT_DATA=66]="CLIENT_DATA",c))(_n||{});function D_(r){return{name:Object.keys(_n).find(e=>_n[e]===r)??"UNKNOWN",isBinary:!!(r&64)}}var M_=1;var ER="service";var ic=ER+".",L_=5e3;var SR=1*1024*1024,Hs=12,V_=70,F_=80,U_=0,H_=1,G_=2,z_=4,B_=8,K_=!!process.env.DERTUNNEL_DEBUG,vn=class{constructor(e){this.onMessage=e}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+U_]!=V_||t[s+H_]!=F_)return this.reset(),!1;let i=t.readUint16LE(s+G_),n=t.readUint32LE(s+z_),o=t.readUint32LE(s+B_),u=o+Hs+s;if(o>SR)return this.reset(),!1;if(t.length>=u)try{let l=t.subarray(s+Hs,u);K_&&W_(i,n,l,!1),await this.onMessage(i,n,l)}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(V_,U_),n.writeUint8(F_,H_),n.writeUint16LE(e,G_),n.writeUint32LE(t,z_),n.writeUint32LE(i?i.length:0,B_),i?.copy(n,Hs,0);let o=r.write(n);return K_&&W_(e,t,i,!0),o}function Gs(r){return JSON.parse(r.toString("utf8"))}function W_(r,e,t,s){let{name:i,isBinary:n}=D_(r);console.debug(`[msg-${s?"out":"in"} ${i} ${e>0?e:""}] ${t?n?`- ${t.length} payload bytes`:t.toString("utf8"):"- empty"}`)}var nc=require("node:crypto");var OR=128,rr,jr;function xR(r){!rr||rr.length<r?(rr=Buffer.allocUnsafe(r*OR),nc.webcrypto.getRandomValues(rr),jr=0):jr+r>rr.length&&(nc.webcrypto.getRandomValues(rr),jr=0),jr+=r}function TR(r){return xR(r|=0),rr.subarray(jr-r,jr)}function PR(r,e,t){let s=(2<<31-Math.clz32(r.length-1|1))-1,i=Math.ceil(1.6*s*e/r.length);return(n=e)=>{if(!n)return"";let o="";for(;;){let a=t(i),u=i;for(;u--;)if(o+=r[a[u]&s]||"",o.length>=n)return o}}}function oc(r,e=21){return PR(r,e,TR)}var bn=oc("0123456789abcdef",8),u2=oc("0123456789abcdefghijklmnopqrstuvwxyz",24);var ev=4096,Dr=13,Mr=10,Y_=new Uint8Array([72,84,84,80,47,49,46,49,Dr,Mr]),IR=new Uint8Array([72,84,84,80,47,49,46,49,32]),ac=0,wn=1,$n=2,uc=3,X_=4,tv=5,zs=class{constructor(e){this.onParsed=e}state=ac;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===ac||this.state===wn||this.state===$n){this.contentData=void 0;let n=s;if((s=e.indexOf(Y_,n))>=0)for(let o=0;o<1;o++){let a=s+Y_.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 l=Z_(e,a);if(l){s=a+l.length,this.headers=Q_(l);let{nextState:c,len:h}=J_(this.headers,!0);this.state=c,this.expectedBodyLen=h}else break;this.isRequest=!0,this.id=bn(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(IR,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 l=e.subarray(o,s+1).toString("ascii").split(" ");if(l.length<3)break;let c=Z_(e,o);if(c){s=o+c.length,this.headers=Q_(c);let{nextState:f,len:p}=J_(this.headers,!1);this.state=f,this.expectedBodyLen=p}else break;let h=Number.parseInt(l[1]);if(!Number.isFinite(h)||h<100||h>999)break;this.isRequest=!1,this.status=h,this.statusText=l.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===uc){let{ok:n,p:o,size:a}=AR(e,s);s=o,a>0?(this.expectedBodyLen=a,this.state=n?X_:ac):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?$n:wn)}else if(this.state===X_){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=uc)}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&&(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?$n:wn)}if(i>=100)throw new Error("Internal parser error: "+this.state)}};function J_(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:uc,isChunked:!0,len:0}:t>0?{nextState:tv,isChunked:!1,len:t}:{nextState:e?$n:wn,isChunked:!1,len:0}}function Z_(r,e){let t=e,s=Math.min(r.length-3,e+ev);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 Q_(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 AR(r,e){let t=0,s=e,i=!1,n=CR(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 CR(r,e){let t=e,s=Math.min(r.length-1,e+ev);for(;t<s&&!(r[t]===Dr&&r[t+1]===Mr);)t++;return t<s?r.slice(e,t).toString("ascii"):void 0}var rv="0.7.10";var Q={headerLines:[`/__\\ DERTUNNEL v${rv} /__\\`,""],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`:"",l=a.slice(0,10)+" "+a.slice(11,19),c=n.headers.find(m=>m.name==="content-type")?.value??"(none)",h=c.split(";")[0],f=n.path.slice(0,Math.min(e-45-(c?c.length:2),n.path.length)),p=ue.white(n.content?" "+$t(n.content.length)+"b ":"");return`${ue.cyan(`${l} -`)} ${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 Ks(r){process.stdout.isTTY?(Q.logLines.push(r),Q.logLines.length>20&&Q.logLines.splice(0,1),Bs()):console.log(r)}var RR=new qr(200,()=>Bs());function sv(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}}}RR.update(void 0)}function iv(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 av(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=yn(r.clientToken);r.serviceHost??=u.service;let l=u.user,c=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=j_(),m=r.serviceHost;m.startsWith(ic)||(m=ic+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=ov.default.connect({timeout:1e4,host:m,port:r.servicePort||443,servername:m,...r.ignoreCertErrors?{checkServerIdentity:()=>{}}:{}},()=>{s&&(s.setKeepAlive(!0,L_),kr(s,1,0,{version:M_,user:l,token:c,endpoint:r.endpoint,endpointPrefix:r.endpointPrefix}))}),s.setMaxListeners(0);let O=new Map,E,$,le=new vn(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,nv.createConnection)({host:h,port:f,allowHalfOpen:!1});N.channelId=G.channelId,N.wasConnected=!1;let Ws=bn(),Vr=Me=>{try{r.onProtocolData?.(Me.type,Ws,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(lv){S("error",lv?.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(),le.receive(U).then(De=>{De||s?.destroy(),s?.resume()}).catch(De=>Ks(`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=q_.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,En.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:l}=yn(a);l=o||l;let[c,h]=s.args;if(!c&&(c=(await(0,En.default)({name:"value",type:"text",message:"Public endpoint name",validate:E=>k_.test(E)})).value,!c))throw new Error("Must specify a public endpoint name");if(!h&&(h=(await(0,En.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(l)}`,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 av({clientToken:a,localServer:f,localPort:p,localUrl:m,serviceHost:_,servicePort:S,endpoint:c,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,$,le){Q.statusLines=iv($),E==="error"&&Ks(ue.redBright(le)),Bs()},onProtocolData(E,$,le){sv(E,$,le)}});["SIGINT","SIGTERM","SIGQUIT"].forEach(E=>{process.on(E,()=>{Ks("Shutting down"),O(),process.exit(0)})})})().catch(r=>{console.error(r)});