@tbox.cn/app-cli 0.8.6 → 0.8.7

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as E,b as ll,c as un,d as W,e as fn}from"./chunk-RA7VYBCF.js";var Tt=E(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.regexpCode=U.getEsmExportName=U.getProperty=U.safeStringify=U.stringify=U.strConcat=U.addCodeArg=U.str=U._=U.nil=U._Code=U.Name=U.IDENTIFIER=U._CodeOrName=void 0;var Nt=class{};U._CodeOrName=Nt;U.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Be=class extends Nt{constructor(e){if(super(),!U.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}}};U.Name=Be;var ue=class extends Nt{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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Be&&(r[n.str]=(r[n.str]||0)+1),r),{})}};U._Code=ue;U.nil=new ue("");function io(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Mn(r,e[n]),r.push(t[++n]);return new ue(r)}U._=io;var Tn=new ue("+");function so(t,...e){let r=[At(t[0])],n=0;for(;n<e.length;)r.push(Tn),Mn(r,e[n]),r.push(Tn,At(t[++n]));return Kl(r),new ue(r)}U.str=so;function Mn(t,e){e instanceof ue?t.push(...e._items):e instanceof Be?t.push(e):t.push(Gl(e))}U.addCodeArg=Mn;function Kl(t){let e=1;for(;e<t.length-1;){if(t[e]===Tn){let r=Bl(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Bl(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Be||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Be))return`"${t}${e.slice(1)}`}function Hl(t,e){return e.emptyStr()?t:t.emptyStr()?e:so`${t}${e}`}U.strConcat=Hl;function Gl(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:At(Array.isArray(t)?t.join(","):t)}function Jl(t){return new ue(At(t))}U.stringify=Jl;function At(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}U.safeStringify=At;function Yl(t){return typeof t=="string"&&U.IDENTIFIER.test(t)?new ue(`.${t}`):io`[${t}]`}U.getProperty=Yl;function Zl(t){if(typeof t=="string"&&U.IDENTIFIER.test(t))return new ue(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}U.getEsmExportName=Zl;function Ql(t){return new ue(t.toString())}U.regexpCode=Ql});var Vn=E(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.ValueScope=ae.ValueScopeName=ae.Scope=ae.varKinds=ae.UsedValueState=void 0;var oe=Tt(),xn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},wr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(wr||(ae.UsedValueState=wr={}));ae.varKinds={const:new oe.Name("const"),let:new oe.Name("let"),var:new oe.Name("var")};var Sr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof oe.Name?e:this.name(e)}name(e){return new oe.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};ae.Scope=Sr;var _r=class extends oe.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,oe._)`.${new oe.Name(r)}[${n}]`}};ae.ValueScopeName=_r;var Xl=(0,oe._)`\n`,Dn=class extends Sr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Xl:oe.nil}}get(){return this._scope}name(e){return new _r(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let d=a.get(o);if(d)return d}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,oe._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=oe.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,wr.Started);let d=r(l);if(d){let f=this.opts.es5?ae.varKinds.var:ae.varKinds.const;s=(0,oe._)`${s}${f} ${l} = ${d};${this.opts._n}`}else if(d=i?.(l))s=(0,oe._)`${s}${d}${this.opts._n}`;else throw new xn(l);c.set(l,wr.Completed)})}return s}};ae.ValueScope=Dn});var x=E(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.or=M.and=M.not=M.CodeGen=M.operators=M.varKinds=M.ValueScopeName=M.ValueScope=M.Scope=M.Name=M.regexpCode=M.stringify=M.getProperty=M.nil=M.strConcat=M.str=M._=void 0;var V=Tt(),ye=Vn(),Ne=Tt();Object.defineProperty(M,"_",{enumerable:!0,get:function(){return Ne._}});Object.defineProperty(M,"str",{enumerable:!0,get:function(){return Ne.str}});Object.defineProperty(M,"strConcat",{enumerable:!0,get:function(){return Ne.strConcat}});Object.defineProperty(M,"nil",{enumerable:!0,get:function(){return Ne.nil}});Object.defineProperty(M,"getProperty",{enumerable:!0,get:function(){return Ne.getProperty}});Object.defineProperty(M,"stringify",{enumerable:!0,get:function(){return Ne.stringify}});Object.defineProperty(M,"regexpCode",{enumerable:!0,get:function(){return Ne.regexpCode}});Object.defineProperty(M,"Name",{enumerable:!0,get:function(){return Ne.Name}});var Ir=Vn();Object.defineProperty(M,"Scope",{enumerable:!0,get:function(){return Ir.Scope}});Object.defineProperty(M,"ValueScope",{enumerable:!0,get:function(){return Ir.ValueScope}});Object.defineProperty(M,"ValueScopeName",{enumerable:!0,get:function(){return Ir.ValueScopeName}});Object.defineProperty(M,"varKinds",{enumerable:!0,get:function(){return Ir.varKinds}});M.operators={GT:new V._Code(">"),GTE:new V._Code(">="),LT:new V._Code("<"),LTE:new V._Code("<="),EQ:new V._Code("==="),NEQ:new V._Code("!=="),NOT:new V._Code("!"),OR:new V._Code("||"),AND:new V._Code("&&"),ADD:new V._Code("+")};var ke=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},qn=class extends ke{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?ye.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ut(this.rhs,e,r)),this}get names(){return this.rhs instanceof V._CodeOrName?this.rhs.names:{}}},$r=class extends ke{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof V.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ut(this.rhs,e,r),this}get names(){let e=this.lhs instanceof V.Name?{}:{...this.lhs.names};return Rr(e,this.rhs)}},Fn=class extends $r{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ln=class extends ke{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Un=class extends ke{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},zn=class extends ke{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Wn=class extends ke{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ut(this.code,e,r),this}get names(){return this.code instanceof V._CodeOrName?this.code.names:{}}},Mt=class extends ke{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(ed(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Je(e,r.names),{})}},Ee=class extends Mt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Kn=class extends Mt{},dt=class extends Ee{};dt.kind="else";var He=class t extends Ee{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new dt(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(oo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ut(this.condition,e,r),this}get names(){let e=super.names;return Rr(e,this.condition),this.else&&Je(e,this.else.names),e}};He.kind="if";var Ge=class extends Ee{};Ge.kind="for";var Bn=class extends Ge{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ut(this.iteration,e,r),this}get names(){return Je(super.names,this.iteration.names)}},Hn=class extends Ge{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?ye.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Rr(super.names,this.from);return Rr(e,this.to)}},br=class extends Ge{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ut(this.iterable,e,r),this}get names(){return Je(super.names,this.iterable.names)}},xt=class extends Ee{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};xt.kind="func";var Dt=class extends Mt{render(e){return"return "+super.render(e)}};Dt.kind="return";var Gn=class extends Ee{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Je(e,this.catch.names),this.finally&&Je(e,this.finally.names),e}},Vt=class extends Ee{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Vt.kind="catch";var qt=class extends Ee{render(e){return"finally"+super.render(e)}};qt.kind="finally";var Jn=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
+ import{a as E,b as ll,c as un,d as W,e as fn}from"./chunk-JZBQYBEL.js";var Tt=E(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.regexpCode=U.getEsmExportName=U.getProperty=U.safeStringify=U.stringify=U.strConcat=U.addCodeArg=U.str=U._=U.nil=U._Code=U.Name=U.IDENTIFIER=U._CodeOrName=void 0;var Nt=class{};U._CodeOrName=Nt;U.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Be=class extends Nt{constructor(e){if(super(),!U.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}}};U.Name=Be;var ue=class extends Nt{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((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Be&&(r[n.str]=(r[n.str]||0)+1),r),{})}};U._Code=ue;U.nil=new ue("");function io(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Mn(r,e[n]),r.push(t[++n]);return new ue(r)}U._=io;var Tn=new ue("+");function so(t,...e){let r=[At(t[0])],n=0;for(;n<e.length;)r.push(Tn),Mn(r,e[n]),r.push(Tn,At(t[++n]));return Kl(r),new ue(r)}U.str=so;function Mn(t,e){e instanceof ue?t.push(...e._items):e instanceof Be?t.push(e):t.push(Gl(e))}U.addCodeArg=Mn;function Kl(t){let e=1;for(;e<t.length-1;){if(t[e]===Tn){let r=Bl(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Bl(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Be||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Be))return`"${t}${e.slice(1)}`}function Hl(t,e){return e.emptyStr()?t:t.emptyStr()?e:so`${t}${e}`}U.strConcat=Hl;function Gl(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:At(Array.isArray(t)?t.join(","):t)}function Jl(t){return new ue(At(t))}U.stringify=Jl;function At(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}U.safeStringify=At;function Yl(t){return typeof t=="string"&&U.IDENTIFIER.test(t)?new ue(`.${t}`):io`[${t}]`}U.getProperty=Yl;function Zl(t){if(typeof t=="string"&&U.IDENTIFIER.test(t))return new ue(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}U.getEsmExportName=Zl;function Ql(t){return new ue(t.toString())}U.regexpCode=Ql});var Vn=E(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.ValueScope=ae.ValueScopeName=ae.Scope=ae.varKinds=ae.UsedValueState=void 0;var oe=Tt(),xn=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},wr;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(wr||(ae.UsedValueState=wr={}));ae.varKinds={const:new oe.Name("const"),let:new oe.Name("let"),var:new oe.Name("var")};var Sr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof oe.Name?e:this.name(e)}name(e){return new oe.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.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}}};ae.Scope=Sr;var _r=class extends oe.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,oe._)`.${new oe.Name(r)}[${n}]`}};ae.ValueScopeName=_r;var Xl=(0,oe._)`\n`,Dn=class extends Sr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Xl:oe.nil}}get(){return this._scope}name(e){return new _r(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let d=a.get(o);if(d)return d}else a=this._values[s]=new Map;a.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,oe._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=oe.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,wr.Started);let d=r(l);if(d){let f=this.opts.es5?ae.varKinds.var:ae.varKinds.const;s=(0,oe._)`${s}${f} ${l} = ${d};${this.opts._n}`}else if(d=i?.(l))s=(0,oe._)`${s}${d}${this.opts._n}`;else throw new xn(l);c.set(l,wr.Completed)})}return s}};ae.ValueScope=Dn});var x=E(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.or=M.and=M.not=M.CodeGen=M.operators=M.varKinds=M.ValueScopeName=M.ValueScope=M.Scope=M.Name=M.regexpCode=M.stringify=M.getProperty=M.nil=M.strConcat=M.str=M._=void 0;var V=Tt(),ye=Vn(),Ne=Tt();Object.defineProperty(M,"_",{enumerable:!0,get:function(){return Ne._}});Object.defineProperty(M,"str",{enumerable:!0,get:function(){return Ne.str}});Object.defineProperty(M,"strConcat",{enumerable:!0,get:function(){return Ne.strConcat}});Object.defineProperty(M,"nil",{enumerable:!0,get:function(){return Ne.nil}});Object.defineProperty(M,"getProperty",{enumerable:!0,get:function(){return Ne.getProperty}});Object.defineProperty(M,"stringify",{enumerable:!0,get:function(){return Ne.stringify}});Object.defineProperty(M,"regexpCode",{enumerable:!0,get:function(){return Ne.regexpCode}});Object.defineProperty(M,"Name",{enumerable:!0,get:function(){return Ne.Name}});var Ir=Vn();Object.defineProperty(M,"Scope",{enumerable:!0,get:function(){return Ir.Scope}});Object.defineProperty(M,"ValueScope",{enumerable:!0,get:function(){return Ir.ValueScope}});Object.defineProperty(M,"ValueScopeName",{enumerable:!0,get:function(){return Ir.ValueScopeName}});Object.defineProperty(M,"varKinds",{enumerable:!0,get:function(){return Ir.varKinds}});M.operators={GT:new V._Code(">"),GTE:new V._Code(">="),LT:new V._Code("<"),LTE:new V._Code("<="),EQ:new V._Code("==="),NEQ:new V._Code("!=="),NOT:new V._Code("!"),OR:new V._Code("||"),AND:new V._Code("&&"),ADD:new V._Code("+")};var ke=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},qn=class extends ke{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?ye.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ut(this.rhs,e,r)),this}get names(){return this.rhs instanceof V._CodeOrName?this.rhs.names:{}}},$r=class extends ke{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof V.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ut(this.rhs,e,r),this}get names(){let e=this.lhs instanceof V.Name?{}:{...this.lhs.names};return Rr(e,this.rhs)}},Fn=class extends $r{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ln=class extends ke{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Un=class extends ke{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},zn=class extends ke{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Wn=class extends ke{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ut(this.code,e,r),this}get names(){return this.code instanceof V._CodeOrName?this.code.names:{}}},Mt=class extends ke{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(ed(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Je(e,r.names),{})}},Ee=class extends Mt{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Kn=class extends Mt{},dt=class extends Ee{};dt.kind="else";var He=class t extends Ee{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new dt(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(oo(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ut(this.condition,e,r),this}get names(){let e=super.names;return Rr(e,this.condition),this.else&&Je(e,this.else.names),e}};He.kind="if";var Ge=class extends Ee{};Ge.kind="for";var Bn=class extends Ge{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ut(this.iteration,e,r),this}get names(){return Je(super.names,this.iteration.names)}},Hn=class extends Ge{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?ye.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Rr(super.names,this.from);return Rr(e,this.to)}},br=class extends Ge{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ut(this.iterable,e,r),this}get names(){return Je(super.names,this.iterable.names)}},xt=class extends Ee{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};xt.kind="func";var Dt=class extends Mt{render(e){return"return "+super.render(e)}};Dt.kind="return";var Gn=class extends Ee{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Je(e,this.catch.names),this.finally&&Je(e,this.finally.names),e}},Vt=class extends Ee{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Vt.kind="catch";var qt=class extends Ee{render(e){return"finally"+super.render(e)}};qt.kind="finally";var Jn=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
3
3
  `:""},this._extScope=e,this._scope=new ye.Scope({parent:e}),this._nodes=[new Kn]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new qn(e,s,n)),s}const(e,r,n){return this._def(ye.varKinds.const,e,r,n)}let(e,r,n){return this._def(ye.varKinds.let,e,r,n)}var(e,r,n){return this._def(ye.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new $r(e,r,n))}add(e,r){return this._leafNode(new Fn(e,M.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==V.nil&&this._leafNode(new Wn(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,V.addCodeArg)(r,i));return r.push("}"),new V._Code(r)}if(e,r,n){if(this._blockNode(new He(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new He(e))}else(){return this._elseNode(new dt)}endIf(){return this._endBlockNode(He,dt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Bn(e),r)}forRange(e,r,n,i,s=this.opts.es5?ye.varKinds.var:ye.varKinds.let){let o=this._scope.toName(e);return this._for(new Hn(s,o,r,n),()=>i(o))}forOf(e,r,n,i=ye.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof V.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,V._)`${o}.length`,a=>{this.var(s,(0,V._)`${o}[${a}]`),n(s)})}return this._for(new br("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?ye.varKinds.var:ye.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,V._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new br("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Ge)}label(e){return this._leafNode(new Ln(e))}break(e){return this._leafNode(new Un(e))}return(e){let r=new Dt;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Dt)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Gn;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Vt(s),r(s)}return n&&(this._currNode=i.finally=new qt,this.code(n)),this._endBlockNode(Vt,qt)}throw(e){return this._leafNode(new zn(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=V.nil,n,i){return this._blockNode(new xt(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(xt)}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,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof He))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};M.CodeGen=Jn;function Je(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Rr(t,e){return e instanceof V._CodeOrName?Je(t,e.names):t}function ut(t,e,r){if(t instanceof V.Name)return n(t);if(!i(t))return t;return new V._Code(t._items.reduce((s,o)=>(o instanceof V.Name&&(o=n(o)),o instanceof V._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof V._Code&&s._items.some(o=>o instanceof V.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function ed(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function oo(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,V._)`!${Yn(t)}`}M.not=oo;var td=ao(M.operators.AND);function rd(...t){return t.reduce(td)}M.and=rd;var nd=ao(M.operators.OR);function id(...t){return t.reduce(nd)}M.or=id;function ao(t){return(e,r)=>e===V.nil?r:r===V.nil?e:(0,V._)`${Yn(e)} ${t} ${Yn(r)}`}function Yn(t){return t instanceof V.Name?t:(0,V._)`(${t})`}});var F=E(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.checkStrictMode=D.getErrorPath=D.Type=D.useFunc=D.setEvaluated=D.evaluatedPropsToName=D.mergeEvaluated=D.eachItem=D.unescapeJsonPointer=D.escapeJsonPointer=D.escapeFragment=D.unescapeFragment=D.schemaRefOrVal=D.schemaHasRulesButRef=D.schemaHasRules=D.checkUnknownRules=D.alwaysValidSchema=D.toHash=void 0;var B=x(),sd=Tt();function od(t){let e={};for(let r of t)e[r]=!0;return e}D.toHash=od;function ad(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(uo(t,e),!fo(e,t.self.RULES.all))}D.alwaysValidSchema=ad;function uo(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||go(t,`unknown keyword: "${s}"`)}D.checkUnknownRules=uo;function fo(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}D.schemaHasRules=fo;function cd(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}D.schemaHasRulesButRef=cd;function ld({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,B._)`${r}`}return(0,B._)`${t}${e}${(0,B.getProperty)(n)}`}D.schemaRefOrVal=ld;function dd(t){return po(decodeURIComponent(t))}D.unescapeFragment=dd;function ud(t){return encodeURIComponent(Qn(t))}D.escapeFragment=ud;function Qn(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}D.escapeJsonPointer=Qn;function po(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}D.unescapeJsonPointer=po;function fd(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}D.eachItem=fd;function co({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof B.Name?(s instanceof B.Name?t(i,s,o):e(i,s,o),o):s instanceof B.Name?(e(i,o,s),s):r(s,o);return a===B.Name&&!(c instanceof B.Name)?n(i,c):c}}D.mergeEvaluated={props:co({mergeNames:(t,e,r)=>t.if((0,B._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,B._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,B._)`${r} || {}`).code((0,B._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,B._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,B._)`${r} || {}`),Xn(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:mo}),items:co({mergeNames:(t,e,r)=>t.if((0,B._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,B._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,B._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,B._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function mo(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,B._)`{}`);return e!==void 0&&Xn(t,r,e),r}D.evaluatedPropsToName=mo;function Xn(t,e,r){Object.keys(r).forEach(n=>t.assign((0,B._)`${e}${(0,B.getProperty)(n)}`,!0))}D.setEvaluated=Xn;var lo={};function pd(t,e){return t.scopeValue("func",{ref:e,code:lo[e.code]||(lo[e.code]=new sd._Code(e.code))})}D.useFunc=pd;var Zn;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Zn||(D.Type=Zn={}));function md(t,e,r){if(t instanceof B.Name){let n=e===Zn.Num;return r?n?(0,B._)`"[" + ${t} + "]"`:(0,B._)`"['" + ${t} + "']"`:n?(0,B._)`"/" + ${t}`:(0,B._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,B.getProperty)(t).toString():"/"+Qn(t)}D.getErrorPath=md;function go(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}D.checkStrictMode=go});var Pe=E(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});var te=x(),gd={data:new te.Name("data"),valCxt:new te.Name("valCxt"),instancePath:new te.Name("instancePath"),parentData:new te.Name("parentData"),parentDataProperty:new te.Name("parentDataProperty"),rootData:new te.Name("rootData"),dynamicAnchors:new te.Name("dynamicAnchors"),vErrors:new te.Name("vErrors"),errors:new te.Name("errors"),this:new te.Name("this"),self:new te.Name("self"),scope:new te.Name("scope"),json:new te.Name("json"),jsonPos:new te.Name("jsonPos"),jsonLen:new te.Name("jsonLen"),jsonPart:new te.Name("jsonPart")};ei.default=gd});var Ft=E(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.extendErrors=re.resetErrorsCount=re.reportExtraError=re.reportError=re.keyword$DataError=re.keywordError=void 0;var L=x(),kr=F(),ie=Pe();re.keywordError={message:({keyword:t})=>(0,L.str)`must pass "${t}" keyword validation`};re.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,L.str)`"${t}" keyword must be ${e} ($data)`:(0,L.str)`"${t}" keyword is invalid ($data)`};function hd(t,e=re.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,c=vo(t,e,r);n??(o||a)?ho(s,c):yo(i,(0,L._)`[${c}]`)}re.reportError=hd;function yd(t,e=re.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,a=vo(t,e,r);ho(i,a),s||o||yo(n,ie.default.vErrors)}re.reportExtraError=yd;function vd(t,e){t.assign(ie.default.errors,e),t.if((0,L._)`${ie.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,L._)`${ie.default.vErrors}.length`,e),()=>t.assign(ie.default.vErrors,null)))}re.resetErrorsCount=vd;function wd({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,ie.default.errors,a=>{t.const(o,(0,L._)`${ie.default.vErrors}[${a}]`),t.if((0,L._)`${o}.instancePath === undefined`,()=>t.assign((0,L._)`${o}.instancePath`,(0,L.strConcat)(ie.default.instancePath,s.errorPath))),t.assign((0,L._)`${o}.schemaPath`,(0,L.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,L._)`${o}.schema`,r),t.assign((0,L._)`${o}.data`,n))})}re.extendErrors=wd;function ho(t,e){let r=t.const("err",e);t.if((0,L._)`${ie.default.vErrors} === null`,()=>t.assign(ie.default.vErrors,(0,L._)`[${r}]`),(0,L._)`${ie.default.vErrors}.push(${r})`),t.code((0,L._)`${ie.default.errors}++`)}function yo(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,L._)`new ${t.ValidationError}(${e})`):(r.assign((0,L._)`${n}.errors`,e),r.return(!1))}var Ye={keyword:new L.Name("keyword"),schemaPath:new L.Name("schemaPath"),params:new L.Name("params"),propertyName:new L.Name("propertyName"),message:new L.Name("message"),schema:new L.Name("schema"),parentSchema:new L.Name("parentSchema")};function vo(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,L._)`{}`:Sd(t,e,r)}function Sd(t,e,r={}){let{gen:n,it:i}=t,s=[_d(i,r),$d(t,r)];return bd(t,e,s),n.object(...s)}function _d({errorPath:t},{instancePath:e}){let r=e?(0,L.str)`${t}${(0,kr.getErrorPath)(e,kr.Type.Str)}`:t;return[ie.default.instancePath,(0,L.strConcat)(ie.default.instancePath,r)]}function $d({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,L.str)`${e}/${t}`;return r&&(i=(0,L.str)`${i}${(0,kr.getErrorPath)(r,kr.Type.Str)}`),[Ye.schemaPath,i]}function bd(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;n.push([Ye.keyword,i],[Ye.params,typeof e=="function"?e(t):e||(0,L._)`{}`]),c.messages&&n.push([Ye.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Ye.schema,o],[Ye.parentSchema,(0,L._)`${d}${f}`],[ie.default.data,s]),l&&n.push([Ye.propertyName,l])}});var So=E(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.boolOrEmptySchema=ft.topBoolOrEmptySchema=void 0;var Rd=Ft(),Id=x(),kd=Pe(),Ed={message:"boolean schema is false"};function Pd(t){let{gen:e,schema:r,validateName:n}=t;r===!1?wo(t,!1):typeof r=="object"&&r.$async===!0?e.return(kd.default.data):(e.assign((0,Id._)`${n}.errors`,null),e.return(!0))}ft.topBoolOrEmptySchema=Pd;function Od(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),wo(t)):r.var(e,!0)}ft.boolOrEmptySchema=Od;function wo(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Rd.reportError)(i,Ed,void 0,e)}});var ti=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.getRules=pt.isJSONType=void 0;var jd=["string","number","integer","boolean","null","object","array"],Cd=new Set(jd);function Nd(t){return typeof t=="string"&&Cd.has(t)}pt.isJSONType=Nd;function Ad(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}pt.getRules=Ad});var ri=E(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.shouldUseRule=Ae.shouldUseGroup=Ae.schemaHasRulesForType=void 0;function Td({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&_o(t,n)}Ae.schemaHasRulesForType=Td;function _o(t,e){return e.rules.some(r=>$o(t,r))}Ae.shouldUseGroup=_o;function $o(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ae.shouldUseRule=$o});var Lt=E(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.reportTypeError=ne.checkDataTypes=ne.checkDataType=ne.coerceAndCheckDataType=ne.getJSONTypes=ne.getSchemaTypes=ne.DataType=void 0;var Md=ti(),xd=ri(),Dd=Ft(),A=x(),bo=F(),mt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(mt||(ne.DataType=mt={}));function Vd(t){let e=Ro(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}ne.getSchemaTypes=Vd;function Ro(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Md.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ne.getJSONTypes=Ro;function qd(t,e){let{gen:r,data:n,opts:i}=t,s=Fd(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,xd.schemaHasRulesForType)(t,e[0]));if(o){let a=ii(e,n,i.strictNumbers,mt.Wrong);r.if(a,()=>{s.length?Ld(t,e,s):si(t)})}return o}ne.coerceAndCheckDataType=qd;var Io=new Set(["string","number","integer","boolean","null"]);function Fd(t,e){return e?t.filter(r=>Io.has(r)||e==="array"&&r==="array"):[]}function Ld(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,A._)`typeof ${i}`),a=n.let("coerced",(0,A._)`undefined`);s.coerceTypes==="array"&&n.if((0,A._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,A._)`${i}[0]`).assign(o,(0,A._)`typeof ${i}`).if(ii(e,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,A._)`${a} !== undefined`);for(let l of r)(Io.has(l)||l==="array"&&s.coerceTypes==="array")&&c(l);n.else(),si(t),n.endIf(),n.if((0,A._)`${a} !== undefined`,()=>{n.assign(i,a),Ud(t,a)});function c(l){switch(l){case"string":n.elseIf((0,A._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,A._)`"" + ${i}`).elseIf((0,A._)`${i} === null`).assign(a,(0,A._)`""`);return;case"number":n.elseIf((0,A._)`${o} == "boolean" || ${i} === null
4
4
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,A._)`+${i}`);return;case"integer":n.elseIf((0,A._)`${o} === "boolean" || ${i} === null
5
5
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,A._)`+${i}`);return;case"boolean":n.elseIf((0,A._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,A._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,A._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,A._)`${o} === "string" || ${o} === "number"
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{d as a,e as b}from"./chunk-RA7VYBCF.js";export{b as invalidateContractsResolver,a as resolveContractsForApp};
2
+ import{d as a,e as b}from"./chunk-JZBQYBEL.js";export{b as invalidateContractsResolver,a as resolveContractsForApp};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{r as a,s as b,t as c}from"./chunk-JNC6WN6V.js";import"./chunk-JZBQYBEL.js";export{c as collectDeclared,b as listLocalModules,a as readComponentFile};