@povio/openapi-codegen-cli 0.13.8 → 0.13.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.
package/dist/sh.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var f2=Object.create;var sc=Object.defineProperty;var Xg=Object.getOwnPropertyDescriptor;var p2=Object.getOwnPropertyNames;var d2=Object.getPrototypeOf,h2=Object.prototype.hasOwnProperty;var o=(e,t)=>sc(e,"name",{value:t,configurable:!0});var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var m2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p2(t))!h2.call(e,i)&&i!==r&&sc(e,i,{get:()=>t[i],enumerable:!(n=Xg(t,i))||n.enumerable});return e};var mt=(e,t,r)=>(r=e!=null?f2(d2(e)):{},m2(t||!e||!e.__esModule?sc(r,"default",{value:e,enumerable:!0}):r,e));var Se=(e,t,r,n)=>{for(var i=n>1?void 0:n?Xg(t,r):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&sc(t,r,i),i};var $b=v(()=>{var xb;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:c(),n=i(e);typeof r.Reflect<"u"&&(n=i(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function i(u,l){return function(p,f){Object.defineProperty(u,p,{configurable:!0,writable:!0,value:f}),l&&l(p,f)}}o(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}o(s,"functionThis");function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}o(a,"indirectEvalThis");function c(){return s()||a()}o(c,"sloppyModeThis")})(function(t,r){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",u={__proto__:[]}instanceof Array,l=!c&&!u,p={create:c?function(){return Jl(Object.create(null))}:u?function(){return Jl({__proto__:null})}:function(){return Jl({})},has:l?function(S,x){return n.call(S,x)}:function(S,x){return x in S},get:l?function(S,x){return n.call(S,x)?S[x]:void 0}:function(S,x){return S[x]}},f=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:s2(),h=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:a2(),y=typeof WeakMap=="function"?WeakMap:c2(),b=i?Symbol.for("@reflect-metadata:registry"):void 0,g=nt(),P=ht(g);function $(S,x,I,M){if(Y(I)){if(!Ve(S))throw new TypeError;if(!Lt(x))throw new TypeError;return R(S,x)}else{if(!Ve(S))throw new TypeError;if(!Ne(x))throw new TypeError;if(!Ne(M)&&!Y(M)&&!Dt(M))throw new TypeError;return Dt(M)&&(M=void 0),I=_e(I),q(S,x,I,M)}}o($,"decorate"),t("decorate",$);function C(S,x){function I(M,J){if(!Ne(M))throw new TypeError;if(!Y(J)&&!uo(J))throw new TypeError;We(S,x,M,J)}return o(I,"decorator"),I}o(C,"metadata"),t("metadata",C);function T(S,x,I,M){if(!Ne(I))throw new TypeError;return Y(M)||(M=_e(M)),We(S,x,I,M)}o(T,"defineMetadata"),t("defineMetadata",T);function A(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),Q(S,x,I)}o(A,"hasMetadata"),t("hasMetadata",A);function te(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),ue(S,x,I)}o(te,"hasOwnMetadata"),t("hasOwnMetadata",te);function X(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),ve(S,x,I)}o(X,"getMetadata"),t("getMetadata",X);function ze(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),ge(S,x,I)}o(ze,"getOwnMetadata"),t("getOwnMetadata",ze);function $e(S,x){if(!Ne(S))throw new TypeError;return Y(x)||(x=_e(x)),Lr(S,x)}o($e,"getMetadataKeys"),t("getMetadataKeys",$e);function G(S,x){if(!Ne(S))throw new TypeError;return Y(x)||(x=_e(x)),Te(S,x)}o(G,"getOwnMetadataKeys"),t("getOwnMetadataKeys",G);function j(S,x,I){if(!Ne(x))throw new TypeError;if(Y(I)||(I=_e(I)),!Ne(x))throw new TypeError;Y(I)||(I=_e(I));var M=Os(x,I,!1);return Y(M)?!1:M.OrdinaryDeleteMetadata(S,x,I)}o(j,"deleteMetadata"),t("deleteMetadata",j);function R(S,x){for(var I=S.length-1;I>=0;--I){var M=S[I],J=M(x);if(!Y(J)&&!Dt(J)){if(!Lt(J))throw new TypeError;x=J}}return x}o(R,"DecorateConstructor");function q(S,x,I,M){for(var J=S.length-1;J>=0;--J){var Xe=S[J],st=Xe(x,I,M);if(!Y(st)&&!Dt(st)){if(!Ne(st))throw new TypeError;M=st}}return M}o(q,"DecorateProperty");function Q(S,x,I){var M=ue(S,x,I);if(M)return!0;var J=k(x);return Dt(J)?!1:Q(S,J,I)}o(Q,"OrdinaryHasMetadata");function ue(S,x,I){var M=Os(x,I,!1);return Y(M)?!1:je(M.OrdinaryHasOwnMetadata(S,x,I))}o(ue,"OrdinaryHasOwnMetadata");function ve(S,x,I){var M=ue(S,x,I);if(M)return ge(S,x,I);var J=k(x);if(!Dt(J))return ve(S,J,I)}o(ve,"OrdinaryGetMetadata");function ge(S,x,I){var M=Os(x,I,!1);if(!Y(M))return M.OrdinaryGetOwnMetadata(S,x,I)}o(ge,"OrdinaryGetOwnMetadata");function We(S,x,I,M){var J=Os(I,M,!0);J.OrdinaryDefineOwnMetadata(S,x,I,M)}o(We,"OrdinaryDefineOwnMetadata");function Lr(S,x){var I=Te(S,x),M=k(S);if(M===null)return I;var J=Lr(M,x);if(J.length<=0)return I;if(I.length<=0)return J;for(var Xe=new h,st=[],de=0,D=I;de<D.length;de++){var L=D[de],V=Xe.has(L);V||(Xe.add(L),st.push(L))}for(var z=0,me=J;z<me.length;z++){var L=me[z],V=Xe.has(L);V||(Xe.add(L),st.push(L))}return st}o(Lr,"OrdinaryMetadataKeys");function Te(S,x){var I=Os(S,x,!1);return I?I.OrdinaryOwnMetadataKeys(S,x):[]}o(Te,"OrdinaryOwnMetadataKeys");function nr(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}o(nr,"Type");function Y(S){return S===void 0}o(Y,"IsUndefined");function Dt(S){return S===null}o(Dt,"IsNull");function ne(S){return typeof S=="symbol"}o(ne,"IsSymbol");function Ne(S){return typeof S=="object"?S!==null:typeof S=="function"}o(Ne,"IsObject");function ee(S,x){switch(nr(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var I=x===3?"string":x===5?"number":"default",M=O(S,s);if(M!==void 0){var J=M.call(S,I);if(Ne(J))throw new TypeError;return J}return Re(S,I==="default"?"number":I)}o(ee,"ToPrimitive");function Re(S,x){if(x==="string"){var I=S.toString;if(ut(I)){var M=I.call(S);if(!Ne(M))return M}var J=S.valueOf;if(ut(J)){var M=J.call(S);if(!Ne(M))return M}}else{var J=S.valueOf;if(ut(J)){var M=J.call(S);if(!Ne(M))return M}var Xe=S.toString;if(ut(Xe)){var M=Xe.call(S);if(!Ne(M))return M}}throw new TypeError}o(Re,"OrdinaryToPrimitive");function je(S){return!!S}o(je,"ToBoolean");function pe(S){return""+S}o(pe,"ToString");function _e(S){var x=ee(S,3);return ne(x)?x:pe(x)}o(_e,"ToPropertyKey");function Ve(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}o(Ve,"IsArray");function ut(S){return typeof S=="function"}o(ut,"IsCallable");function Lt(S){return typeof S=="function"}o(Lt,"IsConstructor");function uo(S){switch(nr(S)){case 3:return!0;case 4:return!0;default:return!1}}o(uo,"IsPropertyKey");function _(S,x){return S===x||S!==S&&x!==x}o(_,"SameValueZero");function O(S,x){var I=S[x];if(I!=null){if(!ut(I))throw new TypeError;return I}}o(O,"GetMethod");function N(S){var x=O(S,a);if(!ut(x))throw new TypeError;var I=x.call(S);if(!Ne(I))throw new TypeError;return I}o(N,"GetIterator");function w(S){return S.value}o(w,"IteratorValue");function E(S){var x=S.next();return x.done?!1:x}o(E,"IteratorStep");function H(S){var x=S.return;x&&x.call(S)}o(H,"IteratorClose");function k(S){var x=Object.getPrototypeOf(S);if(typeof S!="function"||S===f||x!==f)return x;var I=S.prototype,M=I&&Object.getPrototypeOf(I);if(M==null||M===Object.prototype)return x;var J=M.constructor;return typeof J!="function"||J===S?x:J}o(k,"OrdinaryGetPrototypeOf");function Z(){var S;!Y(b)&&typeof r.Reflect<"u"&&!(b in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(S=o2(r.Reflect));var x,I,M,J=new y,Xe={registerProvider:st,getProvider:D,setProvider:V};return Xe;function st(z){if(!Object.isExtensible(Xe))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===z:break;case Y(x):x=z;break;case x===z:break;case Y(I):I=z;break;case I===z:break;default:M===void 0&&(M=new h),M.add(z);break}}function de(z,me){if(!Y(x)){if(x.isProviderFor(z,me))return x;if(!Y(I)){if(I.isProviderFor(z,me))return x;if(!Y(M))for(var Me=N(M);;){var et=E(Me);if(!et)return;var Sr=w(et);if(Sr.isProviderFor(z,me))return H(Me),Sr}}}if(!Y(S)&&S.isProviderFor(z,me))return S}function D(z,me){var Me=J.get(z),et;return Y(Me)||(et=Me.get(me)),Y(et)&&(et=de(z,me),Y(et)||(Y(Me)&&(Me=new d,J.set(z,Me)),Me.set(me,et))),et}function L(z){if(Y(z))throw new TypeError;return x===z||I===z||!Y(M)&&M.has(z)}function V(z,me,Me){if(!L(Me))throw new Error("Metadata provider not registered.");var et=D(z,me);if(et!==Me){if(!Y(et))return!1;var Sr=J.get(z);Y(Sr)&&(Sr=new d,J.set(z,Sr)),Sr.set(me,Me)}return!0}}o(Z,"CreateMetadataRegistry");function nt(){var S;return!Y(b)&&Ne(r.Reflect)&&Object.isExtensible(r.Reflect)&&(S=r.Reflect[b]),Y(S)&&(S=Z()),!Y(b)&&Ne(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,b,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}o(nt,"GetOrCreateMetadataRegistry");function ht(S){var x=new y,I={isProviderFor:o(function(L,V){var z=x.get(L);return Y(z)?!1:z.has(V)},"isProviderFor"),OrdinaryDefineOwnMetadata:st,OrdinaryHasOwnMetadata:J,OrdinaryGetOwnMetadata:Xe,OrdinaryOwnMetadataKeys:de,OrdinaryDeleteMetadata:D};return g.registerProvider(I),I;function M(L,V,z){var me=x.get(L),Me=!1;if(Y(me)){if(!z)return;me=new d,x.set(L,me),Me=!0}var et=me.get(V);if(Y(et)){if(!z)return;if(et=new d,me.set(V,et),!S.setProvider(L,V,I))throw me.delete(V),Me&&x.delete(L),new Error("Wrong provider for target.")}return et}o(M,"GetOrCreateMetadataMap");function J(L,V,z){var me=M(V,z,!1);return Y(me)?!1:je(me.has(L))}o(J,"OrdinaryHasOwnMetadata");function Xe(L,V,z){var me=M(V,z,!1);if(!Y(me))return me.get(L)}o(Xe,"OrdinaryGetOwnMetadata");function st(L,V,z,me){var Me=M(z,me,!0);Me.set(L,V)}o(st,"OrdinaryDefineOwnMetadata");function de(L,V){var z=[],me=M(L,V,!1);if(Y(me))return z;for(var Me=me.keys(),et=N(Me),Sr=0;;){var Jg=E(et);if(!Jg)return z.length=Sr,z;var u2=w(Jg);try{z[Sr]=u2}catch(l2){try{H(et)}finally{throw l2}}Sr++}}o(de,"OrdinaryOwnMetadataKeys");function D(L,V,z){var me=M(V,z,!1);if(Y(me)||!me.delete(L))return!1;if(me.size===0){var Me=x.get(V);Y(Me)||(Me.delete(z),Me.size===0&&x.delete(Me))}return!0}o(D,"OrdinaryDeleteMetadata")}o(ht,"CreateMetadataProvider");function o2(S){var x=S.defineMetadata,I=S.hasOwnMetadata,M=S.getOwnMetadata,J=S.getOwnMetadataKeys,Xe=S.deleteMetadata,st=new y,de={isProviderFor:o(function(D,L){var V=st.get(D);return!Y(V)&&V.has(L)?!0:J(D,L).length?(Y(V)&&(V=new h,st.set(D,V)),V.add(L),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:I,OrdinaryGetOwnMetadata:M,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:Xe};return de}o(o2,"CreateFallbackProvider");function Os(S,x,I){var M=g.getProvider(S,x);if(!Y(M))return M;if(I){if(g.setProvider(S,x,P))return P;throw new Error("Illegal state.")}}o(Os,"GetMetadataProvider");function s2(){var S={},x=[],I=function(){function de(D,L,V){this._index=0,this._keys=D,this._values=L,this._selector=V}return o(de,"MapIterator"),de.prototype["@@iterator"]=function(){return this},de.prototype[a]=function(){return this},de.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var L=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:L,done:!1}}return{value:void 0,done:!0}},de.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),D},de.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:D,done:!0}},de}(),M=function(){function de(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return o(de,"Map"),Object.defineProperty(de.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),de.prototype.has=function(D){return this._find(D,!1)>=0},de.prototype.get=function(D){var L=this._find(D,!1);return L>=0?this._values[L]:void 0},de.prototype.set=function(D,L){var V=this._find(D,!0);return this._values[V]=L,this},de.prototype.delete=function(D){var L=this._find(D,!1);if(L>=0){for(var V=this._keys.length,z=L+1;z<V;z++)this._keys[z-1]=this._keys[z],this._values[z-1]=this._values[z];return this._keys.length--,this._values.length--,_(D,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},de.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},de.prototype.keys=function(){return new I(this._keys,this._values,J)},de.prototype.values=function(){return new I(this._keys,this._values,Xe)},de.prototype.entries=function(){return new I(this._keys,this._values,st)},de.prototype["@@iterator"]=function(){return this.entries()},de.prototype[a]=function(){return this.entries()},de.prototype._find=function(D,L){if(!_(this._cacheKey,D)){this._cacheIndex=-1;for(var V=0;V<this._keys.length;V++)if(_(this._keys[V],D)){this._cacheIndex=V;break}}return this._cacheIndex<0&&L&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},de}();return M;function J(de,D){return de}function Xe(de,D){return D}function st(de,D){return[de,D]}}o(s2,"CreateMapPolyfill");function a2(){var S=function(){function x(){this._map=new d}return o(x,"Set"),Object.defineProperty(x.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),x.prototype.has=function(I){return this._map.has(I)},x.prototype.add=function(I){return this._map.set(I,I),this},x.prototype.delete=function(I){return this._map.delete(I)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return S}o(a2,"CreateSetPolyfill");function c2(){var S=16,x=p.create(),I=M();return function(){function D(){this._key=M()}return o(D,"WeakMap"),D.prototype.has=function(L){var V=J(L,!1);return V!==void 0?p.has(V,this._key):!1},D.prototype.get=function(L){var V=J(L,!1);return V!==void 0?p.get(V,this._key):void 0},D.prototype.set=function(L,V){var z=J(L,!0);return z[this._key]=V,this},D.prototype.delete=function(L){var V=J(L,!1);return V!==void 0?delete V[this._key]:!1},D.prototype.clear=function(){this._key=M()},D}();function M(){var D;do D="@@WeakMap@@"+de();while(p.has(x,D));return x[D]=!0,D}function J(D,L){if(!n.call(D,I)){if(!L)return;Object.defineProperty(D,I,{value:p.create()})}return D[I]}function Xe(D,L){for(var V=0;V<L;++V)D[V]=Math.random()*255|0;return D}function st(D){if(typeof Uint8Array=="function"){var L=new Uint8Array(D);return typeof crypto<"u"?crypto.getRandomValues(L):typeof msCrypto<"u"?msCrypto.getRandomValues(L):Xe(L,D),L}return Xe(new Array(D),D)}function de(){var D=st(S);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var L="",V=0;V<S;++V){var z=D[V];(V===4||V===6||V===8)&&(L+="-"),z<16&&(L+="0"),L+=z.toString(16).toLowerCase()}return L}}o(c2,"CreateWeakMapPolyfill");function Jl(S){return S.__=void 0,delete S.__,S}o(Jl,"MakeDictionary")})})(xb||(xb={}))});var Qt=v((Yt,Ib)=>{"use strict";var Vc=/^win/.test(process.platform),ow=/\//g,sw=/^(\w{2,}):\/\//i,Ab=Ib.exports,aw=/~1/g,cw=/~0/g,zf=[/\?/g,"%3F",/\#/g,"%23"],Zf=[/\%23/g,"#",/\%24/g,"$",/\%26/g,"&",/\%2C/g,",",/\%40/g,"@"];Yt.parse=require("url").parse;Yt.resolve=require("url").resolve;Yt.cwd=o(function(){if(process.browser)return location.href;let t=process.cwd(),r=t.slice(-1);return r==="/"||r==="\\"?t:t+"/"},"cwd");Yt.getProtocol=o(function(t){let r=sw.exec(t);if(r)return r[1].toLowerCase()},"getProtocol");Yt.getExtension=o(function(t){let r=t.lastIndexOf(".");return r>=0?t.substr(r).toLowerCase():""},"getExtension");Yt.getHash=o(function(t){let r=t.indexOf("#");return r>=0?t.substr(r):"#"},"getHash");Yt.stripHash=o(function(t){let r=t.indexOf("#");return r>=0&&(t=t.substr(0,r)),t},"stripHash");Yt.isHttp=o(function(t){let r=Ab.getProtocol(t);return r==="http"||r==="https"?!0:r===void 0?process.browser:!1},"isHttp");Yt.isFileSystemPath=o(function(t){if(process.browser)return!1;let r=Ab.getProtocol(t);return r===void 0||r==="file"},"isFileSystemPath");Yt.fromFileSystemPath=o(function(t){Vc&&(t=t.replace(/\\/g,"/")),t=encodeURI(t);for(let r=0;r<zf.length;r+=2)t=t.replace(zf[r],zf[r+1]);return t},"fromFileSystemPath");Yt.toFileSystemPath=o(function(t,r){t=decodeURI(t);for(let i=0;i<Zf.length;i+=2)t=t.replace(Zf[i],Zf[i+1]);let n=t.substr(0,7).toLowerCase()==="file://";return n&&(t=t[7]==="/"?t.substr(8):t.substr(7),Vc&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),r?t="file:///"+t:(n=!1,t=Vc?t:"/"+t)),Vc&&!n&&(t=t.replace(ow,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t},"toFileSystemPath");Yt.safePointerToPath=o(function(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(r=>decodeURIComponent(r).replace(aw,"/").replace(cw,"~"))},"safePointerToPath")});var Uc=v(qs=>{"use strict";var Cb=require("util"),uw=Qt();qs.format=Cb.format;qs.inherits=Cb.inherits;qs.swaggerParamRegExp=/\{([^/}]+)}/g;var lw=["get","post","put","delete","patch","options","head","trace"];function Wf(e,t){if(e.url&&e.url.startsWith("/")){let r=uw.parse(t),n=r.protocol+"//"+r.hostname+e.url;return e.url=n,e}}o(Wf,"fixServers");function fw(e,t){e.openapi&&t&&(t.startsWith("http:")||t.startsWith("https:"))&&(e.servers&&e.servers.map(r=>Wf(r,t)),["paths","webhooks"].forEach(r=>{Object.keys(e[r]||[]).forEach(n=>{let i=e[r][n];Object.keys(i).forEach(s=>{s==="servers"?i[s].map(a=>Wf(a,t)):lw.includes(s)&&i[s].servers&&i[s].servers.map(a=>Wf(a,t))})})}))}o(fw,"fixOasRelativeServers");qs.fixOasRelativeServers=fw});var Gc=v(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.getDeepKeys=Oo.toJSON=void 0;var pw=["function","symbol","undefined"],dw=["constructor","prototype","__proto__"],hw=Object.getPrototypeOf({});function mw(){let e={},t=this;for(let r of Tb(t))if(typeof r=="string"){let n=t[r],i=typeof n;pw.includes(i)||(e[r]=n)}return e}o(mw,"toJSON");Oo.toJSON=mw;function Tb(e,t=[]){let r=[];for(;e&&e!==hw;)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let i of t.concat(dw))n.delete(i);return n}o(Tb,"getDeepKeys");Oo.getDeepKeys=Tb});var Kf=v(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.addInspectMethod=Po.format=void 0;var Rb=require("util"),gw=Gc(),Nb=Rb.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Po.format=Rb.format;function yw(e){e[Nb]=bw}o(yw,"addInspectMethod");Po.addInspectMethod=yw;function bw(){let e={},t=this;for(let r of gw.getDeepKeys(t)){let n=t[r];e[r]=n}return delete e[Nb],e}o(bw,"inspect")});var kb=v(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.lazyJoinStacks=Ur.joinStacks=Ur.isWritableStack=Ur.isLazyStack=void 0;var vw=/\r?\n/,_w=/\bono[ @]/;function Sw(e){return!!(e&&e.configurable&&typeof e.get=="function")}o(Sw,"isLazyStack");Ur.isLazyStack=Sw;function Ew(e){return!!(!e||e.writable||typeof e.set=="function")}o(Ew,"isWritableStack");Ur.isWritableStack=Ew;function jb(e,t){let r=Mb(e.stack),n=t?t.stack:void 0;return r&&n?r+`
2
+ "use strict";var f2=Object.create;var sc=Object.defineProperty;var Xg=Object.getOwnPropertyDescriptor;var p2=Object.getOwnPropertyNames;var d2=Object.getPrototypeOf,h2=Object.prototype.hasOwnProperty;var o=(e,t)=>sc(e,"name",{value:t,configurable:!0});var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var m2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of p2(t))!h2.call(e,i)&&i!==r&&sc(e,i,{get:()=>t[i],enumerable:!(n=Xg(t,i))||n.enumerable});return e};var gt=(e,t,r)=>(r=e!=null?f2(d2(e)):{},m2(t||!e||!e.__esModule?sc(r,"default",{value:e,enumerable:!0}):r,e));var Se=(e,t,r,n)=>{for(var i=n>1?void 0:n?Xg(t,r):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&sc(t,r,i),i};var $b=v(()=>{var xb;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:c(),n=i(e);typeof r.Reflect<"u"&&(n=i(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function i(u,l){return function(p,f){Object.defineProperty(u,p,{configurable:!0,writable:!0,value:f}),l&&l(p,f)}}o(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}o(s,"functionThis");function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}o(a,"indirectEvalThis");function c(){return s()||a()}o(c,"sloppyModeThis")})(function(t,r){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",u={__proto__:[]}instanceof Array,l=!c&&!u,p={create:c?function(){return Jl(Object.create(null))}:u?function(){return Jl({__proto__:null})}:function(){return Jl({})},has:l?function(S,x){return n.call(S,x)}:function(S,x){return x in S},get:l?function(S,x){return n.call(S,x)?S[x]:void 0}:function(S,x){return S[x]}},f=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:s2(),h=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:a2(),y=typeof WeakMap=="function"?WeakMap:c2(),b=i?Symbol.for("@reflect-metadata:registry"):void 0,g=nt(),P=mt(g);function $(S,x,I,M){if(Y(I)){if(!Ve(S))throw new TypeError;if(!Lt(x))throw new TypeError;return R(S,x)}else{if(!Ve(S))throw new TypeError;if(!Ne(x))throw new TypeError;if(!Ne(M)&&!Y(M)&&!Dt(M))throw new TypeError;return Dt(M)&&(M=void 0),I=_e(I),q(S,x,I,M)}}o($,"decorate"),t("decorate",$);function C(S,x){function I(M,J){if(!Ne(M))throw new TypeError;if(!Y(J)&&!uo(J))throw new TypeError;We(S,x,M,J)}return o(I,"decorator"),I}o(C,"metadata"),t("metadata",C);function T(S,x,I,M){if(!Ne(I))throw new TypeError;return Y(M)||(M=_e(M)),We(S,x,I,M)}o(T,"defineMetadata"),t("defineMetadata",T);function A(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),Q(S,x,I)}o(A,"hasMetadata"),t("hasMetadata",A);function te(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),ue(S,x,I)}o(te,"hasOwnMetadata"),t("hasOwnMetadata",te);function X(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),ve(S,x,I)}o(X,"getMetadata"),t("getMetadata",X);function ze(S,x,I){if(!Ne(x))throw new TypeError;return Y(I)||(I=_e(I)),ge(S,x,I)}o(ze,"getOwnMetadata"),t("getOwnMetadata",ze);function $e(S,x){if(!Ne(S))throw new TypeError;return Y(x)||(x=_e(x)),Lr(S,x)}o($e,"getMetadataKeys"),t("getMetadataKeys",$e);function G(S,x){if(!Ne(S))throw new TypeError;return Y(x)||(x=_e(x)),Te(S,x)}o(G,"getOwnMetadataKeys"),t("getOwnMetadataKeys",G);function j(S,x,I){if(!Ne(x))throw new TypeError;if(Y(I)||(I=_e(I)),!Ne(x))throw new TypeError;Y(I)||(I=_e(I));var M=Os(x,I,!1);return Y(M)?!1:M.OrdinaryDeleteMetadata(S,x,I)}o(j,"deleteMetadata"),t("deleteMetadata",j);function R(S,x){for(var I=S.length-1;I>=0;--I){var M=S[I],J=M(x);if(!Y(J)&&!Dt(J)){if(!Lt(J))throw new TypeError;x=J}}return x}o(R,"DecorateConstructor");function q(S,x,I,M){for(var J=S.length-1;J>=0;--J){var Xe=S[J],st=Xe(x,I,M);if(!Y(st)&&!Dt(st)){if(!Ne(st))throw new TypeError;M=st}}return M}o(q,"DecorateProperty");function Q(S,x,I){var M=ue(S,x,I);if(M)return!0;var J=k(x);return Dt(J)?!1:Q(S,J,I)}o(Q,"OrdinaryHasMetadata");function ue(S,x,I){var M=Os(x,I,!1);return Y(M)?!1:je(M.OrdinaryHasOwnMetadata(S,x,I))}o(ue,"OrdinaryHasOwnMetadata");function ve(S,x,I){var M=ue(S,x,I);if(M)return ge(S,x,I);var J=k(x);if(!Dt(J))return ve(S,J,I)}o(ve,"OrdinaryGetMetadata");function ge(S,x,I){var M=Os(x,I,!1);if(!Y(M))return M.OrdinaryGetOwnMetadata(S,x,I)}o(ge,"OrdinaryGetOwnMetadata");function We(S,x,I,M){var J=Os(I,M,!0);J.OrdinaryDefineOwnMetadata(S,x,I,M)}o(We,"OrdinaryDefineOwnMetadata");function Lr(S,x){var I=Te(S,x),M=k(S);if(M===null)return I;var J=Lr(M,x);if(J.length<=0)return I;if(I.length<=0)return J;for(var Xe=new h,st=[],de=0,D=I;de<D.length;de++){var L=D[de],V=Xe.has(L);V||(Xe.add(L),st.push(L))}for(var z=0,me=J;z<me.length;z++){var L=me[z],V=Xe.has(L);V||(Xe.add(L),st.push(L))}return st}o(Lr,"OrdinaryMetadataKeys");function Te(S,x){var I=Os(S,x,!1);return I?I.OrdinaryOwnMetadataKeys(S,x):[]}o(Te,"OrdinaryOwnMetadataKeys");function nr(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}o(nr,"Type");function Y(S){return S===void 0}o(Y,"IsUndefined");function Dt(S){return S===null}o(Dt,"IsNull");function ne(S){return typeof S=="symbol"}o(ne,"IsSymbol");function Ne(S){return typeof S=="object"?S!==null:typeof S=="function"}o(Ne,"IsObject");function ee(S,x){switch(nr(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var I=x===3?"string":x===5?"number":"default",M=O(S,s);if(M!==void 0){var J=M.call(S,I);if(Ne(J))throw new TypeError;return J}return Re(S,I==="default"?"number":I)}o(ee,"ToPrimitive");function Re(S,x){if(x==="string"){var I=S.toString;if(ut(I)){var M=I.call(S);if(!Ne(M))return M}var J=S.valueOf;if(ut(J)){var M=J.call(S);if(!Ne(M))return M}}else{var J=S.valueOf;if(ut(J)){var M=J.call(S);if(!Ne(M))return M}var Xe=S.toString;if(ut(Xe)){var M=Xe.call(S);if(!Ne(M))return M}}throw new TypeError}o(Re,"OrdinaryToPrimitive");function je(S){return!!S}o(je,"ToBoolean");function pe(S){return""+S}o(pe,"ToString");function _e(S){var x=ee(S,3);return ne(x)?x:pe(x)}o(_e,"ToPropertyKey");function Ve(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}o(Ve,"IsArray");function ut(S){return typeof S=="function"}o(ut,"IsCallable");function Lt(S){return typeof S=="function"}o(Lt,"IsConstructor");function uo(S){switch(nr(S)){case 3:return!0;case 4:return!0;default:return!1}}o(uo,"IsPropertyKey");function _(S,x){return S===x||S!==S&&x!==x}o(_,"SameValueZero");function O(S,x){var I=S[x];if(I!=null){if(!ut(I))throw new TypeError;return I}}o(O,"GetMethod");function N(S){var x=O(S,a);if(!ut(x))throw new TypeError;var I=x.call(S);if(!Ne(I))throw new TypeError;return I}o(N,"GetIterator");function w(S){return S.value}o(w,"IteratorValue");function E(S){var x=S.next();return x.done?!1:x}o(E,"IteratorStep");function H(S){var x=S.return;x&&x.call(S)}o(H,"IteratorClose");function k(S){var x=Object.getPrototypeOf(S);if(typeof S!="function"||S===f||x!==f)return x;var I=S.prototype,M=I&&Object.getPrototypeOf(I);if(M==null||M===Object.prototype)return x;var J=M.constructor;return typeof J!="function"||J===S?x:J}o(k,"OrdinaryGetPrototypeOf");function Z(){var S;!Y(b)&&typeof r.Reflect<"u"&&!(b in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(S=o2(r.Reflect));var x,I,M,J=new y,Xe={registerProvider:st,getProvider:D,setProvider:V};return Xe;function st(z){if(!Object.isExtensible(Xe))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===z:break;case Y(x):x=z;break;case x===z:break;case Y(I):I=z;break;case I===z:break;default:M===void 0&&(M=new h),M.add(z);break}}function de(z,me){if(!Y(x)){if(x.isProviderFor(z,me))return x;if(!Y(I)){if(I.isProviderFor(z,me))return x;if(!Y(M))for(var Me=N(M);;){var et=E(Me);if(!et)return;var Sr=w(et);if(Sr.isProviderFor(z,me))return H(Me),Sr}}}if(!Y(S)&&S.isProviderFor(z,me))return S}function D(z,me){var Me=J.get(z),et;return Y(Me)||(et=Me.get(me)),Y(et)&&(et=de(z,me),Y(et)||(Y(Me)&&(Me=new d,J.set(z,Me)),Me.set(me,et))),et}function L(z){if(Y(z))throw new TypeError;return x===z||I===z||!Y(M)&&M.has(z)}function V(z,me,Me){if(!L(Me))throw new Error("Metadata provider not registered.");var et=D(z,me);if(et!==Me){if(!Y(et))return!1;var Sr=J.get(z);Y(Sr)&&(Sr=new d,J.set(z,Sr)),Sr.set(me,Me)}return!0}}o(Z,"CreateMetadataRegistry");function nt(){var S;return!Y(b)&&Ne(r.Reflect)&&Object.isExtensible(r.Reflect)&&(S=r.Reflect[b]),Y(S)&&(S=Z()),!Y(b)&&Ne(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,b,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}o(nt,"GetOrCreateMetadataRegistry");function mt(S){var x=new y,I={isProviderFor:o(function(L,V){var z=x.get(L);return Y(z)?!1:z.has(V)},"isProviderFor"),OrdinaryDefineOwnMetadata:st,OrdinaryHasOwnMetadata:J,OrdinaryGetOwnMetadata:Xe,OrdinaryOwnMetadataKeys:de,OrdinaryDeleteMetadata:D};return g.registerProvider(I),I;function M(L,V,z){var me=x.get(L),Me=!1;if(Y(me)){if(!z)return;me=new d,x.set(L,me),Me=!0}var et=me.get(V);if(Y(et)){if(!z)return;if(et=new d,me.set(V,et),!S.setProvider(L,V,I))throw me.delete(V),Me&&x.delete(L),new Error("Wrong provider for target.")}return et}o(M,"GetOrCreateMetadataMap");function J(L,V,z){var me=M(V,z,!1);return Y(me)?!1:je(me.has(L))}o(J,"OrdinaryHasOwnMetadata");function Xe(L,V,z){var me=M(V,z,!1);if(!Y(me))return me.get(L)}o(Xe,"OrdinaryGetOwnMetadata");function st(L,V,z,me){var Me=M(z,me,!0);Me.set(L,V)}o(st,"OrdinaryDefineOwnMetadata");function de(L,V){var z=[],me=M(L,V,!1);if(Y(me))return z;for(var Me=me.keys(),et=N(Me),Sr=0;;){var Jg=E(et);if(!Jg)return z.length=Sr,z;var u2=w(Jg);try{z[Sr]=u2}catch(l2){try{H(et)}finally{throw l2}}Sr++}}o(de,"OrdinaryOwnMetadataKeys");function D(L,V,z){var me=M(V,z,!1);if(Y(me)||!me.delete(L))return!1;if(me.size===0){var Me=x.get(V);Y(Me)||(Me.delete(z),Me.size===0&&x.delete(Me))}return!0}o(D,"OrdinaryDeleteMetadata")}o(mt,"CreateMetadataProvider");function o2(S){var x=S.defineMetadata,I=S.hasOwnMetadata,M=S.getOwnMetadata,J=S.getOwnMetadataKeys,Xe=S.deleteMetadata,st=new y,de={isProviderFor:o(function(D,L){var V=st.get(D);return!Y(V)&&V.has(L)?!0:J(D,L).length?(Y(V)&&(V=new h,st.set(D,V)),V.add(L),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:I,OrdinaryGetOwnMetadata:M,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:Xe};return de}o(o2,"CreateFallbackProvider");function Os(S,x,I){var M=g.getProvider(S,x);if(!Y(M))return M;if(I){if(g.setProvider(S,x,P))return P;throw new Error("Illegal state.")}}o(Os,"GetMetadataProvider");function s2(){var S={},x=[],I=function(){function de(D,L,V){this._index=0,this._keys=D,this._values=L,this._selector=V}return o(de,"MapIterator"),de.prototype["@@iterator"]=function(){return this},de.prototype[a]=function(){return this},de.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var L=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:L,done:!1}}return{value:void 0,done:!0}},de.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),D},de.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:D,done:!0}},de}(),M=function(){function de(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return o(de,"Map"),Object.defineProperty(de.prototype,"size",{get:o(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),de.prototype.has=function(D){return this._find(D,!1)>=0},de.prototype.get=function(D){var L=this._find(D,!1);return L>=0?this._values[L]:void 0},de.prototype.set=function(D,L){var V=this._find(D,!0);return this._values[V]=L,this},de.prototype.delete=function(D){var L=this._find(D,!1);if(L>=0){for(var V=this._keys.length,z=L+1;z<V;z++)this._keys[z-1]=this._keys[z],this._values[z-1]=this._values[z];return this._keys.length--,this._values.length--,_(D,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},de.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},de.prototype.keys=function(){return new I(this._keys,this._values,J)},de.prototype.values=function(){return new I(this._keys,this._values,Xe)},de.prototype.entries=function(){return new I(this._keys,this._values,st)},de.prototype["@@iterator"]=function(){return this.entries()},de.prototype[a]=function(){return this.entries()},de.prototype._find=function(D,L){if(!_(this._cacheKey,D)){this._cacheIndex=-1;for(var V=0;V<this._keys.length;V++)if(_(this._keys[V],D)){this._cacheIndex=V;break}}return this._cacheIndex<0&&L&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},de}();return M;function J(de,D){return de}function Xe(de,D){return D}function st(de,D){return[de,D]}}o(s2,"CreateMapPolyfill");function a2(){var S=function(){function x(){this._map=new d}return o(x,"Set"),Object.defineProperty(x.prototype,"size",{get:o(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),x.prototype.has=function(I){return this._map.has(I)},x.prototype.add=function(I){return this._map.set(I,I),this},x.prototype.delete=function(I){return this._map.delete(I)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return S}o(a2,"CreateSetPolyfill");function c2(){var S=16,x=p.create(),I=M();return function(){function D(){this._key=M()}return o(D,"WeakMap"),D.prototype.has=function(L){var V=J(L,!1);return V!==void 0?p.has(V,this._key):!1},D.prototype.get=function(L){var V=J(L,!1);return V!==void 0?p.get(V,this._key):void 0},D.prototype.set=function(L,V){var z=J(L,!0);return z[this._key]=V,this},D.prototype.delete=function(L){var V=J(L,!1);return V!==void 0?delete V[this._key]:!1},D.prototype.clear=function(){this._key=M()},D}();function M(){var D;do D="@@WeakMap@@"+de();while(p.has(x,D));return x[D]=!0,D}function J(D,L){if(!n.call(D,I)){if(!L)return;Object.defineProperty(D,I,{value:p.create()})}return D[I]}function Xe(D,L){for(var V=0;V<L;++V)D[V]=Math.random()*255|0;return D}function st(D){if(typeof Uint8Array=="function"){var L=new Uint8Array(D);return typeof crypto<"u"?crypto.getRandomValues(L):typeof msCrypto<"u"?msCrypto.getRandomValues(L):Xe(L,D),L}return Xe(new Array(D),D)}function de(){var D=st(S);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var L="",V=0;V<S;++V){var z=D[V];(V===4||V===6||V===8)&&(L+="-"),z<16&&(L+="0"),L+=z.toString(16).toLowerCase()}return L}}o(c2,"CreateWeakMapPolyfill");function Jl(S){return S.__=void 0,delete S.__,S}o(Jl,"MakeDictionary")})})(xb||(xb={}))});var Qt=v((Yt,Ib)=>{"use strict";var Vc=/^win/.test(process.platform),ow=/\//g,sw=/^(\w{2,}):\/\//i,Ab=Ib.exports,aw=/~1/g,cw=/~0/g,zf=[/\?/g,"%3F",/\#/g,"%23"],Zf=[/\%23/g,"#",/\%24/g,"$",/\%26/g,"&",/\%2C/g,",",/\%40/g,"@"];Yt.parse=require("url").parse;Yt.resolve=require("url").resolve;Yt.cwd=o(function(){if(process.browser)return location.href;let t=process.cwd(),r=t.slice(-1);return r==="/"||r==="\\"?t:t+"/"},"cwd");Yt.getProtocol=o(function(t){let r=sw.exec(t);if(r)return r[1].toLowerCase()},"getProtocol");Yt.getExtension=o(function(t){let r=t.lastIndexOf(".");return r>=0?t.substr(r).toLowerCase():""},"getExtension");Yt.getHash=o(function(t){let r=t.indexOf("#");return r>=0?t.substr(r):"#"},"getHash");Yt.stripHash=o(function(t){let r=t.indexOf("#");return r>=0&&(t=t.substr(0,r)),t},"stripHash");Yt.isHttp=o(function(t){let r=Ab.getProtocol(t);return r==="http"||r==="https"?!0:r===void 0?process.browser:!1},"isHttp");Yt.isFileSystemPath=o(function(t){if(process.browser)return!1;let r=Ab.getProtocol(t);return r===void 0||r==="file"},"isFileSystemPath");Yt.fromFileSystemPath=o(function(t){Vc&&(t=t.replace(/\\/g,"/")),t=encodeURI(t);for(let r=0;r<zf.length;r+=2)t=t.replace(zf[r],zf[r+1]);return t},"fromFileSystemPath");Yt.toFileSystemPath=o(function(t,r){t=decodeURI(t);for(let i=0;i<Zf.length;i+=2)t=t.replace(Zf[i],Zf[i+1]);let n=t.substr(0,7).toLowerCase()==="file://";return n&&(t=t[7]==="/"?t.substr(8):t.substr(7),Vc&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),r?t="file:///"+t:(n=!1,t=Vc?t:"/"+t)),Vc&&!n&&(t=t.replace(ow,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t},"toFileSystemPath");Yt.safePointerToPath=o(function(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(r=>decodeURIComponent(r).replace(aw,"/").replace(cw,"~"))},"safePointerToPath")});var Uc=v(qs=>{"use strict";var Cb=require("util"),uw=Qt();qs.format=Cb.format;qs.inherits=Cb.inherits;qs.swaggerParamRegExp=/\{([^/}]+)}/g;var lw=["get","post","put","delete","patch","options","head","trace"];function Wf(e,t){if(e.url&&e.url.startsWith("/")){let r=uw.parse(t),n=r.protocol+"//"+r.hostname+e.url;return e.url=n,e}}o(Wf,"fixServers");function fw(e,t){e.openapi&&t&&(t.startsWith("http:")||t.startsWith("https:"))&&(e.servers&&e.servers.map(r=>Wf(r,t)),["paths","webhooks"].forEach(r=>{Object.keys(e[r]||[]).forEach(n=>{let i=e[r][n];Object.keys(i).forEach(s=>{s==="servers"?i[s].map(a=>Wf(a,t)):lw.includes(s)&&i[s].servers&&i[s].servers.map(a=>Wf(a,t))})})}))}o(fw,"fixOasRelativeServers");qs.fixOasRelativeServers=fw});var Gc=v(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.getDeepKeys=Oo.toJSON=void 0;var pw=["function","symbol","undefined"],dw=["constructor","prototype","__proto__"],hw=Object.getPrototypeOf({});function mw(){let e={},t=this;for(let r of Tb(t))if(typeof r=="string"){let n=t[r],i=typeof n;pw.includes(i)||(e[r]=n)}return e}o(mw,"toJSON");Oo.toJSON=mw;function Tb(e,t=[]){let r=[];for(;e&&e!==hw;)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let i of t.concat(dw))n.delete(i);return n}o(Tb,"getDeepKeys");Oo.getDeepKeys=Tb});var Kf=v(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.addInspectMethod=Po.format=void 0;var Rb=require("util"),gw=Gc(),Nb=Rb.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Po.format=Rb.format;function yw(e){e[Nb]=bw}o(yw,"addInspectMethod");Po.addInspectMethod=yw;function bw(){let e={},t=this;for(let r of gw.getDeepKeys(t)){let n=t[r];e[r]=n}return delete e[Nb],e}o(bw,"inspect")});var kb=v(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.lazyJoinStacks=Ur.joinStacks=Ur.isWritableStack=Ur.isLazyStack=void 0;var vw=/\r?\n/,_w=/\bono[ @]/;function Sw(e){return!!(e&&e.configurable&&typeof e.get=="function")}o(Sw,"isLazyStack");Ur.isLazyStack=Sw;function Ew(e){return!!(!e||e.writable||typeof e.set=="function")}o(Ew,"isWritableStack");Ur.isWritableStack=Ew;function jb(e,t){let r=Mb(e.stack),n=t?t.stack:void 0;return r&&n?r+`
3
3
 
4
4
  `+n:r||n}o(jb,"joinStacks");Ur.joinStacks=jb;function Ow(e,t,r){r?Object.defineProperty(t,"stack",{get:o(()=>{let n=e.get.apply(t);return jb({stack:n},r)},"get"),enumerable:!1,configurable:!0}):Pw(t,e)}o(Ow,"lazyJoinStacks");Ur.lazyJoinStacks=Ow;function Mb(e){if(e){let t=e.split(vw),r;for(let n=0;n<t.length;n++){let i=t[n];if(_w.test(i))r===void 0&&(r=n);else if(r!==void 0){t.splice(r,n-r);break}}if(t.length>0)return t.join(`
5
5
  `)}return e}o(Mb,"popStack");function Pw(e,t){Object.defineProperty(e,"stack",{get:o(()=>Mb(t.get.apply(e)),"get"),enumerable:!1,configurable:!0})}o(Pw,"lazyPopStack")});var Lb=v(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.extendError=void 0;var qb=Kf(),zc=kb(),Db=Gc(),xw=["name","message","stack"];function $w(e,t,r){let n=e;return ww(n,t),t&&typeof t=="object"&&Aw(n,t),n.toJSON=Db.toJSON,qb.addInspectMethod&&qb.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}o($w,"extendError");Zc.extendError=$w;function ww(e,t){let r=Object.getOwnPropertyDescriptor(e,"stack");zc.isLazyStack(r)?zc.lazyJoinStacks(r,e,t):zc.isWritableStack(r)&&(e.stack=zc.joinStacks(e,t))}o(ww,"extendStack");function Aw(e,t){let r=Db.getDeepKeys(t,xw),n=e,i=t;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}o(Aw,"mergeErrors")});var Fb=v(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.normalizeArgs=xo.normalizeOptions=void 0;var Iw=Kf();function Cw(e){return e=e||{},{concatMessages:e.concatMessages===void 0?!0:!!e.concatMessages,format:e.format===void 0?Iw.format:typeof e.format=="function"?e.format:!1}}o(Cw,"normalizeOptions");xo.normalizeOptions=Cw;function Tw(e,t){let r,n,i,s="";return typeof e[0]=="string"?i=e:typeof e[1]=="string"?(e[0]instanceof Error?r=e[0]:n=e[0],i=e.slice(1)):(r=e[0],n=e[1],i=e.slice(2)),i.length>0&&(t.format?s=t.format.apply(void 0,i):s=i.join(" ")),t.concatMessages&&r&&r.message&&(s+=(s?`
@@ -7,7 +7,7 @@
7
7
  `:""},this._extScope=t,this._scope=new wr.Scope({parent:t}),this._nodes=[new gp]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new lp(t,s,n)),s}const(t,r,n){return this._def(wr.varKinds.const,t,r,n)}let(t,r,n){return this._def(wr.varKinds.let,t,r,n)}var(t,r,n){return this._def(wr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new eu(t,r,n))}add(t,r){return this._leafNode(new fp(t,le.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ye.nil&&this._leafNode(new mp(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,ye.addCodeArg)(r,i));return r.push("}"),new ye._Code(r)}if(t,r,n){if(this._blockNode(new Ai(t)),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(t){return this._elseNode(new Ai(t))}else(){return this._elseNode(new Ao)}endIf(){return this._endBlockNode(Ai,Ao)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new yp(t),r)}forRange(t,r,n,i,s=this.opts.es5?wr.varKinds.var:wr.varKinds.let){let a=this._scope.toName(t);return this._for(new bp(s,a,r,n),()=>i(a))}forOf(t,r,n,i=wr.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let a=r instanceof ye.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ye._)`${a}.length`,c=>{this.var(s,(0,ye._)`${a}[${c}]`),n(s)})}return this._for(new tu("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?wr.varKinds.var:wr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ye._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new tu("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Ii)}label(t){return this._leafNode(new pp(t))}break(t){return this._leafNode(new dp(t))}return(t){let r=new Vs;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Vs)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new vp;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Us(s),r(s)}return n&&(this._currNode=i.finally=new Gs,this.code(n)),this._endBlockNode(Us,Gs)}throw(t){return this._leafNode(new hp(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){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||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ye.nil,n,i){return this._blockNode(new Bs(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Bs)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Ai))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(Vp,"CodeGen");var _p=Vp;le.CodeGen=_p;function Ci(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(Ci,"addNames");function ru(e,t){return t instanceof ye._CodeOrName?Ci(e,t.names):e}o(ru,"addExprNames");function Io(e,t,r){if(e instanceof ye.Name)return n(e);if(!i(e))return e;return new ye._Code(e._items.reduce((s,a)=>(a instanceof ye.Name&&(a=n(a)),a instanceof ye._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||t[s.str]!==1?s:(delete t[s.str],a)}function i(s){return s instanceof ye._Code&&s._items.some(a=>a instanceof ye.Name&&t[a.str]===1&&r[a.str]!==void 0)}}o(Io,"optimizeExpr");function Ww(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(Ww,"subtractNames");function Wb(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ye._)`!${Sp(e)}`}o(Wb,"not");le.not=Wb;var Kw=Kb(le.operators.AND);function Yw(...e){return e.reduce(Kw)}o(Yw,"and");le.and=Yw;var Qw=Kb(le.operators.OR);function Jw(...e){return e.reduce(Qw)}o(Jw,"or");le.or=Jw;function Kb(e){return(t,r)=>t===ye.nil?r:r===ye.nil?t:(0,ye._)`${Sp(t)} ${e} ${Sp(r)}`}o(Kb,"mappend");function Sp(e){return e instanceof ye.Name?e:(0,ye._)`(${e})`}o(Sp,"par")});var he=v(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.checkStrictMode=fe.getErrorPath=fe.Type=fe.useFunc=fe.setEvaluated=fe.evaluatedPropsToName=fe.mergeEvaluated=fe.eachItem=fe.unescapeJsonPointer=fe.escapeJsonPointer=fe.escapeFragment=fe.unescapeFragment=fe.schemaRefOrVal=fe.schemaHasRulesButRef=fe.schemaHasRules=fe.checkUnknownRules=fe.alwaysValidSchema=fe.toHash=void 0;var Ie=ae(),Xw=Fs();function eA(e){let t={};for(let r of e)t[r]=!0;return t}o(eA,"toHash");fe.toHash=eA;function tA(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Jb(e,t),!Xb(t,e.self.RULES.all))}o(tA,"alwaysValidSchema");fe.alwaysValidSchema=tA;function Jb(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||r0(e,`unknown keyword: "${s}"`)}o(Jb,"checkUnknownRules");fe.checkUnknownRules=Jb;function Xb(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(Xb,"schemaHasRules");fe.schemaHasRules=Xb;function rA(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(rA,"schemaHasRulesButRef");fe.schemaHasRulesButRef=rA;function nA({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ie._)`${r}`}return(0,Ie._)`${e}${t}${(0,Ie.getProperty)(n)}`}o(nA,"schemaRefOrVal");fe.schemaRefOrVal=nA;function iA(e){return e0(decodeURIComponent(e))}o(iA,"unescapeFragment");fe.unescapeFragment=iA;function oA(e){return encodeURIComponent(Gp(e))}o(oA,"escapeFragment");fe.escapeFragment=oA;function Gp(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Gp,"escapeJsonPointer");fe.escapeJsonPointer=Gp;function e0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(e0,"unescapeJsonPointer");fe.unescapeJsonPointer=e0;function sA(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(sA,"eachItem");fe.eachItem=sA;function Yb({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,a,c)=>{let u=a===void 0?s:a instanceof Ie.Name?(s instanceof Ie.Name?e(i,s,a):t(i,s,a),a):s instanceof Ie.Name?(t(i,a,s),s):r(s,a);return c===Ie.Name&&!(u instanceof Ie.Name)?n(i,u):u}}o(Yb,"makeMergeEvaluated");fe.mergeEvaluated={props:Yb({mergeNames:o((e,t,r)=>e.if((0,Ie._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Ie._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Ie._)`${r} || {}`).code((0,Ie._)`Object.assign(${r}, ${t})`))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Ie._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Ie._)`${r} || {}`),zp(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:t0}),items:Yb({mergeNames:o((e,t,r)=>e.if((0,Ie._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Ie._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Ie._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Ie._)`${r} > ${t} ? ${r} : ${t}`)),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};function t0(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Ie._)`{}`);return t!==void 0&&zp(e,r,t),r}o(t0,"evaluatedPropsToName");fe.evaluatedPropsToName=t0;function zp(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Ie._)`${t}${(0,Ie.getProperty)(n)}`,!0))}o(zp,"setEvaluated");fe.setEvaluated=zp;var Qb={};function aA(e,t){return e.scopeValue("func",{ref:t,code:Qb[t.code]||(Qb[t.code]=new Xw._Code(t.code))})}o(aA,"useFunc");fe.useFunc=aA;var Up;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Up||(fe.Type=Up={}));function cA(e,t,r){if(e instanceof Ie.Name){let n=t===Up.Num;return r?n?(0,Ie._)`"[" + ${e} + "]"`:(0,Ie._)`"['" + ${e} + "']"`:n?(0,Ie._)`"/" + ${e}`:(0,Ie._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ie.getProperty)(e).toString():"/"+Gp(e)}o(cA,"getErrorPath");fe.getErrorPath=cA;function r0(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}o(r0,"checkStrictMode");fe.checkStrictMode=r0});var dr=v(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var St=ae(),uA={data:new St.Name("data"),valCxt:new St.Name("valCxt"),instancePath:new St.Name("instancePath"),parentData:new St.Name("parentData"),parentDataProperty:new St.Name("parentDataProperty"),rootData:new St.Name("rootData"),dynamicAnchors:new St.Name("dynamicAnchors"),vErrors:new St.Name("vErrors"),errors:new St.Name("errors"),this:new St.Name("this"),self:new St.Name("self"),scope:new St.Name("scope"),json:new St.Name("json"),jsonPos:new St.Name("jsonPos"),jsonLen:new St.Name("jsonLen"),jsonPart:new St.Name("jsonPart")};Zp.default=uA});var zs=v(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.extendErrors=Et.resetErrorsCount=Et.reportExtraError=Et.reportError=Et.keyword$DataError=Et.keywordError=void 0;var be=ae(),iu=he(),Ct=dr();Et.keywordError={message:o(({keyword:e})=>(0,be.str)`must pass "${e}" keyword validation`,"message")};Et.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,be.str)`"${e}" keyword must be ${t} ($data)`:(0,be.str)`"${e}" keyword is invalid ($data)`,"message")};function lA(e,t=Et.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:a,allErrors:c}=i,u=o0(e,t,r);n??(a||c)?n0(s,u):i0(i,(0,be._)`[${u}]`)}o(lA,"reportError");Et.reportError=lA;function fA(e,t=Et.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:a}=n,c=o0(e,t,r);n0(i,c),s||a||i0(n,Ct.default.vErrors)}o(fA,"reportExtraError");Et.reportExtraError=fA;function pA(e,t){e.assign(Ct.default.errors,t),e.if((0,be._)`${Ct.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,be._)`${Ct.default.vErrors}.length`,t),()=>e.assign(Ct.default.vErrors,null)))}o(pA,"resetErrorsCount");Et.resetErrorsCount=pA;function dA({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",i,Ct.default.errors,c=>{e.const(a,(0,be._)`${Ct.default.vErrors}[${c}]`),e.if((0,be._)`${a}.instancePath === undefined`,()=>e.assign((0,be._)`${a}.instancePath`,(0,be.strConcat)(Ct.default.instancePath,s.errorPath))),e.assign((0,be._)`${a}.schemaPath`,(0,be.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,be._)`${a}.schema`,r),e.assign((0,be._)`${a}.data`,n))})}o(dA,"extendErrors");Et.extendErrors=dA;function n0(e,t){let r=e.const("err",t);e.if((0,be._)`${Ct.default.vErrors} === null`,()=>e.assign(Ct.default.vErrors,(0,be._)`[${r}]`),(0,be._)`${Ct.default.vErrors}.push(${r})`),e.code((0,be._)`${Ct.default.errors}++`)}o(n0,"addError");function i0(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,be._)`new ${e.ValidationError}(${t})`):(r.assign((0,be._)`${n}.errors`,t),r.return(!1))}o(i0,"returnErrors");var Ti={keyword:new be.Name("keyword"),schemaPath:new be.Name("schemaPath"),params:new be.Name("params"),propertyName:new be.Name("propertyName"),message:new be.Name("message"),schema:new be.Name("schema"),parentSchema:new be.Name("parentSchema")};function o0(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,be._)`{}`:hA(e,t,r)}o(o0,"errorObjectCode");function hA(e,t,r={}){let{gen:n,it:i}=e,s=[mA(i,r),gA(e,r)];return yA(e,t,s),n.object(...s)}o(hA,"errorObject");function mA({errorPath:e},{instancePath:t}){let r=t?(0,be.str)`${e}${(0,iu.getErrorPath)(t,iu.Type.Str)}`:e;return[Ct.default.instancePath,(0,be.strConcat)(Ct.default.instancePath,r)]}o(mA,"errorInstancePath");function gA({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,be.str)`${t}/${e}`;return r&&(i=(0,be.str)`${i}${(0,iu.getErrorPath)(r,iu.Type.Str)}`),[Ti.schemaPath,i]}o(gA,"errorSchemaPath");function yA(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:a,it:c}=e,{opts:u,propertyName:l,topSchemaRef:p,schemaPath:f}=c;n.push([Ti.keyword,i],[Ti.params,typeof t=="function"?t(e):t||(0,be._)`{}`]),u.messages&&n.push([Ti.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([Ti.schema,a],[Ti.parentSchema,(0,be._)`${p}${f}`],[Ct.default.data,s]),l&&n.push([Ti.propertyName,l])}o(yA,"extraErrorProps")});var a0=v(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.boolOrEmptySchema=Co.topBoolOrEmptySchema=void 0;var bA=zs(),vA=ae(),_A=dr(),SA={message:"boolean schema is false"};function EA(e){let{gen:t,schema:r,validateName:n}=e;r===!1?s0(e,!1):typeof r=="object"&&r.$async===!0?t.return(_A.default.data):(t.assign((0,vA._)`${n}.errors`,null),t.return(!0))}o(EA,"topBoolOrEmptySchema");Co.topBoolOrEmptySchema=EA;function OA(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),s0(e)):r.var(t,!0)}o(OA,"boolOrEmptySchema");Co.boolOrEmptySchema=OA;function s0(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,bA.reportError)(i,SA,void 0,t)}o(s0,"falseSchemaError")});var Wp=v(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.getRules=To.isJSONType=void 0;var PA=["string","number","integer","boolean","null","object","array"],xA=new Set(PA);function $A(e){return typeof e=="string"&&xA.has(e)}o($A,"isJSONType");To.isJSONType=$A;function wA(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(wA,"getRules");To.getRules=wA});var Kp=v(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.shouldUseRule=jn.shouldUseGroup=jn.schemaHasRulesForType=void 0;function AA({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&c0(e,n)}o(AA,"schemaHasRulesForType");jn.schemaHasRulesForType=AA;function c0(e,t){return t.rules.some(r=>u0(e,r))}o(c0,"shouldUseGroup");jn.shouldUseGroup=c0;function u0(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(u0,"shouldUseRule");jn.shouldUseRule=u0});var Zs=v(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.reportTypeError=Ot.checkDataTypes=Ot.checkDataType=Ot.coerceAndCheckDataType=Ot.getJSONTypes=Ot.getSchemaTypes=Ot.DataType=void 0;var IA=Wp(),CA=Kp(),TA=zs(),ce=ae(),l0=he(),Ro;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ro||(Ot.DataType=Ro={}));function RA(e){let t=f0(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(RA,"getSchemaTypes");Ot.getSchemaTypes=RA;function f0(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(IA.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(f0,"getJSONTypes");Ot.getJSONTypes=f0;function NA(e,t){let{gen:r,data:n,opts:i}=e,s=jA(t,i.coerceTypes),a=t.length>0&&!(s.length===0&&t.length===1&&(0,CA.schemaHasRulesForType)(e,t[0]));if(a){let c=Qp(t,n,i.strictNumbers,Ro.Wrong);r.if(c,()=>{s.length?MA(e,t,s):Jp(e)})}return a}o(NA,"coerceAndCheckDataType");Ot.coerceAndCheckDataType=NA;var p0=new Set(["string","number","integer","boolean","null"]);function jA(e,t){return t?e.filter(r=>p0.has(r)||t==="array"&&r==="array"):[]}o(jA,"coerceToTypes");function MA(e,t,r){let{gen:n,data:i,opts:s}=e,a=n.let("dataType",(0,ce._)`typeof ${i}`),c=n.let("coerced",(0,ce._)`undefined`);s.coerceTypes==="array"&&n.if((0,ce._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,ce._)`${i}[0]`).assign(a,(0,ce._)`typeof ${i}`).if(Qp(t,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,ce._)`${c} !== undefined`);for(let l of r)(p0.has(l)||l==="array"&&s.coerceTypes==="array")&&u(l);n.else(),Jp(e),n.endIf(),n.if((0,ce._)`${c} !== undefined`,()=>{n.assign(i,c),kA(e,c)});function u(l){switch(l){case"string":n.elseIf((0,ce._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,ce._)`"" + ${i}`).elseIf((0,ce._)`${i} === null`).assign(c,(0,ce._)`""`);return;case"number":n.elseIf((0,ce._)`${a} == "boolean" || ${i} === null
8
8
  || (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,ce._)`+${i}`);return;case"integer":n.elseIf((0,ce._)`${a} === "boolean" || ${i} === null
9
9
  || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,ce._)`+${i}`);return;case"boolean":n.elseIf((0,ce._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,ce._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":n.elseIf((0,ce._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(c,null);return;case"array":n.elseIf((0,ce._)`${a} === "string" || ${a} === "number"
10
- || ${a} === "boolean" || ${i} === null`).assign(c,(0,ce._)`[${i}]`)}}o(u,"coerceSpecificType")}o(MA,"coerceData");function kA({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,ce._)`${t} !== undefined`,()=>e.assign((0,ce._)`${t}[${r}]`,n))}o(kA,"assignParentData");function Yp(e,t,r,n=Ro.Correct){let i=n===Ro.Correct?ce.operators.EQ:ce.operators.NEQ,s;switch(e){case"null":return(0,ce._)`${t} ${i} null`;case"array":s=(0,ce._)`Array.isArray(${t})`;break;case"object":s=(0,ce._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a((0,ce._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return(0,ce._)`typeof ${t} ${i} ${e}`}return n===Ro.Correct?s:(0,ce.not)(s);function a(c=ce.nil){return(0,ce.and)((0,ce._)`typeof ${t} == "number"`,c,r?(0,ce._)`isFinite(${t})`:ce.nil)}}o(Yp,"checkDataType");Ot.checkDataType=Yp;function Qp(e,t,r,n){if(e.length===1)return Yp(e[0],t,r,n);let i,s=(0,l0.toHash)(e);if(s.array&&s.object){let a=(0,ce._)`typeof ${t} != "object"`;i=s.null?a:(0,ce._)`!${t} || ${a}`,delete s.null,delete s.array,delete s.object}else i=ce.nil;s.number&&delete s.integer;for(let a in s)i=(0,ce.and)(i,Yp(a,t,r,n));return i}o(Qp,"checkDataTypes");Ot.checkDataTypes=Qp;var qA={message:o(({schema:e})=>`must be ${e}`,"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,ce._)`{type: ${e}}`:(0,ce._)`{type: ${t}}`,"params")};function Jp(e){let t=DA(e);(0,TA.reportError)(t,qA)}o(Jp,"reportTypeError");Ot.reportTypeError=Jp;function DA(e){let{gen:t,data:r,schema:n}=e,i=(0,l0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(DA,"getTypeErrorContext")});var h0=v(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.assignDefaults=void 0;var No=ae(),LA=he();function FA(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)d0(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>d0(e,s,i.default))}o(FA,"assignDefaults");ou.assignDefaults=FA;function d0(e,t,r){let{gen:n,compositeRule:i,data:s,opts:a}=e;if(r===void 0)return;let c=(0,No._)`${s}${(0,No.getProperty)(t)}`;if(i){(0,LA.checkStrictMode)(e,`default is ignored for: ${c}`);return}let u=(0,No._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,No._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,No._)`${c} = ${(0,No.stringify)(r)}`)}o(d0,"assignDefault")});var hr=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.validateUnion=Ae.validateArray=Ae.usePattern=Ae.callValidateCode=Ae.schemaProperties=Ae.allSchemaProperties=Ae.noPropertyInData=Ae.propertyInData=Ae.isOwnProperty=Ae.hasPropFunc=Ae.reportMissingProp=Ae.checkMissingProp=Ae.checkReportMissingProp=void 0;var De=ae(),Xp=he(),Mn=dr(),HA=he();function BA(e,t){let{gen:r,data:n,it:i}=e;r.if(td(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,De._)`${t}`},!0),e.error()})}o(BA,"checkReportMissingProp");Ae.checkReportMissingProp=BA;function VA({gen:e,data:t,it:{opts:r}},n,i){return(0,De.or)(...n.map(s=>(0,De.and)(td(e,t,s,r.ownProperties),(0,De._)`${i} = ${s}`)))}o(VA,"checkMissingProp");Ae.checkMissingProp=VA;function UA(e,t){e.setParams({missingProperty:t},!0),e.error()}o(UA,"reportMissingProp");Ae.reportMissingProp=UA;function m0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,De._)`Object.prototype.hasOwnProperty`})}o(m0,"hasPropFunc");Ae.hasPropFunc=m0;function ed(e,t,r){return(0,De._)`${m0(e)}.call(${t}, ${r})`}o(ed,"isOwnProperty");Ae.isOwnProperty=ed;function GA(e,t,r,n){let i=(0,De._)`${t}${(0,De.getProperty)(r)} !== undefined`;return n?(0,De._)`${i} && ${ed(e,t,r)}`:i}o(GA,"propertyInData");Ae.propertyInData=GA;function td(e,t,r,n){let i=(0,De._)`${t}${(0,De.getProperty)(r)} === undefined`;return n?(0,De.or)(i,(0,De.not)(ed(e,t,r))):i}o(td,"noPropertyInData");Ae.noPropertyInData=td;function g0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(g0,"allSchemaProperties");Ae.allSchemaProperties=g0;function zA(e,t){return g0(t).filter(r=>!(0,Xp.alwaysValidSchema)(e,t[r]))}o(zA,"schemaProperties");Ae.schemaProperties=zA;function ZA({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},c,u,l){let p=l?(0,De._)`${e}, ${t}, ${n}${i}`:t,f=[[Mn.default.instancePath,(0,De.strConcat)(Mn.default.instancePath,s)],[Mn.default.parentData,a.parentData],[Mn.default.parentDataProperty,a.parentDataProperty],[Mn.default.rootData,Mn.default.rootData]];a.opts.dynamicRef&&f.push([Mn.default.dynamicAnchors,Mn.default.dynamicAnchors]);let d=(0,De._)`${p}, ${r.object(...f)}`;return u!==De.nil?(0,De._)`${c}.call(${u}, ${d})`:(0,De._)`${c}(${d})`}o(ZA,"callValidateCode");Ae.callValidateCode=ZA;var WA=(0,De._)`new RegExp`;function KA({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,De._)`${i.code==="new RegExp"?WA:(0,HA.useFunc)(e,i)}(${r}, ${n})`})}o(KA,"usePattern");Ae.usePattern=KA;function YA(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return a(()=>t.assign(c,!1)),c}return t.var(s,!0),a(()=>t.break()),s;function a(c){let u=t.const("len",(0,De._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:Xp.Type.Num},s),t.if((0,De.not)(s),c)})}o(a,"validateItems")}o(YA,"validateArray");Ae.validateArray=YA;function QA(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Xp.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let p=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);t.assign(a,(0,De._)`${a} || ${c}`),e.mergeValidEvaluated(p,c)||t.if((0,De.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}o(QA,"validateUnion");Ae.validateUnion=QA});var v0=v(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.validateKeywordUsage=zr.validSchemaType=zr.funcKeywordCode=zr.macroKeywordCode=void 0;var Tt=ae(),Ri=dr(),JA=hr(),XA=zs();function eI(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=b0(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:Tt.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}o(eI,"macroKeywordCode");zr.macroKeywordCode=eI;function tI(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:u}=e;nI(u,t);let l=!c&&t.compile?t.compile.call(u.self,s,a,u):t.validate,p=b0(n,i,l),f=n.let("valid");e.block$data(f,d),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function d(){if(t.errors===!1)b(),t.modifying&&y0(e),g(()=>e.error());else{let P=t.async?h():y();t.modifying&&y0(e),g(()=>rI(e,P))}}o(d,"validateKeyword");function h(){let P=n.let("ruleErrs",null);return n.try(()=>b((0,Tt._)`await `),$=>n.assign(f,!1).if((0,Tt._)`${$} instanceof ${u.ValidationError}`,()=>n.assign(P,(0,Tt._)`${$}.errors`),()=>n.throw($))),P}o(h,"validateAsync");function y(){let P=(0,Tt._)`${p}.errors`;return n.assign(P,null),b(Tt.nil),P}o(y,"validateSync");function b(P=t.async?(0,Tt._)`await `:Tt.nil){let $=u.opts.passContext?Ri.default.this:Ri.default.self,C=!("compile"in t&&!c||t.schema===!1);n.assign(f,(0,Tt._)`${P}${(0,JA.callValidateCode)(e,p,$,C)}`,t.modifying)}o(b,"assignValid");function g(P){var $;n.if((0,Tt.not)(($=t.valid)!==null&&$!==void 0?$:f),P)}o(g,"reportErrs")}o(tI,"funcKeywordCode");zr.funcKeywordCode=tI;function y0(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Tt._)`${n.parentData}[${n.parentDataProperty}]`))}o(y0,"modifyData");function rI(e,t){let{gen:r}=e;r.if((0,Tt._)`Array.isArray(${t})`,()=>{r.assign(Ri.default.vErrors,(0,Tt._)`${Ri.default.vErrors} === null ? ${t} : ${Ri.default.vErrors}.concat(${t})`).assign(Ri.default.errors,(0,Tt._)`${Ri.default.vErrors}.length`),(0,XA.extendErrors)(e)},()=>e.error())}o(rI,"addErrs");function nI({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(nI,"checkAsyncKeyword");function b0(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Tt.stringify)(r)})}o(b0,"useKeyword");function iI(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(iI,"validSchemaType");zr.validSchemaType=iI;function oI({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a!=null&&a.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(oI,"validateKeywordUsage");zr.validateKeywordUsage=oI});var S0=v(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendSubschemaMode=kn.extendSubschemaData=kn.getSubschema=void 0;var Zr=ae(),_0=he();function sI(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}${(0,Zr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,_0.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(sI,"getSubschema");kn.getSubschema=sI;function aI(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:l,dataPathArr:p,opts:f}=t,d=c.let("data",(0,Zr._)`${t.data}${(0,Zr.getProperty)(r)}`,!0);u(d),e.errorPath=(0,Zr.str)`${l}${(0,_0.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Zr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(i!==void 0){let l=i instanceof Zr.Name?i:c.let("data",i,!0);u(l),a!==void 0&&(e.propertyName=a)}s&&(e.dataTypes=s);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}o(u,"dataContextProps")}o(aI,"extendSubschemaData");kn.extendSubschemaData=aI;function cI(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(cI,"extendSubschemaMode");kn.extendSubschemaMode=cI});var rd=v((l7,E0)=>{"use strict";E0.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var P0=v((p7,O0)=>{"use strict";var qn=O0.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};su(t,n,i,e,"",e)};qn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};qn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};qn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};qn.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 su(e,t,r,n,i,s,a,c,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,a,c,u,l);for(var p in n){var f=n[p];if(Array.isArray(f)){if(p in qn.arrayKeywords)for(var d=0;d<f.length;d++)su(e,t,r,f[d],i+"/"+p+"/"+d,s,i,p,n,d)}else if(p in qn.propsKeywords){if(f&&typeof f=="object")for(var h in f)su(e,t,r,f[h],i+"/"+p+"/"+uI(h),s,i,p,n,h)}else(p in qn.keywords||e.allKeys&&!(p in qn.skipKeywords))&&su(e,t,r,f,i+"/"+p,s,i,p,n)}r(n,i,s,a,c,u,l)}}o(su,"_traverse");function uI(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(uI,"escapeJsonPtr")});var Ws=v(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.getSchemaRefs=Vt.resolveUrl=Vt.normalizeId=Vt._getFullPath=Vt.getFullPath=Vt.inlineRef=void 0;var lI=he(),fI=rd(),pI=P0(),dI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function hI(e,t=!0){return typeof e=="boolean"?!0:t===!0?!nd(e):t?x0(e)<=t:!1}o(hI,"inlineRef");Vt.inlineRef=hI;var mI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nd(e){for(let t in e){if(mI.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(nd)||typeof r=="object"&&nd(r))return!0}return!1}o(nd,"hasRef");function x0(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!dI.has(r)&&(typeof e[r]=="object"&&(0,lI.eachItem)(e[r],n=>t+=x0(n)),t===1/0))return 1/0}return t}o(x0,"countKeys");function $0(e,t="",r){r!==!1&&(t=jo(t));let n=e.parse(t);return w0(e,n)}o($0,"getFullPath");Vt.getFullPath=$0;function w0(e,t){return e.serialize(t).split("#")[0]+"#"}o(w0,"_getFullPath");Vt._getFullPath=w0;var gI=/#\/?$/;function jo(e){return e?e.replace(gI,""):""}o(jo,"normalizeId");Vt.normalizeId=jo;function yI(e,t,r){return r=jo(r),e.resolve(t,r)}o(yI,"resolveUrl");Vt.resolveUrl=yI;var bI=/^[a-z_][-a-z0-9._]*$/i;function vI(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=jo(e[r]||t),s={"":i},a=$0(n,i,!1),c={},u=new Set;return pI(e,{allKeys:!0},(f,d,h,y)=>{if(y===void 0)return;let b=a+d,g=s[y];typeof f[r]=="string"&&(g=P.call(this,f[r])),$.call(this,f.$anchor),$.call(this,f.$dynamicAnchor),s[d]=g;function P(C){let T=this.opts.uriResolver.resolve;if(C=jo(g?T(g,C):C),u.has(C))throw p(C);u.add(C);let A=this.refs[C];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(f,A.schema,C):C!==jo(b)&&(C[0]==="#"?(l(f,c[C],C),c[C]=f):this.refs[C]=b),C}o(P,"addRef");function $(C){if(typeof C=="string"){if(!bI.test(C))throw new Error(`invalid anchor "${C}"`);P.call(this,`#${C}`)}}o($,"addAnchor")}),c;function l(f,d,h){if(d!==void 0&&!fI(f,d))throw p(h)}o(l,"checkAmbiguosRef");function p(f){return new Error(`reference "${f}" resolves to more than one schema`)}o(p,"ambiguos")}o(vI,"getSchemaRefs");Vt.getSchemaRefs=vI});var Qs=v(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.getData=Dn.KeywordCxt=Dn.validateFunctionCode=void 0;var R0=a0(),A0=Zs(),od=Kp(),au=Zs(),_I=h0(),Ys=v0(),id=S0(),K=ae(),oe=dr(),SI=Ws(),gn=he(),Ks=zs();function EI(e){if(M0(e)&&(k0(e),j0(e))){xI(e);return}N0(e,()=>(0,R0.topBoolOrEmptySchema)(e))}o(EI,"validateFunctionCode");Dn.validateFunctionCode=EI;function N0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,K._)`${oe.default.data}, ${oe.default.valCxt}`,n.$async,()=>{e.code((0,K._)`"use strict"; ${I0(r,i)}`),PI(e,i),e.code(s)}):e.func(t,(0,K._)`${oe.default.data}, ${OI(i)}`,n.$async,()=>e.code(I0(r,i)).code(s))}o(N0,"validateFunction");function OI(e){return(0,K._)`{${oe.default.instancePath}="", ${oe.default.parentData}, ${oe.default.parentDataProperty}, ${oe.default.rootData}=${oe.default.data}${e.dynamicRef?(0,K._)`, ${oe.default.dynamicAnchors}={}`:K.nil}}={}`}o(OI,"destructureValCxt");function PI(e,t){e.if(oe.default.valCxt,()=>{e.var(oe.default.instancePath,(0,K._)`${oe.default.valCxt}.${oe.default.instancePath}`),e.var(oe.default.parentData,(0,K._)`${oe.default.valCxt}.${oe.default.parentData}`),e.var(oe.default.parentDataProperty,(0,K._)`${oe.default.valCxt}.${oe.default.parentDataProperty}`),e.var(oe.default.rootData,(0,K._)`${oe.default.valCxt}.${oe.default.rootData}`),t.dynamicRef&&e.var(oe.default.dynamicAnchors,(0,K._)`${oe.default.valCxt}.${oe.default.dynamicAnchors}`)},()=>{e.var(oe.default.instancePath,(0,K._)`""`),e.var(oe.default.parentData,(0,K._)`undefined`),e.var(oe.default.parentDataProperty,(0,K._)`undefined`),e.var(oe.default.rootData,oe.default.data),t.dynamicRef&&e.var(oe.default.dynamicAnchors,(0,K._)`{}`)})}o(PI,"destructureValCxtES5");function xI(e){let{schema:t,opts:r,gen:n}=e;N0(e,()=>{r.$comment&&t.$comment&&D0(e),CI(e),n.let(oe.default.vErrors,null),n.let(oe.default.errors,0),r.unevaluated&&$I(e),q0(e),NI(e)})}o(xI,"topSchemaObjCode");function $I(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,K._)`${r}.evaluated`),t.if((0,K._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,K._)`${e.evaluated}.props`,(0,K._)`undefined`)),t.if((0,K._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,K._)`${e.evaluated}.items`,(0,K._)`undefined`))}o($I,"resetEvaluated");function I0(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,K._)`/*# sourceURL=${r} */`:K.nil}o(I0,"funcSourceUrl");function wI(e,t){if(M0(e)&&(k0(e),j0(e))){AI(e,t);return}(0,R0.boolOrEmptySchema)(e,t)}o(wI,"subschemaCode");function j0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(j0,"schemaCxtHasRules");function M0(e){return typeof e.schema!="boolean"}o(M0,"isSchemaObj");function AI(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&D0(e),TI(e),RI(e);let s=n.const("_errs",oe.default.errors);q0(e,s),n.var(t,(0,K._)`${s} === ${oe.default.errors}`)}o(AI,"subSchemaObjCode");function k0(e){(0,gn.checkUnknownRules)(e),II(e)}o(k0,"checkKeywords");function q0(e,t){if(e.opts.jtd)return C0(e,[],!1,t);let r=(0,A0.getSchemaTypes)(e.schema),n=(0,A0.coerceAndCheckDataType)(e,r);C0(e,r,!n,t)}o(q0,"typeAndKeywords");function II(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,gn.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}o(II,"checkRefsAndKeywords");function CI(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,gn.checkStrictMode)(e,"default is ignored in the schema root")}o(CI,"checkNoDefault");function TI(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,SI.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(TI,"updateContext");function RI(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(RI,"checkAsyncSchema");function D0({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,K._)`${oe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,K.str)`${n}/$comment`,c=e.scopeValue("root",{ref:t.root});e.code((0,K._)`${oe.default.self}.opts.$comment(${s}, ${a}, ${c}.schema)`)}}o(D0,"commentKeyword");function NI(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,K._)`${oe.default.errors} === 0`,()=>t.return(oe.default.data),()=>t.throw((0,K._)`new ${i}(${oe.default.vErrors})`)):(t.assign((0,K._)`${n}.errors`,oe.default.vErrors),s.unevaluated&&jI(e),t.return((0,K._)`${oe.default.errors} === 0`))}o(NI,"returnResults");function jI({gen:e,evaluated:t,props:r,items:n}){r instanceof K.Name&&e.assign((0,K._)`${t}.props`,r),n instanceof K.Name&&e.assign((0,K._)`${t}.items`,n)}o(jI,"assignEvaluated");function C0(e,t,r,n){let{gen:i,schema:s,data:a,allErrors:c,opts:u,self:l}=e,{RULES:p}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,gn.schemaHasRulesButRef)(s,p))){i.block(()=>F0(e,"$ref",p.all.$ref.definition));return}u.jtd||MI(e,t),i.block(()=>{for(let d of p.rules)f(d);f(p.post)});function f(d){(0,od.shouldUseGroup)(s,d)&&(d.type?(i.if((0,au.checkDataType)(d.type,a,u.strictNumbers)),T0(e,d),t.length===1&&t[0]===d.type&&r&&(i.else(),(0,au.reportTypeError)(e)),i.endIf()):T0(e,d),c||i.if((0,K._)`${oe.default.errors} === ${n||0}`))}o(f,"groupKeywords")}o(C0,"schemaKeywords");function T0(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,_I.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,od.shouldUseRule)(n,s)&&F0(e,s.keyword,s.definition,t.type)})}o(T0,"iterateKeywords");function MI(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(kI(e,t),e.opts.allowUnionTypes||qI(e,t),DI(e,e.dataTypes))}o(MI,"checkStrictTypes");function kI(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{L0(e.dataTypes,r)||sd(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),FI(e,t)}}o(kI,"checkContextTypes");function qI(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&sd(e,"use allowUnionTypes to allow union type keyword")}o(qI,"checkMultipleTypes");function DI(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,od.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>LI(t,a))&&sd(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}o(DI,"checkKeywordTypes");function LI(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(LI,"hasApplicableType");function L0(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(L0,"includesType");function FI(e,t){let r=[];for(let n of e.dataTypes)L0(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(FI,"narrowSchemaTypes");function sd(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,gn.checkStrictMode)(e,t,e.opts.strictTypes)}o(sd,"strictTypesError");var ad=class ad{constructor(t,r,n){if((0,Ys.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",H0(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ys.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",oe.default.errors))}result(t,r,n){this.failResult((0,K.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,K.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,K._)`${r} !== undefined && (${(0,K.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ks.reportExtraError:Ks.reportError)(this,this.def.error,r)}$dataError(){(0,Ks.reportError)(this,this.def.$dataError||Ks.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ks.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=K.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=K.nil,r=K.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,K.or)((0,K._)`${i} === undefined`,r)),t!==K.nil&&n.assign(t,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==K.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,K.or)(a(),c());function a(){if(n.length){if(!(r instanceof K.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,K._)`${(0,au.checkDataTypes)(u,r,s.opts.strictNumbers,au.DataType.Wrong)}`}return K.nil}function c(){if(i.validateSchema){let u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,K._)`!${u}(${r})`}return K.nil}}subschema(t,r){let n=(0,id.getSubschema)(this.it,t);(0,id.extendSubschemaData)(n,this.it,t),(0,id.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return wI(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=gn.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=gn.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,K.Name)),!0}};o(ad,"KeywordCxt");var cu=ad;Dn.KeywordCxt=cu;function F0(e,t,r,n){let i=new cu(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Ys.funcKeywordCode)(i,r):"macro"in r?(0,Ys.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Ys.funcKeywordCode)(i,r)}o(F0,"keywordCode");var HI=/^\/(?:[^~]|~0|~1)*$/,BI=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function H0(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return oe.default.rootData;if(e[0]==="/"){if(!HI.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=oe.default.rootData}else{let l=BI.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+l[1];if(i=l[2],i==="#"){if(p>=t)throw new Error(u("property/index",p));return n[t-p]}if(p>t)throw new Error(u("data",p));if(s=r[t-p],!i)return s}let a=s,c=i.split("/");for(let l of c)l&&(s=(0,K._)`${s}${(0,K.getProperty)((0,gn.unescapeJsonPointer)(l))}`,a=(0,K._)`${a} && ${s}`);return a;function u(l,p){return`Cannot access ${l} ${p} levels up, current level is ${t}`}}o(H0,"getData");Dn.getData=H0});var uu=v(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});var ld=class ld extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(ld,"ValidationError");var cd=ld;ud.default=cd});var Js=v(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var fd=Ws(),hd=class hd extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,fd.resolveUrl)(t,r,n),this.missingSchema=(0,fd.normalizeId)((0,fd.getFullPath)(t,this.missingRef))}};o(hd,"MissingRefError");var pd=hd;dd.default=pd});var Xs=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.resolveSchema=mr.getCompilingSchema=mr.resolveRef=mr.compileSchema=mr.SchemaEnv=void 0;var Ar=ae(),VI=uu(),Ni=dr(),Ir=Ws(),B0=he(),UI=Qs(),yd=class yd{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ir.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(yd,"SchemaEnv");var Mo=yd;mr.SchemaEnv=Mo;function gd(e){let t=V0.call(this,e);if(t)return t;let r=(0,Ir.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Ar.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=a.scopeValue("Error",{ref:VI.default,code:(0,Ar._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName("validate");e.validateName=u;let l={gen:a,allErrors:this.opts.allErrors,data:Ni.default.data,parentData:Ni.default.parentData,parentDataProperty:Ni.default.parentDataProperty,dataNames:[Ni.default.data],dataPathArr:[Ar.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Ar.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ar.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ar._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,UI.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let f=a.toString();p=`${a.scopeRefs(Ni.default.scope)}return ${f}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let h=new Function(`${Ni.default.self}`,`${Ni.default.scope}`,p)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){let{props:y,items:b}=l;h.evaluated={props:y instanceof Ar.Name?void 0:y,items:b instanceof Ar.Name?void 0:b,dynamicProps:y instanceof Ar.Name,dynamicItems:b instanceof Ar.Name},h.source&&(h.source.evaluated=(0,Ar.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),f}finally{this._compilations.delete(e)}}o(gd,"compileSchema");mr.compileSchema=gd;function GI(e,t,r){var n;r=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=WI.call(this,e,r);if(s===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;a&&(s=new Mo({schema:a,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=zI.call(this,s)}o(GI,"resolveRef");mr.resolveRef=GI;function zI(e){return(0,Ir.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:gd.call(this,e)}o(zI,"inlineOrCompile");function V0(e){for(let t of this._compilations)if(ZI(t,e))return t}o(V0,"getCompilingSchema");mr.getCompilingSchema=V0;function ZI(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(ZI,"sameSchemaEnv");function WI(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||lu.call(this,e,t)}o(WI,"resolve");function lu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ir._getFullPath)(this.opts.uriResolver,r),i=(0,Ir.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return md.call(this,r,e);let s=(0,Ir.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let c=lu.call(this,e,a);return typeof(c==null?void 0:c.schema)!="object"?void 0:md.call(this,r,c)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||gd.call(this,a),s===(0,Ir.normalizeId)(t)){let{schema:c}=a,{schemaId:u}=this.opts,l=c[u];return l&&(i=(0,Ir.resolveUrl)(this.opts.uriResolver,i,l)),new Mo({schema:c,schemaId:u,root:e,baseId:i})}return md.call(this,r,a)}}o(lu,"resolveSchema");mr.resolveSchema=lu;var KI=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function md(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,B0.unescapeFragment)(c)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!KI.has(c)&&l&&(t=(0,Ir.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,B0.schemaHasRulesButRef)(r,this.RULES)){let c=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=lu.call(this,n,c)}let{schemaId:a}=this.opts;if(s=s||new Mo({schema:r,schemaId:a,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(md,"getJsonPointer")});var U0=v((P7,YI)=>{YI.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 z0=v((x7,G0)=>{"use strict";var QI={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};G0.exports={HEX:QI}});var ev=v(($7,X0)=>{"use strict";var{HEX:JI}=z0();function Y0(e){if(J0(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:eC(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Y0,"normalizeIPv4");function bd(e,t=!1){let r="",n=!0;for(let i of e){if(JI[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(bd,"stringArrayToHexStripped");function XI(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,c=!1;function u(){if(i.length){if(s===!1){let l=bd(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}o(u,"consume");for(let l=0;l<e.length;l++){let p=e[l];if(!(p==="["||p==="]"))if(p===":"){if(a===!0&&(c=!0),!u())break;if(t++,n.push(":"),t>7){r.error=!0;break}l-1>=0&&e[l-1]===":"&&(a=!0);continue}else if(p==="%"){if(!u())break;s=!0}else{i.push(p);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(bd(i))),r.address=n.join(""),r}o(XI,"getIPV6");function Q0(e,t={}){if(J0(e,":")<2)return{host:e,isIPV6:!1};let r=XI(e);if(r.error)return{host:e,isIPV6:!1};{let n=r.address,i=r.address;return r.zone&&(n+="%"+r.zone,i+="%25"+r.zone),{host:n,escapedHost:i,isIPV6:!0}}}o(Q0,"normalizeIPv6");function eC(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let a=e[s];a==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}o(eC,"stripLeadingZeros");function J0(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(J0,"findToken");var Z0=/^\.\.?\//u,W0=/^\/\.(?:\/|$)/u,K0=/^\/\.\.(?:\/|$)/u,tC=/^\/?(?:.|\n)*?(?=\/|$)/u;function rC(e){let t=[];for(;e.length;)if(e.match(Z0))e=e.replace(Z0,"");else if(e.match(W0))e=e.replace(W0,"/");else if(e.match(K0))e=e.replace(K0,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(tC);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(rC,"removeDotSegments");function nC(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(nC,"normalizeComponentEncoding");function iC(e,t){let r=[];if(e.userinfo!==void 0&&(r.push(e.userinfo),r.push("@")),e.host!==void 0){let n=unescape(e.host),i=Y0(n);if(i.isIPV4)n=i.host;else{let s=Q0(i.host,{isIPV4:!1});s.isIPV6===!0?n=`[${s.escapedHost}]`:n=e.host}r.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}o(iC,"recomposeAuthority");X0.exports={recomposeAuthority:iC,normalizeComponentEncoding:nC,removeDotSegments:rC,normalizeIPv4:Y0,normalizeIPv6:Q0,stringArrayToHexStripped:bd}});var sv=v((A7,ov)=>{"use strict";var oC=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,sC=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function tv(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(tv,"isSecure");function rv(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(rv,"httpParse");function nv(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(nv,"httpSerialize");function aC(e){return e.secure=tv(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(aC,"wsParse");function cC(e){if((e.port===(tv(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(cC,"wsSerialize");function uC(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(sC);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=vd[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(uC,"urnParse");function lC(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=vd[i];s&&(e=s.serialize(e,t));let a=e,c=e.nss;return a.path=`${n||t.nid}:${c}`,t.skipEscape=!0,a}o(lC,"urnSerialize");function fC(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!oC.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(fC,"urnuuidParse");function pC(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(pC,"urnuuidSerialize");var iv={scheme:"http",domainHost:!0,parse:rv,serialize:nv},dC={scheme:"https",domainHost:iv.domainHost,parse:rv,serialize:nv},fu={scheme:"ws",domainHost:!0,parse:aC,serialize:cC},hC={scheme:"wss",domainHost:fu.domainHost,parse:fu.parse,serialize:fu.serialize},mC={scheme:"urn",parse:uC,serialize:lC,skipNormalize:!0},gC={scheme:"urn:uuid",parse:fC,serialize:pC,skipNormalize:!0},vd={http:iv,https:dC,ws:fu,wss:hC,urn:mC,"urn:uuid":gC};ov.exports=vd});var cv=v((C7,du)=>{"use strict";var{normalizeIPv6:yC,normalizeIPv4:bC,removeDotSegments:ea,recomposeAuthority:vC,normalizeComponentEncoding:pu}=ev(),_d=sv();function _C(e,t){return typeof e=="string"?e=Wr(yn(e,t),t):typeof e=="object"&&(e=yn(Wr(e,t),t)),e}o(_C,"normalize");function SC(e,t,r){let n=Object.assign({scheme:"null"},r),i=av(yn(e,n),yn(t,n),n,!0);return Wr(i,{...n,skipEscape:!0})}o(SC,"resolve");function av(e,t,r,n){let i={};return n||(e=yn(Wr(e,r),r),t=yn(Wr(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ea(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ea(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=ea(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=ea(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(av,"resolveComponents");function EC(e,t,r){return typeof e=="string"?(e=unescape(e),e=Wr(pu(yn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Wr(pu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Wr(pu(yn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Wr(pu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}o(EC,"equal");function Wr(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=_d[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&(i.push(r.scheme),i.push(":"));let a=vC(r,n);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=ea(c)),a===void 0&&(c=c.replace(/^\/\//u,"/%2F")),i.push(c)}return r.query!==void 0&&(i.push("?"),i.push(r.query)),r.fragment!==void 0&&(i.push("#"),i.push(r.fragment)),i.join("")}o(Wr,"serialize");var OC=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function PC(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||OC[t])return!0;return!1}o(PC,"nonSimpleDomain");var xC=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match(xC);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let u=bC(n.host);if(u.isIPV4===!1){let l=yC(u.host,{isIPV4:!1});n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=u.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&!n.path&&n.query===void 0?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=_d[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&PC(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.userinfo!==void 0&&(n.userinfo=unescape(n.userinfo)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path!==void 0&&n.path.length&&(n.path=escape(unescape(n.path))),n.fragment!==void 0&&n.fragment.length&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(yn,"parse");var Sd={SCHEMES:_d,normalize:_C,resolve:SC,resolveComponents:av,equal:EC,serialize:Wr,parse:yn};du.exports=Sd;du.exports.default=Sd;du.exports.fastUri=Sd});var lv=v(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var uv=cv();uv.code='require("ajv/dist/runtime/uri").default';Ed.default=uv});var qo=v(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.CodeGen=gt.Name=gt.nil=gt.stringify=gt.str=gt._=gt.KeywordCxt=void 0;var $C=Qs();Object.defineProperty(gt,"KeywordCxt",{enumerable:!0,get:o(function(){return $C.KeywordCxt},"get")});var ko=ae();Object.defineProperty(gt,"_",{enumerable:!0,get:o(function(){return ko._},"get")});Object.defineProperty(gt,"str",{enumerable:!0,get:o(function(){return ko.str},"get")});Object.defineProperty(gt,"stringify",{enumerable:!0,get:o(function(){return ko.stringify},"get")});Object.defineProperty(gt,"nil",{enumerable:!0,get:o(function(){return ko.nil},"get")});Object.defineProperty(gt,"Name",{enumerable:!0,get:o(function(){return ko.Name},"get")});Object.defineProperty(gt,"CodeGen",{enumerable:!0,get:o(function(){return ko.CodeGen},"get")});var wC=uu(),mv=Js(),AC=Wp(),ta=Xs(),IC=ae(),ra=Ws(),hu=Zs(),Pd=he(),fv=U0(),CC=lv(),gv=o((e,t)=>new RegExp(e,t),"defaultRegExp");gv.code="new RegExp";var TC=["removeAdditional","useDefaults","coerceTypes"],RC=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NC={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."},jC={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},pv=200;function MC(e){var t,r,n,i,s,a,c,u,l,p,f,d,h,y,b,g,P,$,C,T,A,te,X,ze,$e;let G=e.strict,j=(t=e.code)===null||t===void 0?void 0:t.optimize,R=j===!0||j===void 0?1:j||0,q=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:gv,Q=(i=e.uriResolver)!==null&&i!==void 0?i:CC.default;return{strictSchema:(a=(s=e.strictSchema)!==null&&s!==void 0?s:G)!==null&&a!==void 0?a:!0,strictNumbers:(u=(c=e.strictNumbers)!==null&&c!==void 0?c:G)!==null&&u!==void 0?u:!0,strictTypes:(p=(l=e.strictTypes)!==null&&l!==void 0?l:G)!==null&&p!==void 0?p:"log",strictTuples:(d=(f=e.strictTuples)!==null&&f!==void 0?f:G)!==null&&d!==void 0?d:"log",strictRequired:(y=(h=e.strictRequired)!==null&&h!==void 0?h:G)!==null&&y!==void 0?y:!1,code:e.code?{...e.code,optimize:R,regExp:q}:{optimize:R,regExp:q},loopRequired:(b=e.loopRequired)!==null&&b!==void 0?b:pv,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:pv,meta:(P=e.meta)!==null&&P!==void 0?P:!0,messages:($=e.messages)!==null&&$!==void 0?$:!0,inlineRefs:(C=e.inlineRefs)!==null&&C!==void 0?C:!0,schemaId:(T=e.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(A=e.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(te=e.validateSchema)!==null&&te!==void 0?te:!0,validateFormats:(X=e.validateFormats)!==null&&X!==void 0?X:!0,unicodeRegExp:(ze=e.unicodeRegExp)!==null&&ze!==void 0?ze:!0,int32range:($e=e.int32range)!==null&&$e!==void 0?$e:!0,uriResolver:Q}}o(MC,"requiredOptions");var xd=class xd{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...MC(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new IC.ValueScope({scope:{},prefixes:RC,es5:r,lines:n}),this.logger=HC(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,AC.getRules)(),dv.call(this,NC,t,"NOT SUPPORTED"),dv.call(this,jC,t,"DEPRECATED","warn"),this._metaOpts=LC.call(this),t.formats&&qC.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&DC.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),kC.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=fv;n==="id"&&(i={...fv},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(p,f){await s.call(this,p.$schema);let d=this._addSchema(p,f);return d.validate||a.call(this,d)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function a(p){try{return this._compileSchemaEnv(p)}catch(f){if(!(f instanceof mv.default))throw f;return c.call(this,f),await u.call(this,f.missingSchema),a.call(this,p)}}function c({missingSchema:p,missingRef:f}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${f} cannot be resolved`)}async function u(p){let f=await l.call(this,p);this.refs[p]||await s.call(this,f.$schema),this.refs[p]||this.addSchema(f,p,r)}async function l(p){let f=this._loading[p];if(f)return f;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:a}=this.opts;if(s=t[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,ra.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=hv.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new ta.SchemaEnv({schema:{},schemaId:n});if(r=ta.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=hv.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ra.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(VC.call(this,n,r),!r)return(0,Pd.eachItem)(n,s=>Od.call(this,s)),this;GC.call(this,r);let i={...r,type:(0,hu.getJSONTypes)(r.type),schemaType:(0,hu.getJSONTypes)(r.schemaType)};return(0,Pd.eachItem)(n,i.type.length===0?s=>Od.call(this,s,i):s=>i.type.forEach(a=>Od.call(this,s,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),a=t;for(let c of s)a=a[c];for(let c in n){let u=n[c];if(typeof u!="object")continue;let{$data:l}=u.definition,p=a[c];l&&p&&(a[c]=yv(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof t=="object")a=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,ra.normalizeId)(a||n);let l=ra.getSchemaRefs.call(this,t,n);return u=new ta.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),i&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):ta.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{ta.compileSchema.call(this,t)}finally{this.opts=r}}};o(xd,"Ajv");var na=xd;na.ValidationError=wC.default;na.MissingRefError=mv.default;gt.default=na;function dv(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n](`${r}: option ${i}. ${e[s]}`)}}o(dv,"checkOptions");function hv(e){return e=(0,ra.normalizeId)(e),this.schemas[e]||this.refs[e]}o(hv,"getSchEnv");function kC(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(kC,"addInitialSchemas");function qC(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(qC,"addInitialFormats");function DC(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(DC,"addInitialKeywords");function LC(){let e={...this.opts};for(let t of TC)delete e[t];return e}o(LC,"getMetaSchemaOptions");var FC={log(){},warn(){},error(){}};function HC(e){if(e===!1)return FC;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(HC,"getLogger");var BC=/^[a-z_$][a-z0-9_$:-]*$/i;function VC(e,t){let{RULES:r}=this;if((0,Pd.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!BC.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(VC,"checkKeyword");function Od(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:u})=>u===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:{...t,type:(0,hu.getJSONTypes)(t.type),schemaType:(0,hu.getJSONTypes)(t.schemaType)}};t.before?UC.call(this,a,c,t.before):a.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}o(Od,"addRule");function UC(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}o(UC,"addBeforeRule");function GC(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=yv(t)),e.validateSchema=this.compile(t,!0))}o(GC,"keywordMetaschema");var zC={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function yv(e){return{anyOf:[e,zC]}}o(yv,"schemaOrData")});var ia=v(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.callRef=ji.getValidate=void 0;var ZC=Js(),bv=hr(),Ut=ae(),Do=dr(),vv=Xs(),mu=he(),WC={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:a,opts:c,self:u}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return f();let p=vv.resolveRef.call(u,l,i,r);if(p===void 0)throw new ZC.default(n.opts.uriResolver,i,r);if(p instanceof vv.SchemaEnv)return d(p);return h(p);function f(){if(s===l)return gu(e,a,s,s.$async);let y=t.scopeValue("root",{ref:l});return gu(e,(0,Ut._)`${y}.validate`,l,l.$async)}function d(y){let b=_v(e,y);gu(e,b,y,y.$async)}function h(y){let b=t.scopeValue("schema",c.code.source===!0?{ref:y,code:(0,Ut.stringify)(y)}:{ref:y}),g=t.name("valid"),P=e.subschema({schema:y,dataTypes:[],schemaPath:Ut.nil,topSchemaRef:b,errSchemaPath:r},g);e.mergeEvaluated(P),e.ok(g)}}};function _v(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ut._)`${r.scopeValue("wrapper",{ref:t})}.validate`}o(_v,"getValidate");ji.getValidate=_v;function gu(e,t,r,n){let{gen:i,it:s}=e,{allErrors:a,schemaEnv:c,opts:u}=s,l=u.passContext?Do.default.this:Ut.nil;n?p():f();function p(){if(!c.$async)throw new Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{i.code((0,Ut._)`await ${(0,bv.callValidateCode)(e,t,l)}`),h(t),a||i.assign(y,!0)},b=>{i.if((0,Ut._)`!(${b} instanceof ${s.ValidationError})`,()=>i.throw(b)),d(b),a||i.assign(y,!1)}),e.ok(y)}o(p,"callAsyncRef");function f(){e.result((0,bv.callValidateCode)(e,t,l),()=>h(t),()=>d(t))}o(f,"callSyncRef");function d(y){let b=(0,Ut._)`${y}.errors`;i.assign(Do.default.vErrors,(0,Ut._)`${Do.default.vErrors} === null ? ${b} : ${Do.default.vErrors}.concat(${b})`),i.assign(Do.default.errors,(0,Ut._)`${Do.default.vErrors}.length`)}o(d,"addErrorsFrom");function h(y){var b;if(!s.opts.unevaluated)return;let g=(b=r==null?void 0:r.validate)===null||b===void 0?void 0:b.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=mu.mergeEvaluated.props(i,g.props,s.props));else{let P=i.var("props",(0,Ut._)`${y}.evaluated.props`);s.props=mu.mergeEvaluated.props(i,P,s.props,Ut.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=mu.mergeEvaluated.items(i,g.items,s.items));else{let P=i.var("items",(0,Ut._)`${y}.evaluated.items`);s.items=mu.mergeEvaluated.items(i,P,s.items,Ut.Name)}}o(h,"addEvaluatedFrom")}o(gu,"callRef");ji.callRef=gu;ji.default=WC});var Sv=v($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var KC=ia(),YC=["$schema","id","$defs",{keyword:"$comment"},"definitions",KC.default];$d.default=YC});var Ev=v(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var wd=qo(),QC=ae(),Ln=QC.operators,Ad={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:Ln.LTE,fail:Ln.GT},{okStr:"<",ok:Ln.LT,fail:Ln.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:Ln.GTE,fail:Ln.LT},{okStr:">",ok:Ln.GT,fail:Ln.LTE}]}},JC={message:o(e=>wd.str`must be ${Id(e).okStr} ${e.schemaCode}`,"message"),params:o(e=>wd._`{comparison: ${Id(e).okStr}, limit: ${e.schemaCode}}`,"params")},XC={keyword:Object.keys(Ad),type:"number",schemaType:"number",$data:!0,error:JC,code(e){let{data:t,schemaCode:r}=e;e.fail$data(wd._`${t} ${Id(e).fail} ${r} || isNaN(${t})`)}};function Id(e){var t;let r=e.keyword,n=!((t=e.parentSchema)===null||t===void 0)&&t[Ad[r].exclusive]?1:0;return Ad[r].ops[n]}o(Id,"kwdOp");Cd.default=XC});var Pv=v(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var Ov={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},eT={keyword:Object.keys(Ov),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){let r=Ov[e];if(t[r]===void 0)throw new Error(`${e} can only be used with ${r}`)}};Td.default=eT});var Nd=v(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var oa=ae(),tT={message:o(({schemaCode:e})=>(0,oa.str)`must be multiple of ${e}`,"message"),params:o(({schemaCode:e})=>(0,oa._)`{multipleOf: ${e}}`,"params")},rT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:tT,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?(0,oa._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,oa._)`${a} !== parseInt(${a})`;e.fail$data((0,oa._)`(${n} === 0 || (${a} = ${r}/${n}, ${c}))`)}};Rd.default=rT});var $v=v(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});function xv(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(xv,"ucs2length");jd.default=xv;xv.code='require("ajv/dist/runtime/ucs2length").default'});var kd=v(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var Mi=ae(),nT=he(),iT=$v(),oT={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Mi.str)`must NOT have ${r} than ${t} characters`},params:o(({schemaCode:e})=>(0,Mi._)`{limit: ${e}}`,"params")},sT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:oT,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?Mi.operators.GT:Mi.operators.LT,a=i.opts.unicode===!1?(0,Mi._)`${r}.length`:(0,Mi._)`${(0,nT.useFunc)(e.gen,iT.default)}(${r})`;e.fail$data((0,Mi._)`${a} ${s} ${n}`)}};Md.default=sT});var Dd=v(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var aT=hr(),yu=ae(),cT={message:o(({schemaCode:e})=>(0,yu.str)`must match pattern "${e}"`,"message"),params:o(({schemaCode:e})=>(0,yu._)`{pattern: ${e}}`,"params")},uT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cT,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"",c=r?(0,yu._)`(new RegExp(${i}, ${a}))`:(0,aT.usePattern)(e,n);e.fail$data((0,yu._)`!${c}.test(${t})`)}};qd.default=uT});var Fd=v(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var sa=ae(),lT={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,sa.str)`must NOT have ${r} than ${t} properties`},params:o(({schemaCode:e})=>(0,sa._)`{limit: ${e}}`,"params")},fT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lT,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?sa.operators.GT:sa.operators.LT;e.fail$data((0,sa._)`Object.keys(${r}).length ${i} ${n}`)}};Ld.default=fT});var Bd=v(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var aa=hr(),ca=ae(),pT=he(),dT={message:o(({params:{missingProperty:e}})=>(0,ca.str)`must have required property '${e}'`,"message"),params:o(({params:{missingProperty:e}})=>(0,ca._)`{missingProperty: ${e}}`,"params")},hT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:dT,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:a}=e,{opts:c}=a;if(!s&&r.length===0)return;let u=r.length>=c.loopRequired;if(a.allErrors?l():p(),c.strictRequired){let h=e.parentSchema.properties,{definedProperties:y}=e.it;for(let b of r)if((h==null?void 0:h[b])===void 0&&!y.has(b)){let g=a.schemaEnv.baseId+a.errSchemaPath,P=`required property "${b}" is not defined at "${g}" (strictRequired)`;(0,pT.checkStrictMode)(a,P,a.opts.strictRequired)}}function l(){if(u||s)e.block$data(ca.nil,f);else for(let h of r)(0,aa.checkReportMissingProp)(e,h)}o(l,"allErrorsMode");function p(){let h=t.let("missing");if(u||s){let y=t.let("valid",!0);e.block$data(y,()=>d(h,y)),e.ok(y)}else t.if((0,aa.checkMissingProp)(e,r,h)),(0,aa.reportMissingProp)(e,h),t.else()}o(p,"exitOnErrorMode");function f(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,aa.noPropertyInData)(t,i,h,c.ownProperties),()=>e.error())})}o(f,"loopAllRequired");function d(h,y){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(y,(0,aa.propertyInData)(t,i,h,c.ownProperties)),t.if((0,ca.not)(y),()=>{e.error(),t.break()})},ca.nil)}o(d,"loopUntilMissing")}};Hd.default=hT});var Ud=v(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var ua=ae(),mT={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ua.str)`must NOT have ${r} than ${t} items`},params:o(({schemaCode:e})=>(0,ua._)`{limit: ${e}}`,"params")},gT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mT,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?ua.operators.GT:ua.operators.LT;e.fail$data((0,ua._)`${r}.length ${i} ${n}`)}};Vd.default=gT});var bu=v(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var wv=rd();wv.code='require("ajv/dist/runtime/equal").default';Gd.default=wv});var Wd=v(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var zd=Zs(),yt=ae(),yT=he(),bT=bu(),vT={message:o(({params:{i:e,j:t}})=>(0,yt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,"message"),params:o(({params:{i:e,j:t}})=>(0,yt._)`{i: ${e}, j: ${t}}`,"params")},_T={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:vT,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:c}=e;if(!n&&!i)return;let u=t.let("valid"),l=s.items?(0,zd.getSchemaTypes)(s.items):[];e.block$data(u,p,(0,yt._)`${a} === false`),e.ok(u);function p(){let y=t.let("i",(0,yt._)`${r}.length`),b=t.let("j");e.setParams({i:y,j:b}),t.assign(u,!0),t.if((0,yt._)`${y} > 1`,()=>(f()?d:h)(y,b))}o(p,"validateUniqueItems");function f(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}o(f,"canOptimize");function d(y,b){let g=t.name("item"),P=(0,zd.checkDataTypes)(l,g,c.opts.strictNumbers,zd.DataType.Wrong),$=t.const("indices",(0,yt._)`{}`);t.for((0,yt._)`;${y}--;`,()=>{t.let(g,(0,yt._)`${r}[${y}]`),t.if(P,(0,yt._)`continue`),l.length>1&&t.if((0,yt._)`typeof ${g} == "string"`,(0,yt._)`${g} += "_"`),t.if((0,yt._)`typeof ${$}[${g}] == "number"`,()=>{t.assign(b,(0,yt._)`${$}[${g}]`),e.error(),t.assign(u,!1).break()}).code((0,yt._)`${$}[${g}] = ${y}`)})}o(d,"loopN");function h(y,b){let g=(0,yT.useFunc)(t,bT.default),P=t.name("outer");t.label(P).for((0,yt._)`;${y}--;`,()=>t.for((0,yt._)`${b} = ${y}; ${b}--;`,()=>t.if((0,yt._)`${g}(${r}[${y}], ${r}[${b}])`,()=>{e.error(),t.assign(u,!1).break(P)})))}o(h,"loopN2")}};Zd.default=_T});var Qd=v(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Kd=ae(),ST=he(),ET=bu(),OT={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,Kd._)`{allowedValue: ${e}}`,"params")},PT={keyword:"const",$data:!0,error:OT,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,Kd._)`!${(0,ST.useFunc)(t,ET.default)}(${r}, ${i})`):e.fail((0,Kd._)`${s} !== ${r}`)}};Yd.default=PT});var Xd=v(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var la=ae(),xT=he(),$T=bu(),wT={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,la._)`{allowedValues: ${e}}`,"params")},AT={keyword:"enum",schemaType:"array",$data:!0,error:wT,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=a.opts.loopEnum,u,l=o(()=>u??(u=(0,xT.useFunc)(t,$T.default)),"getEql"),p;if(c||n)p=t.let("valid"),e.block$data(p,f);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let h=t.const("vSchema",s);p=(0,la.or)(...i.map((y,b)=>d(h,b)))}e.pass(p);function f(){t.assign(p,!1),t.forOf("v",s,h=>t.if((0,la._)`${l()}(${r}, ${h})`,()=>t.assign(p,!0).break()))}o(f,"loopEnum");function d(h,y){let b=i[y];return typeof b=="object"&&b!==null?(0,la._)`${l()}(${r}, ${h}[${y}])`:(0,la._)`${r} === ${b}`}o(d,"equalCode")}};Jd.default=AT});var Av=v(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});var IT=Ev(),CT=Pv(),TT=Nd(),RT=kd(),NT=Dd(),jT=Fd(),MT=Bd(),kT=Ud(),qT=Wd(),DT=Qd(),LT=Xd(),FT=[IT.default,CT.default,TT.default,RT.default,NT.default,jT.default,MT.default,kT.default,qT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DT.default,LT.default];eh.default=FT});var rh=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.validateAdditionalItems=void 0;var ki=ae(),th=he(),HT={message:o(({params:{len:e}})=>(0,ki.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,ki._)`{limit: ${e}}`,"params")},BT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:HT,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,th.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Iv(e,n)}};function Iv(e,t){let{gen:r,schema:n,data:i,keyword:s,it:a}=e;a.items=!0;let c=r.const("len",(0,ki._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ki._)`${c} <= ${t.length}`);else if(typeof n=="object"&&!(0,th.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,ki._)`${c} <= ${t.length}`);r.if((0,ki.not)(l),()=>u(l)),e.ok(l)}function u(l){r.forRange("i",t.length,c,p=>{e.subschema({keyword:s,dataProp:p,dataPropType:th.Type.Num},l),a.allErrors||r.if((0,ki.not)(l),()=>r.break())})}o(u,"validateItems")}o(Iv,"validateAdditionalItems");fa.validateAdditionalItems=Iv;fa.default=BT});var nh=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.validateTuple=void 0;var Cv=ae(),vu=he(),VT=hr(),UT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Tv(e,"additionalItems",t);r.items=!0,!(0,vu.alwaysValidSchema)(r,t)&&e.ok((0,VT.validateArray)(e))}};function Tv(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:c}=e;p(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=vu.mergeEvaluated.items(n,r.length,c.items));let u=n.name("valid"),l=n.const("len",(0,Cv._)`${s}.length`);r.forEach((f,d)=>{(0,vu.alwaysValidSchema)(c,f)||(n.if((0,Cv._)`${l} > ${d}`,()=>e.subschema({keyword:a,schemaProp:d,dataProp:d},u)),e.ok(u))});function p(f){let{opts:d,errSchemaPath:h}=c,y=r.length,b=y===f.minItems&&(y===f.maxItems||f[t]===!1);if(d.strictTuples&&!b){let g=`"${a}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,vu.checkStrictMode)(c,g,d.strictTuples)}}o(p,"checkStrictTuple")}o(Tv,"validateTuple");pa.validateTuple=Tv;pa.default=UT});var Rv=v(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var GT=nh(),zT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,GT.validateTuple)(e,"items"),"code")};ih.default=zT});var jv=v(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var Nv=ae(),ZT=he(),WT=hr(),KT=rh(),YT={message:o(({params:{len:e}})=>(0,Nv.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Nv._)`{limit: ${e}}`,"params")},QT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:YT,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,ZT.alwaysValidSchema)(n,t)&&(i?(0,KT.validateAdditionalItems)(e,i):e.ok((0,WT.validateArray)(e)))}};oh.default=QT});var Mv=v(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var gr=ae(),_u=he(),JT={message:o(({params:{min:e,max:t}})=>t===void 0?(0,gr.str)`must contain at least ${e} valid item(s)`:(0,gr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,gr._)`{minContains: ${e}}`:(0,gr._)`{minContains: ${e}, maxContains: ${t}}`,"params")},XT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:JT,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,a,c,{minContains:u,maxContains:l}=n;s.opts.next?(a=u===void 0?1:u,c=l):a=1;let p=t.const("len",(0,gr._)`${i}.length`);if(e.setParams({min:a,max:c}),c===void 0&&a===0){(0,_u.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,_u.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,_u.alwaysValidSchema)(s,r)){let b=(0,gr._)`${p} >= ${a}`;c!==void 0&&(b=(0,gr._)`${b} && ${p} <= ${c}`),e.pass(b);return}s.items=!0;let f=t.name("valid");c===void 0&&a===1?h(f,()=>t.if(f,()=>t.break())):a===0?(t.let(f,!0),c!==void 0&&t.if((0,gr._)`${i}.length > 0`,d)):(t.let(f,!1),d()),e.result(f,()=>e.reset());function d(){let b=t.name("_valid"),g=t.let("count",0);h(b,()=>t.if(b,()=>y(g)))}o(d,"validateItemsWithCount");function h(b,g){t.forRange("i",0,p,P=>{e.subschema({keyword:"contains",dataProp:P,dataPropType:_u.Type.Num,compositeRule:!0},b),g()})}o(h,"validateItems");function y(b){t.code((0,gr._)`${b}++`),c===void 0?t.if((0,gr._)`${b} >= ${a}`,()=>t.assign(f,!0).break()):(t.if((0,gr._)`${b} > ${c}`,()=>t.assign(f,!1).break()),a===1?t.assign(f,!0):t.if((0,gr._)`${b} >= ${a}`,()=>t.assign(f,!0)))}o(y,"checkLimits")}};sh.default=XT});var Su=v(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.validateSchemaDeps=Kr.validatePropertyDeps=Kr.error=void 0;var ah=ae(),eR=he(),da=hr();Kr.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,ah.str)`must have ${n} ${r} when property ${e} is present`},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,ah._)`{property: ${e},
10
+ || ${a} === "boolean" || ${i} === null`).assign(c,(0,ce._)`[${i}]`)}}o(u,"coerceSpecificType")}o(MA,"coerceData");function kA({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,ce._)`${t} !== undefined`,()=>e.assign((0,ce._)`${t}[${r}]`,n))}o(kA,"assignParentData");function Yp(e,t,r,n=Ro.Correct){let i=n===Ro.Correct?ce.operators.EQ:ce.operators.NEQ,s;switch(e){case"null":return(0,ce._)`${t} ${i} null`;case"array":s=(0,ce._)`Array.isArray(${t})`;break;case"object":s=(0,ce._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a((0,ce._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return(0,ce._)`typeof ${t} ${i} ${e}`}return n===Ro.Correct?s:(0,ce.not)(s);function a(c=ce.nil){return(0,ce.and)((0,ce._)`typeof ${t} == "number"`,c,r?(0,ce._)`isFinite(${t})`:ce.nil)}}o(Yp,"checkDataType");Ot.checkDataType=Yp;function Qp(e,t,r,n){if(e.length===1)return Yp(e[0],t,r,n);let i,s=(0,l0.toHash)(e);if(s.array&&s.object){let a=(0,ce._)`typeof ${t} != "object"`;i=s.null?a:(0,ce._)`!${t} || ${a}`,delete s.null,delete s.array,delete s.object}else i=ce.nil;s.number&&delete s.integer;for(let a in s)i=(0,ce.and)(i,Yp(a,t,r,n));return i}o(Qp,"checkDataTypes");Ot.checkDataTypes=Qp;var qA={message:o(({schema:e})=>`must be ${e}`,"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,ce._)`{type: ${e}}`:(0,ce._)`{type: ${t}}`,"params")};function Jp(e){let t=DA(e);(0,TA.reportError)(t,qA)}o(Jp,"reportTypeError");Ot.reportTypeError=Jp;function DA(e){let{gen:t,data:r,schema:n}=e,i=(0,l0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(DA,"getTypeErrorContext")});var h0=v(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.assignDefaults=void 0;var No=ae(),LA=he();function FA(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)d0(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>d0(e,s,i.default))}o(FA,"assignDefaults");ou.assignDefaults=FA;function d0(e,t,r){let{gen:n,compositeRule:i,data:s,opts:a}=e;if(r===void 0)return;let c=(0,No._)`${s}${(0,No.getProperty)(t)}`;if(i){(0,LA.checkStrictMode)(e,`default is ignored for: ${c}`);return}let u=(0,No._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,No._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,No._)`${c} = ${(0,No.stringify)(r)}`)}o(d0,"assignDefault")});var hr=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.validateUnion=Ae.validateArray=Ae.usePattern=Ae.callValidateCode=Ae.schemaProperties=Ae.allSchemaProperties=Ae.noPropertyInData=Ae.propertyInData=Ae.isOwnProperty=Ae.hasPropFunc=Ae.reportMissingProp=Ae.checkMissingProp=Ae.checkReportMissingProp=void 0;var De=ae(),Xp=he(),Mn=dr(),HA=he();function BA(e,t){let{gen:r,data:n,it:i}=e;r.if(td(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,De._)`${t}`},!0),e.error()})}o(BA,"checkReportMissingProp");Ae.checkReportMissingProp=BA;function VA({gen:e,data:t,it:{opts:r}},n,i){return(0,De.or)(...n.map(s=>(0,De.and)(td(e,t,s,r.ownProperties),(0,De._)`${i} = ${s}`)))}o(VA,"checkMissingProp");Ae.checkMissingProp=VA;function UA(e,t){e.setParams({missingProperty:t},!0),e.error()}o(UA,"reportMissingProp");Ae.reportMissingProp=UA;function m0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,De._)`Object.prototype.hasOwnProperty`})}o(m0,"hasPropFunc");Ae.hasPropFunc=m0;function ed(e,t,r){return(0,De._)`${m0(e)}.call(${t}, ${r})`}o(ed,"isOwnProperty");Ae.isOwnProperty=ed;function GA(e,t,r,n){let i=(0,De._)`${t}${(0,De.getProperty)(r)} !== undefined`;return n?(0,De._)`${i} && ${ed(e,t,r)}`:i}o(GA,"propertyInData");Ae.propertyInData=GA;function td(e,t,r,n){let i=(0,De._)`${t}${(0,De.getProperty)(r)} === undefined`;return n?(0,De.or)(i,(0,De.not)(ed(e,t,r))):i}o(td,"noPropertyInData");Ae.noPropertyInData=td;function g0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(g0,"allSchemaProperties");Ae.allSchemaProperties=g0;function zA(e,t){return g0(t).filter(r=>!(0,Xp.alwaysValidSchema)(e,t[r]))}o(zA,"schemaProperties");Ae.schemaProperties=zA;function ZA({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},c,u,l){let p=l?(0,De._)`${e}, ${t}, ${n}${i}`:t,f=[[Mn.default.instancePath,(0,De.strConcat)(Mn.default.instancePath,s)],[Mn.default.parentData,a.parentData],[Mn.default.parentDataProperty,a.parentDataProperty],[Mn.default.rootData,Mn.default.rootData]];a.opts.dynamicRef&&f.push([Mn.default.dynamicAnchors,Mn.default.dynamicAnchors]);let d=(0,De._)`${p}, ${r.object(...f)}`;return u!==De.nil?(0,De._)`${c}.call(${u}, ${d})`:(0,De._)`${c}(${d})`}o(ZA,"callValidateCode");Ae.callValidateCode=ZA;var WA=(0,De._)`new RegExp`;function KA({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,De._)`${i.code==="new RegExp"?WA:(0,HA.useFunc)(e,i)}(${r}, ${n})`})}o(KA,"usePattern");Ae.usePattern=KA;function YA(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return a(()=>t.assign(c,!1)),c}return t.var(s,!0),a(()=>t.break()),s;function a(c){let u=t.const("len",(0,De._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:Xp.Type.Num},s),t.if((0,De.not)(s),c)})}o(a,"validateItems")}o(YA,"validateArray");Ae.validateArray=YA;function QA(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Xp.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let p=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);t.assign(a,(0,De._)`${a} || ${c}`),e.mergeValidEvaluated(p,c)||t.if((0,De.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}o(QA,"validateUnion");Ae.validateUnion=QA});var v0=v(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.validateKeywordUsage=zr.validSchemaType=zr.funcKeywordCode=zr.macroKeywordCode=void 0;var Tt=ae(),Ri=dr(),JA=hr(),XA=zs();function eI(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=b0(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:Tt.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}o(eI,"macroKeywordCode");zr.macroKeywordCode=eI;function tI(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:u}=e;nI(u,t);let l=!c&&t.compile?t.compile.call(u.self,s,a,u):t.validate,p=b0(n,i,l),f=n.let("valid");e.block$data(f,d),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function d(){if(t.errors===!1)b(),t.modifying&&y0(e),g(()=>e.error());else{let P=t.async?h():y();t.modifying&&y0(e),g(()=>rI(e,P))}}o(d,"validateKeyword");function h(){let P=n.let("ruleErrs",null);return n.try(()=>b((0,Tt._)`await `),$=>n.assign(f,!1).if((0,Tt._)`${$} instanceof ${u.ValidationError}`,()=>n.assign(P,(0,Tt._)`${$}.errors`),()=>n.throw($))),P}o(h,"validateAsync");function y(){let P=(0,Tt._)`${p}.errors`;return n.assign(P,null),b(Tt.nil),P}o(y,"validateSync");function b(P=t.async?(0,Tt._)`await `:Tt.nil){let $=u.opts.passContext?Ri.default.this:Ri.default.self,C=!("compile"in t&&!c||t.schema===!1);n.assign(f,(0,Tt._)`${P}${(0,JA.callValidateCode)(e,p,$,C)}`,t.modifying)}o(b,"assignValid");function g(P){var $;n.if((0,Tt.not)(($=t.valid)!==null&&$!==void 0?$:f),P)}o(g,"reportErrs")}o(tI,"funcKeywordCode");zr.funcKeywordCode=tI;function y0(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Tt._)`${n.parentData}[${n.parentDataProperty}]`))}o(y0,"modifyData");function rI(e,t){let{gen:r}=e;r.if((0,Tt._)`Array.isArray(${t})`,()=>{r.assign(Ri.default.vErrors,(0,Tt._)`${Ri.default.vErrors} === null ? ${t} : ${Ri.default.vErrors}.concat(${t})`).assign(Ri.default.errors,(0,Tt._)`${Ri.default.vErrors}.length`),(0,XA.extendErrors)(e)},()=>e.error())}o(rI,"addErrs");function nI({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(nI,"checkAsyncKeyword");function b0(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Tt.stringify)(r)})}o(b0,"useKeyword");function iI(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(iI,"validSchemaType");zr.validSchemaType=iI;function oI({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a!=null&&a.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(oI,"validateKeywordUsage");zr.validateKeywordUsage=oI});var S0=v(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.extendSubschemaMode=kn.extendSubschemaData=kn.getSubschema=void 0;var Zr=ae(),_0=he();function sI(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,Zr._)`${e.schemaPath}${(0,Zr.getProperty)(t)}${(0,Zr.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,_0.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(sI,"getSubschema");kn.getSubschema=sI;function aI(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:l,dataPathArr:p,opts:f}=t,d=c.let("data",(0,Zr._)`${t.data}${(0,Zr.getProperty)(r)}`,!0);u(d),e.errorPath=(0,Zr.str)`${l}${(0,_0.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Zr._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(i!==void 0){let l=i instanceof Zr.Name?i:c.let("data",i,!0);u(l),a!==void 0&&(e.propertyName=a)}s&&(e.dataTypes=s);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}o(u,"dataContextProps")}o(aI,"extendSubschemaData");kn.extendSubschemaData=aI;function cI(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(cI,"extendSubschemaMode");kn.extendSubschemaMode=cI});var rd=v((l7,E0)=>{"use strict";E0.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r},"equal")});var P0=v((p7,O0)=>{"use strict";var qn=O0.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};su(t,n,i,e,"",e)};qn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};qn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};qn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};qn.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 su(e,t,r,n,i,s,a,c,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,a,c,u,l);for(var p in n){var f=n[p];if(Array.isArray(f)){if(p in qn.arrayKeywords)for(var d=0;d<f.length;d++)su(e,t,r,f[d],i+"/"+p+"/"+d,s,i,p,n,d)}else if(p in qn.propsKeywords){if(f&&typeof f=="object")for(var h in f)su(e,t,r,f[h],i+"/"+p+"/"+uI(h),s,i,p,n,h)}else(p in qn.keywords||e.allKeys&&!(p in qn.skipKeywords))&&su(e,t,r,f,i+"/"+p,s,i,p,n)}r(n,i,s,a,c,u,l)}}o(su,"_traverse");function uI(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(uI,"escapeJsonPtr")});var Ws=v(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.getSchemaRefs=Vt.resolveUrl=Vt.normalizeId=Vt._getFullPath=Vt.getFullPath=Vt.inlineRef=void 0;var lI=he(),fI=rd(),pI=P0(),dI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function hI(e,t=!0){return typeof e=="boolean"?!0:t===!0?!nd(e):t?x0(e)<=t:!1}o(hI,"inlineRef");Vt.inlineRef=hI;var mI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nd(e){for(let t in e){if(mI.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(nd)||typeof r=="object"&&nd(r))return!0}return!1}o(nd,"hasRef");function x0(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!dI.has(r)&&(typeof e[r]=="object"&&(0,lI.eachItem)(e[r],n=>t+=x0(n)),t===1/0))return 1/0}return t}o(x0,"countKeys");function $0(e,t="",r){r!==!1&&(t=jo(t));let n=e.parse(t);return w0(e,n)}o($0,"getFullPath");Vt.getFullPath=$0;function w0(e,t){return e.serialize(t).split("#")[0]+"#"}o(w0,"_getFullPath");Vt._getFullPath=w0;var gI=/#\/?$/;function jo(e){return e?e.replace(gI,""):""}o(jo,"normalizeId");Vt.normalizeId=jo;function yI(e,t,r){return r=jo(r),e.resolve(t,r)}o(yI,"resolveUrl");Vt.resolveUrl=yI;var bI=/^[a-z_][-a-z0-9._]*$/i;function vI(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=jo(e[r]||t),s={"":i},a=$0(n,i,!1),c={},u=new Set;return pI(e,{allKeys:!0},(f,d,h,y)=>{if(y===void 0)return;let b=a+d,g=s[y];typeof f[r]=="string"&&(g=P.call(this,f[r])),$.call(this,f.$anchor),$.call(this,f.$dynamicAnchor),s[d]=g;function P(C){let T=this.opts.uriResolver.resolve;if(C=jo(g?T(g,C):C),u.has(C))throw p(C);u.add(C);let A=this.refs[C];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(f,A.schema,C):C!==jo(b)&&(C[0]==="#"?(l(f,c[C],C),c[C]=f):this.refs[C]=b),C}o(P,"addRef");function $(C){if(typeof C=="string"){if(!bI.test(C))throw new Error(`invalid anchor "${C}"`);P.call(this,`#${C}`)}}o($,"addAnchor")}),c;function l(f,d,h){if(d!==void 0&&!fI(f,d))throw p(h)}o(l,"checkAmbiguosRef");function p(f){return new Error(`reference "${f}" resolves to more than one schema`)}o(p,"ambiguos")}o(vI,"getSchemaRefs");Vt.getSchemaRefs=vI});var Qs=v(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.getData=Dn.KeywordCxt=Dn.validateFunctionCode=void 0;var R0=a0(),A0=Zs(),od=Kp(),au=Zs(),_I=h0(),Ys=v0(),id=S0(),K=ae(),oe=dr(),SI=Ws(),gn=he(),Ks=zs();function EI(e){if(M0(e)&&(k0(e),j0(e))){xI(e);return}N0(e,()=>(0,R0.topBoolOrEmptySchema)(e))}o(EI,"validateFunctionCode");Dn.validateFunctionCode=EI;function N0({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,K._)`${oe.default.data}, ${oe.default.valCxt}`,n.$async,()=>{e.code((0,K._)`"use strict"; ${I0(r,i)}`),PI(e,i),e.code(s)}):e.func(t,(0,K._)`${oe.default.data}, ${OI(i)}`,n.$async,()=>e.code(I0(r,i)).code(s))}o(N0,"validateFunction");function OI(e){return(0,K._)`{${oe.default.instancePath}="", ${oe.default.parentData}, ${oe.default.parentDataProperty}, ${oe.default.rootData}=${oe.default.data}${e.dynamicRef?(0,K._)`, ${oe.default.dynamicAnchors}={}`:K.nil}}={}`}o(OI,"destructureValCxt");function PI(e,t){e.if(oe.default.valCxt,()=>{e.var(oe.default.instancePath,(0,K._)`${oe.default.valCxt}.${oe.default.instancePath}`),e.var(oe.default.parentData,(0,K._)`${oe.default.valCxt}.${oe.default.parentData}`),e.var(oe.default.parentDataProperty,(0,K._)`${oe.default.valCxt}.${oe.default.parentDataProperty}`),e.var(oe.default.rootData,(0,K._)`${oe.default.valCxt}.${oe.default.rootData}`),t.dynamicRef&&e.var(oe.default.dynamicAnchors,(0,K._)`${oe.default.valCxt}.${oe.default.dynamicAnchors}`)},()=>{e.var(oe.default.instancePath,(0,K._)`""`),e.var(oe.default.parentData,(0,K._)`undefined`),e.var(oe.default.parentDataProperty,(0,K._)`undefined`),e.var(oe.default.rootData,oe.default.data),t.dynamicRef&&e.var(oe.default.dynamicAnchors,(0,K._)`{}`)})}o(PI,"destructureValCxtES5");function xI(e){let{schema:t,opts:r,gen:n}=e;N0(e,()=>{r.$comment&&t.$comment&&D0(e),CI(e),n.let(oe.default.vErrors,null),n.let(oe.default.errors,0),r.unevaluated&&$I(e),q0(e),NI(e)})}o(xI,"topSchemaObjCode");function $I(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,K._)`${r}.evaluated`),t.if((0,K._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,K._)`${e.evaluated}.props`,(0,K._)`undefined`)),t.if((0,K._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,K._)`${e.evaluated}.items`,(0,K._)`undefined`))}o($I,"resetEvaluated");function I0(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,K._)`/*# sourceURL=${r} */`:K.nil}o(I0,"funcSourceUrl");function wI(e,t){if(M0(e)&&(k0(e),j0(e))){AI(e,t);return}(0,R0.boolOrEmptySchema)(e,t)}o(wI,"subschemaCode");function j0({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(j0,"schemaCxtHasRules");function M0(e){return typeof e.schema!="boolean"}o(M0,"isSchemaObj");function AI(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&D0(e),TI(e),RI(e);let s=n.const("_errs",oe.default.errors);q0(e,s),n.var(t,(0,K._)`${s} === ${oe.default.errors}`)}o(AI,"subSchemaObjCode");function k0(e){(0,gn.checkUnknownRules)(e),II(e)}o(k0,"checkKeywords");function q0(e,t){if(e.opts.jtd)return C0(e,[],!1,t);let r=(0,A0.getSchemaTypes)(e.schema),n=(0,A0.coerceAndCheckDataType)(e,r);C0(e,r,!n,t)}o(q0,"typeAndKeywords");function II(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,gn.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}o(II,"checkRefsAndKeywords");function CI(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,gn.checkStrictMode)(e,"default is ignored in the schema root")}o(CI,"checkNoDefault");function TI(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,SI.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(TI,"updateContext");function RI(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(RI,"checkAsyncSchema");function D0({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,K._)`${oe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,K.str)`${n}/$comment`,c=e.scopeValue("root",{ref:t.root});e.code((0,K._)`${oe.default.self}.opts.$comment(${s}, ${a}, ${c}.schema)`)}}o(D0,"commentKeyword");function NI(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,K._)`${oe.default.errors} === 0`,()=>t.return(oe.default.data),()=>t.throw((0,K._)`new ${i}(${oe.default.vErrors})`)):(t.assign((0,K._)`${n}.errors`,oe.default.vErrors),s.unevaluated&&jI(e),t.return((0,K._)`${oe.default.errors} === 0`))}o(NI,"returnResults");function jI({gen:e,evaluated:t,props:r,items:n}){r instanceof K.Name&&e.assign((0,K._)`${t}.props`,r),n instanceof K.Name&&e.assign((0,K._)`${t}.items`,n)}o(jI,"assignEvaluated");function C0(e,t,r,n){let{gen:i,schema:s,data:a,allErrors:c,opts:u,self:l}=e,{RULES:p}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,gn.schemaHasRulesButRef)(s,p))){i.block(()=>F0(e,"$ref",p.all.$ref.definition));return}u.jtd||MI(e,t),i.block(()=>{for(let d of p.rules)f(d);f(p.post)});function f(d){(0,od.shouldUseGroup)(s,d)&&(d.type?(i.if((0,au.checkDataType)(d.type,a,u.strictNumbers)),T0(e,d),t.length===1&&t[0]===d.type&&r&&(i.else(),(0,au.reportTypeError)(e)),i.endIf()):T0(e,d),c||i.if((0,K._)`${oe.default.errors} === ${n||0}`))}o(f,"groupKeywords")}o(C0,"schemaKeywords");function T0(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,_I.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,od.shouldUseRule)(n,s)&&F0(e,s.keyword,s.definition,t.type)})}o(T0,"iterateKeywords");function MI(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(kI(e,t),e.opts.allowUnionTypes||qI(e,t),DI(e,e.dataTypes))}o(MI,"checkStrictTypes");function kI(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{L0(e.dataTypes,r)||sd(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),FI(e,t)}}o(kI,"checkContextTypes");function qI(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&sd(e,"use allowUnionTypes to allow union type keyword")}o(qI,"checkMultipleTypes");function DI(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,od.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>LI(t,a))&&sd(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}o(DI,"checkKeywordTypes");function LI(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(LI,"hasApplicableType");function L0(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(L0,"includesType");function FI(e,t){let r=[];for(let n of e.dataTypes)L0(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(FI,"narrowSchemaTypes");function sd(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,gn.checkStrictMode)(e,t,e.opts.strictTypes)}o(sd,"strictTypesError");var ad=class ad{constructor(t,r,n){if((0,Ys.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,gn.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",H0(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ys.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",oe.default.errors))}result(t,r,n){this.failResult((0,K.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,K.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,K._)`${r} !== undefined && (${(0,K.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ks.reportExtraError:Ks.reportError)(this,this.def.error,r)}$dataError(){(0,Ks.reportError)(this,this.def.$dataError||Ks.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ks.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=K.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=K.nil,r=K.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,K.or)((0,K._)`${i} === undefined`,r)),t!==K.nil&&n.assign(t,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==K.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,K.or)(a(),c());function a(){if(n.length){if(!(r instanceof K.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,K._)`${(0,au.checkDataTypes)(u,r,s.opts.strictNumbers,au.DataType.Wrong)}`}return K.nil}function c(){if(i.validateSchema){let u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,K._)`!${u}(${r})`}return K.nil}}subschema(t,r){let n=(0,id.getSubschema)(this.it,t);(0,id.extendSubschemaData)(n,this.it,t),(0,id.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return wI(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=gn.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=gn.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,K.Name)),!0}};o(ad,"KeywordCxt");var cu=ad;Dn.KeywordCxt=cu;function F0(e,t,r,n){let i=new cu(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Ys.funcKeywordCode)(i,r):"macro"in r?(0,Ys.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Ys.funcKeywordCode)(i,r)}o(F0,"keywordCode");var HI=/^\/(?:[^~]|~0|~1)*$/,BI=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function H0(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return oe.default.rootData;if(e[0]==="/"){if(!HI.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,s=oe.default.rootData}else{let l=BI.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let p=+l[1];if(i=l[2],i==="#"){if(p>=t)throw new Error(u("property/index",p));return n[t-p]}if(p>t)throw new Error(u("data",p));if(s=r[t-p],!i)return s}let a=s,c=i.split("/");for(let l of c)l&&(s=(0,K._)`${s}${(0,K.getProperty)((0,gn.unescapeJsonPointer)(l))}`,a=(0,K._)`${a} && ${s}`);return a;function u(l,p){return`Cannot access ${l} ${p} levels up, current level is ${t}`}}o(H0,"getData");Dn.getData=H0});var uu=v(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});var ld=class ld extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(ld,"ValidationError");var cd=ld;ud.default=cd});var Js=v(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var fd=Ws(),hd=class hd extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,fd.resolveUrl)(t,r,n),this.missingSchema=(0,fd.normalizeId)((0,fd.getFullPath)(t,this.missingRef))}};o(hd,"MissingRefError");var pd=hd;dd.default=pd});var Xs=v(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.resolveSchema=mr.getCompilingSchema=mr.resolveRef=mr.compileSchema=mr.SchemaEnv=void 0;var Ar=ae(),VI=uu(),Ni=dr(),Ir=Ws(),B0=he(),UI=Qs(),yd=class yd{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ir.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(yd,"SchemaEnv");var Mo=yd;mr.SchemaEnv=Mo;function gd(e){let t=V0.call(this,e);if(t)return t;let r=(0,Ir.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Ar.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=a.scopeValue("Error",{ref:VI.default,code:(0,Ar._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName("validate");e.validateName=u;let l={gen:a,allErrors:this.opts.allErrors,data:Ni.default.data,parentData:Ni.default.parentData,parentDataProperty:Ni.default.parentDataProperty,dataNames:[Ni.default.data],dataPathArr:[Ar.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Ar.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ar.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ar._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(e),(0,UI.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let f=a.toString();p=`${a.scopeRefs(Ni.default.scope)}return ${f}`,this.opts.code.process&&(p=this.opts.code.process(p,e));let h=new Function(`${Ni.default.self}`,`${Ni.default.scope}`,p)(this,this.scope.get());if(this.scope.value(u,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:u,validateCode:f,scopeValues:a._values}),this.opts.unevaluated){let{props:y,items:b}=l;h.evaluated={props:y instanceof Ar.Name?void 0:y,items:b instanceof Ar.Name?void 0:b,dynamicProps:y instanceof Ar.Name,dynamicItems:b instanceof Ar.Name},h.source&&(h.source.evaluated=(0,Ar.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),f}finally{this._compilations.delete(e)}}o(gd,"compileSchema");mr.compileSchema=gd;function GI(e,t,r){var n;r=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=WI.call(this,e,r);if(s===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;a&&(s=new Mo({schema:a,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=zI.call(this,s)}o(GI,"resolveRef");mr.resolveRef=GI;function zI(e){return(0,Ir.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:gd.call(this,e)}o(zI,"inlineOrCompile");function V0(e){for(let t of this._compilations)if(ZI(t,e))return t}o(V0,"getCompilingSchema");mr.getCompilingSchema=V0;function ZI(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(ZI,"sameSchemaEnv");function WI(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||lu.call(this,e,t)}o(WI,"resolve");function lu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ir._getFullPath)(this.opts.uriResolver,r),i=(0,Ir.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return md.call(this,r,e);let s=(0,Ir.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let c=lu.call(this,e,a);return typeof(c==null?void 0:c.schema)!="object"?void 0:md.call(this,r,c)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||gd.call(this,a),s===(0,Ir.normalizeId)(t)){let{schema:c}=a,{schemaId:u}=this.opts,l=c[u];return l&&(i=(0,Ir.resolveUrl)(this.opts.uriResolver,i,l)),new Mo({schema:c,schemaId:u,root:e,baseId:i})}return md.call(this,r,a)}}o(lu,"resolveSchema");mr.resolveSchema=lu;var KI=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function md(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,B0.unescapeFragment)(c)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!KI.has(c)&&l&&(t=(0,Ir.resolveUrl)(this.opts.uriResolver,t,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,B0.schemaHasRulesButRef)(r,this.RULES)){let c=(0,Ir.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=lu.call(this,n,c)}let{schemaId:a}=this.opts;if(s=s||new Mo({schema:r,schemaId:a,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(md,"getJsonPointer")});var U0=v((P7,YI)=>{YI.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 z0=v((x7,G0)=>{"use strict";var QI={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};G0.exports={HEX:QI}});var ev=v(($7,X0)=>{"use strict";var{HEX:JI}=z0();function Y0(e){if(J0(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:eC(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Y0,"normalizeIPv4");function bd(e,t=!1){let r="",n=!0;for(let i of e){if(JI[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(bd,"stringArrayToHexStripped");function XI(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,c=!1;function u(){if(i.length){if(s===!1){let l=bd(i);if(l!==void 0)n.push(l);else return r.error=!0,!1}i.length=0}return!0}o(u,"consume");for(let l=0;l<e.length;l++){let p=e[l];if(!(p==="["||p==="]"))if(p===":"){if(a===!0&&(c=!0),!u())break;if(t++,n.push(":"),t>7){r.error=!0;break}l-1>=0&&e[l-1]===":"&&(a=!0);continue}else if(p==="%"){if(!u())break;s=!0}else{i.push(p);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(bd(i))),r.address=n.join(""),r}o(XI,"getIPV6");function Q0(e,t={}){if(J0(e,":")<2)return{host:e,isIPV6:!1};let r=XI(e);if(r.error)return{host:e,isIPV6:!1};{let n=r.address,i=r.address;return r.zone&&(n+="%"+r.zone,i+="%25"+r.zone),{host:n,escapedHost:i,isIPV6:!0}}}o(Q0,"normalizeIPv6");function eC(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let a=e[s];a==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=a,n=!1):(a===t?n=!0:n=!1,r+=a)}return r}o(eC,"stripLeadingZeros");function J0(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(J0,"findToken");var Z0=/^\.\.?\//u,W0=/^\/\.(?:\/|$)/u,K0=/^\/\.\.(?:\/|$)/u,tC=/^\/?(?:.|\n)*?(?=\/|$)/u;function rC(e){let t=[];for(;e.length;)if(e.match(Z0))e=e.replace(Z0,"");else if(e.match(W0))e=e.replace(W0,"/");else if(e.match(K0))e=e.replace(K0,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(tC);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(rC,"removeDotSegments");function nC(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(nC,"normalizeComponentEncoding");function iC(e,t){let r=[];if(e.userinfo!==void 0&&(r.push(e.userinfo),r.push("@")),e.host!==void 0){let n=unescape(e.host),i=Y0(n);if(i.isIPV4)n=i.host;else{let s=Q0(i.host,{isIPV4:!1});s.isIPV6===!0?n=`[${s.escapedHost}]`:n=e.host}r.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}o(iC,"recomposeAuthority");X0.exports={recomposeAuthority:iC,normalizeComponentEncoding:nC,removeDotSegments:rC,normalizeIPv4:Y0,normalizeIPv6:Q0,stringArrayToHexStripped:bd}});var sv=v((A7,ov)=>{"use strict";var oC=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,sC=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function tv(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(tv,"isSecure");function rv(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(rv,"httpParse");function nv(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(nv,"httpSerialize");function aC(e){return e.secure=tv(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(aC,"wsParse");function cC(e){if((e.port===(tv(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(cC,"wsSerialize");function uC(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(sC);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=vd[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(uC,"urnParse");function lC(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=vd[i];s&&(e=s.serialize(e,t));let a=e,c=e.nss;return a.path=`${n||t.nid}:${c}`,t.skipEscape=!0,a}o(lC,"urnSerialize");function fC(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!oC.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(fC,"urnuuidParse");function pC(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(pC,"urnuuidSerialize");var iv={scheme:"http",domainHost:!0,parse:rv,serialize:nv},dC={scheme:"https",domainHost:iv.domainHost,parse:rv,serialize:nv},fu={scheme:"ws",domainHost:!0,parse:aC,serialize:cC},hC={scheme:"wss",domainHost:fu.domainHost,parse:fu.parse,serialize:fu.serialize},mC={scheme:"urn",parse:uC,serialize:lC,skipNormalize:!0},gC={scheme:"urn:uuid",parse:fC,serialize:pC,skipNormalize:!0},vd={http:iv,https:dC,ws:fu,wss:hC,urn:mC,"urn:uuid":gC};ov.exports=vd});var cv=v((C7,du)=>{"use strict";var{normalizeIPv6:yC,normalizeIPv4:bC,removeDotSegments:ea,recomposeAuthority:vC,normalizeComponentEncoding:pu}=ev(),_d=sv();function _C(e,t){return typeof e=="string"?e=Wr(yn(e,t),t):typeof e=="object"&&(e=yn(Wr(e,t),t)),e}o(_C,"normalize");function SC(e,t,r){let n=Object.assign({scheme:"null"},r),i=av(yn(e,n),yn(t,n),n,!0);return Wr(i,{...n,skipEscape:!0})}o(SC,"resolve");function av(e,t,r,n){let i={};return n||(e=yn(Wr(e,r),r),t=yn(Wr(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ea(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ea(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=ea(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=ea(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(av,"resolveComponents");function EC(e,t,r){return typeof e=="string"?(e=unescape(e),e=Wr(pu(yn(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Wr(pu(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Wr(pu(yn(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Wr(pu(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}o(EC,"equal");function Wr(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=_d[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&(i.push(r.scheme),i.push(":"));let a=vC(r,n);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=ea(c)),a===void 0&&(c=c.replace(/^\/\//u,"/%2F")),i.push(c)}return r.query!==void 0&&(i.push("?"),i.push(r.query)),r.fragment!==void 0&&(i.push("#"),i.push(r.fragment)),i.join("")}o(Wr,"serialize");var OC=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function PC(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||OC[t])return!0;return!1}o(PC,"nonSimpleDomain");var xC=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yn(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let a=e.match(xC);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host){let u=bC(n.host);if(u.isIPV4===!1){let l=yC(u.host,{isIPV4:!1});n.host=l.host.toLowerCase(),s=l.isIPV6}else n.host=u.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&!n.path&&n.query===void 0?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=_d[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&PC(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.userinfo!==void 0&&(n.userinfo=unescape(n.userinfo)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path!==void 0&&n.path.length&&(n.path=escape(unescape(n.path))),n.fragment!==void 0&&n.fragment.length&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(yn,"parse");var Sd={SCHEMES:_d,normalize:_C,resolve:SC,resolveComponents:av,equal:EC,serialize:Wr,parse:yn};du.exports=Sd;du.exports.default=Sd;du.exports.fastUri=Sd});var lv=v(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var uv=cv();uv.code='require("ajv/dist/runtime/uri").default';Ed.default=uv});var qo=v(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.CodeGen=yt.Name=yt.nil=yt.stringify=yt.str=yt._=yt.KeywordCxt=void 0;var $C=Qs();Object.defineProperty(yt,"KeywordCxt",{enumerable:!0,get:o(function(){return $C.KeywordCxt},"get")});var ko=ae();Object.defineProperty(yt,"_",{enumerable:!0,get:o(function(){return ko._},"get")});Object.defineProperty(yt,"str",{enumerable:!0,get:o(function(){return ko.str},"get")});Object.defineProperty(yt,"stringify",{enumerable:!0,get:o(function(){return ko.stringify},"get")});Object.defineProperty(yt,"nil",{enumerable:!0,get:o(function(){return ko.nil},"get")});Object.defineProperty(yt,"Name",{enumerable:!0,get:o(function(){return ko.Name},"get")});Object.defineProperty(yt,"CodeGen",{enumerable:!0,get:o(function(){return ko.CodeGen},"get")});var wC=uu(),mv=Js(),AC=Wp(),ta=Xs(),IC=ae(),ra=Ws(),hu=Zs(),Pd=he(),fv=U0(),CC=lv(),gv=o((e,t)=>new RegExp(e,t),"defaultRegExp");gv.code="new RegExp";var TC=["removeAdditional","useDefaults","coerceTypes"],RC=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),NC={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."},jC={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},pv=200;function MC(e){var t,r,n,i,s,a,c,u,l,p,f,d,h,y,b,g,P,$,C,T,A,te,X,ze,$e;let G=e.strict,j=(t=e.code)===null||t===void 0?void 0:t.optimize,R=j===!0||j===void 0?1:j||0,q=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:gv,Q=(i=e.uriResolver)!==null&&i!==void 0?i:CC.default;return{strictSchema:(a=(s=e.strictSchema)!==null&&s!==void 0?s:G)!==null&&a!==void 0?a:!0,strictNumbers:(u=(c=e.strictNumbers)!==null&&c!==void 0?c:G)!==null&&u!==void 0?u:!0,strictTypes:(p=(l=e.strictTypes)!==null&&l!==void 0?l:G)!==null&&p!==void 0?p:"log",strictTuples:(d=(f=e.strictTuples)!==null&&f!==void 0?f:G)!==null&&d!==void 0?d:"log",strictRequired:(y=(h=e.strictRequired)!==null&&h!==void 0?h:G)!==null&&y!==void 0?y:!1,code:e.code?{...e.code,optimize:R,regExp:q}:{optimize:R,regExp:q},loopRequired:(b=e.loopRequired)!==null&&b!==void 0?b:pv,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:pv,meta:(P=e.meta)!==null&&P!==void 0?P:!0,messages:($=e.messages)!==null&&$!==void 0?$:!0,inlineRefs:(C=e.inlineRefs)!==null&&C!==void 0?C:!0,schemaId:(T=e.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(A=e.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(te=e.validateSchema)!==null&&te!==void 0?te:!0,validateFormats:(X=e.validateFormats)!==null&&X!==void 0?X:!0,unicodeRegExp:(ze=e.unicodeRegExp)!==null&&ze!==void 0?ze:!0,int32range:($e=e.int32range)!==null&&$e!==void 0?$e:!0,uriResolver:Q}}o(MC,"requiredOptions");var xd=class xd{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...MC(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new IC.ValueScope({scope:{},prefixes:RC,es5:r,lines:n}),this.logger=HC(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,AC.getRules)(),dv.call(this,NC,t,"NOT SUPPORTED"),dv.call(this,jC,t,"DEPRECATED","warn"),this._metaOpts=LC.call(this),t.formats&&qC.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&DC.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),kC.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=fv;n==="id"&&(i={...fv},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(p,f){await s.call(this,p.$schema);let d=this._addSchema(p,f);return d.validate||a.call(this,d)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function a(p){try{return this._compileSchemaEnv(p)}catch(f){if(!(f instanceof mv.default))throw f;return c.call(this,f),await u.call(this,f.missingSchema),a.call(this,p)}}function c({missingSchema:p,missingRef:f}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${f} cannot be resolved`)}async function u(p){let f=await l.call(this,p);this.refs[p]||await s.call(this,f.$schema),this.refs[p]||this.addSchema(f,p,r)}async function l(p){let f=this._loading[p];if(f)return f;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:a}=this.opts;if(s=t[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,ra.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=hv.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new ta.SchemaEnv({schema:{},schemaId:n});if(r=ta.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=hv.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ra.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(VC.call(this,n,r),!r)return(0,Pd.eachItem)(n,s=>Od.call(this,s)),this;GC.call(this,r);let i={...r,type:(0,hu.getJSONTypes)(r.type),schemaType:(0,hu.getJSONTypes)(r.schemaType)};return(0,Pd.eachItem)(n,i.type.length===0?s=>Od.call(this,s,i):s=>i.type.forEach(a=>Od.call(this,s,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),a=t;for(let c of s)a=a[c];for(let c in n){let u=n[c];if(typeof u!="object")continue;let{$data:l}=u.definition,p=a[c];l&&p&&(a[c]=yv(p))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof t=="object")a=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,ra.normalizeId)(a||n);let l=ra.getSchemaRefs.call(this,t,n);return u=new ta.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),i&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):ta.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{ta.compileSchema.call(this,t)}finally{this.opts=r}}};o(xd,"Ajv");var na=xd;na.ValidationError=wC.default;na.MissingRefError=mv.default;yt.default=na;function dv(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n](`${r}: option ${i}. ${e[s]}`)}}o(dv,"checkOptions");function hv(e){return e=(0,ra.normalizeId)(e),this.schemas[e]||this.refs[e]}o(hv,"getSchEnv");function kC(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(kC,"addInitialSchemas");function qC(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(qC,"addInitialFormats");function DC(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(DC,"addInitialKeywords");function LC(){let e={...this.opts};for(let t of TC)delete e[t];return e}o(LC,"getMetaSchemaOptions");var FC={log(){},warn(){},error(){}};function HC(e){if(e===!1)return FC;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(HC,"getLogger");var BC=/^[a-z_$][a-z0-9_$:-]*$/i;function VC(e,t){let{RULES:r}=this;if((0,Pd.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!BC.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(VC,"checkKeyword");function Od(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:u})=>u===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:{...t,type:(0,hu.getJSONTypes)(t.type),schemaType:(0,hu.getJSONTypes)(t.schemaType)}};t.before?UC.call(this,a,c,t.before):a.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}o(Od,"addRule");function UC(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}o(UC,"addBeforeRule");function GC(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=yv(t)),e.validateSchema=this.compile(t,!0))}o(GC,"keywordMetaschema");var zC={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function yv(e){return{anyOf:[e,zC]}}o(yv,"schemaOrData")});var ia=v(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.callRef=ji.getValidate=void 0;var ZC=Js(),bv=hr(),Ut=ae(),Do=dr(),vv=Xs(),mu=he(),WC={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:a,opts:c,self:u}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return f();let p=vv.resolveRef.call(u,l,i,r);if(p===void 0)throw new ZC.default(n.opts.uriResolver,i,r);if(p instanceof vv.SchemaEnv)return d(p);return h(p);function f(){if(s===l)return gu(e,a,s,s.$async);let y=t.scopeValue("root",{ref:l});return gu(e,(0,Ut._)`${y}.validate`,l,l.$async)}function d(y){let b=_v(e,y);gu(e,b,y,y.$async)}function h(y){let b=t.scopeValue("schema",c.code.source===!0?{ref:y,code:(0,Ut.stringify)(y)}:{ref:y}),g=t.name("valid"),P=e.subschema({schema:y,dataTypes:[],schemaPath:Ut.nil,topSchemaRef:b,errSchemaPath:r},g);e.mergeEvaluated(P),e.ok(g)}}};function _v(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ut._)`${r.scopeValue("wrapper",{ref:t})}.validate`}o(_v,"getValidate");ji.getValidate=_v;function gu(e,t,r,n){let{gen:i,it:s}=e,{allErrors:a,schemaEnv:c,opts:u}=s,l=u.passContext?Do.default.this:Ut.nil;n?p():f();function p(){if(!c.$async)throw new Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{i.code((0,Ut._)`await ${(0,bv.callValidateCode)(e,t,l)}`),h(t),a||i.assign(y,!0)},b=>{i.if((0,Ut._)`!(${b} instanceof ${s.ValidationError})`,()=>i.throw(b)),d(b),a||i.assign(y,!1)}),e.ok(y)}o(p,"callAsyncRef");function f(){e.result((0,bv.callValidateCode)(e,t,l),()=>h(t),()=>d(t))}o(f,"callSyncRef");function d(y){let b=(0,Ut._)`${y}.errors`;i.assign(Do.default.vErrors,(0,Ut._)`${Do.default.vErrors} === null ? ${b} : ${Do.default.vErrors}.concat(${b})`),i.assign(Do.default.errors,(0,Ut._)`${Do.default.vErrors}.length`)}o(d,"addErrorsFrom");function h(y){var b;if(!s.opts.unevaluated)return;let g=(b=r==null?void 0:r.validate)===null||b===void 0?void 0:b.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=mu.mergeEvaluated.props(i,g.props,s.props));else{let P=i.var("props",(0,Ut._)`${y}.evaluated.props`);s.props=mu.mergeEvaluated.props(i,P,s.props,Ut.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=mu.mergeEvaluated.items(i,g.items,s.items));else{let P=i.var("items",(0,Ut._)`${y}.evaluated.items`);s.items=mu.mergeEvaluated.items(i,P,s.items,Ut.Name)}}o(h,"addEvaluatedFrom")}o(gu,"callRef");ji.callRef=gu;ji.default=WC});var Sv=v($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var KC=ia(),YC=["$schema","id","$defs",{keyword:"$comment"},"definitions",KC.default];$d.default=YC});var Ev=v(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var wd=qo(),QC=ae(),Ln=QC.operators,Ad={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:Ln.LTE,fail:Ln.GT},{okStr:"<",ok:Ln.LT,fail:Ln.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:Ln.GTE,fail:Ln.LT},{okStr:">",ok:Ln.GT,fail:Ln.LTE}]}},JC={message:o(e=>wd.str`must be ${Id(e).okStr} ${e.schemaCode}`,"message"),params:o(e=>wd._`{comparison: ${Id(e).okStr}, limit: ${e.schemaCode}}`,"params")},XC={keyword:Object.keys(Ad),type:"number",schemaType:"number",$data:!0,error:JC,code(e){let{data:t,schemaCode:r}=e;e.fail$data(wd._`${t} ${Id(e).fail} ${r} || isNaN(${t})`)}};function Id(e){var t;let r=e.keyword,n=!((t=e.parentSchema)===null||t===void 0)&&t[Ad[r].exclusive]?1:0;return Ad[r].ops[n]}o(Id,"kwdOp");Cd.default=XC});var Pv=v(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var Ov={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},eT={keyword:Object.keys(Ov),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){let r=Ov[e];if(t[r]===void 0)throw new Error(`${e} can only be used with ${r}`)}};Td.default=eT});var Nd=v(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var oa=ae(),tT={message:o(({schemaCode:e})=>(0,oa.str)`must be multiple of ${e}`,"message"),params:o(({schemaCode:e})=>(0,oa._)`{multipleOf: ${e}}`,"params")},rT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:tT,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),c=s?(0,oa._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,oa._)`${a} !== parseInt(${a})`;e.fail$data((0,oa._)`(${n} === 0 || (${a} = ${r}/${n}, ${c}))`)}};Rd.default=rT});var $v=v(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});function xv(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(xv,"ucs2length");jd.default=xv;xv.code='require("ajv/dist/runtime/ucs2length").default'});var kd=v(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var Mi=ae(),nT=he(),iT=$v(),oT={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Mi.str)`must NOT have ${r} than ${t} characters`},params:o(({schemaCode:e})=>(0,Mi._)`{limit: ${e}}`,"params")},sT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:oT,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?Mi.operators.GT:Mi.operators.LT,a=i.opts.unicode===!1?(0,Mi._)`${r}.length`:(0,Mi._)`${(0,nT.useFunc)(e.gen,iT.default)}(${r})`;e.fail$data((0,Mi._)`${a} ${s} ${n}`)}};Md.default=sT});var Dd=v(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var aT=hr(),yu=ae(),cT={message:o(({schemaCode:e})=>(0,yu.str)`must match pattern "${e}"`,"message"),params:o(({schemaCode:e})=>(0,yu._)`{pattern: ${e}}`,"params")},uT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cT,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"",c=r?(0,yu._)`(new RegExp(${i}, ${a}))`:(0,aT.usePattern)(e,n);e.fail$data((0,yu._)`!${c}.test(${t})`)}};qd.default=uT});var Fd=v(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var sa=ae(),lT={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,sa.str)`must NOT have ${r} than ${t} properties`},params:o(({schemaCode:e})=>(0,sa._)`{limit: ${e}}`,"params")},fT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lT,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?sa.operators.GT:sa.operators.LT;e.fail$data((0,sa._)`Object.keys(${r}).length ${i} ${n}`)}};Ld.default=fT});var Bd=v(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var aa=hr(),ca=ae(),pT=he(),dT={message:o(({params:{missingProperty:e}})=>(0,ca.str)`must have required property '${e}'`,"message"),params:o(({params:{missingProperty:e}})=>(0,ca._)`{missingProperty: ${e}}`,"params")},hT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:dT,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:a}=e,{opts:c}=a;if(!s&&r.length===0)return;let u=r.length>=c.loopRequired;if(a.allErrors?l():p(),c.strictRequired){let h=e.parentSchema.properties,{definedProperties:y}=e.it;for(let b of r)if((h==null?void 0:h[b])===void 0&&!y.has(b)){let g=a.schemaEnv.baseId+a.errSchemaPath,P=`required property "${b}" is not defined at "${g}" (strictRequired)`;(0,pT.checkStrictMode)(a,P,a.opts.strictRequired)}}function l(){if(u||s)e.block$data(ca.nil,f);else for(let h of r)(0,aa.checkReportMissingProp)(e,h)}o(l,"allErrorsMode");function p(){let h=t.let("missing");if(u||s){let y=t.let("valid",!0);e.block$data(y,()=>d(h,y)),e.ok(y)}else t.if((0,aa.checkMissingProp)(e,r,h)),(0,aa.reportMissingProp)(e,h),t.else()}o(p,"exitOnErrorMode");function f(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,aa.noPropertyInData)(t,i,h,c.ownProperties),()=>e.error())})}o(f,"loopAllRequired");function d(h,y){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(y,(0,aa.propertyInData)(t,i,h,c.ownProperties)),t.if((0,ca.not)(y),()=>{e.error(),t.break()})},ca.nil)}o(d,"loopUntilMissing")}};Hd.default=hT});var Ud=v(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var ua=ae(),mT={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,ua.str)`must NOT have ${r} than ${t} items`},params:o(({schemaCode:e})=>(0,ua._)`{limit: ${e}}`,"params")},gT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mT,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?ua.operators.GT:ua.operators.LT;e.fail$data((0,ua._)`${r}.length ${i} ${n}`)}};Vd.default=gT});var bu=v(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var wv=rd();wv.code='require("ajv/dist/runtime/equal").default';Gd.default=wv});var Wd=v(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var zd=Zs(),bt=ae(),yT=he(),bT=bu(),vT={message:o(({params:{i:e,j:t}})=>(0,bt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,"message"),params:o(({params:{i:e,j:t}})=>(0,bt._)`{i: ${e}, j: ${t}}`,"params")},_T={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:vT,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:c}=e;if(!n&&!i)return;let u=t.let("valid"),l=s.items?(0,zd.getSchemaTypes)(s.items):[];e.block$data(u,p,(0,bt._)`${a} === false`),e.ok(u);function p(){let y=t.let("i",(0,bt._)`${r}.length`),b=t.let("j");e.setParams({i:y,j:b}),t.assign(u,!0),t.if((0,bt._)`${y} > 1`,()=>(f()?d:h)(y,b))}o(p,"validateUniqueItems");function f(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}o(f,"canOptimize");function d(y,b){let g=t.name("item"),P=(0,zd.checkDataTypes)(l,g,c.opts.strictNumbers,zd.DataType.Wrong),$=t.const("indices",(0,bt._)`{}`);t.for((0,bt._)`;${y}--;`,()=>{t.let(g,(0,bt._)`${r}[${y}]`),t.if(P,(0,bt._)`continue`),l.length>1&&t.if((0,bt._)`typeof ${g} == "string"`,(0,bt._)`${g} += "_"`),t.if((0,bt._)`typeof ${$}[${g}] == "number"`,()=>{t.assign(b,(0,bt._)`${$}[${g}]`),e.error(),t.assign(u,!1).break()}).code((0,bt._)`${$}[${g}] = ${y}`)})}o(d,"loopN");function h(y,b){let g=(0,yT.useFunc)(t,bT.default),P=t.name("outer");t.label(P).for((0,bt._)`;${y}--;`,()=>t.for((0,bt._)`${b} = ${y}; ${b}--;`,()=>t.if((0,bt._)`${g}(${r}[${y}], ${r}[${b}])`,()=>{e.error(),t.assign(u,!1).break(P)})))}o(h,"loopN2")}};Zd.default=_T});var Qd=v(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var Kd=ae(),ST=he(),ET=bu(),OT={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,Kd._)`{allowedValue: ${e}}`,"params")},PT={keyword:"const",$data:!0,error:OT,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,Kd._)`!${(0,ST.useFunc)(t,ET.default)}(${r}, ${i})`):e.fail((0,Kd._)`${s} !== ${r}`)}};Yd.default=PT});var Xd=v(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var la=ae(),xT=he(),$T=bu(),wT={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,la._)`{allowedValues: ${e}}`,"params")},AT={keyword:"enum",schemaType:"array",$data:!0,error:wT,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=a.opts.loopEnum,u,l=o(()=>u??(u=(0,xT.useFunc)(t,$T.default)),"getEql"),p;if(c||n)p=t.let("valid"),e.block$data(p,f);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let h=t.const("vSchema",s);p=(0,la.or)(...i.map((y,b)=>d(h,b)))}e.pass(p);function f(){t.assign(p,!1),t.forOf("v",s,h=>t.if((0,la._)`${l()}(${r}, ${h})`,()=>t.assign(p,!0).break()))}o(f,"loopEnum");function d(h,y){let b=i[y];return typeof b=="object"&&b!==null?(0,la._)`${l()}(${r}, ${h}[${y}])`:(0,la._)`${r} === ${b}`}o(d,"equalCode")}};Jd.default=AT});var Av=v(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});var IT=Ev(),CT=Pv(),TT=Nd(),RT=kd(),NT=Dd(),jT=Fd(),MT=Bd(),kT=Ud(),qT=Wd(),DT=Qd(),LT=Xd(),FT=[IT.default,CT.default,TT.default,RT.default,NT.default,jT.default,MT.default,kT.default,qT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},DT.default,LT.default];eh.default=FT});var rh=v(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.validateAdditionalItems=void 0;var ki=ae(),th=he(),HT={message:o(({params:{len:e}})=>(0,ki.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,ki._)`{limit: ${e}}`,"params")},BT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:HT,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,th.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Iv(e,n)}};function Iv(e,t){let{gen:r,schema:n,data:i,keyword:s,it:a}=e;a.items=!0;let c=r.const("len",(0,ki._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ki._)`${c} <= ${t.length}`);else if(typeof n=="object"&&!(0,th.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,ki._)`${c} <= ${t.length}`);r.if((0,ki.not)(l),()=>u(l)),e.ok(l)}function u(l){r.forRange("i",t.length,c,p=>{e.subschema({keyword:s,dataProp:p,dataPropType:th.Type.Num},l),a.allErrors||r.if((0,ki.not)(l),()=>r.break())})}o(u,"validateItems")}o(Iv,"validateAdditionalItems");fa.validateAdditionalItems=Iv;fa.default=BT});var nh=v(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.validateTuple=void 0;var Cv=ae(),vu=he(),VT=hr(),UT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Tv(e,"additionalItems",t);r.items=!0,!(0,vu.alwaysValidSchema)(r,t)&&e.ok((0,VT.validateArray)(e))}};function Tv(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:c}=e;p(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=vu.mergeEvaluated.items(n,r.length,c.items));let u=n.name("valid"),l=n.const("len",(0,Cv._)`${s}.length`);r.forEach((f,d)=>{(0,vu.alwaysValidSchema)(c,f)||(n.if((0,Cv._)`${l} > ${d}`,()=>e.subschema({keyword:a,schemaProp:d,dataProp:d},u)),e.ok(u))});function p(f){let{opts:d,errSchemaPath:h}=c,y=r.length,b=y===f.minItems&&(y===f.maxItems||f[t]===!1);if(d.strictTuples&&!b){let g=`"${a}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,vu.checkStrictMode)(c,g,d.strictTuples)}}o(p,"checkStrictTuple")}o(Tv,"validateTuple");pa.validateTuple=Tv;pa.default=UT});var Rv=v(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var GT=nh(),zT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,GT.validateTuple)(e,"items"),"code")};ih.default=zT});var jv=v(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var Nv=ae(),ZT=he(),WT=hr(),KT=rh(),YT={message:o(({params:{len:e}})=>(0,Nv.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,Nv._)`{limit: ${e}}`,"params")},QT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:YT,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,ZT.alwaysValidSchema)(n,t)&&(i?(0,KT.validateAdditionalItems)(e,i):e.ok((0,WT.validateArray)(e)))}};oh.default=QT});var Mv=v(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var gr=ae(),_u=he(),JT={message:o(({params:{min:e,max:t}})=>t===void 0?(0,gr.str)`must contain at least ${e} valid item(s)`:(0,gr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,gr._)`{minContains: ${e}}`:(0,gr._)`{minContains: ${e}, maxContains: ${t}}`,"params")},XT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:JT,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,a,c,{minContains:u,maxContains:l}=n;s.opts.next?(a=u===void 0?1:u,c=l):a=1;let p=t.const("len",(0,gr._)`${i}.length`);if(e.setParams({min:a,max:c}),c===void 0&&a===0){(0,_u.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,_u.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,_u.alwaysValidSchema)(s,r)){let b=(0,gr._)`${p} >= ${a}`;c!==void 0&&(b=(0,gr._)`${b} && ${p} <= ${c}`),e.pass(b);return}s.items=!0;let f=t.name("valid");c===void 0&&a===1?h(f,()=>t.if(f,()=>t.break())):a===0?(t.let(f,!0),c!==void 0&&t.if((0,gr._)`${i}.length > 0`,d)):(t.let(f,!1),d()),e.result(f,()=>e.reset());function d(){let b=t.name("_valid"),g=t.let("count",0);h(b,()=>t.if(b,()=>y(g)))}o(d,"validateItemsWithCount");function h(b,g){t.forRange("i",0,p,P=>{e.subschema({keyword:"contains",dataProp:P,dataPropType:_u.Type.Num,compositeRule:!0},b),g()})}o(h,"validateItems");function y(b){t.code((0,gr._)`${b}++`),c===void 0?t.if((0,gr._)`${b} >= ${a}`,()=>t.assign(f,!0).break()):(t.if((0,gr._)`${b} > ${c}`,()=>t.assign(f,!1).break()),a===1?t.assign(f,!0):t.if((0,gr._)`${b} >= ${a}`,()=>t.assign(f,!0)))}o(y,"checkLimits")}};sh.default=XT});var Su=v(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.validateSchemaDeps=Kr.validatePropertyDeps=Kr.error=void 0;var ah=ae(),eR=he(),da=hr();Kr.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,ah.str)`must have ${n} ${r} when property ${e} is present`},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,ah._)`{property: ${e},
11
11
  missingProperty: ${n},
12
12
  depsCount: ${t},
13
13
  deps: ${r}}`,"params")};var tR={keyword:"dependencies",type:"object",schemaType:"object",error:Kr.error,code(e){let[t,r]=rR(e);kv(e,t),qv(e,r)}};function rR({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}o(rR,"splitDependencies");function kv(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let a in t){let c=t[a];if(c.length===0)continue;let u=(0,da.propertyInData)(r,n,a,i.opts.ownProperties);e.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(u,()=>{for(let l of c)(0,da.checkReportMissingProp)(e,l)}):(r.if((0,ah._)`${u} && (${(0,da.checkMissingProp)(e,c,s)})`),(0,da.reportMissingProp)(e,s),r.else())}}o(kv,"validatePropertyDeps");Kr.validatePropertyDeps=kv;function qv(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,a=r.name("valid");for(let c in t)(0,eR.alwaysValidSchema)(s,t[c])||(r.if((0,da.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let u=e.subschema({keyword:i,schemaProp:c},a);e.mergeValidEvaluated(u,a)},()=>r.var(a,!0)),e.ok(a))}o(qv,"validateSchemaDeps");Kr.validateSchemaDeps=qv;Kr.default=tR});var Lv=v(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var Dv=ae(),nR=he(),iR={message:"property name must be valid",params:o(({params:e})=>(0,Dv._)`{propertyName: ${e.propertyName}}`,"params")},oR={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:iR,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,nR.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),t.if((0,Dv.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};ch.default=oR});var lh=v(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});var Eu=hr(),Cr=ae(),sR=dr(),Ou=he(),aR={message:"must NOT have additional properties",params:o(({params:e})=>(0,Cr._)`{additionalProperty: ${e.additionalProperty}}`,"params")},cR={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:aR,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,Ou.alwaysValidSchema)(a,r))return;let l=(0,Eu.allSchemaProperties)(n.properties),p=(0,Eu.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Cr._)`${s} === ${sR.default.errors}`);function f(){t.forIn("key",i,g=>{!l.length&&!p.length?y(g):t.if(d(g),()=>y(g))})}o(f,"checkAdditionalProperties");function d(g){let P;if(l.length>8){let $=(0,Ou.schemaRefOrVal)(a,n.properties,"properties");P=(0,Eu.isOwnProperty)(t,$,g)}else l.length?P=(0,Cr.or)(...l.map($=>(0,Cr._)`${g} === ${$}`)):P=Cr.nil;return p.length&&(P=(0,Cr.or)(P,...p.map($=>(0,Cr._)`${(0,Eu.usePattern)(e,$)}.test(${g})`))),(0,Cr.not)(P)}o(d,"isAdditional");function h(g){t.code((0,Cr._)`delete ${i}[${g}]`)}o(h,"deleteAdditional");function y(g){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){h(g);return}if(r===!1){e.setParams({additionalProperty:g}),e.error(),c||t.break();return}if(typeof r=="object"&&!(0,Ou.alwaysValidSchema)(a,r)){let P=t.name("valid");u.removeAdditional==="failing"?(b(g,P,!1),t.if((0,Cr.not)(P),()=>{e.reset(),h(g)})):(b(g,P),c||t.if((0,Cr.not)(P),()=>t.break()))}}o(y,"additionalPropertyCode");function b(g,P,$){let C={keyword:"additionalProperties",dataProp:g,dataPropType:Ou.Type.Str};$===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,P)}o(b,"applyAdditionalSchema")}};uh.default=cR});var Bv=v(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var uR=Qs(),Fv=hr(),fh=he(),Hv=lh(),lR={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Hv.default.code(new uR.KeywordCxt(s,Hv.default,"additionalProperties"));let a=(0,Fv.allSchemaProperties)(r);for(let f of a)s.definedProperties.add(f);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=fh.mergeEvaluated.props(t,(0,fh.toHash)(a),s.props));let c=a.filter(f=>!(0,fh.alwaysValidSchema)(s,r[f]));if(c.length===0)return;let u=t.name("valid");for(let f of c)l(f)?p(f):(t.if((0,Fv.propertyInData)(t,i,f,s.opts.ownProperties)),p(f),s.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(u);function l(f){return s.opts.useDefaults&&!s.compositeRule&&r[f].default!==void 0}o(l,"hasDefault");function p(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}o(p,"applyPropertySchema")}};ph.default=lR});var zv=v(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var Vv=hr(),Pu=ae(),Uv=he(),Gv=he(),fR={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:a}=s,c=(0,Vv.allSchemaProperties)(r),u=c.filter(b=>(0,Uv.alwaysValidSchema)(s,r[b]));if(c.length===0||u.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let l=a.strictSchema&&!a.allowMatchingProperties&&i.properties,p=t.name("valid");s.props!==!0&&!(s.props instanceof Pu.Name)&&(s.props=(0,Gv.evaluatedPropsToName)(t,s.props));let{props:f}=s;d();function d(){for(let b of c)l&&h(b),s.allErrors?y(b):(t.var(p,!0),y(b),t.if(p))}o(d,"validatePatternProperties");function h(b){for(let g in l)new RegExp(b).test(g)&&(0,Uv.checkStrictMode)(s,`property ${g} matches pattern ${b} (use allowMatchingProperties)`)}o(h,"checkMatchingProperties");function y(b){t.forIn("key",n,g=>{t.if((0,Pu._)`${(0,Vv.usePattern)(e,b)}.test(${g})`,()=>{let P=u.includes(b);P||e.subschema({keyword:"patternProperties",schemaProp:b,dataProp:g,dataPropType:Gv.Type.Str},p),s.opts.unevaluated&&f!==!0?t.assign((0,Pu._)`${f}[${g}]`,!0):!P&&!s.allErrors&&t.if((0,Pu.not)(p),()=>t.break())})})}o(y,"validateProperties")}};dh.default=fR});var Zv=v(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});var pR=he(),dR={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,pR.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};hh.default=dR});var Wv=v(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});var hR=hr(),mR={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:hR.validateUnion,error:{message:"must match a schema in anyOf"}};mh.default=mR});var Kv=v(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var xu=ae(),gR=he(),yR={message:"must match exactly one schema in oneOf",params:o(({params:e})=>(0,xu._)`{passingSchemas: ${e.passing}}`,"params")},bR={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:yR,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=t.let("valid",!1),c=t.let("passing",null),u=t.name("_valid");e.setParams({passing:c}),t.block(l),e.result(a,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((p,f)=>{let d;(0,gR.alwaysValidSchema)(i,p)?t.var(u,!0):d=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&t.if((0,xu._)`${u} && ${a}`).assign(a,!1).assign(c,(0,xu._)`[${c}, ${f}]`).else(),t.if(u,()=>{t.assign(a,!0),t.assign(c,f),d&&e.mergeEvaluated(d,xu.Name)})})}o(l,"validateOneOf")}};gh.default=bR});var Yv=v(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});var vR=he(),_R={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,a)=>{if((0,vR.alwaysValidSchema)(n,s))return;let c=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(c)})}};yh.default=_R});var Xv=v(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});var $u=ae(),Jv=he(),SR={message:o(({params:e})=>(0,$u.str)`must match "${e.ifClause}" schema`,"message"),params:o(({params:e})=>(0,$u._)`{failingKeyword: ${e.ifClause}}`,"params")},ER={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:SR,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,Jv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Qv(n,"then"),s=Qv(n,"else");if(!i&&!s)return;let a=t.let("valid",!0),c=t.name("_valid");if(u(),e.reset(),i&&s){let p=t.let("ifClause");e.setParams({ifClause:p}),t.if(c,l("then",p),l("else",p))}else i?t.if(c,l("then")):t.if((0,$u.not)(c),l("else"));e.pass(a,()=>e.error(!0));function u(){let p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(p)}o(u,"validateIf");function l(p,f){return()=>{let d=e.subschema({keyword:p},c);t.assign(a,c),e.mergeValidEvaluated(d,a),f?t.assign(f,(0,$u._)`${p}`):e.setParams({ifClause:p})}}o(l,"validateClause")}};function Qv(e,t){let r=e.schema[t];return r!==void 0&&!(0,Jv.alwaysValidSchema)(e,r)}o(Qv,"hasSchema");bh.default=ER});var e_=v(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var OR=he(),PR={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,OR.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};vh.default=PR});var Sh=v(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});var xR=rh(),$R=Rv(),wR=nh(),AR=jv(),IR=Mv(),CR=Su(),TR=Lv(),RR=lh(),NR=Bv(),jR=zv(),MR=Zv(),kR=Wv(),qR=Kv(),DR=Yv(),LR=Xv(),FR=e_();function HR(e=!1){let t=[MR.default,kR.default,qR.default,DR.default,LR.default,FR.default,TR.default,RR.default,CR.default,NR.default,jR.default];return e?t.push($R.default,AR.default):t.push(xR.default,wR.default),t.push(IR.default),t}o(HR,"getApplicator");_h.default=HR});var t_=v(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var rt=ae(),BR={message:o(({schemaCode:e})=>(0,rt.str)`must match format "${e}"`,"message"),params:o(({schemaCode:e})=>(0,rt._)`{format: ${e}}`,"params")},VR={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:BR,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:p,self:f}=c;if(!u.validateFormats)return;i?d():h();function d(){let y=r.scopeValue("formats",{ref:f.formats,code:u.code.formats}),b=r.const("fDef",(0,rt._)`${y}[${a}]`),g=r.let("fType"),P=r.let("format");r.if((0,rt._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>r.assign(g,(0,rt._)`${b}.type || "string"`).assign(P,(0,rt._)`${b}.validate`),()=>r.assign(g,(0,rt._)`"string"`).assign(P,b)),e.fail$data((0,rt.or)($(),C()));function $(){return u.strictSchema===!1?rt.nil:(0,rt._)`${a} && !${P}`}o($,"unknownFmt");function C(){let T=p.$async?(0,rt._)`(${b}.async ? await ${P}(${n}) : ${P}(${n}))`:(0,rt._)`${P}(${n})`,A=(0,rt._)`(typeof ${P} == "function" ? ${T} : ${P}.test(${n}))`;return(0,rt._)`${P} && ${P} !== true && ${g} === ${t} && !${A}`}o(C,"invalidFmt")}o(d,"validate$DataFormat");function h(){let y=f.formats[s];if(!y){$();return}if(y===!0)return;let[b,g,P]=C(y);b===t&&e.pass(T());function $(){if(u.strictSchema===!1){f.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${s}" ignored in schema at path "${l}"`}}o($,"unknownFormat");function C(A){let te=A instanceof RegExp?(0,rt.regexpCode)(A):u.code.formats?(0,rt._)`${u.code.formats}${(0,rt.getProperty)(s)}`:void 0,X=r.scopeValue("formats",{key:s,ref:A,code:te});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,rt._)`${X}.validate`]:["string",A,X]}o(C,"getFormat");function T(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!p.$async)throw new Error("async format in sync schema");return(0,rt._)`await ${P}(${n})`}return typeof g=="function"?(0,rt._)`${P}(${n})`:(0,rt._)`${P}.test(${n})`}o(T,"validCondition")}o(h,"validateFormat")}};Eh.default=VR});var Ph=v(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});var UR=t_(),GR=[UR.default];Oh.default=GR});var r_=v(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});var zR=Sv(),ZR=Av(),WR=Sh(),KR=Ph(),YR=["title","description","default"],QR=[zR.default,ZR.default,WR.default(),KR.default,YR];xh.default=QR});var i_=v(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.DiscrError=void 0;var n_;(function(e){e.Tag="tag",e.Mapping="mapping"})(n_||(wu.DiscrError=n_={}))});var Ah=v(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var Lo=ae(),$h=i_(),o_=Xs(),JR=Js(),XR=he(),eN={message:o(({params:{discrError:e,tagName:t}})=>e===$h.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,"message"),params:o(({params:{discrError:e,tag:t,tagName:r}})=>(0,Lo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`,"params")},tN={keyword:"discriminator",type:"object",schemaType:"object",error:eN,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),l=t.const("tag",(0,Lo._)`${r}${(0,Lo.getProperty)(c)}`);t.if((0,Lo._)`typeof ${l} == "string"`,()=>p(),()=>e.error(!1,{discrError:$h.DiscrError.Tag,tag:l,tagName:c})),e.ok(u);function p(){let h=d();t.if(!1);for(let y in h)t.elseIf((0,Lo._)`${l} === ${y}`),t.assign(u,f(h[y]));t.else(),e.error(!1,{discrError:$h.DiscrError.Mapping,tag:l,tagName:c}),t.endIf()}o(p,"validateMapping");function f(h){let y=t.name("valid"),b=e.subschema({keyword:"oneOf",schemaProp:h},y);return e.mergeEvaluated(b,Lo.Name),y}o(f,"applyTagSchema");function d(){var h;let y={},b=P(i),g=!0;for(let T=0;T<a.length;T++){let A=a[T];if(A!=null&&A.$ref&&!(0,XR.schemaHasRulesButRef)(A,s.self.RULES)){let X=A.$ref;if(A=o_.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,X),A instanceof o_.SchemaEnv&&(A=A.schema),A===void 0)throw new JR.default(s.opts.uriResolver,s.baseId,X)}let te=(h=A==null?void 0:A.properties)===null||h===void 0?void 0:h[c];if(typeof te!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);g=g&&(b||P(A)),$(te,T)}if(!g)throw new Error(`discriminator: "${c}" must be required`);return y;function P({required:T}){return Array.isArray(T)&&T.includes(c)}function $(T,A){if(T.const)C(T.const,A);else if(T.enum)for(let te of T.enum)C(te,A);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function C(T,A){if(typeof T!="string"||T in y)throw new Error(`discriminator: "${c}" values must be unique strings`);y[T]=A}}o(d,"getMapping")}};wh.default=tN});var s_=v((zB,rN)=>{rN.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}});var u_=v((at,c_)=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.CodeGen=at.Name=at.nil=at.stringify=at.str=at._=at.KeywordCxt=void 0;var nN=qo(),iN=r_(),oN=Ah(),a_=s_(),sN=["/properties"],Au="http://json-schema.org/draft-04/schema",Ih=class Ih extends nN.default{constructor(t={}){super({...t,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),iN.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(oN.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(a_,sN):a_;this.addMetaSchema(t,Au,!1),this.refs["http://json-schema.org/schema"]=Au}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Au)?Au:void 0)}};o(Ih,"Ajv");var Iu=Ih;c_.exports=at=Iu;Object.defineProperty(at,"__esModule",{value:!0});at.default=Iu;var aN=qo();Object.defineProperty(at,"KeywordCxt",{enumerable:!0,get:o(function(){return aN.KeywordCxt},"get")});var Fo=qo();Object.defineProperty(at,"_",{enumerable:!0,get:o(function(){return Fo._},"get")});Object.defineProperty(at,"str",{enumerable:!0,get:o(function(){return Fo.str},"get")});Object.defineProperty(at,"stringify",{enumerable:!0,get:o(function(){return Fo.stringify},"get")});Object.defineProperty(at,"nil",{enumerable:!0,get:o(function(){return Fo.nil},"get")});Object.defineProperty(at,"Name",{enumerable:!0,get:o(function(){return Fo.Name},"get")});Object.defineProperty(at,"CodeGen",{enumerable:!0,get:o(function(){return Fo.CodeGen},"get")})});var l_=v(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var cN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ch.default=cN});var f_=v(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});var uN=l_(),lN=ia(),fN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",uN.default,lN.default];Th.default=fN});var p_=v(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});var Cu=ae(),Fn=Cu.operators,Tu={maximum:{okStr:"<=",ok:Fn.LTE,fail:Fn.GT},minimum:{okStr:">=",ok:Fn.GTE,fail:Fn.LT},exclusiveMaximum:{okStr:"<",ok:Fn.LT,fail:Fn.GTE},exclusiveMinimum:{okStr:">",ok:Fn.GT,fail:Fn.LTE}},pN={message:o(({keyword:e,schemaCode:t})=>(0,Cu.str)`must be ${Tu[e].okStr} ${t}`,"message"),params:o(({keyword:e,schemaCode:t})=>(0,Cu._)`{comparison: ${Tu[e].okStr}, limit: ${t}}`,"params")},dN={keyword:Object.keys(Tu),type:"number",schemaType:"number",$data:!0,error:pN,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Cu._)`${r} ${Tu[t].fail} ${n} || isNaN(${r})`)}};Rh.default=dN});var d_=v(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});var hN=p_(),mN=Nd(),gN=kd(),yN=Dd(),bN=Fd(),vN=Bd(),_N=Ud(),SN=Wd(),EN=Qd(),ON=Xd(),PN=[hN.default,mN.default,gN.default,yN.default,bN.default,vN.default,_N.default,SN.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},EN.default,ON.default];Nh.default=PN});var Mh=v(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.dynamicAnchor=void 0;var jh=ae(),xN=dr(),h_=Xs(),$N=ia(),wN={keyword:"$dynamicAnchor",schemaType:"string",code:o(e=>m_(e,e.schema),"code")};function m_(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let i=(0,jh._)`${xN.default.dynamicAnchors}${(0,jh.getProperty)(t)}`,s=n.errSchemaPath==="#"?n.validateName:AN(e);r.if((0,jh._)`!${i}`,()=>r.assign(i,s))}o(m_,"dynamicAnchor");ha.dynamicAnchor=m_;function AN(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:i,baseId:s,localRefs:a,meta:c}=t.root,{schemaId:u}=n.opts,l=new h_.SchemaEnv({schema:r,schemaId:u,root:i,baseId:s,localRefs:a,meta:c});return h_.compileSchema.call(n,l),(0,$N.getValidate)(e,l)}o(AN,"_getValidate");ha.default=wN});var kh=v(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.dynamicRef=void 0;var g_=ae(),IN=dr(),y_=ia(),CN={keyword:"$dynamicRef",schemaType:"string",code:o(e=>b_(e,e.schema),"code")};function b_(e,t){let{gen:r,keyword:n,it:i}=e;if(t[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=t.slice(1);if(i.allErrors)a();else{let u=r.let("valid",!1);a(u),e.ok(u)}function a(u){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",(0,g_._)`${IN.default.dynamicAnchors}${(0,g_.getProperty)(s)}`);r.if(l,c(l,u),c(i.validateName,u))}else c(i.validateName,u)()}o(a,"_dynamicRef");function c(u,l){return l?()=>r.block(()=>{(0,y_.callRef)(e,u),r.let(l,!0)}):()=>(0,y_.callRef)(e,u)}o(c,"_callRef")}o(b_,"dynamicRef");ma.dynamicRef=b_;ma.default=CN});var v_=v(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});var TN=Mh(),RN=he(),NN={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,TN.dynamicAnchor)(e,""):(0,RN.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};qh.default=NN});var __=v(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});var jN=kh(),MN={keyword:"$recursiveRef",schemaType:"string",code:o(e=>(0,jN.dynamicRef)(e,e.schema),"code")};Dh.default=MN});var S_=v(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});var kN=Mh(),qN=kh(),DN=v_(),LN=__(),FN=[kN.default,qN.default,DN.default,LN.default];Lh.default=FN});var O_=v(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var E_=Su(),HN={keyword:"dependentRequired",type:"object",schemaType:"object",error:E_.error,code:o(e=>(0,E_.validatePropertyDeps)(e),"code")};Fh.default=HN});var P_=v(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});var BN=Su(),VN={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o(e=>(0,BN.validateSchemaDeps)(e),"code")};Hh.default=VN});var x_=v(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});var UN=he(),GN={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){t.contains===void 0&&(0,UN.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}};Bh.default=GN});var $_=v(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});var zN=O_(),ZN=P_(),WN=x_(),KN=[zN.default,ZN.default,WN.default];Vh.default=KN});var A_=v(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});var Hn=ae(),w_=he(),YN=dr(),QN={message:"must NOT have unevaluated properties",params:o(({params:e})=>(0,Hn._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`,"params")},JN={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:QN,code(e){let{gen:t,schema:r,data:n,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,props:c}=s;c instanceof Hn.Name?t.if((0,Hn._)`${c} !== true`,()=>t.forIn("key",n,f=>t.if(l(c,f),()=>u(f)))):c!==!0&&t.forIn("key",n,f=>c===void 0?u(f):t.if(p(c,f),()=>u(f))),s.props=!0,e.ok((0,Hn._)`${i} === ${YN.default.errors}`);function u(f){if(r===!1){e.setParams({unevaluatedProperty:f}),e.error(),a||t.break();return}if(!(0,w_.alwaysValidSchema)(s,r)){let d=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:w_.Type.Str},d),a||t.if((0,Hn.not)(d),()=>t.break())}}o(u,"unevaluatedPropCode");function l(f,d){return(0,Hn._)`!${f} || !${f}[${d}]`}o(l,"unevaluatedDynamic");function p(f,d){let h=[];for(let y in f)f[y]===!0&&h.push((0,Hn._)`${d} !== ${y}`);return(0,Hn.and)(...h)}o(p,"unevaluatedStatic")}};Uh.default=JN});var C_=v(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var qi=ae(),I_=he(),XN={message:o(({params:{len:e}})=>(0,qi.str)`must NOT have more than ${e} items`,"message"),params:o(({params:{len:e}})=>(0,qi._)`{limit: ${e}}`,"params")},ej={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:XN,code(e){let{gen:t,schema:r,data:n,it:i}=e,s=i.items||0;if(s===!0)return;let a=t.const("len",(0,qi._)`${n}.length`);if(r===!1)e.setParams({len:s}),e.fail((0,qi._)`${a} > ${s}`);else if(typeof r=="object"&&!(0,I_.alwaysValidSchema)(i,r)){let u=t.var("valid",(0,qi._)`${a} <= ${s}`);t.if((0,qi.not)(u),()=>c(u,s)),e.ok(u)}i.items=!0;function c(u,l){t.forRange("i",l,a,p=>{e.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:I_.Type.Num},u),i.allErrors||t.if((0,qi.not)(u),()=>t.break())})}o(c,"validateItems")}};Gh.default=ej});var T_=v(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});var tj=A_(),rj=C_(),nj=[tj.default,rj.default];zh.default=nj});var R_=v(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.contentVocabulary=Ho.metadataVocabulary=void 0;Ho.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ho.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var j_=v(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0});var ij=f_(),oj=d_(),sj=Sh(),aj=S_(),cj=$_(),uj=T_(),lj=Ph(),N_=R_(),fj=[aj.default,ij.default,oj.default,(0,sj.default)(!0),lj.default,N_.metadataVocabulary,N_.contentVocabulary,cj.default,uj.default];Zh.default=fj});var M_=v((_V,pj)=>{pj.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 k_=v((SV,dj)=>{dj.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 q_=v((EV,hj)=>{hj.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 D_=v((OV,mj)=>{mj.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 L_=v((PV,gj)=>{gj.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 F_=v((xV,yj)=>{yj.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 H_=v(($V,bj)=>{bj.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 B_=v((wV,vj)=>{vj.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 V_=v(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});var _j=M_(),Sj=k_(),Ej=q_(),Oj=D_(),Pj=L_(),xj=F_(),$j=H_(),wj=B_(),Aj=["/properties"];function Ij(e){return[_j,Sj,Ej,Oj,Pj,t(this,xj),$j,t(this,wj)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,Aj):n}o(t,"with$data")}o(Ij,"addMetaSchema2020");Wh.default=Ij});var U_=v((Le,Yh)=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.MissingRefError=Le.ValidationError=Le.CodeGen=Le.Name=Le.nil=Le.stringify=Le.str=Le._=Le.KeywordCxt=Le.Ajv2020=void 0;var Cj=qo(),Tj=j_(),Rj=Ah(),Nj=V_(),Kh="https://json-schema.org/draft/2020-12/schema",Qh=class Qh extends Cj.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),Tj.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Rj.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:r}=this.opts;r&&(Nj.default.call(this,t),this.refs["http://json-schema.org/schema"]=Kh)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Kh)?Kh:void 0)}};o(Qh,"Ajv2020");var Bo=Qh;Le.Ajv2020=Bo;Yh.exports=Le=Bo;Yh.exports.Ajv2020=Bo;Object.defineProperty(Le,"__esModule",{value:!0});Le.default=Bo;var jj=Qs();Object.defineProperty(Le,"KeywordCxt",{enumerable:!0,get:o(function(){return jj.KeywordCxt},"get")});var Vo=ae();Object.defineProperty(Le,"_",{enumerable:!0,get:o(function(){return Vo._},"get")});Object.defineProperty(Le,"str",{enumerable:!0,get:o(function(){return Vo.str},"get")});Object.defineProperty(Le,"stringify",{enumerable:!0,get:o(function(){return Vo.stringify},"get")});Object.defineProperty(Le,"nil",{enumerable:!0,get:o(function(){return Vo.nil},"get")});Object.defineProperty(Le,"Name",{enumerable:!0,get:o(function(){return Vo.Name},"get")});Object.defineProperty(Le,"CodeGen",{enumerable:!0,get:o(function(){return Vo.CodeGen},"get")});var Mj=uu();Object.defineProperty(Le,"ValidationError",{enumerable:!0,get:o(function(){return Mj.default},"get")});var kj=Js();Object.defineProperty(Le,"MissingRefError",{enumerable:!0,get:o(function(){return kj.default},"get")})});var G_=v((TV,qj)=>{qj.exports={id:"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","basePath","apis"],properties:{swaggerVersion:{enum:["1.2"]},apiVersion:{type:"string"},basePath:{type:"string",format:"uri",pattern:"^https?://"},resourcePath:{type:"string",format:"uri",pattern:"^/"},apis:{type:"array",items:{$ref:"#/definitions/apiObject"}},models:{type:"object",additionalProperties:{$ref:"modelsObject.json#"}},produces:{$ref:"#/definitions/mimeTypeArray"},consumes:{$ref:"#/definitions/mimeTypeArray"},authorizations:{$ref:"authorizationObject.json#"}},additionalProperties:!1,definitions:{apiObject:{type:"object",required:["path","operations"],properties:{path:{type:"string",format:"uri-template",pattern:"^/"},description:{type:"string"},operations:{type:"array",items:{$ref:"operationObject.json#"}}},additionalProperties:!1},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}}});var z_=v((RV,Dj)=>{Dj.exports={title:"A JSON Schema for Swagger 2.0 API.",id:"http://swagger.io/v2/schema.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swagger","info","paths"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{swagger:{type:"string",enum:["2.0"],description:"The Swagger version of this document."},info:{$ref:"#/definitions/info"},host:{type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",description:"The host (name or ip) of the API. Example: 'swagger.io'"},basePath:{type:"string",pattern:"^/",description:"The base path to the API. Example: '/api'."},schemes:{$ref:"#/definitions/schemesList"},consumes:{description:"A list of MIME types accepted by the API.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},produces:{description:"A list of MIME types the API can produce.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},paths:{$ref:"#/definitions/paths"},definitions:{$ref:"#/definitions/definitions"},parameters:{$ref:"#/definitions/parameterDefinitions"},responses:{$ref:"#/definitions/responseDefinitions"},security:{$ref:"#/definitions/security"},securityDefinitions:{$ref:"#/definitions/securityDefinitions"},tags:{type:"array",items:{$ref:"#/definitions/tag"},uniqueItems:!0},externalDocs:{$ref:"#/definitions/externalDocs"}},definitions:{info:{type:"object",description:"General information about the API.",required:["version","title"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{title:{type:"string",description:"A unique and precise title of the API."},version:{type:"string",description:"A semantic version number of the API."},description:{type:"string",description:"A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."},termsOfService:{type:"string",description:"The terms of service for the API."},contact:{$ref:"#/definitions/contact"},license:{$ref:"#/definitions/license"}}},contact:{type:"object",description:"Contact information for the owners of the API.",additionalProperties:!1,properties:{name:{type:"string",description:"The identifying name of the contact person/organization."},url:{type:"string",description:"The URL pointing to the contact information.",format:"uri"},email:{type:"string",description:"The email address of the contact person/organization.",format:"email"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},license:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"The name of the license type. It's encouraged to use an OSI compatible license."},url:{type:"string",description:"The URL pointing to the license.",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},paths:{type:"object",description:"Relative paths to the individual endpoints. They must be relative to the 'basePath'.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"},"^/":{$ref:"#/definitions/pathItem"}},additionalProperties:!1},definitions:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},description:"One or more JSON objects describing the schemas being consumed and produced by the API."},parameterDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/parameter"},description:"One or more JSON representations for parameters"},responseDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/response"},description:"One or more JSON representations for responses"},externalDocs:{type:"object",additionalProperties:!1,description:"information about external documentation",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},examples:{type:"object",additionalProperties:!0},mimeType:{type:"string",description:"The MIME type of the HTTP message."},operation:{type:"object",required:["responses"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{tags:{type:"array",items:{type:"string"},uniqueItems:!0},summary:{type:"string",description:"A brief summary of the operation."},description:{type:"string",description:"A longer description of the operation, GitHub Flavored Markdown is allowed."},externalDocs:{$ref:"#/definitions/externalDocs"},operationId:{type:"string",description:"A unique identifier of the operation."},produces:{description:"A list of MIME types the API can produce.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},consumes:{description:"A list of MIME types the API can consume.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},parameters:{$ref:"#/definitions/parametersList"},responses:{$ref:"#/definitions/responses"},schemes:{$ref:"#/definitions/schemesList"},deprecated:{type:"boolean",default:!1},security:{$ref:"#/definitions/security"}}},pathItem:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},get:{$ref:"#/definitions/operation"},put:{$ref:"#/definitions/operation"},post:{$ref:"#/definitions/operation"},delete:{$ref:"#/definitions/operation"},options:{$ref:"#/definitions/operation"},head:{$ref:"#/definitions/operation"},patch:{$ref:"#/definitions/operation"},parameters:{$ref:"#/definitions/parametersList"}}},responses:{type:"object",description:"Response objects names can either be any valid HTTP status code or 'default'.",minProperties:1,additionalProperties:!1,patternProperties:{"^([0-9]{3})$|^(default)$":{$ref:"#/definitions/responseValue"},"^x-":{$ref:"#/definitions/vendorExtension"}},not:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}}},responseValue:{oneOf:[{$ref:"#/definitions/response"},{$ref:"#/definitions/jsonReference"}]},response:{type:"object",required:["description"],properties:{description:{type:"string"},schema:{oneOf:[{$ref:"#/definitions/schema"},{$ref:"#/definitions/fileSchema"}]},headers:{$ref:"#/definitions/headers"},examples:{$ref:"#/definitions/examples"}},additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},headers:{type:"object",additionalProperties:{$ref:"#/definitions/header"}},header:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},vendorExtension:{description:"Any property starting with x- is valid.",additionalProperties:!0,additionalItems:!0},bodyParameter:{type:"object",required:["name","in","schema"],patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},in:{type:"string",description:"Determines the location of the parameter.",enum:["body"]},required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},schema:{$ref:"#/definitions/schema"}},additionalProperties:!1},headerParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["header"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},queryParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["query"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean",default:!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},formDataParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["formData"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean",default:!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string",enum:["string","number","boolean","integer","array","file"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},pathParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["required"],properties:{required:{type:"boolean",enum:[!0],description:"Determines whether or not this parameter is required or optional."},in:{type:"string",description:"Determines the location of the parameter.",enum:["path"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},nonBodyParameter:{type:"object",required:["name","in","type"],oneOf:[{$ref:"#/definitions/headerParameterSubSchema"},{$ref:"#/definitions/formDataParameterSubSchema"},{$ref:"#/definitions/queryParameterSubSchema"},{$ref:"#/definitions/pathParameterSubSchema"}]},parameter:{oneOf:[{$ref:"#/definitions/bodyParameter"},{$ref:"#/definitions/nonBodyParameter"}]},schema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},maxProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},enum:{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},additionalProperties:{anyOf:[{$ref:"#/definitions/schema"},{type:"boolean"}],default:{}},type:{$ref:"http://json-schema.org/draft-04/schema#/properties/type"},items:{anyOf:[{$ref:"#/definitions/schema"},{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}}],default:{}},allOf:{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}},properties:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},default:{}},discriminator:{type:"string"},readOnly:{type:"boolean",default:!1},xml:{$ref:"#/definitions/xml"},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},fileSchema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["type"],properties:{format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},type:{type:"string",enum:["file"]},readOnly:{type:"boolean",default:!1},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},primitivesItems:{type:"object",additionalProperties:!1,properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},security:{type:"array",items:{$ref:"#/definitions/securityRequirement"},uniqueItems:!0},securityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"},uniqueItems:!0}},xml:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},tag:{type:"object",additionalProperties:!1,required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/externalDocs"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},securityDefinitions:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuthenticationSecurity"},{$ref:"#/definitions/apiKeySecurity"},{$ref:"#/definitions/oauth2ImplicitSecurity"},{$ref:"#/definitions/oauth2PasswordSecurity"},{$ref:"#/definitions/oauth2ApplicationSecurity"},{$ref:"#/definitions/oauth2AccessCodeSecurity"}]}},basicAuthenticationSecurity:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string",enum:["basic"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},apiKeySecurity:{type:"object",additionalProperties:!1,required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ImplicitSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["implicit"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2PasswordSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["password"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ApplicationSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["application"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2AccessCodeSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["accessCode"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2Scopes:{type:"object",additionalProperties:{type:"string"}},mediaTypeList:{type:"array",items:{$ref:"#/definitions/mimeType"},uniqueItems:!0},parametersList:{type:"array",description:"The parameters needed to send a valid API call.",additionalItems:!1,items:{oneOf:[{$ref:"#/definitions/parameter"},{$ref:"#/definitions/jsonReference"}]},uniqueItems:!0},schemesList:{type:"array",description:"The transfer protocol of the API.",items:{type:"string",enum:["http","https","ws","wss"]},uniqueItems:!0},collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes"],default:"csv"},collectionFormatWithMulti:{type:"string",enum:["csv","ssv","tsv","pipes","multi"],default:"csv"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},enum:{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},jsonReference:{type:"object",required:["$ref"],additionalProperties:!1,properties:{$ref:{type:"string"}}}}}});var Z_=v((NV,Lj)=>{Lj.exports={id:"https://spec.openapis.org/oas/3.0/schema/2019-04-02",$schema:"http://json-schema.org/draft-04/schema#",description:"Validation schema for OpenAPI Specification 3.0.X.",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{enum:["bearer"]}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{enum:["bearer"]}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{$ref:"#/definitions/Header"}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}}});var W_=v((jV,Fj)=>{Fj.exports={$id:"https://spec.openapis.org/oas/3.1/schema/2021-04-15",$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{openapi:{type:"string",pattern:"^3\\.1\\.\\d+(-.+)?$"},info:{$ref:"#/$defs/info"},jsonSchemaDialect:{$ref:"#/$defs/uri",default:"https://spec.openapis.org/oas/3.1/dialect/base"},servers:{type:"array",items:{$ref:"#/$defs/server"}},paths:{$ref:"#/$defs/paths"},webhooks:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},components:{$ref:"#/$defs/components"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},tags:{type:"array",items:{$ref:"#/$defs/tag"}},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["openapi","info"],anyOf:[{required:["paths"]},{required:["components"]},{required:["webhooks"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{info:{type:"object",properties:{title:{type:"string"},summary:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:{$ref:"#/$defs/contact"},license:{$ref:"#/$defs/license"},version:{type:"string"}},required:["title","version"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},contact:{type:"object",properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},license:{type:"object",properties:{name:{type:"string"},identifier:{type:"string"},url:{$ref:"#/$defs/uri"}},required:["name"],oneOf:[{required:["identifier"]},{required:["url"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},server:{type:"object",properties:{url:{$ref:"#/$defs/uri"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/$defs/server-variable"}}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"server-variable":{type:"object",properties:{enum:{type:"array",items:{type:"string"},minItems:1},default:{type:"string"},descriptions:{type:"string"}},required:["default"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},components:{type:"object",properties:{schemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"}},responses:{type:"object",additionalProperties:{$ref:"#/$defs/response-or-reference"}},parameters:{type:"object",additionalProperties:{$ref:"#/$defs/parameter-or-reference"}},examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}},requestBodies:{type:"object",additionalProperties:{$ref:"#/$defs/request-body-or-reference"}},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},securitySchemes:{type:"object",additionalProperties:{$ref:"#/$defs/security-scheme-or-reference"}},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},pathItems:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}}},patternProperties:{"^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$":{$comment:"Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",propertyNames:{pattern:"^[a-zA-Z0-9._-]+$"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},paths:{type:"object",patternProperties:{"^/":{$ref:"#/$defs/path-item"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item":{type:"object",properties:{summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/$defs/server"}},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/$defs/operation"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/path-item"}},operation:{type:"object",properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"},operationId:{type:"string"},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}},requestBody:{$ref:"#/$defs/request-body-or-reference"},responses:{$ref:"#/$defs/responses"},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},deprecated:{default:!1,type:"boolean"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},servers:{type:"array",items:{$ref:"#/$defs/server"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"external-documentation":{type:"object",properties:{description:{type:"string"},url:{$ref:"#/$defs/uri"}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},parameter:{type:"object",properties:{name:{type:"string"},in:{enum:["query","header","path","cookie"]},description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},allowEmptyValue:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"},content:{$ref:"#/$defs/content"}},required:["in"],oneOf:[{required:["schema"]},{required:["content"]}],dependentSchemas:{schema:{properties:{style:{type:"string"},explode:{type:"boolean"},allowReserved:{default:!1,type:"boolean"}},allOf:[{$ref:"#/$defs/examples"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-form"}],$defs:{"styles-for-path":{if:{properties:{in:{const:"path"}},required:["in"]},then:{properties:{style:{default:"simple",enum:["matrix","label","simple"]},required:{const:!0}},required:["required"]}},"styles-for-header":{if:{properties:{in:{const:"header"}},required:["in"]},then:{properties:{style:{default:"simple",enum:["simple"]}}}},"styles-for-query":{if:{properties:{in:{const:"query"}},required:["in"]},then:{properties:{style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]}}}},"styles-for-cookie":{if:{properties:{in:{const:"cookie"}},required:["in"]},then:{properties:{style:{default:"form",enum:["form"]}}}},"styles-for-form":{if:{properties:{style:{const:"form"}},required:["style"]},then:{properties:{explode:{default:!0}}},else:{properties:{explode:{default:!1}}}}}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"parameter-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/parameter"}},"request-body":{type:"object",properties:{description:{type:"string"},content:{$ref:"#/$defs/content"},required:{default:!1,type:"boolean"}},required:["content"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"request-body-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/request-body"}},content:{type:"object",additionalProperties:{$ref:"#/$defs/media-type"},propertyNames:{format:"media-range"}},"media-type":{type:"object",properties:{schema:{$dynamicRef:"#meta"},encoding:{type:"object",additionalProperties:{$ref:"#/$defs/encoding"}}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/examples"}],unevaluatedProperties:!1},encoding:{type:"object",properties:{contentType:{type:"string",format:"media-range"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{default:!1,type:"boolean"}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/encoding/$defs/explode-default"}],unevaluatedProperties:!1,$defs:{"explode-default":{if:{properties:{style:{const:"form"}},required:["style"]},then:{properties:{explode:{default:!0}}},else:{properties:{explode:{default:!1}}}}}},responses:{type:"object",properties:{default:{$ref:"#/$defs/response-or-reference"}},patternProperties:{"^[1-5][0-9X]{2}$":{$ref:"#/$defs/response-or-reference"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},response:{type:"object",properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},content:{$ref:"#/$defs/content"},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}}},required:["description"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"response-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/response"}},callbacks:{type:"object",$ref:"#/$defs/specification-extensions",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},"callbacks-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/callbacks"}},example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:!0,externalValue:{$ref:"#/$defs/uri"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"example-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/example"}},link:{type:"object",properties:{operationRef:{$ref:"#/$defs/uri"},operationId:!0,parameters:{$ref:"#/$defs/map-of-strings"},requestBody:!0,description:{type:"string"},body:{$ref:"#/$defs/server"}},oneOf:[{required:["operationRef"]},{required:["operationId"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"link-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/link"}},header:{type:"object",properties:{description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},allowEmptyValue:{default:!1,type:"boolean"}},dependentSchemas:{schema:{properties:{style:{default:"simple",enum:["simple"]},explode:{default:!1,type:"boolean"},allowReserved:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"}},$ref:"#/$defs/examples"},content:{properties:{content:{$ref:"#/$defs/content"}}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"header-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/header"}},tag:{type:"object",properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["name"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},reference:{type:"object",properties:{$ref:{$ref:"#/$defs/uri"},summary:{type:"string"},description:{type:"string"}},unevaluatedProperties:!1},schema:{$dynamicAnchor:"meta",type:["object","boolean"]},"security-scheme":{type:"object",properties:{type:{enum:["apiKey","http","mutualTLS","oauth2","openIdConnect"]},description:{type:"string"}},required:["type"],allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/security-scheme/$defs/type-apikey"},{$ref:"#/$defs/security-scheme/$defs/type-http"},{$ref:"#/$defs/security-scheme/$defs/type-http-bearer"},{$ref:"#/$defs/security-scheme/$defs/type-oauth2"},{$ref:"#/$defs/security-scheme/$defs/type-oidc"}],unevaluatedProperties:!1,$defs:{"type-apikey":{if:{properties:{type:{const:"apiKey"}},required:["type"]},then:{properties:{name:{type:"string"},in:{enum:["query","header","cookie"]}},required:["name","in"]}},"type-http":{if:{properties:{type:{const:"http"}},required:["type"]},then:{properties:{scheme:{type:"string"}},required:["scheme"]}},"type-http-bearer":{if:{properties:{type:{const:"http"},scheme:{const:"bearer"}},required:["type","scheme"]},then:{properties:{bearerFormat:{type:"string"}},required:["scheme"]}},"type-oauth2":{if:{properties:{type:{const:"oauth2"}},required:["type"]},then:{properties:{flows:{$ref:"#/$defs/oauth-flows"}},required:["flows"]}},"type-oidc":{if:{properties:{type:{const:"openIdConnect"}},required:["type"]},then:{properties:{openIdConnectUrl:{$ref:"#/$defs/uri"}},required:["openIdConnectUrl"]}}}},"security-scheme-or-reference":{if:{required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/security-scheme"}},"oauth-flows":{type:"object",properties:{implicit:{$ref:"#/$defs/oauth-flows/$defs/implicit"},password:{$ref:"#/$defs/oauth-flows/$defs/password"},clientCredentials:{$ref:"#/$defs/oauth-flows/$defs/client-credentials"},authorizationCode:{$ref:"#/$defs/oauth-flows/$defs/authorization-code"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{implicit:{type:"object",properties:{authorizationUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},password:{type:"object",properties:{tokenUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"client-credentials":{type:"object",properties:{tokenUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"authorization-code":{type:"object",properties:{authorizationUrl:{type:"string"},tokenUrl:{type:"string"},refreshUrl:{type:"string"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1}}},"security-requirement":{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},"specification-extensions":{patternProperties:{"^x-":!0}},examples:{properties:{example:!0,examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}}}},uri:{type:"string",format:"uri"},"map-of-strings":{type:"object",additionalProperties:{type:"string"}}}}});var K_=v((ft,Uo)=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.openapi=ft.openapiV31=ft.openapiV3=ft.openapiV2=ft.openapiV1=void 0;ft.openapiV1=G_();ft.openapiV2=z_();ft.openapiV3=Z_();ft.openapiV31=W_();ft.openapi={v1:ft.openapiV1,v2:ft.openapiV2,v3:ft.openapiV3,v31:ft.openapiV31};ft.default=ft.openapi;typeof Uo=="object"&&typeof Uo.exports=="object"&&(Uo.exports=Object.assign(Uo.exports.default,Uo.exports))});var em=v((MV,Y_)=>{"use strict";var Hj=Uc(),{ono:Bj}=$r(),Vj=u_(),Uj=U_(),{openapi:Jh}=K_();Y_.exports=Gj;function Gj(e){let t,r;if(e.swagger)r=Jh.v2,t=Xh();else if(e.openapi.startsWith("3.1")){r=Jh.v31;let i=r.$defs.schema;delete i.$dynamicAnchor,r.$defs.components.properties.schemas.additionalProperties=i,r.$defs.header.dependentSchemas.schema.properties.schema=i,r.$defs["media-type"].properties.schema=i,r.$defs.parameter.properties.schema=i,t=Xh(!1)}else r=Jh.v3,t=Xh();if(!t.validate(r,e)){let i=t.errors,s=`Swagger schema validation failed.
@@ -75,7 +75,7 @@ Expecting `+Q.join(", ")+", got '"+(this.terminals_[T]||T)+"'":ue="Parse error o
75
75
  `)}rowToString(t,r){return this.rasterize(t).forEach((n,i)=>{let s="";n.forEach((a,c)=>{let{width:u}=t[c],l=this.negatePadding(t[c]),p=a;if(l>zt.stringWidth(a)&&(p+=" ".repeat(l-zt.stringWidth(a))),t[c].align&&t[c].align!=="left"&&this.wrap){let d=g2[t[c].align];p=d(p,l),zt.stringWidth(p)<l&&(p+=" ".repeat((u||0)-zt.stringWidth(p)-1))}let f=t[c].padding||[0,0,0,0];f[cc]&&(s+=" ".repeat(f[cc])),s+=ey(t[c],p,"| "),s+=p,s+=ey(t[c],p," |"),f[ac]&&(s+=" ".repeat(f[ac])),i===0&&r.length>0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:t.span})}),r}renderInline(t,r){let n=t.match(/^ */),i=n?n[0].length:0,s=r.text,a=zt.stringWidth(s.trimRight());return r.span?this.wrap?i<a?t:(r.hidden=!0,s.trimRight()+" ".repeat(i-a)+t.trimLeft()):(r.hidden=!0,s+t):t}rasterize(t){let r=[],n=this.columnWidths(t),i;return t.forEach((s,a)=>{s.width=n[a],this.wrap?i=zt.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
76
76
  `):i=s.text.split(`
77
77
  `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[y2]||0).fill("")),i.push(...new Array(s.padding[b2]||0).fill(""))),i.forEach((c,u)=>{r[u]||r.push([]);let l=r[u];for(let p=0;p<a;p++)l[p]===void 0&&l.push("");l.push(c)})}),r}negatePadding(t){let r=t.width||0;return t.padding&&(r-=(t.padding[cc]||0)+(t.padding[ac]||0)),t.border&&(r-=4),r}columnWidths(t){if(!this.wrap)return t.map(a=>a.width||zt.stringWidth(a.text));let r=t.length,n=this.width,i=t.map(a=>{if(a.width)return r--,n-=a.width,a.width}),s=r?Math.floor(n/r):0;return i.map((a,c)=>a===void 0?Math.max(s,v2(t[c])):a)}};o(ef,"UI");var Xl=ef;function ey(e,t,r){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?r:" ":""}o(ey,"addBorder");function v2(e){let t=e.padding||[],r=1+(t[cc]||0)+(t[ac]||0);return e.border?r+4:r}o(v2,"_minWidth");function _2(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}o(_2,"getWindowWidth");function S2(e,t){e=e.trim();let r=zt.stringWidth(e);return r<t?" ".repeat(t-r)+e:e}o(S2,"alignRight");function E2(e,t){e=e.trim();let r=zt.stringWidth(e);return r>=t?e:" ".repeat(t-r>>1)+e}o(E2,"alignCenter");var zt;function ty(e,t){return zt=t,new Xl({width:(e==null?void 0:e.width)||_2(),wrap:e==null?void 0:e.wrap})}o(ty,"cliui");var ry=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function tf(e){return e.replace(ry,"")}o(tf,"stripAnsi");function ny(e,t){let[r,n]=e.match(ry)||["",""];e=tf(e);let i="";for(let s=0;s<e.length;s++)s!==0&&s%t===0&&(i+=`
78
- `),i+=e.charAt(s);return r&&n&&(i=`${r}${i}${n}`),i}o(ny,"wrap");function rf(e){return ty(e,{stringWidth:o(t=>[...t].length,"stringWidth"),stripAnsi:tf,wrap:ny})}o(rf,"ui");var lo=require("path"),uc=require("fs");function nf(e,t){let r=(0,lo.resolve)(".",e),n;for((0,uc.statSync)(r).isDirectory()||(r=(0,lo.dirname)(r));;){if(n=t(r,(0,uc.readdirSync)(r)),n)return(0,lo.resolve)(r,n);if(r=(0,lo.dirname)(n=r),n===r)break}}o(nf,"default");var vy=require("util"),_y=require("fs"),Sy=require("url");var cy=require("util"),dc=require("path");function di(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let r="",n=!1,i=e.match(/^-+/);for(let s=i?i[0].length:0;s<e.length;s++){let a=e.charAt(s);n&&(n=!1,a=a.toUpperCase()),s!==0&&(a==="-"||a==="_")?n=!0:a!=="-"&&a!=="_"&&(r+=a)}return r}}o(di,"camelCase");function lc(e,t){let r=e.toLowerCase();t=t||"-";let n="";for(let i=0;i<e.length;i++){let s=r.charAt(i),a=e.charAt(i);s!==a&&i>0?n+=`${t}${r.charAt(i)}`:n+=a}return n}o(lc,"decamelize");function fc(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}o(fc,"looksLikeNumber");function iy(e){if(Array.isArray(e))return e.map(a=>typeof a!="string"?a+"":a);e=e.trim();let t=0,r=null,n=null,i=null,s=[];for(let a=0;a<e.length;a++){if(r=n,n=e.charAt(a),n===" "&&!i){r!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[t]||(s[t]=""),s[t]+=n}return s}o(iy,"tokenizeArgString");var ir;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(ir||(ir={}));var dn,sf=class sf{constructor(t){dn=t}parse(t,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=iy(t),s=typeof t=="string",a=O2(Object.assign(Object.create(null),n.alias)),c=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],p=n.envPrefix,f=c["populate--"],d=f?"--":"_",h=Object.create(null),y=Object.create(null),b=n.__||dn.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},P=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,$=new RegExp("^--"+c["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(_){let O=typeof _=="object"?_.key:_,N=Object.keys(_).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();N&&(g[N][O]=!0),g.arrays[O]=!0,g.keys.push(O)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(_){g.bools[_]=!0,g.keys.push(_)}),[].concat(n.string||[]).filter(Boolean).forEach(function(_){g.strings[_]=!0,g.keys.push(_)}),[].concat(n.number||[]).filter(Boolean).forEach(function(_){g.numbers[_]=!0,g.keys.push(_)}),[].concat(n.count||[]).filter(Boolean).forEach(function(_){g.counts[_]=!0,g.keys.push(_)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(_){g.normalize[_]=!0,g.keys.push(_)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([_,O])=>{typeof O=="number"&&(g.nargs[_]=O,g.keys.push(_))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([_,O])=>{typeof O=="function"&&(g.coercions[_]=O,g.keys.push(_))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(_){g.configs[_]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([_,O])=>{(typeof O=="boolean"||typeof O=="function")&&(g.configs[_]=O)})),Dt(n.key,a,n.default,g.arrays),Object.keys(u).forEach(function(_){(g.aliases[_]||[]).forEach(function(O){u[O]=u[_]})});let C=null;uo();let T=[],A=Object.assign(Object.create(null),{_:[]}),te={};for(let _=0;_<i.length;_++){let O=i[_],N=O.replace(/^-{3,}/,"---"),w,E,H,k,Z,nt;if(O!=="--"&&/^-/.test(O)&&je(O))X(O);else if(N.match(/^---+(=|$)/)){X(O);continue}else if(O.match(/^--.+=/)||!c["short-option-groups"]&&O.match(/^-.+=/))k=O.match(/^--?([^=]+)=([\s\S]*)$/),k!==null&&Array.isArray(k)&&k.length>=3&&(ne(k[1],g.arrays)?_=$e(_,k[1],i,k[2]):ne(k[1],g.nargs)!==!1?_=ze(_,k[1],i,k[2]):G(k[1],k[2],!0));else if(O.match($)&&c["boolean-negation"])k=O.match($),k!==null&&Array.isArray(k)&&k.length>=2&&(E=k[1],G(E,ne(E,g.arrays)?[!1]:!1));else if(O.match(/^--.+/)||!c["short-option-groups"]&&O.match(/^-[^-]+/))k=O.match(/^--?(.+)/),k!==null&&Array.isArray(k)&&k.length>=2&&(E=k[1],ne(E,g.arrays)?_=$e(_,E,i):ne(E,g.nargs)!==!1?_=ze(_,E,i):(Z=i[_+1],Z!==void 0&&(!Z.match(/^-/)||Z.match(P))&&!ne(E,g.bools)&&!ne(E,g.counts)||/^(true|false)$/.test(Z)?(G(E,Z),_++):G(E,_e(E))));else if(O.match(/^-.\..+=/))k=O.match(/^-([^=]+)=([\s\S]*)$/),k!==null&&Array.isArray(k)&&k.length>=3&&G(k[1],k[2]);else if(O.match(/^-.\..+/)&&!O.match(P))Z=i[_+1],k=O.match(/^-(.\..+)/),k!==null&&Array.isArray(k)&&k.length>=2&&(E=k[1],Z!==void 0&&!Z.match(/^-/)&&!ne(E,g.bools)&&!ne(E,g.counts)?(G(E,Z),_++):G(E,_e(E)));else if(O.match(/^-[^-]+/)&&!O.match(P)){H=O.slice(1,-1).split(""),w=!1;for(let ht=0;ht<H.length;ht++){if(Z=O.slice(ht+2),H[ht+1]&&H[ht+1]==="="){nt=O.slice(ht+3),E=H[ht],ne(E,g.arrays)?_=$e(_,E,i,nt):ne(E,g.nargs)!==!1?_=ze(_,E,i,nt):G(E,nt),w=!0;break}if(Z==="-"){G(H[ht],Z);continue}if(/[A-Za-z]/.test(H[ht])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(Z)&&ne(Z,g.bools)===!1){G(H[ht],Z),w=!0;break}if(H[ht+1]&&H[ht+1].match(/\W/)){G(H[ht],Z),w=!0;break}else G(H[ht],_e(H[ht]))}E=O.slice(-1)[0],!w&&E!=="-"&&(ne(E,g.arrays)?_=$e(_,E,i):ne(E,g.nargs)!==!1?_=ze(_,E,i):(Z=i[_+1],Z!==void 0&&(!/^(-|--)[^-]/.test(Z)||Z.match(P))&&!ne(E,g.bools)&&!ne(E,g.counts)||/^(true|false)$/.test(Z)?(G(E,Z),_++):G(E,_e(E))))}else if(O.match(/^-[0-9]$/)&&O.match(P)&&ne(O.slice(1),g.bools))E=O.slice(1),G(E,_e(E));else if(O==="--"){T=i.slice(_+1);break}else if(c["halt-at-non-option"]){T=i.slice(_);break}else X(O)}ge(A,!0),ge(A,!1),Q(A),ve(),Te(A,g.aliases,u,!0),We(A),c["set-placeholder-key"]&&Lr(A),Object.keys(g.counts).forEach(function(_){nr(A,_.split("."))||G(_,0)}),f&&T.length&&(A[d]=[]),T.forEach(function(_){A[d].push(_)}),c["camel-case-expansion"]&&c["strip-dashed"]&&Object.keys(A).filter(_=>_!=="--"&&_.includes("-")).forEach(_=>{delete A[_]}),c["strip-aliased"]&&[].concat(...Object.keys(a).map(_=>a[_])).forEach(_=>{c["camel-case-expansion"]&&_.includes("-")&&delete A[_.split(".").map(O=>di(O)).join(".")],delete A[_]});function X(_){let O=q("_",_);(typeof O=="string"||typeof O=="number")&&A._.push(O)}o(X,"pushPositional");function ze(_,O,N,w){let E,H=ne(O,g.nargs);if(H=typeof H!="number"||isNaN(H)?1:H,H===0)return Lt(w)||(C=Error(b("Argument unexpected for: %s",O))),G(O,_e(O)),_;let k=Lt(w)?0:1;if(c["nargs-eats-options"])N.length-(_+1)+k<H&&(C=Error(b("Not enough arguments following: %s",O))),k=H;else{for(E=_+1;E<N.length&&(!N[E].match(/^-[^0-9]/)||N[E].match(P)||je(N[E]));E++)k++;k<H&&(C=Error(b("Not enough arguments following: %s",O)))}let Z=Math.min(k,H);for(!Lt(w)&&Z>0&&(G(O,w),Z--),E=_+1;E<Z+_+1;E++)G(O,N[E]);return _+Z}o(ze,"eatNargs");function $e(_,O,N,w){let E=[],H=w||N[_+1],k=ne(O,g.nargs);if(ne(O,g.bools)&&!/^(true|false)$/.test(H))E.push(!0);else if(Lt(H)||Lt(w)&&/^-/.test(H)&&!P.test(H)&&!je(H)){if(u[O]!==void 0){let Z=u[O];E=Array.isArray(Z)?Z:[Z]}}else{Lt(w)||E.push(R(O,w,!0));for(let Z=_+1;Z<N.length&&!(!c["greedy-arrays"]&&E.length>0||k&&typeof k=="number"&&E.length>=k||(H=N[Z],/^-/.test(H)&&!P.test(H)&&!je(H)));Z++)_=Z,E.push(R(O,H,s))}return typeof k=="number"&&(k&&E.length<k||isNaN(k)&&E.length===0)&&(C=Error(b("Not enough arguments following: %s",O))),G(O,E),_}o($e,"eatArray");function G(_,O,N=s){if(/-/.test(_)&&c["camel-case-expansion"]){let H=_.split(".").map(function(k){return di(k)}).join(".");j(_,H)}let w=R(_,O,N),E=_.split(".");Y(A,E,w),g.aliases[_]&&g.aliases[_].forEach(function(H){let k=H.split(".");Y(A,k,w)}),E.length>1&&c["dot-notation"]&&(g.aliases[E[0]]||[]).forEach(function(H){let k=H.split("."),Z=[].concat(E);Z.shift(),k=k.concat(Z),(g.aliases[_]||[]).includes(k.join("."))||Y(A,k,w)}),ne(_,g.normalize)&&!ne(_,g.arrays)&&[_].concat(g.aliases[_]||[]).forEach(function(k){Object.defineProperty(te,k,{enumerable:!0,get(){return O},set(Z){O=typeof Z=="string"?dn.normalize(Z):Z}})})}o(G,"setArg");function j(_,O){g.aliases[_]&&g.aliases[_].length||(g.aliases[_]=[O],h[O]=!0),g.aliases[O]&&g.aliases[O].length||j(O,_)}o(j,"addNewAlias");function R(_,O,N){N&&(O=P2(O)),(ne(_,g.bools)||ne(_,g.counts))&&typeof O=="string"&&(O=O==="true");let w=Array.isArray(O)?O.map(function(E){return q(_,E)}):q(_,O);return ne(_,g.counts)&&(Lt(w)||typeof w=="boolean")&&(w=of()),ne(_,g.normalize)&&ne(_,g.arrays)&&(Array.isArray(O)?w=O.map(E=>dn.normalize(E)):w=dn.normalize(O)),w}o(R,"processValue");function q(_,O){return!c["parse-positional-numbers"]&&_==="_"||!ne(_,g.strings)&&!ne(_,g.bools)&&!Array.isArray(O)&&(fc(O)&&c["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${O}`)))||!Lt(O)&&ne(_,g.numbers))&&(O=Number(O)),O}o(q,"maybeCoerceNumber");function Q(_){let O=Object.create(null);Te(O,g.aliases,u),Object.keys(g.configs).forEach(function(N){let w=_[N]||O[N];if(w)try{let E=null,H=dn.resolve(dn.cwd(),w),k=g.configs[N];if(typeof k=="function"){try{E=k(H)}catch(Z){E=Z}if(E instanceof Error){C=E;return}}else E=dn.require(H);ue(E)}catch(E){E.name==="PermissionDenied"?C=E:_[N]&&(C=Error(b("Invalid JSON config file: %s",w)))}})}o(Q,"setConfig");function ue(_,O){Object.keys(_).forEach(function(N){let w=_[N],E=O?O+"."+N:N;typeof w=="object"&&w!==null&&!Array.isArray(w)&&c["dot-notation"]?ue(w,E):(!nr(A,E.split("."))||ne(E,g.arrays)&&c["combine-arrays"])&&G(E,w)})}o(ue,"setConfigObject");function ve(){typeof l<"u"&&l.forEach(function(_){ue(_)})}o(ve,"setConfigObjects");function ge(_,O){if(typeof p>"u")return;let N=typeof p=="string"?p:"",w=dn.env();Object.keys(w).forEach(function(E){if(N===""||E.lastIndexOf(N,0)===0){let H=E.split("__").map(function(k,Z){return Z===0&&(k=k.substring(N.length)),di(k)});(O&&g.configs[H.join(".")]||!O)&&!nr(_,H)&&G(H.join("."),w[E])}})}o(ge,"applyEnvVars");function We(_){let O,N=new Set;Object.keys(_).forEach(function(w){if(!N.has(w)&&(O=ne(w,g.coercions),typeof O=="function"))try{let E=q(w,O(_[w]));[].concat(g.aliases[w]||[],w).forEach(H=>{N.add(H),_[H]=E})}catch(E){C=E}})}o(We,"applyCoercions");function Lr(_){return g.keys.forEach(O=>{~O.indexOf(".")||typeof _[O]>"u"&&(_[O]=void 0)}),_}o(Lr,"setPlaceholderKeys");function Te(_,O,N,w=!1){Object.keys(N).forEach(function(E){nr(_,E.split("."))||(Y(_,E.split("."),N[E]),w&&(y[E]=!0),(O[E]||[]).forEach(function(H){nr(_,H.split("."))||Y(_,H.split("."),N[E])}))})}o(Te,"applyDefaultsAndAliases");function nr(_,O){let N=_;c["dot-notation"]||(O=[O.join(".")]),O.slice(0,-1).forEach(function(E){N=N[E]||{}});let w=O[O.length-1];return typeof N!="object"?!1:w in N}o(nr,"hasKey");function Y(_,O,N){let w=_;c["dot-notation"]||(O=[O.join(".")]),O.slice(0,-1).forEach(function(nt){nt=oy(nt),typeof w=="object"&&w[nt]===void 0&&(w[nt]={}),typeof w[nt]!="object"||Array.isArray(w[nt])?(Array.isArray(w[nt])?w[nt].push({}):w[nt]=[w[nt],{}],w=w[nt][w[nt].length-1]):w=w[nt]});let E=oy(O[O.length-1]),H=ne(O.join("."),g.arrays),k=Array.isArray(N),Z=c["duplicate-arguments-array"];!Z&&ne(E,g.nargs)&&(Z=!0,(!Lt(w[E])&&g.nargs[E]===1||Array.isArray(w[E])&&w[E].length===g.nargs[E])&&(w[E]=void 0)),N===of()?w[E]=of(w[E]):Array.isArray(w[E])?Z&&H&&k?w[E]=c["flatten-duplicate-arrays"]?w[E].concat(N):(Array.isArray(w[E][0])?w[E]:[w[E]]).concat([N]):!Z&&!!H==!!k?w[E]=N:w[E]=w[E].concat([N]):w[E]===void 0&&H?w[E]=k?N:[N]:Z&&!(w[E]===void 0||ne(E,g.counts)||ne(E,g.bools))?w[E]=[w[E],N]:w[E]=N}o(Y,"setKey");function Dt(..._){_.forEach(function(O){Object.keys(O||{}).forEach(function(N){g.aliases[N]||(g.aliases[N]=[].concat(a[N]||[]),g.aliases[N].concat(N).forEach(function(w){if(/-/.test(w)&&c["camel-case-expansion"]){let E=di(w);E!==N&&g.aliases[N].indexOf(E)===-1&&(g.aliases[N].push(E),h[E]=!0)}}),g.aliases[N].concat(N).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&c["camel-case-expansion"]){let E=lc(w,"-");E!==N&&g.aliases[N].indexOf(E)===-1&&(g.aliases[N].push(E),h[E]=!0)}}),g.aliases[N].forEach(function(w){g.aliases[w]=[N].concat(g.aliases[N].filter(function(E){return w!==E}))}))})})}o(Dt,"extendAliases");function ne(_,O){let N=[].concat(g.aliases[_]||[],_),w=Object.keys(O),E=N.find(H=>w.includes(H));return E?O[E]:!1}o(ne,"checkAllAliases");function Ne(_){let O=Object.keys(g);return[].concat(O.map(w=>g[w])).some(function(w){return Array.isArray(w)?w.includes(_):w[_]})}o(Ne,"hasAnyFlag");function ee(_,...O){return[].concat(...O).some(function(w){let E=_.match(w);return E&&Ne(E[1])})}o(ee,"hasFlagsMatching");function Re(_){if(_.match(P)||!_.match(/^-[^-]+/))return!1;let O=!0,N,w=_.slice(1).split("");for(let E=0;E<w.length;E++){if(N=_.slice(E+2),!Ne(w[E])){O=!1;break}if(w[E+1]&&w[E+1]==="="||N==="-"||/[A-Za-z]/.test(w[E])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(N)||w[E+1]&&w[E+1].match(/\W/))break}return O}o(Re,"hasAllShortFlags");function je(_){return c["unknown-options-as-args"]&&pe(_)}o(je,"isUnknownOptionAsArg");function pe(_){return _=_.replace(/^-{3,}/,"--"),_.match(P)||Re(_)?!1:!ee(_,/^-+([^=]+?)=[\s\S]*$/,$,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}o(pe,"isUnknownOption");function _e(_){return!ne(_,g.bools)&&!ne(_,g.counts)&&`${_}`in u?u[_]:Ve(ut(_))}o(_e,"defaultValue");function Ve(_){return{[ir.BOOLEAN]:!0,[ir.STRING]:"",[ir.NUMBER]:void 0,[ir.ARRAY]:[]}[_]}o(Ve,"defaultForType");function ut(_){let O=ir.BOOLEAN;return ne(_,g.strings)?O=ir.STRING:ne(_,g.numbers)?O=ir.NUMBER:ne(_,g.bools)?O=ir.BOOLEAN:ne(_,g.arrays)&&(O=ir.ARRAY),O}o(ut,"guessType");function Lt(_){return _===void 0}o(Lt,"isUndefined");function uo(){Object.keys(g.counts).find(_=>ne(_,g.arrays)?(C=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",_)),!0):ne(_,g.nargs)?(C=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",_)),!0):!1)}return o(uo,"checkConfiguration"),{aliases:Object.assign({},g.aliases),argv:Object.assign(te,A),configuration:c,defaulted:Object.assign({},y),error:C,newAliases:Object.assign({},h)}}};o(sf,"YargsParser");var pc=sf;function O2(e){let t=[],r=Object.create(null),n=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(c){return t[s].indexOf(c)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(a,c,u){return u.indexOf(a)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(r[s]=i)}),r}o(O2,"combineAliases");function of(e){return e!==void 0?e+1:1}o(of,"increment");function oy(e){return e==="__proto__"?"___proto___":e}o(oy,"sanitizeKey");function P2(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}o(P2,"stripQuotes");var uy=require("fs");var af,cf,uf,sy=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ay=(cf=(af=process==null?void 0:process.versions)===null||af===void 0?void 0:af.node)!==null&&cf!==void 0?cf:(uf=process==null?void 0:process.version)===null||uf===void 0?void 0:uf.slice(1);if(ay&&Number(ay.match(/^([^.]+)/)[1])<sy)throw Error(`yargs parser supports a minimum Node.js version of ${sy}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var x2=process?process.env:{},ly=new pc({cwd:process.cwd,env:o(()=>x2,"env"),format:cy.format,normalize:dc.normalize,resolve:dc.resolve,require:o(e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse((0,uy.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),Ps=o(function(t,r){return ly.parse(t.slice(),r).argv},"Parser");Ps.detailed=function(e,t){return ly.parse(e.slice(),t)};Ps.camelCase=di;Ps.decamelize=lc;Ps.looksLikeNumber=fc;var lf=Ps;var Or=require("path");function fy(){return $2()?0:1}o(fy,"getProcessArgvBinIndex");function $2(){return w2()&&!process.defaultApp}o($2,"isBundledElectronApp");function w2(){return!!process.versions.electron}o(w2,"isElectronApp");function ff(e){return e.slice(fy()+1)}o(ff,"hideBin");function py(){return process.argv[fy()]}o(py,"getProcessArgvBin");var hc=class hc extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,hc)}};o(hc,"YError");var ke=hc;var fo=require("fs"),dy=require("util"),hy=require("path");var my={fs:{readFileSync:fo.readFileSync,writeFile:fo.writeFile},format:dy.format,resolve:hy.resolve,exists:o(e=>{try{return(0,fo.statSync)(e).isFile()}catch{return!1}},"exists")};var Er,df=class df{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=t.shift(),n=o(function(){},"cb");return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Er.format.apply(Er.format,[this.cache[this.locale][r]||r].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),r=t.shift(),n=t.shift(),i=t.shift(),s=o(function(){},"cb");typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let a=i===1?r:n;this.cache[this.locale][r]&&(a=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[a];return~a.indexOf("%d")&&c.push(i),Er.format.apply(Er.format,c.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.cache[this.locale][r]=t[r])}_taggedLiteral(t,...r){let n="";return t.forEach(function(i,s){let a=r[s+1];n+=i,typeof a<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,r=this.writeQueue[0],n=r.directory,i=r.locale,s=r.cb,a=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);Er.fs.writeFile(a,c,"utf-8",function(u){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(u)})}_readLocaleFile(){let t={},r=this._resolveLocaleFile(this.directory,this.locale);try{Er.fs.readFileSync&&(t=JSON.parse(Er.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,r){let n=Er.resolve(t,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=Er.resolve(t,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(t){return Er.exists(t)}};o(df,"Y18N");var pf=df;function gy(e,t){Er=t;let r=new pf(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}o(gy,"y18n");var A2=o(e=>gy(e,my),"y18n"),yy=A2;var T2={};var I2="require is not supported by ESM",by="loading a directory of commands is not supported yet for ESM",xs;try{xs=(0,Sy.fileURLToPath)(T2.url)}catch{xs=process.cwd()}var C2=xs.substring(0,xs.lastIndexOf("node_modules")),hf={assert:{notStrictEqual:mc.notStrictEqual,strictEqual:mc.strictEqual},cliui:rf,findUp:nf,getEnv:o(e=>process.env[e],"getEnv"),inspect:vy.inspect,getCallerFile:o(()=>{throw new ke(by)},"getCallerFile"),getProcessArgvBin:py,mainFilename:C2||process.cwd(),Parser:lf,path:{basename:Or.basename,dirname:Or.dirname,extname:Or.extname,relative:Or.relative,resolve:Or.resolve},process:{argv:o(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:o((e,t)=>process.emitWarning(e,t),"emitWarning"),execPath:o(()=>process.execPath,"execPath"),exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:_y.readFileSync,require:o(()=>{throw new ke(I2)},"require"),requireDirectory:o(()=>{throw new ke(by)},"requireDirectory"),stringWidth:o(e=>[...e].length,"stringWidth"),y18n:yy({directory:(0,Or.resolve)(xs,"../../../locales"),updateFiles:!1})};function It(e,t,r,n){r.assert.notStrictEqual(e,t,n)}o(It,"assertNotStrictEqual");function mf(e,t){t.assert.strictEqual(typeof e,"string")}o(mf,"assertSingleKey");function po(e){return Object.keys(e)}o(po,"objectKeys");function qe(e){return!!e&&!!e.then&&typeof e.then=="function"}o(qe,"isPromise");function xn(e){let r=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${e}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((a,c)=>{let u=!1;a=a.replace(/\s/g,""),/\.+[\]>]/.test(a)&&c===r.length-1&&(u=!0),/^\[/.test(a)?s.optional.push({cmd:a.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:a.replace(n,"").split("|"),variadic:u})}),s}o(xn,"parseCommand");var R2=["first","second","third","fourth","fifth","sixth"];function F(e,t,r){function n(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[xn(`cmd ${e}`),t,r]}o(n,"parseArgs");try{let i=0,[s,a,c]=n(),u=[].slice.call(a);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=c||u.length;if(l<s.demanded.length)throw new ke(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let p=s.demanded.length+s.optional.length;if(l>p)throw new ke(`Too many arguments provided. Expected max ${p} but received ${l}.`);s.demanded.forEach(f=>{let d=u.shift(),h=Ey(d);f.cmd.filter(b=>b===h||b==="*").length===0&&Oy(h,f.cmd,i),i+=1}),s.optional.forEach(f=>{if(u.length===0)return;let d=u.shift(),h=Ey(d);f.cmd.filter(b=>b===h||b==="*").length===0&&Oy(h,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}o(F,"argsert");function Ey(e){return Array.isArray(e)?"array":e===null?"null":typeof e}o(Ey,"guessType");function Oy(e,t,r){throw new ke(`Invalid ${R2[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}o(Oy,"argumentTypeError");var gf=class gf{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,r,n=!0,i=!1){if(F("<array|function> [boolean] [boolean] [boolean]",[t,r,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let a=t[s];a.applyBeforeValidation=r,a.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=r,s.global=n,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[r]||[],r];return i.option?!s.includes(i.option):!0}),t.option=r,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};o(gf,"GlobalMiddleware");var gc=gf;function Py(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}o(Py,"commandMiddlewareFactory");function hi(e,t,r,n){return r.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(qe(i))return i.then(a=>Promise.all([a,s(a,t)])).then(([a,c])=>Object.assign(a,c));{let a=s(i,t);return qe(a)?a.then(c=>Object.assign(i,c)):Object.assign(i,a)}},e)}o(hi,"applyMiddleware");function mi(e,t,r=n=>{throw n}){try{let n=N2(e)?e():e;return qe(n)?n.then(i=>t(i)):t(n)}catch(n){return r(n)}}o(mi,"maybeAsyncResult");function N2(e){return typeof e=="function"}o(N2,"isFunction");function yf(e){if(typeof require>"u")return null;for(let t=0,r=Object.keys(require.cache),n;t<r.length;t++)if(n=require.cache[r[t]],n.exports===e)return n;return null}o(yf,"whichModule");var ho=/(^\*)|(^\$0)/,vf=class vf{constructor(t,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=n,this.validation=r}addDirectory(t,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:a=>a;i.visit=(a,c,u)=>{let l=s(a,c,u);if(l){if(this.requireCache.has(c))return l;this.requireCache.add(c),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},t,i)}addHandler(t,r,n,i,s,a){let c=[],u=Py(s);if(i=i||(()=>{}),Array.isArray(t))if(j2(t))[t,...c]=t;else for(let l of t)this.addHandler(l);else if(k2(t)){let l=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(l=[].concat(l).concat(t.aliases)),this.addHandler(l,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(xy(n)){this.addHandler([t].concat(c),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let l=xn(t);c=c.map(d=>xn(d).cmd);let p=!1,f=[l.cmd].concat(c).filter(d=>ho.test(d)?(p=!0,!1):!0);f.length===0&&p&&f.push("$0"),p&&(l.cmd=f[0],c=f.slice(1),t=t.replace(ho,l.cmd)),c.forEach(d=>{this.aliasMap[d]=l.cmd}),r!==!1&&this.usage.command(t,r,p,c,a),this.handlers[l.cmd]={original:t,description:r,handler:i,builder:n||{},middlewares:u,deprecated:a,demanded:l.demanded,optional:l.optional},p&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,r,n,i,s,a){let c=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),p=!t;t&&(u.commands.push(t),u.fullCommands.push(c.original));let f=this.applyBuilderUpdateUsageAndParse(p,c,r,n.aliases,l,i,s,a);return qe(f)?f.then(d=>this.applyMiddlewareAndGetResult(p,c,d.innerArgv,u,s,d.aliases,r)):this.applyMiddlewareAndGetResult(p,c,f.innerArgv,u,s,f.aliases,r)}applyBuilderUpdateUsageAndParse(t,r,n,i,s,a,c,u){let l=r.builder,p=n;if(yc(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(d=>(p=wy(d)?d:n,this.parseAndUpdateUsage(t,r,p,s,a,c)))}else M2(l)&&(n.getInternalMethods().getUsageInstance().freeze(),p=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{p.option(f,l[f])}));return this.parseAndUpdateUsage(t,r,p,s,a,c)}parseAndUpdateUsage(t,r,n,i,s,a){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,a);return qe(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,r){let n=ho.test(r.original)?r.original.replace(ho,"").trim():r.original,i=t.filter(s=>!ho.test(s));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,r,n,i,s,a,c,u){if(!a.getInternalMethods().getHasOutput()){let l=a.getInternalMethods().runValidation(s,u,a.parsed.error,t);n=mi(n,p=>(l(p),p))}if(r.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let l=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(n,l,!1,!1),n=hi(n,a,c,!1),n=mi(n,p=>{let f=r.handler(p);return qe(f)?f.then(()=>p):p}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(p=>{try{a.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,r,n,i,s,a,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,c));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),p=hi(n,c,l,!0);return qe(p)?p.then(f=>this.handleValidationAndGetResult(t,r,f,i,a,c,l,u)):this.handleValidationAndGetResult(t,r,p,i,a,c,l,u)}populatePositionals(t,r,n,i){r._=r._.slice(n.commands.length);let s=t.demanded.slice(0),a=t.optional.slice(0),c={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,c)}for(;a.length;){let u=a.shift();this.populatePositional(u,r,c)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,c,this.cmdToParseOptions(t.original),i),c}populatePositional(t,r,n){let i=t.cmd[0];t.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(t){let r={array:[],default:{},alias:{},demand:{}},n=xn(t);return n.demanded.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=a,r.demand[s]=!0}),n.optional.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=a}),r}postProcessPositionals(t,r,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let l of Object.keys(n.alias))s.alias[l]=(s.alias[l]||[]).concat(n.alias[l]);s.array=s.array.concat(n.array),s.config={};let a=[];if(Object.keys(r).forEach(l=>{r[l].map(p=>{s.configuration["unknown-options-as-args"]&&(s.key[l]=!0),a.push(`--${l}`),a.push(p)})}),!a.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(a,Object.assign({},s,{configuration:c}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(p=>{l.push(...u.aliases[p])}),Object.keys(u.argv).forEach(p=>{l.includes(p)&&(r[p]||(r[p]=u.argv[p]),!this.isInConfigs(i,p)&&!this.isDefaulted(i,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(u.argv,p)&&(Array.isArray(t[p])||Array.isArray(u.argv[p]))?t[p]=[].concat(t[p],u.argv[p]):t[p]=u.argv[p])})}}isDefaulted(t,r){let{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(t,r){let{configObjects:n}=t.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=ho.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(yc(r))return r(t,!0);xy(r)||Object.keys(r).forEach(n=>{t.option(n,r[n])})}moduleName(t){let r=yf(t);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(r.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:r,desc:n}){for(let i of[t,r,n]){if(typeof i=="string"||i===!1)return i;It(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();It(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};o(vf,"CommandInstance");var bf=vf;function $y(e,t,r,n){return new bf(e,t,r,n)}o($y,"command");function xy(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}o(xy,"isCommandBuilderDefinition");function j2(e){return e.every(t=>typeof t=="string")}o(j2,"isCommandAndAliases");function yc(e){return typeof e=="function"}o(yc,"isCommandBuilderCallback");function M2(e){return typeof e=="object"}o(M2,"isCommandBuilderOptionDefinitions");function k2(e){return typeof e=="object"&&!Array.isArray(e)}o(k2,"isCommandHandlerDefinition");function $n(e={},t=()=>!0){let r={};return po(e).forEach(n=>{t(n,e[n])&&(r[n]=e[n])}),r}o($n,"objFilter");function wn(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let r=t;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(e)})}o(wn,"setBlocking");function q2(e){return typeof e=="boolean"}o(q2,"isBoolean");function Iy(e,t){let r=t.y18n.__,n={},i=[];n.failFn=o(function(R){i.push(R)},"failFn");let s=null,a=null,c=!0;n.showHelpOnFail=o(function(R=!0,q){let[Q,ue]=typeof R=="string"?[!0,R]:[R,q];return e.getInternalMethods().isGlobalContext()&&(a=ue),s=ue,c=Q,n},"showHelpOnFailFn");let u=!1;n.fail=o(function(R,q){let Q=e.getInternalMethods().getLoggerInstance();if(i.length)for(let ue=i.length-1;ue>=0;--ue){let ve=i[ue];if(q2(ve)){if(q)throw q;if(R)throw Error(R)}else ve(R,q,n)}else{if(e.getExitProcess()&&wn(!0),!u){u=!0,c&&(e.showHelp("error"),Q.error()),(R||q)&&Q.error(R||q);let ue=s||a;ue&&((R||q)&&Q.error(""),Q.error(ue))}if(q=q||new ke(R),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,q);throw q}},"fail");let l=[],p=!1;n.usage=(j,R)=>j===null?(p=!0,l=[],n):(p=!1,l.push([j,R||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(j,R)=>{f.push([j,R||""])};let d=[];n.command=o(function(R,q,Q,ue,ve=!1){Q&&(d=d.map(ge=>(ge[2]=!1,ge))),d.push([R,q||"",Q,ue,ve])},"command"),n.getCommands=()=>d;let h={};n.describe=o(function(R,q){Array.isArray(R)?R.forEach(Q=>{n.describe(Q,q)}):typeof R=="object"?Object.keys(R).forEach(Q=>{n.describe(Q,R[Q])}):h[R]=q},"describe"),n.getDescriptions=()=>h;let y=[];n.epilog=j=>{y.push(j)};let b=!1,g;n.wrap=j=>{b=!0,g=j},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(b||(g=ze(),b=!0),g);let P="__yargsString__:";n.deferY18nLookup=j=>P+j,n.help=o(function(){if(T)return T;C();let R=e.customScriptName?e.$0:t.path.basename(e.$0),q=e.getDemandedOptions(),Q=e.getDemandedCommands(),ue=e.getDeprecatedOptions(),ve=e.getGroups(),ge=e.getOptions(),We=[];We=We.concat(Object.keys(h)),We=We.concat(Object.keys(q)),We=We.concat(Object.keys(Q)),We=We.concat(Object.keys(ge.default)),We=We.filter(te),We=Object.keys(We.reduce((ee,Re)=>(Re!=="_"&&(ee[Re]=!0),ee),{}));let Lr=n.getWrap(),Te=t.cliui({width:Lr,wrap:!!Lr});if(!p){if(l.length)l.forEach(ee=>{Te.div({text:`${ee[0].replace(/\$0/g,R)}`}),ee[1]&&Te.div({text:`${ee[1]}`,padding:[1,0,0,0]})}),Te.div();else if(d.length){let ee=null;Q._?ee=`${R} <${r("command")}>
78
+ `),i+=e.charAt(s);return r&&n&&(i=`${r}${i}${n}`),i}o(ny,"wrap");function rf(e){return ty(e,{stringWidth:o(t=>[...t].length,"stringWidth"),stripAnsi:tf,wrap:ny})}o(rf,"ui");var lo=require("path"),uc=require("fs");function nf(e,t){let r=(0,lo.resolve)(".",e),n;for((0,uc.statSync)(r).isDirectory()||(r=(0,lo.dirname)(r));;){if(n=t(r,(0,uc.readdirSync)(r)),n)return(0,lo.resolve)(r,n);if(r=(0,lo.dirname)(n=r),n===r)break}}o(nf,"default");var vy=require("util"),_y=require("fs"),Sy=require("url");var cy=require("util"),dc=require("path");function di(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let r="",n=!1,i=e.match(/^-+/);for(let s=i?i[0].length:0;s<e.length;s++){let a=e.charAt(s);n&&(n=!1,a=a.toUpperCase()),s!==0&&(a==="-"||a==="_")?n=!0:a!=="-"&&a!=="_"&&(r+=a)}return r}}o(di,"camelCase");function lc(e,t){let r=e.toLowerCase();t=t||"-";let n="";for(let i=0;i<e.length;i++){let s=r.charAt(i),a=e.charAt(i);s!==a&&i>0?n+=`${t}${r.charAt(i)}`:n+=a}return n}o(lc,"decamelize");function fc(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}o(fc,"looksLikeNumber");function iy(e){if(Array.isArray(e))return e.map(a=>typeof a!="string"?a+"":a);e=e.trim();let t=0,r=null,n=null,i=null,s=[];for(let a=0;a<e.length;a++){if(r=n,n=e.charAt(a),n===" "&&!i){r!==" "&&t++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[t]||(s[t]=""),s[t]+=n}return s}o(iy,"tokenizeArgString");var ir;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(ir||(ir={}));var dn,sf=class sf{constructor(t){dn=t}parse(t,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=iy(t),s=typeof t=="string",a=O2(Object.assign(Object.create(null),n.alias)),c=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],p=n.envPrefix,f=c["populate--"],d=f?"--":"_",h=Object.create(null),y=Object.create(null),b=n.__||dn.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},P=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,$=new RegExp("^--"+c["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(_){let O=typeof _=="object"?_.key:_,N=Object.keys(_).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();N&&(g[N][O]=!0),g.arrays[O]=!0,g.keys.push(O)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(_){g.bools[_]=!0,g.keys.push(_)}),[].concat(n.string||[]).filter(Boolean).forEach(function(_){g.strings[_]=!0,g.keys.push(_)}),[].concat(n.number||[]).filter(Boolean).forEach(function(_){g.numbers[_]=!0,g.keys.push(_)}),[].concat(n.count||[]).filter(Boolean).forEach(function(_){g.counts[_]=!0,g.keys.push(_)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(_){g.normalize[_]=!0,g.keys.push(_)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([_,O])=>{typeof O=="number"&&(g.nargs[_]=O,g.keys.push(_))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([_,O])=>{typeof O=="function"&&(g.coercions[_]=O,g.keys.push(_))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(_){g.configs[_]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([_,O])=>{(typeof O=="boolean"||typeof O=="function")&&(g.configs[_]=O)})),Dt(n.key,a,n.default,g.arrays),Object.keys(u).forEach(function(_){(g.aliases[_]||[]).forEach(function(O){u[O]=u[_]})});let C=null;uo();let T=[],A=Object.assign(Object.create(null),{_:[]}),te={};for(let _=0;_<i.length;_++){let O=i[_],N=O.replace(/^-{3,}/,"---"),w,E,H,k,Z,nt;if(O!=="--"&&/^-/.test(O)&&je(O))X(O);else if(N.match(/^---+(=|$)/)){X(O);continue}else if(O.match(/^--.+=/)||!c["short-option-groups"]&&O.match(/^-.+=/))k=O.match(/^--?([^=]+)=([\s\S]*)$/),k!==null&&Array.isArray(k)&&k.length>=3&&(ne(k[1],g.arrays)?_=$e(_,k[1],i,k[2]):ne(k[1],g.nargs)!==!1?_=ze(_,k[1],i,k[2]):G(k[1],k[2],!0));else if(O.match($)&&c["boolean-negation"])k=O.match($),k!==null&&Array.isArray(k)&&k.length>=2&&(E=k[1],G(E,ne(E,g.arrays)?[!1]:!1));else if(O.match(/^--.+/)||!c["short-option-groups"]&&O.match(/^-[^-]+/))k=O.match(/^--?(.+)/),k!==null&&Array.isArray(k)&&k.length>=2&&(E=k[1],ne(E,g.arrays)?_=$e(_,E,i):ne(E,g.nargs)!==!1?_=ze(_,E,i):(Z=i[_+1],Z!==void 0&&(!Z.match(/^-/)||Z.match(P))&&!ne(E,g.bools)&&!ne(E,g.counts)||/^(true|false)$/.test(Z)?(G(E,Z),_++):G(E,_e(E))));else if(O.match(/^-.\..+=/))k=O.match(/^-([^=]+)=([\s\S]*)$/),k!==null&&Array.isArray(k)&&k.length>=3&&G(k[1],k[2]);else if(O.match(/^-.\..+/)&&!O.match(P))Z=i[_+1],k=O.match(/^-(.\..+)/),k!==null&&Array.isArray(k)&&k.length>=2&&(E=k[1],Z!==void 0&&!Z.match(/^-/)&&!ne(E,g.bools)&&!ne(E,g.counts)?(G(E,Z),_++):G(E,_e(E)));else if(O.match(/^-[^-]+/)&&!O.match(P)){H=O.slice(1,-1).split(""),w=!1;for(let mt=0;mt<H.length;mt++){if(Z=O.slice(mt+2),H[mt+1]&&H[mt+1]==="="){nt=O.slice(mt+3),E=H[mt],ne(E,g.arrays)?_=$e(_,E,i,nt):ne(E,g.nargs)!==!1?_=ze(_,E,i,nt):G(E,nt),w=!0;break}if(Z==="-"){G(H[mt],Z);continue}if(/[A-Za-z]/.test(H[mt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(Z)&&ne(Z,g.bools)===!1){G(H[mt],Z),w=!0;break}if(H[mt+1]&&H[mt+1].match(/\W/)){G(H[mt],Z),w=!0;break}else G(H[mt],_e(H[mt]))}E=O.slice(-1)[0],!w&&E!=="-"&&(ne(E,g.arrays)?_=$e(_,E,i):ne(E,g.nargs)!==!1?_=ze(_,E,i):(Z=i[_+1],Z!==void 0&&(!/^(-|--)[^-]/.test(Z)||Z.match(P))&&!ne(E,g.bools)&&!ne(E,g.counts)||/^(true|false)$/.test(Z)?(G(E,Z),_++):G(E,_e(E))))}else if(O.match(/^-[0-9]$/)&&O.match(P)&&ne(O.slice(1),g.bools))E=O.slice(1),G(E,_e(E));else if(O==="--"){T=i.slice(_+1);break}else if(c["halt-at-non-option"]){T=i.slice(_);break}else X(O)}ge(A,!0),ge(A,!1),Q(A),ve(),Te(A,g.aliases,u,!0),We(A),c["set-placeholder-key"]&&Lr(A),Object.keys(g.counts).forEach(function(_){nr(A,_.split("."))||G(_,0)}),f&&T.length&&(A[d]=[]),T.forEach(function(_){A[d].push(_)}),c["camel-case-expansion"]&&c["strip-dashed"]&&Object.keys(A).filter(_=>_!=="--"&&_.includes("-")).forEach(_=>{delete A[_]}),c["strip-aliased"]&&[].concat(...Object.keys(a).map(_=>a[_])).forEach(_=>{c["camel-case-expansion"]&&_.includes("-")&&delete A[_.split(".").map(O=>di(O)).join(".")],delete A[_]});function X(_){let O=q("_",_);(typeof O=="string"||typeof O=="number")&&A._.push(O)}o(X,"pushPositional");function ze(_,O,N,w){let E,H=ne(O,g.nargs);if(H=typeof H!="number"||isNaN(H)?1:H,H===0)return Lt(w)||(C=Error(b("Argument unexpected for: %s",O))),G(O,_e(O)),_;let k=Lt(w)?0:1;if(c["nargs-eats-options"])N.length-(_+1)+k<H&&(C=Error(b("Not enough arguments following: %s",O))),k=H;else{for(E=_+1;E<N.length&&(!N[E].match(/^-[^0-9]/)||N[E].match(P)||je(N[E]));E++)k++;k<H&&(C=Error(b("Not enough arguments following: %s",O)))}let Z=Math.min(k,H);for(!Lt(w)&&Z>0&&(G(O,w),Z--),E=_+1;E<Z+_+1;E++)G(O,N[E]);return _+Z}o(ze,"eatNargs");function $e(_,O,N,w){let E=[],H=w||N[_+1],k=ne(O,g.nargs);if(ne(O,g.bools)&&!/^(true|false)$/.test(H))E.push(!0);else if(Lt(H)||Lt(w)&&/^-/.test(H)&&!P.test(H)&&!je(H)){if(u[O]!==void 0){let Z=u[O];E=Array.isArray(Z)?Z:[Z]}}else{Lt(w)||E.push(R(O,w,!0));for(let Z=_+1;Z<N.length&&!(!c["greedy-arrays"]&&E.length>0||k&&typeof k=="number"&&E.length>=k||(H=N[Z],/^-/.test(H)&&!P.test(H)&&!je(H)));Z++)_=Z,E.push(R(O,H,s))}return typeof k=="number"&&(k&&E.length<k||isNaN(k)&&E.length===0)&&(C=Error(b("Not enough arguments following: %s",O))),G(O,E),_}o($e,"eatArray");function G(_,O,N=s){if(/-/.test(_)&&c["camel-case-expansion"]){let H=_.split(".").map(function(k){return di(k)}).join(".");j(_,H)}let w=R(_,O,N),E=_.split(".");Y(A,E,w),g.aliases[_]&&g.aliases[_].forEach(function(H){let k=H.split(".");Y(A,k,w)}),E.length>1&&c["dot-notation"]&&(g.aliases[E[0]]||[]).forEach(function(H){let k=H.split("."),Z=[].concat(E);Z.shift(),k=k.concat(Z),(g.aliases[_]||[]).includes(k.join("."))||Y(A,k,w)}),ne(_,g.normalize)&&!ne(_,g.arrays)&&[_].concat(g.aliases[_]||[]).forEach(function(k){Object.defineProperty(te,k,{enumerable:!0,get(){return O},set(Z){O=typeof Z=="string"?dn.normalize(Z):Z}})})}o(G,"setArg");function j(_,O){g.aliases[_]&&g.aliases[_].length||(g.aliases[_]=[O],h[O]=!0),g.aliases[O]&&g.aliases[O].length||j(O,_)}o(j,"addNewAlias");function R(_,O,N){N&&(O=P2(O)),(ne(_,g.bools)||ne(_,g.counts))&&typeof O=="string"&&(O=O==="true");let w=Array.isArray(O)?O.map(function(E){return q(_,E)}):q(_,O);return ne(_,g.counts)&&(Lt(w)||typeof w=="boolean")&&(w=of()),ne(_,g.normalize)&&ne(_,g.arrays)&&(Array.isArray(O)?w=O.map(E=>dn.normalize(E)):w=dn.normalize(O)),w}o(R,"processValue");function q(_,O){return!c["parse-positional-numbers"]&&_==="_"||!ne(_,g.strings)&&!ne(_,g.bools)&&!Array.isArray(O)&&(fc(O)&&c["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${O}`)))||!Lt(O)&&ne(_,g.numbers))&&(O=Number(O)),O}o(q,"maybeCoerceNumber");function Q(_){let O=Object.create(null);Te(O,g.aliases,u),Object.keys(g.configs).forEach(function(N){let w=_[N]||O[N];if(w)try{let E=null,H=dn.resolve(dn.cwd(),w),k=g.configs[N];if(typeof k=="function"){try{E=k(H)}catch(Z){E=Z}if(E instanceof Error){C=E;return}}else E=dn.require(H);ue(E)}catch(E){E.name==="PermissionDenied"?C=E:_[N]&&(C=Error(b("Invalid JSON config file: %s",w)))}})}o(Q,"setConfig");function ue(_,O){Object.keys(_).forEach(function(N){let w=_[N],E=O?O+"."+N:N;typeof w=="object"&&w!==null&&!Array.isArray(w)&&c["dot-notation"]?ue(w,E):(!nr(A,E.split("."))||ne(E,g.arrays)&&c["combine-arrays"])&&G(E,w)})}o(ue,"setConfigObject");function ve(){typeof l<"u"&&l.forEach(function(_){ue(_)})}o(ve,"setConfigObjects");function ge(_,O){if(typeof p>"u")return;let N=typeof p=="string"?p:"",w=dn.env();Object.keys(w).forEach(function(E){if(N===""||E.lastIndexOf(N,0)===0){let H=E.split("__").map(function(k,Z){return Z===0&&(k=k.substring(N.length)),di(k)});(O&&g.configs[H.join(".")]||!O)&&!nr(_,H)&&G(H.join("."),w[E])}})}o(ge,"applyEnvVars");function We(_){let O,N=new Set;Object.keys(_).forEach(function(w){if(!N.has(w)&&(O=ne(w,g.coercions),typeof O=="function"))try{let E=q(w,O(_[w]));[].concat(g.aliases[w]||[],w).forEach(H=>{N.add(H),_[H]=E})}catch(E){C=E}})}o(We,"applyCoercions");function Lr(_){return g.keys.forEach(O=>{~O.indexOf(".")||typeof _[O]>"u"&&(_[O]=void 0)}),_}o(Lr,"setPlaceholderKeys");function Te(_,O,N,w=!1){Object.keys(N).forEach(function(E){nr(_,E.split("."))||(Y(_,E.split("."),N[E]),w&&(y[E]=!0),(O[E]||[]).forEach(function(H){nr(_,H.split("."))||Y(_,H.split("."),N[E])}))})}o(Te,"applyDefaultsAndAliases");function nr(_,O){let N=_;c["dot-notation"]||(O=[O.join(".")]),O.slice(0,-1).forEach(function(E){N=N[E]||{}});let w=O[O.length-1];return typeof N!="object"?!1:w in N}o(nr,"hasKey");function Y(_,O,N){let w=_;c["dot-notation"]||(O=[O.join(".")]),O.slice(0,-1).forEach(function(nt){nt=oy(nt),typeof w=="object"&&w[nt]===void 0&&(w[nt]={}),typeof w[nt]!="object"||Array.isArray(w[nt])?(Array.isArray(w[nt])?w[nt].push({}):w[nt]=[w[nt],{}],w=w[nt][w[nt].length-1]):w=w[nt]});let E=oy(O[O.length-1]),H=ne(O.join("."),g.arrays),k=Array.isArray(N),Z=c["duplicate-arguments-array"];!Z&&ne(E,g.nargs)&&(Z=!0,(!Lt(w[E])&&g.nargs[E]===1||Array.isArray(w[E])&&w[E].length===g.nargs[E])&&(w[E]=void 0)),N===of()?w[E]=of(w[E]):Array.isArray(w[E])?Z&&H&&k?w[E]=c["flatten-duplicate-arrays"]?w[E].concat(N):(Array.isArray(w[E][0])?w[E]:[w[E]]).concat([N]):!Z&&!!H==!!k?w[E]=N:w[E]=w[E].concat([N]):w[E]===void 0&&H?w[E]=k?N:[N]:Z&&!(w[E]===void 0||ne(E,g.counts)||ne(E,g.bools))?w[E]=[w[E],N]:w[E]=N}o(Y,"setKey");function Dt(..._){_.forEach(function(O){Object.keys(O||{}).forEach(function(N){g.aliases[N]||(g.aliases[N]=[].concat(a[N]||[]),g.aliases[N].concat(N).forEach(function(w){if(/-/.test(w)&&c["camel-case-expansion"]){let E=di(w);E!==N&&g.aliases[N].indexOf(E)===-1&&(g.aliases[N].push(E),h[E]=!0)}}),g.aliases[N].concat(N).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&c["camel-case-expansion"]){let E=lc(w,"-");E!==N&&g.aliases[N].indexOf(E)===-1&&(g.aliases[N].push(E),h[E]=!0)}}),g.aliases[N].forEach(function(w){g.aliases[w]=[N].concat(g.aliases[N].filter(function(E){return w!==E}))}))})})}o(Dt,"extendAliases");function ne(_,O){let N=[].concat(g.aliases[_]||[],_),w=Object.keys(O),E=N.find(H=>w.includes(H));return E?O[E]:!1}o(ne,"checkAllAliases");function Ne(_){let O=Object.keys(g);return[].concat(O.map(w=>g[w])).some(function(w){return Array.isArray(w)?w.includes(_):w[_]})}o(Ne,"hasAnyFlag");function ee(_,...O){return[].concat(...O).some(function(w){let E=_.match(w);return E&&Ne(E[1])})}o(ee,"hasFlagsMatching");function Re(_){if(_.match(P)||!_.match(/^-[^-]+/))return!1;let O=!0,N,w=_.slice(1).split("");for(let E=0;E<w.length;E++){if(N=_.slice(E+2),!Ne(w[E])){O=!1;break}if(w[E+1]&&w[E+1]==="="||N==="-"||/[A-Za-z]/.test(w[E])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(N)||w[E+1]&&w[E+1].match(/\W/))break}return O}o(Re,"hasAllShortFlags");function je(_){return c["unknown-options-as-args"]&&pe(_)}o(je,"isUnknownOptionAsArg");function pe(_){return _=_.replace(/^-{3,}/,"--"),_.match(P)||Re(_)?!1:!ee(_,/^-+([^=]+?)=[\s\S]*$/,$,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}o(pe,"isUnknownOption");function _e(_){return!ne(_,g.bools)&&!ne(_,g.counts)&&`${_}`in u?u[_]:Ve(ut(_))}o(_e,"defaultValue");function Ve(_){return{[ir.BOOLEAN]:!0,[ir.STRING]:"",[ir.NUMBER]:void 0,[ir.ARRAY]:[]}[_]}o(Ve,"defaultForType");function ut(_){let O=ir.BOOLEAN;return ne(_,g.strings)?O=ir.STRING:ne(_,g.numbers)?O=ir.NUMBER:ne(_,g.bools)?O=ir.BOOLEAN:ne(_,g.arrays)&&(O=ir.ARRAY),O}o(ut,"guessType");function Lt(_){return _===void 0}o(Lt,"isUndefined");function uo(){Object.keys(g.counts).find(_=>ne(_,g.arrays)?(C=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",_)),!0):ne(_,g.nargs)?(C=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",_)),!0):!1)}return o(uo,"checkConfiguration"),{aliases:Object.assign({},g.aliases),argv:Object.assign(te,A),configuration:c,defaulted:Object.assign({},y),error:C,newAliases:Object.assign({},h)}}};o(sf,"YargsParser");var pc=sf;function O2(e){let t=[],r=Object.create(null),n=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});n;){n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(c){return t[s].indexOf(c)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),n=!0;break}}return t.forEach(function(i){i=i.filter(function(a,c,u){return u.indexOf(a)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(r[s]=i)}),r}o(O2,"combineAliases");function of(e){return e!==void 0?e+1:1}o(of,"increment");function oy(e){return e==="__proto__"?"___proto___":e}o(oy,"sanitizeKey");function P2(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}o(P2,"stripQuotes");var uy=require("fs");var af,cf,uf,sy=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ay=(cf=(af=process==null?void 0:process.versions)===null||af===void 0?void 0:af.node)!==null&&cf!==void 0?cf:(uf=process==null?void 0:process.version)===null||uf===void 0?void 0:uf.slice(1);if(ay&&Number(ay.match(/^([^.]+)/)[1])<sy)throw Error(`yargs parser supports a minimum Node.js version of ${sy}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var x2=process?process.env:{},ly=new pc({cwd:process.cwd,env:o(()=>x2,"env"),format:cy.format,normalize:dc.normalize,resolve:dc.resolve,require:o(e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse((0,uy.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),Ps=o(function(t,r){return ly.parse(t.slice(),r).argv},"Parser");Ps.detailed=function(e,t){return ly.parse(e.slice(),t)};Ps.camelCase=di;Ps.decamelize=lc;Ps.looksLikeNumber=fc;var lf=Ps;var Or=require("path");function fy(){return $2()?0:1}o(fy,"getProcessArgvBinIndex");function $2(){return w2()&&!process.defaultApp}o($2,"isBundledElectronApp");function w2(){return!!process.versions.electron}o(w2,"isElectronApp");function ff(e){return e.slice(fy()+1)}o(ff,"hideBin");function py(){return process.argv[fy()]}o(py,"getProcessArgvBin");var hc=class hc extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,hc)}};o(hc,"YError");var ke=hc;var fo=require("fs"),dy=require("util"),hy=require("path");var my={fs:{readFileSync:fo.readFileSync,writeFile:fo.writeFile},format:dy.format,resolve:hy.resolve,exists:o(e=>{try{return(0,fo.statSync)(e).isFile()}catch{return!1}},"exists")};var Er,df=class df{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=t.shift(),n=o(function(){},"cb");return typeof t[t.length-1]=="function"&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Er.format.apply(Er.format,[this.cache[this.locale][r]||r].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),r=t.shift(),n=t.shift(),i=t.shift(),s=o(function(){},"cb");typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let a=i===1?r:n;this.cache[this.locale][r]&&(a=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[a];return~a.indexOf("%d")&&c.push(i),Er.format.apply(Er.format,c.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.cache[this.locale][r]=t[r])}_taggedLiteral(t,...r){let n="";return t.forEach(function(i,s){let a=r[s+1];n+=i,typeof a<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,r=this.writeQueue[0],n=r.directory,i=r.locale,s=r.cb,a=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);Er.fs.writeFile(a,c,"utf-8",function(u){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(u)})}_readLocaleFile(){let t={},r=this._resolveLocaleFile(this.directory,this.locale);try{Er.fs.readFileSync&&(t=JSON.parse(Er.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")t={};else throw n}this.cache[this.locale]=t}_resolveLocaleFile(t,r){let n=Er.resolve(t,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=Er.resolve(t,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(t){return Er.exists(t)}};o(df,"Y18N");var pf=df;function gy(e,t){Er=t;let r=new pf(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}o(gy,"y18n");var A2=o(e=>gy(e,my),"y18n"),yy=A2;var T2={};var I2="require is not supported by ESM",by="loading a directory of commands is not supported yet for ESM",xs;try{xs=(0,Sy.fileURLToPath)(T2.url)}catch{xs=process.cwd()}var C2=xs.substring(0,xs.lastIndexOf("node_modules")),hf={assert:{notStrictEqual:mc.notStrictEqual,strictEqual:mc.strictEqual},cliui:rf,findUp:nf,getEnv:o(e=>process.env[e],"getEnv"),inspect:vy.inspect,getCallerFile:o(()=>{throw new ke(by)},"getCallerFile"),getProcessArgvBin:py,mainFilename:C2||process.cwd(),Parser:lf,path:{basename:Or.basename,dirname:Or.dirname,extname:Or.extname,relative:Or.relative,resolve:Or.resolve},process:{argv:o(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:o((e,t)=>process.emitWarning(e,t),"emitWarning"),execPath:o(()=>process.execPath,"execPath"),exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:_y.readFileSync,require:o(()=>{throw new ke(I2)},"require"),requireDirectory:o(()=>{throw new ke(by)},"requireDirectory"),stringWidth:o(e=>[...e].length,"stringWidth"),y18n:yy({directory:(0,Or.resolve)(xs,"../../../locales"),updateFiles:!1})};function It(e,t,r,n){r.assert.notStrictEqual(e,t,n)}o(It,"assertNotStrictEqual");function mf(e,t){t.assert.strictEqual(typeof e,"string")}o(mf,"assertSingleKey");function po(e){return Object.keys(e)}o(po,"objectKeys");function qe(e){return!!e&&!!e.then&&typeof e.then=="function"}o(qe,"isPromise");function xn(e){let r=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${e}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((a,c)=>{let u=!1;a=a.replace(/\s/g,""),/\.+[\]>]/.test(a)&&c===r.length-1&&(u=!0),/^\[/.test(a)?s.optional.push({cmd:a.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:a.replace(n,"").split("|"),variadic:u})}),s}o(xn,"parseCommand");var R2=["first","second","third","fourth","fifth","sixth"];function F(e,t,r){function n(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[xn(`cmd ${e}`),t,r]}o(n,"parseArgs");try{let i=0,[s,a,c]=n(),u=[].slice.call(a);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=c||u.length;if(l<s.demanded.length)throw new ke(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let p=s.demanded.length+s.optional.length;if(l>p)throw new ke(`Too many arguments provided. Expected max ${p} but received ${l}.`);s.demanded.forEach(f=>{let d=u.shift(),h=Ey(d);f.cmd.filter(b=>b===h||b==="*").length===0&&Oy(h,f.cmd,i),i+=1}),s.optional.forEach(f=>{if(u.length===0)return;let d=u.shift(),h=Ey(d);f.cmd.filter(b=>b===h||b==="*").length===0&&Oy(h,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}o(F,"argsert");function Ey(e){return Array.isArray(e)?"array":e===null?"null":typeof e}o(Ey,"guessType");function Oy(e,t,r){throw new ke(`Invalid ${R2[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}o(Oy,"argumentTypeError");var gf=class gf{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,r,n=!0,i=!1){if(F("<array|function> [boolean] [boolean] [boolean]",[t,r,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let a=t[s];a.applyBeforeValidation=r,a.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=r,s.global=n,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[r]||[],r];return i.option?!s.includes(i.option):!0}),t.option=r,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};o(gf,"GlobalMiddleware");var gc=gf;function Py(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}o(Py,"commandMiddlewareFactory");function hi(e,t,r,n){return r.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(qe(i))return i.then(a=>Promise.all([a,s(a,t)])).then(([a,c])=>Object.assign(a,c));{let a=s(i,t);return qe(a)?a.then(c=>Object.assign(i,c)):Object.assign(i,a)}},e)}o(hi,"applyMiddleware");function mi(e,t,r=n=>{throw n}){try{let n=N2(e)?e():e;return qe(n)?n.then(i=>t(i)):t(n)}catch(n){return r(n)}}o(mi,"maybeAsyncResult");function N2(e){return typeof e=="function"}o(N2,"isFunction");function yf(e){if(typeof require>"u")return null;for(let t=0,r=Object.keys(require.cache),n;t<r.length;t++)if(n=require.cache[r[t]],n.exports===e)return n;return null}o(yf,"whichModule");var ho=/(^\*)|(^\$0)/,vf=class vf{constructor(t,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=n,this.validation=r}addDirectory(t,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:a=>a;i.visit=(a,c,u)=>{let l=s(a,c,u);if(l){if(this.requireCache.has(c))return l;this.requireCache.add(c),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},t,i)}addHandler(t,r,n,i,s,a){let c=[],u=Py(s);if(i=i||(()=>{}),Array.isArray(t))if(j2(t))[t,...c]=t;else for(let l of t)this.addHandler(l);else if(k2(t)){let l=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(l=[].concat(l).concat(t.aliases)),this.addHandler(l,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(xy(n)){this.addHandler([t].concat(c),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof t=="string"){let l=xn(t);c=c.map(d=>xn(d).cmd);let p=!1,f=[l.cmd].concat(c).filter(d=>ho.test(d)?(p=!0,!1):!0);f.length===0&&p&&f.push("$0"),p&&(l.cmd=f[0],c=f.slice(1),t=t.replace(ho,l.cmd)),c.forEach(d=>{this.aliasMap[d]=l.cmd}),r!==!1&&this.usage.command(t,r,p,c,a),this.handlers[l.cmd]={original:t,description:r,handler:i,builder:n||{},middlewares:u,deprecated:a,demanded:l.demanded,optional:l.optional},p&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,r,n,i,s,a){let c=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),p=!t;t&&(u.commands.push(t),u.fullCommands.push(c.original));let f=this.applyBuilderUpdateUsageAndParse(p,c,r,n.aliases,l,i,s,a);return qe(f)?f.then(d=>this.applyMiddlewareAndGetResult(p,c,d.innerArgv,u,s,d.aliases,r)):this.applyMiddlewareAndGetResult(p,c,f.innerArgv,u,s,f.aliases,r)}applyBuilderUpdateUsageAndParse(t,r,n,i,s,a,c,u){let l=r.builder,p=n;if(yc(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(d=>(p=wy(d)?d:n,this.parseAndUpdateUsage(t,r,p,s,a,c)))}else M2(l)&&(n.getInternalMethods().getUsageInstance().freeze(),p=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{p.option(f,l[f])}));return this.parseAndUpdateUsage(t,r,p,s,a,c)}parseAndUpdateUsage(t,r,n,i,s,a){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,a);return qe(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,r){let n=ho.test(r.original)?r.original.replace(ho,"").trim():r.original,i=t.filter(s=>!ho.test(s));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,r,n,i,s,a,c,u){if(!a.getInternalMethods().getHasOutput()){let l=a.getInternalMethods().runValidation(s,u,a.parsed.error,t);n=mi(n,p=>(l(p),p))}if(r.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let l=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(n,l,!1,!1),n=hi(n,a,c,!1),n=mi(n,p=>{let f=r.handler(p);return qe(f)?f.then(()=>p):p}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(p=>{try{a.getInternalMethods().getUsageInstance().fail(null,p)}catch{}})}return t||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,r,n,i,s,a,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,c));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),p=hi(n,c,l,!0);return qe(p)?p.then(f=>this.handleValidationAndGetResult(t,r,f,i,a,c,l,u)):this.handleValidationAndGetResult(t,r,p,i,a,c,l,u)}populatePositionals(t,r,n,i){r._=r._.slice(n.commands.length);let s=t.demanded.slice(0),a=t.optional.slice(0),c={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,c)}for(;a.length;){let u=a.shift();this.populatePositional(u,r,c)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,c,this.cmdToParseOptions(t.original),i),c}populatePositional(t,r,n){let i=t.cmd[0];t.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(t){let r={array:[],default:{},alias:{},demand:{}},n=xn(t);return n.demanded.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=a,r.demand[s]=!0}),n.optional.forEach(i=>{let[s,...a]=i.cmd;i.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=a}),r}postProcessPositionals(t,r,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let l of Object.keys(n.alias))s.alias[l]=(s.alias[l]||[]).concat(n.alias[l]);s.array=s.array.concat(n.array),s.config={};let a=[];if(Object.keys(r).forEach(l=>{r[l].map(p=>{s.configuration["unknown-options-as-args"]&&(s.key[l]=!0),a.push(`--${l}`),a.push(p)})}),!a.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(a,Object.assign({},s,{configuration:c}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(p=>{l.push(...u.aliases[p])}),Object.keys(u.argv).forEach(p=>{l.includes(p)&&(r[p]||(r[p]=u.argv[p]),!this.isInConfigs(i,p)&&!this.isDefaulted(i,p)&&Object.prototype.hasOwnProperty.call(t,p)&&Object.prototype.hasOwnProperty.call(u.argv,p)&&(Array.isArray(t[p])||Array.isArray(u.argv[p]))?t[p]=[].concat(t[p],u.argv[p]):t[p]=u.argv[p])})}}isDefaulted(t,r){let{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(t,r){let{configObjects:n}=t.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let n=ho.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(yc(r))return r(t,!0);xy(r)||Object.keys(r).forEach(n=>{t.option(n,r[n])})}moduleName(t){let r=yf(t);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(r.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:r,desc:n}){for(let i of[t,r,n]){if(typeof i=="string"||i===!1)return i;It(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();It(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};o(vf,"CommandInstance");var bf=vf;function $y(e,t,r,n){return new bf(e,t,r,n)}o($y,"command");function xy(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}o(xy,"isCommandBuilderDefinition");function j2(e){return e.every(t=>typeof t=="string")}o(j2,"isCommandAndAliases");function yc(e){return typeof e=="function"}o(yc,"isCommandBuilderCallback");function M2(e){return typeof e=="object"}o(M2,"isCommandBuilderOptionDefinitions");function k2(e){return typeof e=="object"&&!Array.isArray(e)}o(k2,"isCommandHandlerDefinition");function $n(e={},t=()=>!0){let r={};return po(e).forEach(n=>{t(n,e[n])&&(r[n]=e[n])}),r}o($n,"objFilter");function wn(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let r=t;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(e)})}o(wn,"setBlocking");function q2(e){return typeof e=="boolean"}o(q2,"isBoolean");function Iy(e,t){let r=t.y18n.__,n={},i=[];n.failFn=o(function(R){i.push(R)},"failFn");let s=null,a=null,c=!0;n.showHelpOnFail=o(function(R=!0,q){let[Q,ue]=typeof R=="string"?[!0,R]:[R,q];return e.getInternalMethods().isGlobalContext()&&(a=ue),s=ue,c=Q,n},"showHelpOnFailFn");let u=!1;n.fail=o(function(R,q){let Q=e.getInternalMethods().getLoggerInstance();if(i.length)for(let ue=i.length-1;ue>=0;--ue){let ve=i[ue];if(q2(ve)){if(q)throw q;if(R)throw Error(R)}else ve(R,q,n)}else{if(e.getExitProcess()&&wn(!0),!u){u=!0,c&&(e.showHelp("error"),Q.error()),(R||q)&&Q.error(R||q);let ue=s||a;ue&&((R||q)&&Q.error(""),Q.error(ue))}if(q=q||new ke(R),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,q);throw q}},"fail");let l=[],p=!1;n.usage=(j,R)=>j===null?(p=!0,l=[],n):(p=!1,l.push([j,R||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(j,R)=>{f.push([j,R||""])};let d=[];n.command=o(function(R,q,Q,ue,ve=!1){Q&&(d=d.map(ge=>(ge[2]=!1,ge))),d.push([R,q||"",Q,ue,ve])},"command"),n.getCommands=()=>d;let h={};n.describe=o(function(R,q){Array.isArray(R)?R.forEach(Q=>{n.describe(Q,q)}):typeof R=="object"?Object.keys(R).forEach(Q=>{n.describe(Q,R[Q])}):h[R]=q},"describe"),n.getDescriptions=()=>h;let y=[];n.epilog=j=>{y.push(j)};let b=!1,g;n.wrap=j=>{b=!0,g=j},n.getWrap=()=>t.getEnv("YARGS_DISABLE_WRAP")?null:(b||(g=ze(),b=!0),g);let P="__yargsString__:";n.deferY18nLookup=j=>P+j,n.help=o(function(){if(T)return T;C();let R=e.customScriptName?e.$0:t.path.basename(e.$0),q=e.getDemandedOptions(),Q=e.getDemandedCommands(),ue=e.getDeprecatedOptions(),ve=e.getGroups(),ge=e.getOptions(),We=[];We=We.concat(Object.keys(h)),We=We.concat(Object.keys(q)),We=We.concat(Object.keys(Q)),We=We.concat(Object.keys(ge.default)),We=We.filter(te),We=Object.keys(We.reduce((ee,Re)=>(Re!=="_"&&(ee[Re]=!0),ee),{}));let Lr=n.getWrap(),Te=t.cliui({width:Lr,wrap:!!Lr});if(!p){if(l.length)l.forEach(ee=>{Te.div({text:`${ee[0].replace(/\$0/g,R)}`}),ee[1]&&Te.div({text:`${ee[1]}`,padding:[1,0,0,0]})}),Te.div();else if(d.length){let ee=null;Q._?ee=`${R} <${r("command")}>
79
79
  `:ee=`${R} [${r("command")}]
80
80
  `,Te.div(`${ee}`)}}if(d.length>1||d.length===1&&!d[0][2]){Te.div(r("Commands:"));let ee=e.getInternalMethods().getContext(),Re=ee.commands.length?`${ee.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((pe,_e)=>pe[0].localeCompare(_e[0])));let je=R?`${R} `:"";d.forEach(pe=>{let _e=`${je}${Re}${pe[0].replace(/^\$0 ?/,"")}`;Te.span({text:_e,padding:[0,2,0,2],width:$(d,Lr,`${R}${Re}`)+4},{text:pe[1]});let Ve=[];pe[2]&&Ve.push(`[${r("default")}]`),pe[3]&&pe[3].length&&Ve.push(`[${r("aliases:")} ${pe[3].join(", ")}]`),pe[4]&&(typeof pe[4]=="string"?Ve.push(`[${r("deprecated: %s",pe[4])}]`):Ve.push(`[${r("deprecated")}]`)),Ve.length?Te.div({text:Ve.join(" "),padding:[0,0,0,2],align:"right"}):Te.div()}),Te.div()}let nr=(Object.keys(ge.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);We=We.filter(ee=>!e.parsed.newAliases[ee]&&nr.every(Re=>(ge.alias[Re]||[]).indexOf(ee)===-1));let Y=r("Options:");ve[Y]||(ve[Y]=[]),A(We,ge.alias,ve,Y);let Dt=o(ee=>/^--/.test(bc(ee)),"isLongSwitch"),ne=Object.keys(ve).filter(ee=>ve[ee].length>0).map(ee=>{let Re=ve[ee].filter(te).map(je=>{if(nr.includes(je))return je;for(let pe=0,_e;(_e=nr[pe])!==void 0;pe++)if((ge.alias[_e]||[]).includes(je))return _e;return je});return{groupName:ee,normalizedKeys:Re}}).filter(({normalizedKeys:ee})=>ee.length>0).map(({groupName:ee,normalizedKeys:Re})=>{let je=Re.reduce((pe,_e)=>(pe[_e]=[_e].concat(ge.alias[_e]||[]).map(Ve=>ee===n.getPositionalGroupName()?Ve:(/^[0-9]$/.test(Ve)?ge.boolean.includes(_e)?"-":"--":Ve.length>1?"--":"-")+Ve).sort((Ve,ut)=>Dt(Ve)===Dt(ut)?0:Dt(Ve)?1:-1).join(", "),pe),{});return{groupName:ee,normalizedKeys:Re,switches:je}});if(ne.filter(({groupName:ee})=>ee!==n.getPositionalGroupName()).some(({normalizedKeys:ee,switches:Re})=>!ee.every(je=>Dt(Re[je])))&&ne.filter(({groupName:ee})=>ee!==n.getPositionalGroupName()).forEach(({normalizedKeys:ee,switches:Re})=>{ee.forEach(je=>{Dt(Re[je])&&(Re[je]=D2(Re[je],4))})}),ne.forEach(({groupName:ee,normalizedKeys:Re,switches:je})=>{Te.div(ee),Re.forEach(pe=>{let _e=je[pe],Ve=h[pe]||"",ut=null;Ve.includes(P)&&(Ve=r(Ve.substring(P.length))),ge.boolean.includes(pe)&&(ut=`[${r("boolean")}]`),ge.count.includes(pe)&&(ut=`[${r("count")}]`),ge.string.includes(pe)&&(ut=`[${r("string")}]`),ge.normalize.includes(pe)&&(ut=`[${r("string")}]`),ge.array.includes(pe)&&(ut=`[${r("array")}]`),ge.number.includes(pe)&&(ut=`[${r("number")}]`);let Lt=o(O=>typeof O=="string"?`[${r("deprecated: %s",O)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),uo=[pe in ue?Lt(ue[pe]):null,ut,pe in q?`[${r("required")}]`:null,ge.choices&&ge.choices[pe]?`[${r("choices:")} ${n.stringifiedValues(ge.choices[pe])}]`:null,X(ge.default[pe],ge.defaultDescription[pe])].filter(Boolean).join(" ");Te.span({text:bc(_e),padding:[0,2,0,2+Ay(_e)],width:$(je,Lr)+4},Ve);let _=e.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;uo&&!_?Te.div({text:uo,padding:[0,0,0,2],align:"right"}):Te.div()}),Te.div()}),f.length&&(Te.div(r("Examples:")),f.forEach(ee=>{ee[0]=ee[0].replace(/\$0/g,R)}),f.forEach(ee=>{ee[1]===""?Te.div({text:ee[0],padding:[0,2,0,2]}):Te.div({text:ee[0],padding:[0,2,0,2],width:$(f,Lr)+4},{text:ee[1]})}),Te.div()),y.length>0){let ee=y.map(Re=>Re.replace(/\$0/g,R)).join(`
81
81
  `);Te.div(`${ee}
@@ -133,22 +133,22 @@ ${y.join(`
133
133
  `;d.forEach(y=>{h+=y}),t.fail(h)}},"implications");let u={};s.conflicts=o(function(f,d){F("<string|object> [array|string]",[f,d],arguments.length),typeof f=="object"?Object.keys(f).forEach(h=>{s.conflicts(h,f[h])}):(e.global(f),u[f]||(u[f]=[]),Array.isArray(d)?d.forEach(h=>s.conflicts(f,h)):u[f].push(d))},"conflicts"),s.getConflicting=()=>u,s.conflicting=o(function(f){Object.keys(f).forEach(d=>{u[d]&&u[d].forEach(h=>{h&&f[d]!==void 0&&f[h]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",d,h))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(d=>{u[d].forEach(h=>{h&&f[r.Parser.camelCase(d)]!==void 0&&f[r.Parser.camelCase(h)]!==void 0&&t.fail(n("Arguments %s and %s are mutually exclusive",d,h))})})},"conflictingFn"),s.recommendCommands=o(function(f,d){d=d.sort((g,P)=>P.length-g.length);let y=null,b=1/0;for(let g=0,P;(P=d[g])!==void 0;g++){let $=Ny(f,P);$<=3&&$<b&&(b=$,y=P)}y&&t.fail(n("Did you mean %s?",y))},"recommendCommands"),s.reset=o(function(f){return a=$n(a,d=>!f[d]),u=$n(u,d=>!f[d]),s},"reset");let l=[];return s.freeze=o(function(){l.push({implied:a,conflicting:u})},"freeze"),s.unfreeze=o(function(){let f=l.pop();It(f,void 0,r),{implied:a,conflicting:u}=f},"unfreeze"),s}o(My,"validation");var Of=[],$s;function ws(e,t,r,n){$s=n;let i={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return i;let s=/\.json|\..*rc$/.test(e.extends),a=null;if(s)a=V2(t,e.extends);else try{a=require.resolve(e.extends)}catch{return e}B2(a),Of.push(a),i=s?JSON.parse($s.readFileSync(a,"utf8")):require(e.extends),delete e.extends,i=ws(i,$s.path.dirname(a),r,$s)}return Of=[],r?ky(i,e):Object.assign({},i,e)}o(ws,"applyExtends");function B2(e){if(Of.indexOf(e)>-1)throw new ke(`Circular extended configurations: '${e}'.`)}o(B2,"checkForCircularExtends");function V2(e,t){return $s.path.resolve(e,t)}o(V2,"getPathToDefaultConfig");function ky(e,t){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}o(n,"isObject"),Object.assign(r,e);for(let i of Object.keys(t))n(t[i])&&n(r[i])?r[i]=ky(e[i],t[i]):r[i]=t[i];return r}o(ky,"mergeDeep");var B=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},m=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},tt,gi,As,or,Zt,vc,An,yi,_c,sr,Sc,ar,Fr,Wt,cr,Ec,mo,lt,W,Oc,Pc,Kt,bi,go,vi,In,xc,ie,_i,Si,Ei,se,$c,Hr,Ke;function rb(e){return(t=[],r=e.process.cwd(),n)=>{let i=new jf(t,r,n,e);return Object.defineProperty(i,"argv",{get:o(()=>i.parse(),"get"),enumerable:!0}),i.help(),i.version(),i}}o(rb,"YargsFactory");var qy=Symbol("copyDoubleDash"),Dy=Symbol("copyDoubleDash"),Pf=Symbol("deleteFromParserHintObject"),Ly=Symbol("emitWarning"),Fy=Symbol("freeze"),Hy=Symbol("getDollarZero"),Oi=Symbol("getParserConfiguration"),By=Symbol("getUsageConfiguration"),xf=Symbol("guessLocale"),Vy=Symbol("guessVersion"),Uy=Symbol("parsePositionalNumbers"),$f=Symbol("pkgUp"),Cn=Symbol("populateParserHintArray"),yo=Symbol("populateParserHintSingleValueDictionary"),wf=Symbol("populateParserHintArrayDictionary"),Af=Symbol("populateParserHintDictionary"),If=Symbol("sanitizeKey"),Cf=Symbol("setKey"),Tf=Symbol("unfreeze"),Gy=Symbol("validateAsync"),zy=Symbol("getCommandInstance"),Zy=Symbol("getContext"),Wy=Symbol("getHasOutput"),Ky=Symbol("getLoggerInstance"),Yy=Symbol("getParseContext"),Qy=Symbol("getUsageInstance"),Jy=Symbol("getValidationInstance"),wc=Symbol("hasParseCallback"),Xy=Symbol("isGlobalContext"),Pi=Symbol("postProcess"),eb=Symbol("rebase"),Rf=Symbol("reset"),Is=Symbol("runYargsParserAndExecuteCommands"),Nf=Symbol("runValidation"),tb=Symbol("setHasOutput"),xi=Symbol("kTrackManuallySetKeys"),Mf=class Mf{constructor(t=[],r,n,i){this.customScriptName=!1,this.parsed=!1,tt.set(this,void 0),gi.set(this,void 0),As.set(this,{commands:[],fullCommands:[]}),or.set(this,null),Zt.set(this,null),vc.set(this,"show-hidden"),An.set(this,null),yi.set(this,!0),_c.set(this,{}),sr.set(this,!0),Sc.set(this,[]),ar.set(this,void 0),Fr.set(this,{}),Wt.set(this,!1),cr.set(this,null),Ec.set(this,!0),mo.set(this,void 0),lt.set(this,""),W.set(this,void 0),Oc.set(this,void 0),Pc.set(this,{}),Kt.set(this,null),bi.set(this,null),go.set(this,{}),vi.set(this,{}),In.set(this,void 0),xc.set(this,!1),ie.set(this,void 0),_i.set(this,!1),Si.set(this,!1),Ei.set(this,!1),se.set(this,void 0),$c.set(this,{}),Hr.set(this,null),Ke.set(this,void 0),B(this,ie,i,"f"),B(this,In,t,"f"),B(this,gi,r,"f"),B(this,Oc,n,"f"),B(this,ar,new gc(this),"f"),this.$0=this[Hy](),this[Rf](),B(this,tt,m(this,tt,"f"),"f"),B(this,se,m(this,se,"f"),"f"),B(this,Ke,m(this,Ke,"f"),"f"),B(this,W,m(this,W,"f"),"f"),m(this,W,"f").showHiddenOpt=m(this,vc,"f"),B(this,mo,this[Dy](),"f")}addHelpOpt(t,r){let n="help";return F("[string|boolean] [string]",[t,r],arguments.length),m(this,cr,"f")&&(this[Pf](m(this,cr,"f")),B(this,cr,null,"f")),t===!1&&r===void 0?this:(B(this,cr,typeof t=="string"?t:n,"f"),this.boolean(m(this,cr,"f")),this.describe(m(this,cr,"f"),r||m(this,se,"f").deferY18nLookup("Show help")),this)}help(t,r){return this.addHelpOpt(t,r)}addShowHiddenOpt(t,r){if(F("[string|boolean] [string]",[t,r],arguments.length),t===!1&&r===void 0)return this;let n=typeof t=="string"?t:m(this,vc,"f");return this.boolean(n),this.describe(n,r||m(this,se,"f").deferY18nLookup("Show hidden options")),m(this,W,"f").showHiddenOpt=n,this}showHidden(t,r){return this.addShowHiddenOpt(t,r)}alias(t,r){return F("<object|string|array> [string|array]",[t,r],arguments.length),this[wf](this.alias.bind(this),"alias",t,r),this}array(t){return F("<array|string>",[t],arguments.length),this[Cn]("array",t),this[xi](t),this}boolean(t){return F("<array|string>",[t],arguments.length),this[Cn]("boolean",t),this[xi](t),this}check(t,r){return F("<function> [boolean]",[t,r],arguments.length),this.middleware((n,i)=>mi(()=>t(n,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&m(this,se,"f").fail(s.toString(),s):m(this,se,"f").fail(m(this,ie,"f").y18n.__("Argument check failed: %s",t.toString())),n),s=>(m(this,se,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(t,r){return F("<object|string|array> [string|array]",[t,r],arguments.length),this[wf](this.choices.bind(this),"choices",t,r),this}coerce(t,r){if(F("<object|string|array> [function]",[t,r],arguments.length),Array.isArray(t)){if(!r)throw new ke("coerce callback must be provided");for(let n of t)this.coerce(n,r);return this}else if(typeof t=="object"){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!r)throw new ke("coerce callback must be provided");return m(this,W,"f").key[t]=!0,m(this,ar,"f").addCoerceMiddleware((n,i)=>{let s;return Object.prototype.hasOwnProperty.call(n,t)?mi(()=>(s=i.getAliases(),r(n[t])),c=>{n[t]=c;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&u!==!0)for(let l of s[t])n[l]=c;return n},c=>{throw new ke(c.message)}):n},t),this}conflicts(t,r){return F("<string|object> [string|array]",[t,r],arguments.length),m(this,Ke,"f").conflicts(t,r),this}config(t="config",r,n){return F("[object|string] [string|function] [function]",[t,r,n],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=ws(t,m(this,gi,"f"),this[Oi]()["deep-merge-config"]||!1,m(this,ie,"f")),m(this,W,"f").configObjects=(m(this,W,"f").configObjects||[]).concat(t),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(t,r||m(this,se,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{m(this,W,"f").config[i]=n||!0}),this)}completion(t,r,n){return F("[string] [string|boolean|function] [function]",[t,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),B(this,Zt,t||m(this,Zt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(m(this,Zt,"f"),r),n&&m(this,or,"f").registerFunction(n),this}command(t,r,n,i,s,a){return F("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,r,n,i,s,a],arguments.length),m(this,tt,"f").addHandler(t,r,n,i,s,a),this}commands(t,r,n,i,s,a){return this.command(t,r,n,i,s,a)}commandDir(t,r){F("<string> [object]",[t,r],arguments.length);let n=m(this,Oc,"f")||m(this,ie,"f").require;return m(this,tt,"f").addDirectory(t,n,m(this,ie,"f").getCallerFile(),r),this}count(t){return F("<array|string>",[t],arguments.length),this[Cn]("count",t),this[xi](t),this}default(t,r,n){return F("<object|string|array> [*] [string]",[t,r,n],arguments.length),n&&(mf(t,m(this,ie,"f")),m(this,W,"f").defaultDescription[t]=n),typeof r=="function"&&(mf(t,m(this,ie,"f")),m(this,W,"f").defaultDescription[t]||(m(this,W,"f").defaultDescription[t]=m(this,se,"f").functionDescription(r)),r=r.call()),this[yo](this.default.bind(this),"default",t,r),this}defaults(t,r,n){return this.default(t,r,n)}demandCommand(t=1,r,n,i){return F("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),m(this,W,"f").demandedCommands._={min:t,max:r,minMsg:n,maxMsg:i},this}demand(t,r,n){return Array.isArray(r)?(r.forEach(i=>{It(n,!0,m(this,ie,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof t=="number"?(It(n,!0,m(this,ie,"f")),this.demandCommand(t,r,n,n)):Array.isArray(t)?t.forEach(i=>{It(n,!0,m(this,ie,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(t,n):(n===!0||typeof n>"u")&&this.demandOption(t),this}demandOption(t,r){return F("<object|string|array> [string]",[t,r],arguments.length),this[yo](this.demandOption.bind(this),"demandedOptions",t,r),this}deprecateOption(t,r){return F("<string> [string|boolean]",[t,r],arguments.length),m(this,W,"f").deprecatedOptions[t]=r,this}describe(t,r){return F("<object|string|array> [string]",[t,r],arguments.length),this[Cf](t,!0),m(this,se,"f").describe(t,r),this}detectLocale(t){return F("<boolean>",[t],arguments.length),B(this,yi,t,"f"),this}env(t){return F("[string|boolean]",[t],arguments.length),t===!1?delete m(this,W,"f").envPrefix:m(this,W,"f").envPrefix=t||"",this}epilogue(t){return F("<string>",[t],arguments.length),m(this,se,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,r){return F("<string|array> [string]",[t,r],arguments.length),Array.isArray(t)?t.forEach(n=>this.example(...n)):m(this,se,"f").example(t,r),this}exit(t,r){B(this,Wt,!0,"f"),B(this,An,r,"f"),m(this,sr,"f")&&m(this,ie,"f").process.exit(t)}exitProcess(t=!0){return F("[boolean]",[t],arguments.length),B(this,sr,t,"f"),this}fail(t){if(F("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new ke("Invalid first argument. Expected function or boolean 'false'");return m(this,se,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,r){return F("<array> [function]",[t,r],arguments.length),r?m(this,or,"f").getCompletion(t,r):new Promise((n,i)=>{m(this,or,"f").getCompletion(t,(s,a)=>{s?i(s):n(a)})})}getDemandedOptions(){return F([],0),m(this,W,"f").demandedOptions}getDemandedCommands(){return F([],0),m(this,W,"f").demandedCommands}getDeprecatedOptions(){return F([],0),m(this,W,"f").deprecatedOptions}getDetectLocale(){return m(this,yi,"f")}getExitProcess(){return m(this,sr,"f")}getGroups(){return Object.assign({},m(this,Fr,"f"),m(this,vi,"f"))}getHelp(){if(B(this,Wt,!0,"f"),!m(this,se,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Is](m(this,In,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>m(this,se,"f").help())}let t=m(this,tt,"f").runDefaultBuilderOn(this);if(qe(t))return t.then(()=>m(this,se,"f").help())}return Promise.resolve(m(this,se,"f").help())}getOptions(){return m(this,W,"f")}getStrict(){return m(this,_i,"f")}getStrictCommands(){return m(this,Si,"f")}getStrictOptions(){return m(this,Ei,"f")}global(t,r){return F("<string|array> [boolean]",[t,r],arguments.length),t=[].concat(t),r!==!1?m(this,W,"f").local=m(this,W,"f").local.filter(n=>t.indexOf(n)===-1):t.forEach(n=>{m(this,W,"f").local.includes(n)||m(this,W,"f").local.push(n)}),this}group(t,r){F("<string|array> <string>",[t,r],arguments.length);let n=m(this,vi,"f")[r]||m(this,Fr,"f")[r];m(this,vi,"f")[r]&&delete m(this,vi,"f")[r];let i={};return m(this,Fr,"f")[r]=(n||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return F("<string>",[t],arguments.length),m(this,W,"f").hiddenOptions.push(t),this}implies(t,r){return F("<string|object> [number|string|array]",[t,r],arguments.length),m(this,Ke,"f").implies(t,r),this}locale(t){return F("[string]",[t],arguments.length),t===void 0?(this[xf](),m(this,ie,"f").y18n.getLocale()):(B(this,yi,!1,"f"),m(this,ie,"f").y18n.setLocale(t),this)}middleware(t,r,n){return m(this,ar,"f").addMiddleware(t,!!r,n)}nargs(t,r){return F("<string|object|array> [number]",[t,r],arguments.length),this[yo](this.nargs.bind(this),"narg",t,r),this}normalize(t){return F("<array|string>",[t],arguments.length),this[Cn]("normalize",t),this}number(t){return F("<array|string>",[t],arguments.length),this[Cn]("number",t),this[xi](t),this}option(t,r){if(F("<string|object> [object]",[t,r],arguments.length),typeof t=="object")Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof r!="object"&&(r={}),this[xi](t),m(this,Hr,"f")&&(t==="version"||(r==null?void 0:r.alias)==="version")&&this[Ly](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
134
134
  `),void 0,"versionWarning"),m(this,W,"f").key[t]=!0,r.alias&&this.alias(t,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(t,n);let i=r.demand||r.required||r.require;i&&this.demand(t,i),r.demandOption&&this.demandOption(t,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(t,r.conflicts),"default"in r&&this.default(t,r.default),r.implies!==void 0&&this.implies(t,r.implies),r.nargs!==void 0&&this.nargs(t,r.nargs),r.config&&this.config(t,r.configParser),r.normalize&&this.normalize(t),r.choices&&this.choices(t,r.choices),r.coerce&&this.coerce(t,r.coerce),r.group&&this.group(t,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(t),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(t),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(t),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(t),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(t),typeof r.global=="boolean"&&this.global(t,r.global),r.defaultDescription&&(m(this,W,"f").defaultDescription[t]=r.defaultDescription),r.skipValidation&&this.skipValidation(t);let s=r.describe||r.description||r.desc,a=m(this,se,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(a,t)||typeof s=="string")&&this.describe(t,s),r.hidden&&this.hide(t),r.requiresArg&&this.requiresArg(t)}return this}options(t,r){return this.option(t,r)}parse(t,r,n){F("[string|array] [function|boolean|object] [function]",[t,r,n],arguments.length),this[Fy](),typeof t>"u"&&(t=m(this,In,"f")),typeof r=="object"&&(B(this,bi,r,"f"),r=n),typeof r=="function"&&(B(this,Kt,r,"f"),r=!1),r||B(this,In,t,"f"),m(this,Kt,"f")&&B(this,sr,!1,"f");let i=this[Is](t,!!r),s=this.parsed;return m(this,or,"f").setParsed(this.parsed),qe(i)?i.then(a=>(m(this,Kt,"f")&&m(this,Kt,"f").call(this,m(this,An,"f"),a,m(this,lt,"f")),a)).catch(a=>{throw m(this,Kt,"f")&&m(this,Kt,"f")(a,this.parsed.argv,m(this,lt,"f")),a}).finally(()=>{this[Tf](),this.parsed=s}):(m(this,Kt,"f")&&m(this,Kt,"f").call(this,m(this,An,"f"),i,m(this,lt,"f")),this[Tf](),this.parsed=s,i)}parseAsync(t,r,n){let i=this.parse(t,r,n);return qe(i)?i:Promise.resolve(i)}parseSync(t,r,n){let i=this.parse(t,r,n);if(qe(i))throw new ke(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return F("<object>",[t],arguments.length),B(this,Pc,t,"f"),this}pkgConf(t,r){F("<string> [string]",[t,r],arguments.length);let n=null,i=this[$f](r||m(this,gi,"f"));return i[t]&&typeof i[t]=="object"&&(n=ws(i[t],r||m(this,gi,"f"),this[Oi]()["deep-merge-config"]||!1,m(this,ie,"f")),m(this,W,"f").configObjects=(m(this,W,"f").configObjects||[]).concat(n)),this}positional(t,r){F("<string> <object>",[t,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=$n(r,(a,c)=>a==="type"&&!["string","number","boolean"].includes(c)?!1:n.includes(a));let i=m(this,As,"f").fullCommands[m(this,As,"f").fullCommands.length-1],s=i?m(this,tt,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return po(s).forEach(a=>{let c=s[a];Array.isArray(c)?c.indexOf(t)!==-1&&(r[a]=!0):c[t]&&!(a in r)&&(r[a]=c[t])}),this.group(t,m(this,se,"f").getPositionalGroupName()),this.option(t,r)}recommendCommands(t=!0){return F("[boolean]",[t],arguments.length),B(this,xc,t,"f"),this}required(t,r,n){return this.demand(t,r,n)}require(t,r,n){return this.demand(t,r,n)}requiresArg(t){return F("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&m(this,W,"f").narg[t]?this:(this[yo](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,r){return F("[string] [string]",[t,r],arguments.length),t=t||this.$0,m(this,mo,"f").log(m(this,or,"f").generateCompletionScript(t,r||m(this,Zt,"f")||"completion")),this}showHelp(t){if(F("[string|function]",[t],arguments.length),B(this,Wt,!0,"f"),!m(this,se,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Is](m(this,In,"f"),void 0,void 0,0,!0);if(qe(n))return n.then(()=>{m(this,se,"f").showHelp(t)}),this}let r=m(this,tt,"f").runDefaultBuilderOn(this);if(qe(r))return r.then(()=>{m(this,se,"f").showHelp(t)}),this}return m(this,se,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,r){return F("[boolean|string] [string]",[t,r],arguments.length),m(this,se,"f").showHelpOnFail(t,r),this}showVersion(t){return F("[string|function]",[t],arguments.length),m(this,se,"f").showVersion(t),this}skipValidation(t){return F("<array|string>",[t],arguments.length),this[Cn]("skipValidation",t),this}strict(t){return F("[boolean]",[t],arguments.length),B(this,_i,t!==!1,"f"),this}strictCommands(t){return F("[boolean]",[t],arguments.length),B(this,Si,t!==!1,"f"),this}strictOptions(t){return F("[boolean]",[t],arguments.length),B(this,Ei,t!==!1,"f"),this}string(t){return F("<array|string>",[t],arguments.length),this[Cn]("string",t),this[xi](t),this}terminalWidth(){return F([],0),m(this,ie,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return F("<object>",[t],arguments.length),B(this,yi,!1,"f"),m(this,ie,"f").y18n.updateLocale(t),this}usage(t,r,n,i){if(F("<string|null|undefined> [string|boolean] [function|object] [function]",[t,r,n,i],arguments.length),r!==void 0){if(It(t,null,m(this,ie,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,r,n,i);throw new ke(".usage() description must start with $0 if being used as alias for .command()")}else return m(this,se,"f").usage(t),this}usageConfiguration(t){return F("<object>",[t],arguments.length),B(this,$c,t,"f"),this}version(t,r,n){let i="version";if(F("[boolean|string] [string] [string]",[t,r,n],arguments.length),m(this,Hr,"f")&&(this[Pf](m(this,Hr,"f")),m(this,se,"f").version(void 0),B(this,Hr,null,"f")),arguments.length===0)n=this[Vy](),t=i;else if(arguments.length===1){if(t===!1)return this;n=t,t=i}else arguments.length===2&&(n=r,r=void 0);return B(this,Hr,typeof t=="string"?t:i,"f"),r=r||m(this,se,"f").deferY18nLookup("Show version number"),m(this,se,"f").version(n||void 0),this.boolean(m(this,Hr,"f")),this.describe(m(this,Hr,"f"),r),this}wrap(t){return F("<number|null|undefined>",[t],arguments.length),m(this,se,"f").wrap(t),this}[(tt=new WeakMap,gi=new WeakMap,As=new WeakMap,or=new WeakMap,Zt=new WeakMap,vc=new WeakMap,An=new WeakMap,yi=new WeakMap,_c=new WeakMap,sr=new WeakMap,Sc=new WeakMap,ar=new WeakMap,Fr=new WeakMap,Wt=new WeakMap,cr=new WeakMap,Ec=new WeakMap,mo=new WeakMap,lt=new WeakMap,W=new WeakMap,Oc=new WeakMap,Pc=new WeakMap,Kt=new WeakMap,bi=new WeakMap,go=new WeakMap,vi=new WeakMap,In=new WeakMap,xc=new WeakMap,ie=new WeakMap,_i=new WeakMap,Si=new WeakMap,Ei=new WeakMap,se=new WeakMap,$c=new WeakMap,Hr=new WeakMap,Ke=new WeakMap,qy)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[Dy](){return{log:o((...t)=>{this[wc]()||console.log(...t),B(this,Wt,!0,"f"),m(this,lt,"f").length&&B(this,lt,m(this,lt,"f")+`
135
135
  `,"f"),B(this,lt,m(this,lt,"f")+t.join(" "),"f")},"log"),error:o((...t)=>{this[wc]()||console.error(...t),B(this,Wt,!0,"f"),m(this,lt,"f").length&&B(this,lt,m(this,lt,"f")+`
136
- `,"f"),B(this,lt,m(this,lt,"f")+t.join(" "),"f")},"error")}}[Pf](t){po(m(this,W,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=m(this,W,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete m(this,se,"f").getDescriptions()[t]}[Ly](t,r,n){m(this,_c,"f")[n]||(m(this,ie,"f").process.emitWarning(t,r),m(this,_c,"f")[n]=!0)}[Fy](){m(this,Sc,"f").push({options:m(this,W,"f"),configObjects:m(this,W,"f").configObjects.slice(0),exitProcess:m(this,sr,"f"),groups:m(this,Fr,"f"),strict:m(this,_i,"f"),strictCommands:m(this,Si,"f"),strictOptions:m(this,Ei,"f"),completionCommand:m(this,Zt,"f"),output:m(this,lt,"f"),exitError:m(this,An,"f"),hasOutput:m(this,Wt,"f"),parsed:this.parsed,parseFn:m(this,Kt,"f"),parseContext:m(this,bi,"f")}),m(this,se,"f").freeze(),m(this,Ke,"f").freeze(),m(this,tt,"f").freeze(),m(this,ar,"f").freeze()}[Hy](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(m(this,ie,"f").process.argv()[0])?r=m(this,ie,"f").process.argv().slice(1,2):r=m(this,ie,"f").process.argv().slice(0,1),t=r.map(n=>{let i=this[eb](m(this,gi,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),m(this,ie,"f").getEnv("_")&&m(this,ie,"f").getProcessArgvBin()===m(this,ie,"f").getEnv("_")&&(t=m(this,ie,"f").getEnv("_").replace(`${m(this,ie,"f").path.dirname(m(this,ie,"f").process.execPath())}/`,"")),t}[Oi](){return m(this,Pc,"f")}[By](){return m(this,$c,"f")}[xf](){if(!m(this,yi,"f"))return;let t=m(this,ie,"f").getEnv("LC_ALL")||m(this,ie,"f").getEnv("LC_MESSAGES")||m(this,ie,"f").getEnv("LANG")||m(this,ie,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Vy](){return this[$f]().version||"unknown"}[Uy](t){let r=t["--"]?t["--"]:t._;for(let n=0,i;(i=r[n])!==void 0;n++)m(this,ie,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return t}[$f](t){let r=t||"*";if(m(this,go,"f")[r])return m(this,go,"f")[r];let n={};try{let i=t||m(this,ie,"f").mainFilename;!t&&m(this,ie,"f").path.extname(i)&&(i=m(this,ie,"f").path.dirname(i));let s=m(this,ie,"f").findUp(i,(a,c)=>{if(c.includes("package.json"))return"package.json"});It(s,void 0,m(this,ie,"f")),n=JSON.parse(m(this,ie,"f").readFileSync(s,"utf8"))}catch{}return m(this,go,"f")[r]=n||{},m(this,go,"f")[r]}[Cn](t,r){r=[].concat(r),r.forEach(n=>{n=this[If](n),m(this,W,"f")[t].push(n)})}[yo](t,r,n,i){this[Af](t,r,n,i,(s,a,c)=>{m(this,W,"f")[s][a]=c})}[wf](t,r,n,i){this[Af](t,r,n,i,(s,a,c)=>{m(this,W,"f")[s][a]=(m(this,W,"f")[s][a]||[]).concat(c)})}[Af](t,r,n,i,s){if(Array.isArray(n))n.forEach(a=>{t(a,i)});else if((a=>typeof a=="object")(n))for(let a of po(n))t(a,n[a]);else s(r,this[If](n),i)}[If](t){return t==="__proto__"?"___proto___":t}[Cf](t,r){return this[yo](this[Cf].bind(this),"key",t,r),this}[Tf](){var t,r,n,i,s,a,c,u,l,p,f,d;let h=m(this,Sc,"f").pop();It(h,void 0,m(this,ie,"f"));let y;t=this,r=this,n=this,i=this,s=this,a=this,c=this,u=this,l=this,p=this,f=this,d=this,{options:{set value(b){B(t,W,b,"f")}}.value,configObjects:y,exitProcess:{set value(b){B(r,sr,b,"f")}}.value,groups:{set value(b){B(n,Fr,b,"f")}}.value,output:{set value(b){B(i,lt,b,"f")}}.value,exitError:{set value(b){B(s,An,b,"f")}}.value,hasOutput:{set value(b){B(a,Wt,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){B(c,_i,b,"f")}}.value,strictCommands:{set value(b){B(u,Si,b,"f")}}.value,strictOptions:{set value(b){B(l,Ei,b,"f")}}.value,completionCommand:{set value(b){B(p,Zt,b,"f")}}.value,parseFn:{set value(b){B(f,Kt,b,"f")}}.value,parseContext:{set value(b){B(d,bi,b,"f")}}.value}=h,m(this,W,"f").configObjects=y,m(this,se,"f").unfreeze(),m(this,Ke,"f").unfreeze(),m(this,tt,"f").unfreeze(),m(this,ar,"f").unfreeze()}[Gy](t,r){return mi(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[zy].bind(this),getContext:this[Zy].bind(this),getHasOutput:this[Wy].bind(this),getLoggerInstance:this[Ky].bind(this),getParseContext:this[Yy].bind(this),getParserConfiguration:this[Oi].bind(this),getUsageConfiguration:this[By].bind(this),getUsageInstance:this[Qy].bind(this),getValidationInstance:this[Jy].bind(this),hasParseCallback:this[wc].bind(this),isGlobalContext:this[Xy].bind(this),postProcess:this[Pi].bind(this),reset:this[Rf].bind(this),runValidation:this[Nf].bind(this),runYargsParserAndExecuteCommands:this[Is].bind(this),setHasOutput:this[tb].bind(this)}}[zy](){return m(this,tt,"f")}[Zy](){return m(this,As,"f")}[Wy](){return m(this,Wt,"f")}[Ky](){return m(this,mo,"f")}[Yy](){return m(this,bi,"f")||{}}[Qy](){return m(this,se,"f")}[Jy](){return m(this,Ke,"f")}[wc](){return!!m(this,Kt,"f")}[Xy](){return m(this,Ec,"f")}[Pi](t,r,n,i){return n||qe(t)||(r||(t=this[qy](t)),(this[Oi]()["parse-positional-numbers"]||this[Oi]()["parse-positional-numbers"]===void 0)&&(t=this[Uy](t)),i&&(t=hi(t,this,m(this,ar,"f").getMiddleware(),!1))),t}[Rf](t={}){B(this,W,m(this,W,"f")||{},"f");let r={};r.local=m(this,W,"f").local||[],r.configObjects=m(this,W,"f").configObjects||[];let n={};r.local.forEach(a=>{n[a]=!0,(t[a]||[]).forEach(c=>{n[c]=!0})}),Object.assign(m(this,vi,"f"),Object.keys(m(this,Fr,"f")).reduce((a,c)=>{let u=m(this,Fr,"f")[c].filter(l=>!(l in n));return u.length>0&&(a[c]=u),a},{})),B(this,Fr,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(a=>{r[a]=(m(this,W,"f")[a]||[]).filter(c=>!n[c])}),s.forEach(a=>{r[a]=$n(m(this,W,"f")[a],c=>!n[c])}),r.envPrefix=m(this,W,"f").envPrefix,B(this,W,r,"f"),B(this,se,m(this,se,"f")?m(this,se,"f").reset(n):Iy(this,m(this,ie,"f")),"f"),B(this,Ke,m(this,Ke,"f")?m(this,Ke,"f").reset(n):My(this,m(this,se,"f"),m(this,ie,"f")),"f"),B(this,tt,m(this,tt,"f")?m(this,tt,"f").reset():$y(m(this,se,"f"),m(this,Ke,"f"),m(this,ar,"f"),m(this,ie,"f")),"f"),m(this,or,"f")||B(this,or,Ry(this,m(this,se,"f"),m(this,tt,"f"),m(this,ie,"f")),"f"),m(this,ar,"f").reset(),B(this,Zt,null,"f"),B(this,lt,"","f"),B(this,An,null,"f"),B(this,Wt,!1,"f"),this.parsed=!1,this}[eb](t,r){return m(this,ie,"f").path.relative(t,r)}[Is](t,r,n,i=0,s=!1){let a=!!n||s;t=t||m(this,In,"f"),m(this,W,"f").__=m(this,ie,"f").y18n.__,m(this,W,"f").configuration=this[Oi]();let c=!!m(this,W,"f").configuration["populate--"],u=Object.assign({},m(this,W,"f").configuration,{"populate--":!0}),l=m(this,ie,"f").Parser.detailed(t,Object.assign({},m(this,W,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),p=Object.assign(l.argv,m(this,bi,"f")),f,d=l.aliases,h=!1,y=!1;Object.keys(p).forEach(b=>{b===m(this,cr,"f")&&p[b]?h=!0:b===m(this,Hr,"f")&&p[b]&&(y=!0)}),p.$0=this.$0,this.parsed=l,i===0&&m(this,se,"f").clearCachedHelpMessage();try{if(this[xf](),r)return this[Pi](p,c,!!n,!1);m(this,cr,"f")&&[m(this,cr,"f")].concat(d[m(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+p._[p._.length-1])&&(p._.pop(),h=!0),B(this,Ec,!1,"f");let b=m(this,tt,"f").getCommands(),g=m(this,or,"f").completionKey in p,P=h||g||s;if(p._.length){if(b.length){let $;for(let C=i||0,T;p._[C]!==void 0;C++)if(T=String(p._[C]),b.includes(T)&&T!==m(this,Zt,"f")){let A=m(this,tt,"f").runCommand(T,this,l,C+1,s,h||y||s);return this[Pi](A,c,!!n,!1)}else if(!$&&T!==m(this,Zt,"f")){$=T;break}!m(this,tt,"f").hasDefaultCommand()&&m(this,xc,"f")&&$&&!P&&m(this,Ke,"f").recommendCommands($,b)}m(this,Zt,"f")&&p._.includes(m(this,Zt,"f"))&&!g&&(m(this,sr,"f")&&wn(!0),this.showCompletionScript(),this.exit(0))}if(m(this,tt,"f").hasDefaultCommand()&&!P){let $=m(this,tt,"f").runCommand(null,this,l,0,s,h||y||s);return this[Pi]($,c,!!n,!1)}if(g){m(this,sr,"f")&&wn(!0),t=[].concat(t);let $=t.slice(t.indexOf(`--${m(this,or,"f").completionKey}`)+1);return m(this,or,"f").getCompletion($,(C,T)=>{if(C)throw new ke(C.message);(T||[]).forEach(A=>{m(this,mo,"f").log(A)}),this.exit(0)}),this[Pi](p,!c,!!n,!1)}if(m(this,Wt,"f")||(h?(m(this,sr,"f")&&wn(!0),a=!0,this.showHelp("log"),this.exit(0)):y&&(m(this,sr,"f")&&wn(!0),a=!0,m(this,se,"f").showVersion("log"),this.exit(0))),!a&&m(this,W,"f").skipValidation.length>0&&(a=Object.keys(p).some($=>m(this,W,"f").skipValidation.indexOf($)>=0&&p[$]===!0)),!a){if(l.error)throw new ke(l.error.message);if(!g){let $=this[Nf](d,{},l.error);n||(f=hi(p,this,m(this,ar,"f").getMiddleware(),!0)),f=this[Gy]($,f??p),qe(f)&&!n&&(f=f.then(()=>hi(p,this,m(this,ar,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof ke)m(this,se,"f").fail(b.message,b);else throw b}return this[Pi](f??p,c,!!n,!0)}[Nf](t,r,n,i){let s={...this.getDemandedOptions()};return a=>{if(n)throw new ke(n.message);m(this,Ke,"f").nonOptionCount(a),m(this,Ke,"f").requiredArguments(a,s);let c=!1;m(this,Si,"f")&&(c=m(this,Ke,"f").unknownCommands(a)),m(this,_i,"f")&&!c?m(this,Ke,"f").unknownArguments(a,t,r,!!i):m(this,Ei,"f")&&m(this,Ke,"f").unknownArguments(a,t,{},!1,!1),m(this,Ke,"f").limitedChoices(a),m(this,Ke,"f").implications(a),m(this,Ke,"f").conflicting(a)}}[tb](){B(this,Wt,!0,"f")}[xi](t){if(typeof t=="string")m(this,W,"f").key[t]=!0;else for(let r of t)m(this,W,"f").key[r]=!0}};o(Mf,"YargsInstance");var jf=Mf;function wy(e){return!!e&&typeof e.getInternalMethods=="function"}o(wy,"isYargsInstance");var U2=rb(hf),nb=U2;var Cs="AppRestClient",Ac={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},kf="src/data",qf="@/data",ur={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},Tn={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Ic={bindings:[Tn.ErrorHandler,Tn.SharedErrorHandler],from:ur.errorHandling.template},Df="AbilityContext",ib={bindings:[Df],from:ur.abilityContext.template};var Cc={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Tc={fileName:"app-rest-client",extension:"ts"},Lf="QueryModule",Rc={fileName:"queryModules",extension:"ts"},ob={fileName:"queryConfig.context",extension:"tsx"},bo={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},Nc={fileName:"useMutationEffects",extension:"ts"},Br={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},jc={fileName:"zod",extension:"ts"};var sb="Schema",ab="Enum",cb="Body",ub="Param",lb="Response",fb="ErrorResponse",Ts="z.void()",Mc="z.instanceof(Blob)",Rs="z.enum",kc="z.string()",vo={bindings:["z"],from:"zod"};var Pe={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:ur.abilityContext.template,schemaSuffix:sb,enumSuffix:ab,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:ur.appRestClient.template,errorHandlingImportPath:ur.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:ur.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var pb=o((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),db=o((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),hb=o((e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,"wrapAnsi16m"),Ue={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]}},V6=Object.keys(Ue.modifier),G2=Object.keys(Ue.color),z2=Object.keys(Ue.bgColor),U6=[...G2,...z2];function Z2(){let e=new Map;for(let[t,r]of Object.entries(Ue)){for(let[n,i]of Object.entries(r))Ue[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ue[n],e.set(i[0],i[1]);Object.defineProperty(Ue,t,{value:r,enumerable:!1})}return Object.defineProperty(Ue,"codes",{value:e,enumerable:!1}),Ue.color.close="\x1B[39m",Ue.bgColor.close="\x1B[49m",Ue.color.ansi=pb(),Ue.color.ansi256=db(),Ue.color.ansi16m=hb(),Ue.bgColor.ansi=pb(10),Ue.bgColor.ansi256=db(10),Ue.bgColor.ansi16m=hb(10),Object.defineProperties(Ue,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o(t=>Ue.rgbToAnsi256(...Ue.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let c=t%36;r=Math.floor(t/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:o((t,r,n)=>Ue.ansi256ToAnsi(Ue.rgbToAnsi256(t,r,n)),"value"),enumerable:!1},hexToAnsi:{value:o(t=>Ue.ansi256ToAnsi(Ue.hexToAnsi256(t)),"value"),enumerable:!1}}),Ue}o(Z2,"assembleStyles");var W2=Z2(),Pr=W2;var Dc=mt(require("process"),1),gb=mt(require("os"),1),Ff=mt(require("tty"),1);function lr(e,t=globalThis.Deno?globalThis.Deno.args:Dc.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}o(lr,"hasFlag");var{env:Ze}=Dc.default,qc;lr("no-color")||lr("no-colors")||lr("color=false")||lr("color=never")?qc=0:(lr("color")||lr("colors")||lr("color=true")||lr("color=always"))&&(qc=1);function K2(){if("FORCE_COLOR"in Ze)return Ze.FORCE_COLOR==="true"?1:Ze.FORCE_COLOR==="false"?0:Ze.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ze.FORCE_COLOR,10),3)}o(K2,"envForceColor");function Y2(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(Y2,"translateLevel");function Q2(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=K2();n!==void 0&&(qc=n);let i=r?qc:n;if(i===0)return 0;if(r){if(lr("color=16m")||lr("color=full")||lr("color=truecolor"))return 3;if(lr("color=256"))return 2}if("TF_BUILD"in Ze&&"AGENT_NAME"in Ze)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(Ze.TERM==="dumb")return s;if(Dc.default.platform==="win32"){let a=gb.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ze)return"GITHUB_ACTIONS"in Ze||"GITEA_ACTIONS"in Ze?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Ze)||Ze.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM==="truecolor"||Ze.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Ze){let a=Number.parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||"COLORTERM"in Ze?1:s}o(Q2,"_supportsColor");function mb(e,t={}){let r=Q2(e,{streamIsTTY:e&&e.isTTY,...t});return Y2(r)}o(mb,"createSupportsColor");var J2={stdout:mb({isTTY:Ff.default.isatty(1)}),stderr:mb({isTTY:Ff.default.isatty(2)})},yb=J2;function bb(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let i=t.length,s=0,a="";do a+=e.slice(s,n)+t+r,s=n+i,n=e.indexOf(t,s);while(n!==-1);return a+=e.slice(s),a}o(bb,"stringReplaceAll");function vb(e,t,r,n){let i=0,s="";do{let a=e[n-1]==="\r";s+=e.slice(i,a?n-1:n)+t+(a?`\r
136
+ `,"f"),B(this,lt,m(this,lt,"f")+t.join(" "),"f")},"error")}}[Pf](t){po(m(this,W,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=m(this,W,"f")[r];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):typeof n=="object"&&delete n[t]}),delete m(this,se,"f").getDescriptions()[t]}[Ly](t,r,n){m(this,_c,"f")[n]||(m(this,ie,"f").process.emitWarning(t,r),m(this,_c,"f")[n]=!0)}[Fy](){m(this,Sc,"f").push({options:m(this,W,"f"),configObjects:m(this,W,"f").configObjects.slice(0),exitProcess:m(this,sr,"f"),groups:m(this,Fr,"f"),strict:m(this,_i,"f"),strictCommands:m(this,Si,"f"),strictOptions:m(this,Ei,"f"),completionCommand:m(this,Zt,"f"),output:m(this,lt,"f"),exitError:m(this,An,"f"),hasOutput:m(this,Wt,"f"),parsed:this.parsed,parseFn:m(this,Kt,"f"),parseContext:m(this,bi,"f")}),m(this,se,"f").freeze(),m(this,Ke,"f").freeze(),m(this,tt,"f").freeze(),m(this,ar,"f").freeze()}[Hy](){let t="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(m(this,ie,"f").process.argv()[0])?r=m(this,ie,"f").process.argv().slice(1,2):r=m(this,ie,"f").process.argv().slice(0,1),t=r.map(n=>{let i=this[eb](m(this,gi,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),m(this,ie,"f").getEnv("_")&&m(this,ie,"f").getProcessArgvBin()===m(this,ie,"f").getEnv("_")&&(t=m(this,ie,"f").getEnv("_").replace(`${m(this,ie,"f").path.dirname(m(this,ie,"f").process.execPath())}/`,"")),t}[Oi](){return m(this,Pc,"f")}[By](){return m(this,$c,"f")}[xf](){if(!m(this,yi,"f"))return;let t=m(this,ie,"f").getEnv("LC_ALL")||m(this,ie,"f").getEnv("LC_MESSAGES")||m(this,ie,"f").getEnv("LANG")||m(this,ie,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Vy](){return this[$f]().version||"unknown"}[Uy](t){let r=t["--"]?t["--"]:t._;for(let n=0,i;(i=r[n])!==void 0;n++)m(this,ie,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return t}[$f](t){let r=t||"*";if(m(this,go,"f")[r])return m(this,go,"f")[r];let n={};try{let i=t||m(this,ie,"f").mainFilename;!t&&m(this,ie,"f").path.extname(i)&&(i=m(this,ie,"f").path.dirname(i));let s=m(this,ie,"f").findUp(i,(a,c)=>{if(c.includes("package.json"))return"package.json"});It(s,void 0,m(this,ie,"f")),n=JSON.parse(m(this,ie,"f").readFileSync(s,"utf8"))}catch{}return m(this,go,"f")[r]=n||{},m(this,go,"f")[r]}[Cn](t,r){r=[].concat(r),r.forEach(n=>{n=this[If](n),m(this,W,"f")[t].push(n)})}[yo](t,r,n,i){this[Af](t,r,n,i,(s,a,c)=>{m(this,W,"f")[s][a]=c})}[wf](t,r,n,i){this[Af](t,r,n,i,(s,a,c)=>{m(this,W,"f")[s][a]=(m(this,W,"f")[s][a]||[]).concat(c)})}[Af](t,r,n,i,s){if(Array.isArray(n))n.forEach(a=>{t(a,i)});else if((a=>typeof a=="object")(n))for(let a of po(n))t(a,n[a]);else s(r,this[If](n),i)}[If](t){return t==="__proto__"?"___proto___":t}[Cf](t,r){return this[yo](this[Cf].bind(this),"key",t,r),this}[Tf](){var t,r,n,i,s,a,c,u,l,p,f,d;let h=m(this,Sc,"f").pop();It(h,void 0,m(this,ie,"f"));let y;t=this,r=this,n=this,i=this,s=this,a=this,c=this,u=this,l=this,p=this,f=this,d=this,{options:{set value(b){B(t,W,b,"f")}}.value,configObjects:y,exitProcess:{set value(b){B(r,sr,b,"f")}}.value,groups:{set value(b){B(n,Fr,b,"f")}}.value,output:{set value(b){B(i,lt,b,"f")}}.value,exitError:{set value(b){B(s,An,b,"f")}}.value,hasOutput:{set value(b){B(a,Wt,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){B(c,_i,b,"f")}}.value,strictCommands:{set value(b){B(u,Si,b,"f")}}.value,strictOptions:{set value(b){B(l,Ei,b,"f")}}.value,completionCommand:{set value(b){B(p,Zt,b,"f")}}.value,parseFn:{set value(b){B(f,Kt,b,"f")}}.value,parseContext:{set value(b){B(d,bi,b,"f")}}.value}=h,m(this,W,"f").configObjects=y,m(this,se,"f").unfreeze(),m(this,Ke,"f").unfreeze(),m(this,tt,"f").unfreeze(),m(this,ar,"f").unfreeze()}[Gy](t,r){return mi(r,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[zy].bind(this),getContext:this[Zy].bind(this),getHasOutput:this[Wy].bind(this),getLoggerInstance:this[Ky].bind(this),getParseContext:this[Yy].bind(this),getParserConfiguration:this[Oi].bind(this),getUsageConfiguration:this[By].bind(this),getUsageInstance:this[Qy].bind(this),getValidationInstance:this[Jy].bind(this),hasParseCallback:this[wc].bind(this),isGlobalContext:this[Xy].bind(this),postProcess:this[Pi].bind(this),reset:this[Rf].bind(this),runValidation:this[Nf].bind(this),runYargsParserAndExecuteCommands:this[Is].bind(this),setHasOutput:this[tb].bind(this)}}[zy](){return m(this,tt,"f")}[Zy](){return m(this,As,"f")}[Wy](){return m(this,Wt,"f")}[Ky](){return m(this,mo,"f")}[Yy](){return m(this,bi,"f")||{}}[Qy](){return m(this,se,"f")}[Jy](){return m(this,Ke,"f")}[wc](){return!!m(this,Kt,"f")}[Xy](){return m(this,Ec,"f")}[Pi](t,r,n,i){return n||qe(t)||(r||(t=this[qy](t)),(this[Oi]()["parse-positional-numbers"]||this[Oi]()["parse-positional-numbers"]===void 0)&&(t=this[Uy](t)),i&&(t=hi(t,this,m(this,ar,"f").getMiddleware(),!1))),t}[Rf](t={}){B(this,W,m(this,W,"f")||{},"f");let r={};r.local=m(this,W,"f").local||[],r.configObjects=m(this,W,"f").configObjects||[];let n={};r.local.forEach(a=>{n[a]=!0,(t[a]||[]).forEach(c=>{n[c]=!0})}),Object.assign(m(this,vi,"f"),Object.keys(m(this,Fr,"f")).reduce((a,c)=>{let u=m(this,Fr,"f")[c].filter(l=>!(l in n));return u.length>0&&(a[c]=u),a},{})),B(this,Fr,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(a=>{r[a]=(m(this,W,"f")[a]||[]).filter(c=>!n[c])}),s.forEach(a=>{r[a]=$n(m(this,W,"f")[a],c=>!n[c])}),r.envPrefix=m(this,W,"f").envPrefix,B(this,W,r,"f"),B(this,se,m(this,se,"f")?m(this,se,"f").reset(n):Iy(this,m(this,ie,"f")),"f"),B(this,Ke,m(this,Ke,"f")?m(this,Ke,"f").reset(n):My(this,m(this,se,"f"),m(this,ie,"f")),"f"),B(this,tt,m(this,tt,"f")?m(this,tt,"f").reset():$y(m(this,se,"f"),m(this,Ke,"f"),m(this,ar,"f"),m(this,ie,"f")),"f"),m(this,or,"f")||B(this,or,Ry(this,m(this,se,"f"),m(this,tt,"f"),m(this,ie,"f")),"f"),m(this,ar,"f").reset(),B(this,Zt,null,"f"),B(this,lt,"","f"),B(this,An,null,"f"),B(this,Wt,!1,"f"),this.parsed=!1,this}[eb](t,r){return m(this,ie,"f").path.relative(t,r)}[Is](t,r,n,i=0,s=!1){let a=!!n||s;t=t||m(this,In,"f"),m(this,W,"f").__=m(this,ie,"f").y18n.__,m(this,W,"f").configuration=this[Oi]();let c=!!m(this,W,"f").configuration["populate--"],u=Object.assign({},m(this,W,"f").configuration,{"populate--":!0}),l=m(this,ie,"f").Parser.detailed(t,Object.assign({},m(this,W,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),p=Object.assign(l.argv,m(this,bi,"f")),f,d=l.aliases,h=!1,y=!1;Object.keys(p).forEach(b=>{b===m(this,cr,"f")&&p[b]?h=!0:b===m(this,Hr,"f")&&p[b]&&(y=!0)}),p.$0=this.$0,this.parsed=l,i===0&&m(this,se,"f").clearCachedHelpMessage();try{if(this[xf](),r)return this[Pi](p,c,!!n,!1);m(this,cr,"f")&&[m(this,cr,"f")].concat(d[m(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+p._[p._.length-1])&&(p._.pop(),h=!0),B(this,Ec,!1,"f");let b=m(this,tt,"f").getCommands(),g=m(this,or,"f").completionKey in p,P=h||g||s;if(p._.length){if(b.length){let $;for(let C=i||0,T;p._[C]!==void 0;C++)if(T=String(p._[C]),b.includes(T)&&T!==m(this,Zt,"f")){let A=m(this,tt,"f").runCommand(T,this,l,C+1,s,h||y||s);return this[Pi](A,c,!!n,!1)}else if(!$&&T!==m(this,Zt,"f")){$=T;break}!m(this,tt,"f").hasDefaultCommand()&&m(this,xc,"f")&&$&&!P&&m(this,Ke,"f").recommendCommands($,b)}m(this,Zt,"f")&&p._.includes(m(this,Zt,"f"))&&!g&&(m(this,sr,"f")&&wn(!0),this.showCompletionScript(),this.exit(0))}if(m(this,tt,"f").hasDefaultCommand()&&!P){let $=m(this,tt,"f").runCommand(null,this,l,0,s,h||y||s);return this[Pi]($,c,!!n,!1)}if(g){m(this,sr,"f")&&wn(!0),t=[].concat(t);let $=t.slice(t.indexOf(`--${m(this,or,"f").completionKey}`)+1);return m(this,or,"f").getCompletion($,(C,T)=>{if(C)throw new ke(C.message);(T||[]).forEach(A=>{m(this,mo,"f").log(A)}),this.exit(0)}),this[Pi](p,!c,!!n,!1)}if(m(this,Wt,"f")||(h?(m(this,sr,"f")&&wn(!0),a=!0,this.showHelp("log"),this.exit(0)):y&&(m(this,sr,"f")&&wn(!0),a=!0,m(this,se,"f").showVersion("log"),this.exit(0))),!a&&m(this,W,"f").skipValidation.length>0&&(a=Object.keys(p).some($=>m(this,W,"f").skipValidation.indexOf($)>=0&&p[$]===!0)),!a){if(l.error)throw new ke(l.error.message);if(!g){let $=this[Nf](d,{},l.error);n||(f=hi(p,this,m(this,ar,"f").getMiddleware(),!0)),f=this[Gy]($,f??p),qe(f)&&!n&&(f=f.then(()=>hi(p,this,m(this,ar,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof ke)m(this,se,"f").fail(b.message,b);else throw b}return this[Pi](f??p,c,!!n,!0)}[Nf](t,r,n,i){let s={...this.getDemandedOptions()};return a=>{if(n)throw new ke(n.message);m(this,Ke,"f").nonOptionCount(a),m(this,Ke,"f").requiredArguments(a,s);let c=!1;m(this,Si,"f")&&(c=m(this,Ke,"f").unknownCommands(a)),m(this,_i,"f")&&!c?m(this,Ke,"f").unknownArguments(a,t,r,!!i):m(this,Ei,"f")&&m(this,Ke,"f").unknownArguments(a,t,{},!1,!1),m(this,Ke,"f").limitedChoices(a),m(this,Ke,"f").implications(a),m(this,Ke,"f").conflicting(a)}}[tb](){B(this,Wt,!0,"f")}[xi](t){if(typeof t=="string")m(this,W,"f").key[t]=!0;else for(let r of t)m(this,W,"f").key[r]=!0}};o(Mf,"YargsInstance");var jf=Mf;function wy(e){return!!e&&typeof e.getInternalMethods=="function"}o(wy,"isYargsInstance");var U2=rb(hf),nb=U2;var Cs="AppRestClient",Ac={query:"AppQueryOptions",infiniteQuery:"AppInfiniteQueryOptions",mutation:"AppMutationOptions"},kf="src/data",qf="@/data",ur={appRestClient:{template:"@/util/rest/clients/app-rest-client",monorepoTemplate:"@/clients/app-rest-client"},queryTypes:{template:"@/types/react-query",monorepoTemplate:"@povio/utils/types/react-query"},errorHandling:{template:"@/util/vendor/error-handling",monorepoTemplate:"@povio/utils/vendor/error-handling"},abilityContext:{template:"@/data/acl/ability.context",monorepoTemplate:"@povio/auth/acl/ability.context"}},Tn={ErrorHandler:"ErrorHandler",SharedErrorHandler:"SharedErrorHandler"},Ic={bindings:[Tn.ErrorHandler,Tn.SharedErrorHandler],from:ur.errorHandling.template},Df="AbilityContext",ib={bindings:[Df],from:ur.abilityContext.template};var Cc={reactQueryTypes:{fileName:"react-query.types",extension:"ts"},restClient:{fileName:"rest-client",extension:"ts"},restInterceptor:{fileName:"rest-interceptor",extension:"ts"}},Tc={fileName:"app-rest-client",extension:"ts"},Lf="QueryModule",Rc={fileName:"queryModules",extension:"ts"},ob={fileName:"queryConfig.context",extension:"tsx"},bo={optionsType:"MutationEffectsOptions",hookName:"useMutationEffects",runFunctionName:"runMutationEffects"},Nc={fileName:"useMutationEffects",extension:"ts"},Br={name:"zod",properties:{sortingString:"sortingString",parse:"parse"}},jc={fileName:"zod",extension:"ts"};var sb="Schema",ab="Enum",cb="Body",ub="Param",lb="Response",fb="ErrorResponse",Ts="z.void()",Mc="z.instanceof(Blob)",Rs="z.enum",kc="z.string()",vo={bindings:["z"],from:"zod"};var Pe={input:"",output:"output",splitByTags:!0,defaultTag:"Common",excludeTags:[],excludePathRegex:"",excludeRedundantZodSchemas:!0,tsNamespaces:!0,importPath:"ts",configs:{models:{outputFileNameSuffix:"models",namespaceSuffix:"Models"},endpoints:{outputFileNameSuffix:"api",namespaceSuffix:"Api"},queries:{outputFileNameSuffix:"queries",namespaceSuffix:"Queries"},acl:{outputFileNameSuffix:"acl",namespaceSuffix:"Acl"}},acl:!0,checkAcl:!0,standalone:!1,baseUrl:"",abilityContextImportPath:ur.abilityContext.template,schemaSuffix:sb,enumSuffix:ab,withDefaultValues:!0,extractEnums:!0,branded:!0,replaceOptionalWithNullish:!1,restClientImportPath:ur.appRestClient.template,errorHandlingImportPath:ur.errorHandling.template,removeOperationPrefixEndingWith:"Controller_",parseRequestParams:!0,queryTypesImportPath:ur.queryTypes.template,axiosRequestConfig:!1,infiniteQueries:!1,mutationEffects:!0};var pb=o((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),db=o((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),hb=o((e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,"wrapAnsi16m"),Ue={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]}},V6=Object.keys(Ue.modifier),G2=Object.keys(Ue.color),z2=Object.keys(Ue.bgColor),U6=[...G2,...z2];function Z2(){let e=new Map;for(let[t,r]of Object.entries(Ue)){for(let[n,i]of Object.entries(r))Ue[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ue[n],e.set(i[0],i[1]);Object.defineProperty(Ue,t,{value:r,enumerable:!1})}return Object.defineProperty(Ue,"codes",{value:e,enumerable:!1}),Ue.color.close="\x1B[39m",Ue.bgColor.close="\x1B[49m",Ue.color.ansi=pb(),Ue.color.ansi256=db(),Ue.color.ansi16m=hb(),Ue.bgColor.ansi=pb(10),Ue.bgColor.ansi256=db(10),Ue.bgColor.ansi16m=hb(10),Object.defineProperties(Ue,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o(t=>Ue.rgbToAnsi256(...Ue.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let c=t%36;r=Math.floor(t/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:o((t,r,n)=>Ue.ansi256ToAnsi(Ue.rgbToAnsi256(t,r,n)),"value"),enumerable:!1},hexToAnsi:{value:o(t=>Ue.ansi256ToAnsi(Ue.hexToAnsi256(t)),"value"),enumerable:!1}}),Ue}o(Z2,"assembleStyles");var W2=Z2(),Pr=W2;var Dc=gt(require("process"),1),gb=gt(require("os"),1),Ff=gt(require("tty"),1);function lr(e,t=globalThis.Deno?globalThis.Deno.args:Dc.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}o(lr,"hasFlag");var{env:Ze}=Dc.default,qc;lr("no-color")||lr("no-colors")||lr("color=false")||lr("color=never")?qc=0:(lr("color")||lr("colors")||lr("color=true")||lr("color=always"))&&(qc=1);function K2(){if("FORCE_COLOR"in Ze)return Ze.FORCE_COLOR==="true"?1:Ze.FORCE_COLOR==="false"?0:Ze.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ze.FORCE_COLOR,10),3)}o(K2,"envForceColor");function Y2(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}o(Y2,"translateLevel");function Q2(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=K2();n!==void 0&&(qc=n);let i=r?qc:n;if(i===0)return 0;if(r){if(lr("color=16m")||lr("color=full")||lr("color=truecolor"))return 3;if(lr("color=256"))return 2}if("TF_BUILD"in Ze&&"AGENT_NAME"in Ze)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(Ze.TERM==="dumb")return s;if(Dc.default.platform==="win32"){let a=gb.default.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ze)return"GITHUB_ACTIONS"in Ze||"GITEA_ACTIONS"in Ze?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Ze)||Ze.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ze)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ze.TEAMCITY_VERSION)?1:0;if(Ze.COLORTERM==="truecolor"||Ze.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Ze){let a=Number.parseInt((Ze.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ze.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ze.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ze.TERM)||"COLORTERM"in Ze?1:s}o(Q2,"_supportsColor");function mb(e,t={}){let r=Q2(e,{streamIsTTY:e&&e.isTTY,...t});return Y2(r)}o(mb,"createSupportsColor");var J2={stdout:mb({isTTY:Ff.default.isatty(1)}),stderr:mb({isTTY:Ff.default.isatty(2)})},yb=J2;function bb(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let i=t.length,s=0,a="";do a+=e.slice(s,n)+t+r,s=n+i,n=e.indexOf(t,s);while(n!==-1);return a+=e.slice(s),a}o(bb,"stringReplaceAll");function vb(e,t,r,n){let i=0,s="";do{let a=e[n-1]==="\r";s+=e.slice(i,a?n-1:n)+t+(a?`\r
137
137
  `:`
138
138
  `)+r,i=n+1,n=e.indexOf(`
139
139
  `,i)}while(n!==-1);return s+=e.slice(i),s}o(vb,"stringEncaseCRLFWithFirstIndex");var{stdout:_b,stderr:Sb}=yb,Hf=Symbol("GENERATOR"),_o=Symbol("STYLER"),Ns=Symbol("IS_EMPTY"),Eb=["ansi","ansi","ansi256","ansi16m"],So=Object.create(null),X2=o((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=_b?_b.level:0;e.level=t.level===void 0?r:t.level},"applyOptions"),Uf=class Uf{constructor(t){return Ob(t)}};o(Uf,"Chalk");var Lc=Uf,Ob=o(e=>{let t=o((...r)=>r.join(" "),"chalk");return X2(t,e),Object.setPrototypeOf(t,js.prototype),t},"chalkFactory");function js(e){return Ob(e)}o(js,"createChalk");Object.setPrototypeOf(js.prototype,Function.prototype);for(let[e,t]of Object.entries(Pr))So[e]={get(){let r=Fc(this,Vf(t.open,t.close,this[_o]),this[Ns]);return Object.defineProperty(this,e,{value:r}),r}};So.visible={get(){let e=Fc(this,this[_o],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Bf=o((e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Pr[r].ansi16m(...n):t==="ansi256"?Pr[r].ansi256(Pr.rgbToAnsi256(...n)):Pr[r].ansi(Pr.rgbToAnsi(...n)):e==="hex"?Bf("rgb",t,r,...Pr.hexToRgb(...n)):Pr[r][e](...n),"getModelAnsi"),ew=["rgb","hex","ansi256"];for(let e of ew){So[e]={get(){let{level:r}=this;return function(...n){let i=Vf(Bf(e,Eb[r],"color",...n),Pr.color.close,this[_o]);return Fc(this,i,this[Ns])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);So[t]={get(){let{level:r}=this;return function(...n){let i=Vf(Bf(e,Eb[r],"bgColor",...n),Pr.bgColor.close,this[_o]);return Fc(this,i,this[Ns])}}}}var tw=Object.defineProperties(()=>{},{...So,level:{enumerable:!0,get(){return this[Hf].level},set(e){this[Hf].level=e}}}),Vf=o((e,t,r)=>{let n,i;return r===void 0?(n=e,i=t):(n=r.openAll+e,i=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:i,parent:r}},"createStyler"),Fc=o((e,t,r)=>{let n=o((...i)=>rw(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,tw),n[Hf]=e,n[_o]=t,n[Ns]=r,n},"createBuilder"),rw=o((e,t)=>{if(e.level<=0||!t)return e[Ns]?"":t;let r=e[_o];if(r===void 0)return t;let{openAll:n,closeAll:i}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=bb(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
140
- `);return s!==-1&&(t=vb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(js.prototype,So);var eH=js(),tH=js({level:Sb?Sb.level:0});var Vr=new Lc;function Ms(e,t,r){console.log(r!==void 0&&r!==t?`${Vr.yellow(`${e}:`.padEnd(20))}${Vr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Ms,"logVariable");function fr(e){console.log(`[INFO] ${e}`)}o(fr,"logInfo");function Rn(e){console.log(Vr.green(`[SUCCESS] ${e}`))}o(Rn,"logSuccess");function ks(e,t){e instanceof Error?(console.log(Vr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Vr.red(`[ERROR] ${e}`))}o(ks,"logError");function Hc(e){console.log(Vr.bgYellow(`==== ${e} ====`))}o(Hc,"logBanner");var Pb=mt(require("fs"));function Eo(){return"0.13.8"}o(Eo,"getVersion");var hH=mt($b());var Gf=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Gf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(Gf,s,t)}}}o(Ee,"YargOption");function wb(e){let t=Reflect.getMetadata(Gf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(wb,"getYargsOption");function Bc(e){return async t=>t.options(nw(e)).middleware(async r=>await iw(e,r),!0)}o(Bc,"getBuilder");function nw(e){return Object.entries(wb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(nw,"getYargsOptions");async function iw(e,t){let r=new e;for(let[n,i]of Object.entries(wb(e)))r[n]=t[n]??i.default;return r}o(iw,"loadYargsConfig");var Mx=mt(Mm());var rP={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},nP={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var kr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},iP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},wa={pageParamName:"page"},Wu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Aa="moduleName";var km={"Content-Type":"application/json",Accept:"application/json"},Ku="data",qm="axios",Kn="config",en="AxiosRequestConfig",Yu={defaultImport:qm,bindings:[en],from:"axios"};var oP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Yn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function we(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(we,"isReferenceObject");function Nt(e){return!we(e)}o(Nt,"isSchemaObject");function Qu(e){return e.type==="array"}o(Qu,"isArraySchemaObject");function sP(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(Xq(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(we(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(sP,"inferRequiredSchema");var Xq=o(e=>!we(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var vn=Symbol.for("@ts-pattern/matcher"),eD=Symbol.for("@ts-pattern/isVariadic"),Xu="@ts-pattern/anonymous-select-key",Dm=o(e=>!!(e&&typeof e=="object"),"r"),Ju=o(e=>e&&!!e[vn],"i"),nn=o((e,t,r)=>{if(Ju(e)){let n=e[vn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Dm(e)){if(!Dm(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];Ju(c)&&c[eD]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,p)=>nn(l,a[p],r))&&i.every((l,p)=>nn(l,c[p],r))&&(s.length===0||nn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>nn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ju(s=i)&&s[vn]().matcherType==="optional")&&nn(i,t[n],r);var s})}return Object.is(t,e)},"s"),ti=o(e=>{var t,r,n;return Dm(e)?Ju(e)?(t=(r=(n=e[vn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ca(e,ti):Ca(Object.values(e),ti):[]},"o"),Ca=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function yr(e){return Object.assign(e,{optional:o(()=>tD(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>rD(e,t),"or"),select:o(t=>t===void 0?aP(e):aP(t,e),"select")})}o(yr,"u");function tD(e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(ti(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:nn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>ti(e),"getSelectionKeys"),matcherType:"optional"})})}o(tD,"h");function Ge(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function rD(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ca(e,ti).forEach(i=>n(i,void 0)),{matched:e.some(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"or"})})}o(rD,"d");function xe(e){return{[vn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(xe,"p");function aP(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return yr({[vn]:()=>({match:o(n=>{let i={[t??Xu]:n};return{matched:r===void 0||nn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Xu].concat(r===void 0?[]:ti(r)),"getSelectionKeys")})})}o(aP,"y");function tn(e){return typeof e=="number"}o(tn,"v");function Qn(e){return typeof e=="string"}o(Qn,"b");function Jn(e){return typeof e=="bigint"}o(Jn,"w");var RU=yr(xe(function(e){return!0}));var Xn=o(e=>Object.assign(yr(e),{startsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&!!n.match(r)))));var r},"regex")}),"j"),NU=Xn(xe(Qn)),rn=o(e=>Object.assign(yr(e),{between:o((t,r)=>rn(Ge(e,((n,i)=>xe(s=>tn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<r))(t))),"lt"),gt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>r))(t))),"gt"),lte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<=r))(t))),"lte"),gte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>=r))(t))),"gte"),int:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isInteger(t)))),"int"),finite:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>rn(Ge(e,xe(t=>tn(t)&&t>0))),"positive"),negative:o(()=>rn(Ge(e,xe(t=>tn(t)&&t<0))),"negative")}),"x"),jU=rn(xe(tn)),ei=o(e=>Object.assign(yr(e),{between:o((t,r)=>ei(Ge(e,((n,i)=>xe(s=>Jn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<r))(t))),"lt"),gt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>r))(t))),"gt"),lte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<=r))(t))),"lte"),gte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>=r))(t))),"gte"),positive:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t>0))),"positive"),negative:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t<0))),"negative")}),"A"),MU=ei(xe(Jn)),kU=yr(xe(function(e){return typeof e=="boolean"})),qU=yr(xe(function(e){return typeof e=="symbol"})),DU=yr(xe(function(e){return e==null})),LU=yr(xe(function(e){return e!=null}));var Bm=class Bm extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(Bm,"W");var Lm=Bm,Fm={matched:!1,value:void 0};function $t(e){return new Hm(e,Fm)}o($t,"z");var Ia=class Ia{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>nn(l,this.input,c))||i&&!i(this.input)?Fm:{matched:!0,value:r(s?Xu in a?a[Xu]:a:this.input,this.input)};return new Ia(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ia(this.input,n?{matched:!0,value:r(this.input,this.input)}:Fm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Lm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ia,"I");var Hm=Ia;var Vm=2,cP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],uP=["query","header","path"],Zi=["get","put","post","delete","options","head","patch","trace"],lP=["string","number","integer","boolean"],Ta=["allOf","anyOf","oneOf"];var Fe=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ri=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),fP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),pP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Um=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),dP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),nD=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),Gm=o(e=>{let t=e.map(Fe).map(hP).map(r=>iD(r)).flat();return nD(t)},"getMostCommonAdjacentCombinationSplit"),hP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),mP=o(e=>hP(e).join(" "),"camelToSpaceSeparated"),iD=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),gP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ri(r)}|${Fe(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Wi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),as=o(e=>Wi(e).split("/").at(-1),"getSchemaNameByRef");function Zm(e){let t=oD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Zm,"normalizeString");function vP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(vP,"wrapWithQuotesIfNeeded");function _P(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(_P,"unwrapQuotesIfNeeded");function oD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(oD,"prefixStringStartingWithNumberIfNeeded");function Wm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Wm,"pathParamToVariableName");var Ki=o(e=>lP.includes(e),"isPrimitiveType");function SP(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o(SP,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||cP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ra(e){return e>=200&&e<300}o(Ra,"isMainResponseStatus");function el(e){return!(e>=200&&e<300)}o(el,"isErrorStatus");function tl(e){return e.startsWith("application/")}o(tl,"isMediaTypeAllowed");var yP=/({\w+})/g,sD=/[^\w\-]+/g;function EP(e){e=Fe(fP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(yP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(yP,"")}By${Fe(r.slice(1,-1))}`}return e.replace(sD,"_")}o(EP,"pathToVariableName");var zm=/{(\b\w+(?:-\w+)*\b)}/g;function OP(e){let t=e.match(zm);return t===null?e.replaceAll(zm,":$1"):(t.forEach(r=>{let n=Wm(r.replaceAll(zm,":$1"));e=e.replaceAll(r,n)}),e)}o(OP,"replaceHyphenatedPath");var PP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Nt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Yi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Jt=o(e=>e.method==="get","isQuery"),ii=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),cs=o((e,t)=>Jt(e)&&(t??Object.values(wa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),xP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ni(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ni(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function oi(e){return pP(e)}o(oi,"formatTag");function si(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return oi(r??t.defaultTag)}o(si,"getOperationTag");function $P(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o($P,"isTagExcluded");var rl={fileName:"acl/app.ability",extension:"ts"},Na="AllAbilities",ja="AppAbilities",nl={fileName:"acl/useAclCheck",extension:"ts"},ai="useAclCheck",bt={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subject:"Subject"},Ma={bindings:[bt.abilityTuple,bt.pureAbility,bt.forcedSubject,bt.subject],from:"@casl/ability"};var Xt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var wP=o(e=>`Use${Fe(pt(e.operationName))}Ability`,"getAbilityTypeName"),ka=o(e=>`canUse${Fe(pt(e.operationName))}`,"getAbilityFunctionName"),AP=o((e,t)=>`${t.tsNamespaces?`${He({type:"acl",tag:ci(e,t),options:t})}.`:""}${ka(e)}`,"getImportedAbilityFunctionName"),IP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),CP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),il=o(e=>{var t;return!!((t=qa(e))!=null&&t.length)},"hasAbilityConditions"),qa=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),TP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ol=o(e=>`${Fe(e)}${Na}`,"getTagAllAbilitiesName");function jt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(we(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ta.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&jt(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&jt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;jt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;jt(s,t)}}o(jt,"iterateSchema");var sn=o((e,t)=>Um(Fe(Zm(e)),t),"getZodSchemaName"),Da=o((e,t,r)=>Um(Fe(Zm(e)),`${t}${r}`),"getEnumZodSchemaName"),wt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),RP=o(e=>e.startsWith(Rs),"isEnumZodSchema"),Qi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),sl=o(e=>pt(`${e}_${cb}`),"getBodyZodSchemaName"),NP=o((e,t)=>pt(`${e}_${t}${ub}`),"getParamZodSchemaName"),aD=o(e=>pt(`${e}${lb}`),"getMainResponseZodSchemaName"),cD=o((e,t)=>pt(`${e}_${t}_${fb}`),"getErrorResponseZodSchemaName");function al({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Qi(t,r,n);return!Ra(i)&&e!=="default"&&el(i)?cD(s,e):aD(s)}o(al,"getResponseZodSchemaName");function La(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Fe(mP(i))}: \`${e[i]}\``],[])}o(La,"getSchemaDescriptions");var Fa=o((e,t)=>dP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),jP=o((e,t)=>wt(t)?`${e.options.tsNamespaces?`${He({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Ji=o((e,t,r)=>{if(!wt(t))return t===Ts?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${He({type:"models",tag:n,options:e.options})}.`:""}${Fa(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function MP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(MP,"getZodSchemaType");function kP(e){if(e.schemaObj)return[e.schemaObj.description,...La(e.schemaObj).join(". ")].filter(Boolean)}o(kP,"getZodSchemaDescription");function qP(e,t,r){var n;if(we(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Ji(e,i,r):void 0}if(Qu(t)){if(!we(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Ji(e,i,r)}[]`:void 0}if(Ta.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return qP(e,i[0],r)}return t.type}o(qP,"getType");function DP(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let p=e.resolveObject(c.schema),f=[p.description,...La(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:qP(e,c.schema,r)??"unknown",description:f.join(". ")})}return jt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(we(c)){let u=e.resolveObject(c);jt(u,{data:{pathSegments:[]},onSchema:a})}}),jt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(DP,"getZodSchemaPropertyDescriptions");function ui({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=cl({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=cl({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Fa(u,e.options),"getEntityName"),options:e.options});return uD(e.options,a,c)}o(ui,"getModelsImports");function LP({tag:e,endpoints:t,options:r}){return cl({type:"endpoints",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:Ha,options:r})}o(LP,"getEndpointsImports");function FP({tag:e,endpoints:t,options:r}){return cl({type:"acl",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:ka,options:r})}o(FP,"getAclImports");function HP({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?He({type:n,tag:a,options:i}):c],from:`${an(i)}${ul({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(HP,"getEntityImports");function an(e){let t=qf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${kf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${kf}`,"g"),qf)),`${t}/`.replace(/\/\//g,"/")}o(an,"getImportPath");function cl({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?He({type:e,tag:u,options:s}):i(c)],from:`${l?"./":an(s)}${ul({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(cl,"getImports");function uD(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Xt(n.bindings)}))}o(uD,"mergeImports");function Xi({fileName:e,extension:t}){return`${e}.${t}`}o(Xi,"getFileNameWithExtension");function BP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ri(t)}/`:""}${ri(t)}.${i}`:i}o(BP,"getTagFileNameWithoutExtension");function ul(...e){return BP(...e)}o(ul,"getTagImportPath");function ll(...e){return`${BP(...e)}.ts`}o(ll,"getTagFileName");var He=o(({type:e,tag:t,options:r})=>`${Fe(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function VP(e){return e.standalone?`${an(e)}${Tc.fileName}`:e.restClientImportPath}o(VP,"getAppRestClientImportPath");function UP(e){return e.standalone?`${an(e)}${Cc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(UP,"getQueryTypesImportPath");function GP(e){return`${an(e)}${Rc.fileName}`}o(GP,"getQueryModulesImportPath");function zP(e){return`${an(e)}${Nc.fileName}`}o(zP,"getMutationEffectsImportPath");function ZP(e){return`${an(e)}${nl.fileName}`}o(ZP,"getAclCheckImportPath");function WP(e){return`${an(e)}${jc.fileName}`}o(WP,"getZodExtendedImportPath");function KP(e){return`${an(e)}${rl.fileName}`}o(KP,"getAppAbilitiesImportPath");function YP(e){return $t(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(YP,"primitiveTypeToTsType");var Ha=o(e=>ri(pt(e.operationName)),"getEndpointName");function QP(e,t){return`${t.tsNamespaces?`${He({type:"endpoints",tag:ci(e,t),options:t})}.`:""}${Ha(e)}`}o(QP,"getImportedEndpointName");var JP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ci(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return oi(r??t.defaultTag)}o(ci,"getEndpointTag");function ni(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(wt(i.zodSchema))s=Ji(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Nt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Ki(p)&&(s=YP(p))}return{name:Yn(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==Ku)&&(!(r!=null&&r.excludePageParam)||i.name!==wa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===wa.pageParamName?"pageParam":i.name}))}o(ni,"mapEndpointParamsToFunctionParams");function XP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=oP(i.name)?i.name:`"${i.name}"`,a=Yn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==km["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==km.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Yn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(XP,"getEndpointConfig");function ex(e,t){return t.filter(r=>Jt(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(ex,"getUpdateQueryEndpoints");var Km=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function eo(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(eo,"pick");function us(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=si(e,t),i=$P(n,t);return r||i}o(us,"isOperationExcluded");function Ym({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${EP(e)}`,u=r.operationId?Yn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Fe(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=gP(u,i);l===""?u=t.toLowerCase():Km.includes(l)||(u=l)}return Km.includes(u)?c:u}o(Ym,"getOperationName");function Ba({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?si(r,n):n.defaultTag,s=o(a=>{let c=Ym({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Ym({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Ym({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Ba,"getUniqueOperationName");function tx(e,t,r){let n=[];for(let i in e.paths){if(Yi(i,r))continue;let s=e.paths[i],a=eo(s,Zi);for(let c in a){let u=a[c];if(!u||us(u,r))continue;let l=Ba({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(tx,"getUniqueOperationNamesWithoutSplitByTags");function rx(e,t){let r={};for(let n in e.paths){if(Yi(n,t))continue;let i=e.paths[n],s=eo(i,Zi);for(let a in s){let c=s[a];if(!c||us(c,t))continue;let u=t.splitByTags?si(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(rx,"getOperationsByTag");function Va(e){return{type:"invalid-schema",message:e}}o(Va,"getInvalidSchemaError");function nx(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nx,"getInvalidOperationIdError");function ix(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ix,"getMissingPathParameterError");function ox(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ox,"getNotAllowedInlineEnumError");function sx(e){return{type:"not-allowed-circular-schema",message:e}}o(sx,"getNotAllowedCircularSchemaError");function ax(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${pl(t,r)}`}}o(ax,"getMissingAclConditionPropertyError");function Qm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${fl(e)} in operation ${pl(t,r)}`}}o(Qm,"getMissingStatusCodeError");function cx(e,t,r){return{type:"invalid-status-code",message:`Operation ${pl(t,r)} expected HTTP status code ${fl(e.expected)} but received ${fl(e.received)}`}}o(cx,"getInvalidStatusCodeError");function ux(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${pl(t,r)} has multiple success HTTP status codes: ${e.map(fl).join(", ")}`}}o(ux,"getMultipleSuccessStatusCodesError");function pl(e,t){return e.operationId??`${t.method} ${t.path}`}o(pl,"getOperationDescriptor");function fl(e){return`${e} (${rP[e]})`}o(fl,"getStatusCodeDescription");function lx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(lx,"groupByType");function cn({schema:e,meta:t,options:r}){let n=[];$t(e.type).with("string",()=>n.push(pD(e,r))).with("number","integer",()=>n.push(hD(e))).with("array",()=>n.push(mD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
140
+ `);return s!==-1&&(t=vb(t,i,n,s)),n+t+i},"applyStyle");Object.defineProperties(js.prototype,So);var eH=js(),tH=js({level:Sb?Sb.level:0});var Vr=new Lc;function Ms(e,t,r){console.log(r!==void 0&&r!==t?`${Vr.yellow(`${e}:`.padEnd(20))}${Vr.magenta(t)}`:`${`${e}:`.padEnd(20)}${t}`)}o(Ms,"logVariable");function fr(e){console.log(`[INFO] ${e}`)}o(fr,"logInfo");function Rn(e){console.log(Vr.green(`[SUCCESS] ${e}`))}o(Rn,"logSuccess");function ks(e,t){e instanceof Error?(console.log(Vr.red(`[ERROR] ${t||e.message}`)),process.env.VERBOSE&&console.error(e)):console.log(Vr.red(`[ERROR] ${e}`))}o(ks,"logError");function Hc(e){console.log(Vr.bgYellow(`==== ${e} ====`))}o(Hc,"logBanner");var Pb=gt(require("fs"));function Eo(){return"0.13.10"}o(Eo,"getVersion");var hH=gt($b());var Gf=Symbol("options_key");function Ee(e){return(t,r)=>{var n,i;if(e!=null){let s={...Reflect.getMetadata(Gf,t)||{},[r]:{...e,describe:e.envAlias?`${e.describe||""} [${e.envAlias}]`:e.describe,type:e.type||((i=(n=Reflect.getMetadata("design:type",t,r))==null?void 0:n.name)==null?void 0:i.toLowerCase())}};Reflect.defineMetadata(Gf,s,t)}}}o(Ee,"YargOption");function wb(e){let t=Reflect.getMetadata(Gf,e.prototype);if(!t)throw new Error(`Options for ${e.name} were not defined`);return t}o(wb,"getYargsOption");function Bc(e){return async t=>t.options(nw(e)).middleware(async r=>await iw(e,r),!0)}o(Bc,"getBuilder");function nw(e){return Object.entries(wb(e)).reduce((t,[r,n])=>(t[r]=Object.fromEntries(Object.entries(n).filter(([i])=>!["envAlias","default"].includes(i))),t),{})}o(nw,"getYargsOptions");async function iw(e,t){let r=new e;for(let[n,i]of Object.entries(wb(e)))r[n]=t[n]??i.default;return r}o(iw,"loadYargsConfig");var Mx=gt(Mm());var rP={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Ambiguous",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I Am a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",424:"Failed Dependency",428:"Precondition Required",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},nP={"invalid-schema":"Invalid OpenAPI Schemas","invalid-operation-id":"Invalid Operation IDs","missing-path-parameter":"Missing Path Parameters","not-allowed-inline-enum":"Not Allowed Inline Enums","not-allowed-circular-schema":"Not Allowed Circular Schemas","missing-acl-condition-property":"Missing x-acl Condition Properties","missing-status-code":"Missing HTTP Status Codes","invalid-status-code":"Invalid HTTP Status Codes","multiple-success-status-codes":"Multiple Success HTTP Status Codes"};var kr={query:"useQuery",infiniteQuery:"useInfiniteQuery",mutation:"useMutation"},iP={bindings:[kr.query,kr.infiniteQuery,kr.mutation],from:"@tanstack/react-query"},wa={pageParamName:"page"},Wu={pageParamName:"page",totalItemsName:"totalItems",limitParamName:"limit"},Aa="moduleName";var km={"Content-Type":"application/json",Accept:"application/json"},Ku="data",qm="axios",Kn="config",en="AxiosRequestConfig",Yu={defaultImport:qm,bindings:[en],from:"axios"};var oP=o(e=>/^(?:[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+)$/.test(e),"isValidPropertyName"),Yn=o(e=>e.replace(/^[^a-zA-Z_$]*/g,"").replace(/[^a-zA-Z0-9_$]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"invalidVariableNameCharactersToCamel");function we(e){return e!=null&&Object.prototype.hasOwnProperty.call(e,"$ref")}o(we,"isReferenceObject");function Nt(e){return!we(e)}o(Nt,"isSchemaObject");function Qu(e){return e.type==="array"}o(Qu,"isArraySchemaObject");function sP(e){if(!e.allOf)throw new Error("Function inferRequiredSchema is specialized to handle item with required only in an allOf array.");let[t,r]=e.allOf.reduce((i,s)=>{if(Xq(s)){let a=s.required;i[0].push(...a??[])}else i[1].push(s);return i},[[],[]]),n={properties:t.reduce((i,s)=>(i[s]={},i),{}),type:"object",required:t};return{noRequiredOnlyAllof:r,composedRequiredSchema:n,patchRequiredSchemaInLoop:o((i,s)=>{if(we(i)){let a=s(i.$ref);a&&n.required.forEach(c=>{var u;n.properties[c]=((u=a==null?void 0:a.properties)==null?void 0:u[c])??{}})}else{let a=i.properties??{};n.required.forEach(c=>{a[c]&&(n.properties[c]=a[c]??{})})}},"patchRequiredSchemaInLoop")}}o(sP,"inferRequiredSchema");var Xq=o(e=>!we(e)&&!!e.required&&!e.type&&!e.properties&&!(e!=null&&e.allOf)&&!(e!=null&&e.anyOf)&&!e.oneOf,"isBrokenAllOfItem");var vn=Symbol.for("@ts-pattern/matcher"),eD=Symbol.for("@ts-pattern/isVariadic"),Xu="@ts-pattern/anonymous-select-key",Dm=o(e=>!!(e&&typeof e=="object"),"r"),Ju=o(e=>e&&!!e[vn],"i"),nn=o((e,t,r)=>{if(Ju(e)){let n=e[vn](),{matched:i,selections:s}=n.match(t);return i&&s&&Object.keys(s).forEach(a=>r(a,s[a])),i}if(Dm(e)){if(!Dm(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],s=[];for(let a of e.keys()){let c=e[a];Ju(c)&&c[eD]?s.push(c):s.length?i.push(c):n.push(c)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let a=t.slice(0,n.length),c=i.length===0?[]:t.slice(-i.length),u=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((l,p)=>nn(l,a[p],r))&&i.every((l,p)=>nn(l,c[p],r))&&(s.length===0||nn(s[0],u,r))}return e.length===t.length&&e.every((a,c)=>nn(a,t[c],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||Ju(s=i)&&s[vn]().matcherType==="optional")&&nn(i,t[n],r);var s})}return Object.is(t,e)},"s"),ti=o(e=>{var t,r,n;return Dm(e)?Ju(e)?(t=(r=(n=e[vn]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Ca(e,ti):Ca(Object.values(e),ti):[]},"o"),Ca=o((e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]),"c");function yr(e){return Object.assign(e,{optional:o(()=>tD(e),"optional"),and:o(t=>Ge(e,t),"and"),or:o(t=>rD(e,t),"or"),select:o(t=>t===void 0?aP(e):aP(t,e),"select")})}o(yr,"u");function tD(e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return t===void 0?(ti(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:nn(e,t,n),selections:r}},"match"),getSelectionKeys:o(()=>ti(e),"getSelectionKeys"),matcherType:"optional"})})}o(tD,"h");function Ge(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return{matched:e.every(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"and"})})}o(Ge,"m");function rD(...e){return yr({[vn]:()=>({match:o(t=>{let r={},n=o((i,s)=>{r[i]=s},"r");return Ca(e,ti).forEach(i=>n(i,void 0)),{matched:e.some(i=>nn(i,t,n)),selections:r}},"match"),getSelectionKeys:o(()=>Ca(e,ti),"getSelectionKeys"),matcherType:"or"})})}o(rD,"d");function xe(e){return{[vn]:()=>({match:o(t=>({matched:!!e(t)}),"match")})}}o(xe,"p");function aP(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return yr({[vn]:()=>({match:o(n=>{let i={[t??Xu]:n};return{matched:r===void 0||nn(r,n,(s,a)=>{i[s]=a}),selections:i}},"match"),getSelectionKeys:o(()=>[t??Xu].concat(r===void 0?[]:ti(r)),"getSelectionKeys")})})}o(aP,"y");function tn(e){return typeof e=="number"}o(tn,"v");function Qn(e){return typeof e=="string"}o(Qn,"b");function Jn(e){return typeof e=="bigint"}o(Jn,"w");var RU=yr(xe(function(e){return!0}));var Xn=o(e=>Object.assign(yr(e),{startsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.startsWith(r)))));var r},"startsWith"),endsWith:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.endsWith(r)))));var r},"endsWith"),minLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length>=r))(t))),"minLength"),length:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length===r))(t))),"length"),maxLength:o(t=>Xn(Ge(e,(r=>xe(n=>Qn(n)&&n.length<=r))(t))),"maxLength"),includes:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&n.includes(r)))));var r},"includes"),regex:o(t=>{return Xn(Ge(e,(r=t,xe(n=>Qn(n)&&!!n.match(r)))));var r},"regex")}),"j"),NU=Xn(xe(Qn)),rn=o(e=>Object.assign(yr(e),{between:o((t,r)=>rn(Ge(e,((n,i)=>xe(s=>tn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<r))(t))),"lt"),gt:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>r))(t))),"gt"),lte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n<=r))(t))),"lte"),gte:o(t=>rn(Ge(e,(r=>xe(n=>tn(n)&&n>=r))(t))),"gte"),int:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isInteger(t)))),"int"),finite:o(()=>rn(Ge(e,xe(t=>tn(t)&&Number.isFinite(t)))),"finite"),positive:o(()=>rn(Ge(e,xe(t=>tn(t)&&t>0))),"positive"),negative:o(()=>rn(Ge(e,xe(t=>tn(t)&&t<0))),"negative")}),"x"),jU=rn(xe(tn)),ei=o(e=>Object.assign(yr(e),{between:o((t,r)=>ei(Ge(e,((n,i)=>xe(s=>Jn(s)&&n<=s&&i>=s))(t,r))),"between"),lt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<r))(t))),"lt"),gt:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>r))(t))),"gt"),lte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n<=r))(t))),"lte"),gte:o(t=>ei(Ge(e,(r=>xe(n=>Jn(n)&&n>=r))(t))),"gte"),positive:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t>0))),"positive"),negative:o(()=>ei(Ge(e,xe(t=>Jn(t)&&t<0))),"negative")}),"A"),MU=ei(xe(Jn)),kU=yr(xe(function(e){return typeof e=="boolean"})),qU=yr(xe(function(e){return typeof e=="symbol"})),DU=yr(xe(function(e){return e==null})),LU=yr(xe(function(e){return e!=null}));var Bm=class Bm extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}};o(Bm,"W");var Lm=Bm,Fm={matched:!1,value:void 0};function $t(e){return new Hm(e,Fm)}o($t,"z");var Ia=class Ia{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let s=!1,a={},c=o((l,p)=>{s=!0,a[l]=p},"a"),u=!n.some(l=>nn(l,this.input,c))||i&&!i(this.input)?Fm:{matched:!0,value:r(s?Xu in a?a[Xu]:a:this.input,this.input)};return new Ia(this.input,u)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new Ia(this.input,n?{matched:!0,value:r(this.input,this.input)}:Fm)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new Lm(this.input)}run(){return this.exhaustive()}returnType(){return this}};o(Ia,"I");var Hm=Ia;var Vm=2,cP=["application/octet-stream","multipart/form-data","application/x-www-form-urlencoded","*/*"],uP=["query","header","path"],Zi=["get","put","post","delete","options","head","patch","trace"],lP=["string","number","integer","boolean"],Ta=["allOf","anyOf","oneOf"];var Fe=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),ri=o(e=>e.charAt(0).toLowerCase()+e.slice(1),"decapitalize"),fP=o(e=>e.replace(/(-\w)/g,t=>t[1].toUpperCase()),"kebabToCamel"),pt=o(e=>e.replace(/(_\w)/g,t=>t[1].toUpperCase()),"snakeToCamel"),pP=o(e=>e.replace(/[\W_]+(\w)?/g,(t,r)=>(r==null?void 0:r.toUpperCase())??""),"nonWordCharactersToCamel"),Um=o((e,t="")=>e.endsWith(t)?e:`${e}${t}`,"suffixIfNeeded"),dP=o((e,t)=>e.replace(new RegExp(`${t}$`),""),"removeSuffix"),nD=o(e=>{var n;let t=e.reduce((i,s)=>({...i,[s]:(i[s]??0)+1}),{});return(n=Object.entries(t).sort((i,s)=>i[1]===s[1]?s[0].length-i[0].length:s[1]-i[1])[0])==null?void 0:n[0]},"getLongestMostCommon"),Gm=o(e=>{let t=e.map(Fe).map(hP).map(r=>iD(r)).flat();return nD(t)},"getMostCommonAdjacentCombinationSplit"),hP=o(e=>e.split(/(?<![A-Z])(?=[A-Z])/).filter(Boolean),"splitByUppercase"),mP=o(e=>hP(e).join(" "),"camelToSpaceSeparated"),iD=o((e,t=["dto","by","for","of","in","to","and","with"])=>{var n;let r=[];for(let i=0;i<e.length;i++)if(!t.includes(e[i].toLowerCase()))for(let s=i+1;s<=e.length;s++)t.includes((n=e[s-1])==null?void 0:n.toLowerCase())||r.push(e.slice(i,s).join(""));return r},"getAdjacentStringCombinations"),gP=o((e,t)=>{let r=t.replace(/es$|s$/g,""),n=new RegExp(`(${ri(r)}|${Fe(r)})[a-z]*(?=$|[A-Z])`,"g");return e.replace(n,"")},"removeWord");var bP=o(e=>`#/components/schemas/${e}`,"getSchemaRef"),Wi=o(e=>e[1]==="/"?e:"#/"+e.slice(1),"autocorrectRef"),as=o(e=>Wi(e).split("/").at(-1),"getSchemaNameByRef");function Zm(e){let t=oD(e).normalize("NFKD").trim().replace(/\s+/g,"_").replace(/--+/g,"-").replace(/-+/g,"_").replace(/[^\w-]+/g,"_");return pt(t)}o(Zm,"normalizeString");function vP(e){return/^[a-zA-Z]\w*$/.test(e)?e:`"${e}"`}o(vP,"wrapWithQuotesIfNeeded");function _P(e){return typeof e=="string"&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}o(_P,"unwrapQuotesIfNeeded");function oD(e){let t=Number(e[0]);return typeof t=="number"&&!Number.isNaN(t)?"_"+e:e}o(oD,"prefixStringStartingWithNumberIfNeeded");function Wm(e){let t=e.replaceAll("_","#");return pt(t.replaceAll("-","_")).replaceAll("#","_")}o(Wm,"pathParamToVariableName");var Ki=o(e=>lP.includes(e),"isPrimitiveType");function SP(e){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/([\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\uFFFE\uFFFF])/g,(t,r)=>{let n=r.codePointAt(),i=n.toString(16);return n<=255?`\\x${`00${i}`.slice(-2)}`:`\\u${`0000${i}`.slice(-4)}`}).replace(/\//g,"\\/")}o(SP,"escapeControlCharacters");function on(e){return e.includes("application/")&&e.includes("json")||cP.includes(e)||e.includes("text/")}o(on,"isParamMediaTypeAllowed");function Ra(e){return e>=200&&e<300}o(Ra,"isMainResponseStatus");function el(e){return!(e>=200&&e<300)}o(el,"isErrorStatus");function tl(e){return e.startsWith("application/")}o(tl,"isMediaTypeAllowed");var yP=/({\w+})/g,sD=/[^\w\-]+/g;function EP(e){e=Fe(fP(e.replaceAll("/","-")).replaceAll("-",""));let t=[...e.matchAll(yP)];if(t.length>0){let r=t.sort((n,i)=>n.index-i.index)[t.length-1][0];e=`${e.replace(yP,"")}By${Fe(r.slice(1,-1))}`}return e.replace(sD,"_")}o(EP,"pathToVariableName");var zm=/{(\b\w+(?:-\w+)*\b)}/g;function OP(e){let t=e.match(zm);return t===null?e.replaceAll(zm,":$1"):(t.forEach(r=>{let n=Wm(r.replaceAll(zm,":$1"));e=e.replaceAll(r,n)}),e)}o(OP,"replaceHyphenatedPath");var PP=o(e=>{let t=e["x-enumNames"],r=Array.isArray(t)&&t.length>0,n=!!e.schema&&Nt(e.schema)&&e.schema.type==="string";return r&&n},"isSortingParameterObject"),Yi=o((e,t)=>t.excludePathRegex?new RegExp(t.excludePathRegex).test(e):!1,"isPathExcluded");var Jt=o(e=>e.method==="get","isQuery"),ii=o(e=>e.method!=="get"||!!e.mediaDownload,"isMutation"),cs=o((e,t)=>Jt(e)&&(t??Object.values(wa)).every(r=>e.parameters.some(n=>n.name===r&&n.type==="Query")),"isInfiniteQuery"),xP=o((e,t,r)=>{let n=r.reduce((i,s)=>[...i,...ni(e,s,{includeOnlyRequiredParams:!0}).map(a=>a.name)],[]);return ni(e,t,{includeOnlyRequiredParams:!0,excludeBodyParam:!0}).filter(i=>n.includes(i.name)).map(i=>i.name)},"getDestructuredVariables");function oi(e){return pP(e)}o(oi,"formatTag");function si(e,t){var n;let r=(n=e.tags)==null?void 0:n[0];return oi(r??t.defaultTag)}o(si,"getOperationTag");function $P(e,t){return t.excludeTags.some(r=>r.toLowerCase()===e.toLowerCase())}o($P,"isTagExcluded");var rl={fileName:"acl/app.ability",extension:"ts"},Na="AllAbilities",ja="AppAbilities",nl={fileName:"acl/useAclCheck",extension:"ts"},ai="useAclCheck",dt={abilityTuple:"AbilityTuple",pureAbility:"PureAbility",forcedSubject:"ForcedSubject",subjectType:"Subject",subject:"subject"},Ma={bindings:[dt.abilityTuple,dt.pureAbility,dt.forcedSubject,dt.subjectType,dt.subject],from:"@casl/ability"};var Xt=o((...e)=>[...new Set(e.flat())],"getUniqueArray");var wP=o(e=>`Use${Fe(pt(e.operationName))}Ability`,"getAbilityTypeName"),ka=o(e=>`canUse${Fe(pt(e.operationName))}`,"getAbilityFunctionName"),AP=o((e,t)=>`${t.tsNamespaces?`${He({type:"acl",tag:ci(e,t),options:t})}.`:""}${ka(e)}`,"getImportedAbilityFunctionName"),IP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].action},"getAbilityAction"),CP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].subject},"getAbilitySubject"),il=o(e=>{var t;return!!((t=qa(e))!=null&&t.length)},"hasAbilityConditions"),qa=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].conditionsTypes},"getAbilityConditionsTypes"),TP=o(e=>{var t;return(t=e.acl)==null?void 0:t[0].description},"getAbilityDescription"),ol=o(e=>`${Fe(e)}${Na}`,"getTagAllAbilitiesName");function jt(e,t){if(!e)return;let{data:r,onSchema:n}=t;if(we(e)&&n({type:"reference",schema:e,data:r})===!0)return;let i=e;if(Ta.some(s=>s in i&&i[s])){let s=i.allOf??i.anyOf??i.oneOf??[];for(let a of s)(n==null?void 0:n({type:"composite",parentSchema:e,schema:a,data:r}))!==!0&&jt(a,{data:r,onSchema:n})}if(i.properties)for(let[s,a]of Object.entries(i.properties))n({type:"property",parentSchema:e,schema:a,data:r,propertyName:s})!==!0&&jt(a,t);if(i.additionalProperties&&typeof i.additionalProperties=="object"){if(n({type:"additionalProperties",parentSchema:e,schema:i.additionalProperties,data:r})===!0)return;jt(i.additionalProperties,t)}if(i.type==="array"){let s=e.items;if(n({type:"array",parentSchema:e,schema:s,data:r})===!0)return;jt(s,t)}}o(jt,"iterateSchema");var sn=o((e,t)=>Um(Fe(Zm(e)),t),"getZodSchemaName"),Da=o((e,t,r)=>Um(Fe(Zm(e)),`${t}${r}`),"getEnumZodSchemaName"),wt=o(e=>!e.startsWith("z."),"isNamedZodSchema"),RP=o(e=>e.startsWith(Rs),"isEnumZodSchema"),Qi=o((e,t,r)=>t?e:`${r}_${e}`,"getZodSchemaOperationName"),sl=o(e=>pt(`${e}_${cb}`),"getBodyZodSchemaName"),NP=o((e,t)=>pt(`${e}_${t}${ub}`),"getParamZodSchemaName"),aD=o(e=>pt(`${e}${lb}`),"getMainResponseZodSchemaName"),cD=o((e,t)=>pt(`${e}_${t}_${fb}`),"getErrorResponseZodSchemaName");function al({statusCode:e,operationName:t,isUniqueOperationName:r,tag:n}){let i=Number(e),s=Qi(t,r,n);return!Ra(i)&&e!=="default"&&el(i)?cD(s,e):aD(s)}o(al,"getResponseZodSchemaName");function La(e){return["minimum","exclusiveMinimum","maximum","exclusiveMaximum","minItems","minLength","minProperties","maxItems","maxLength","maxProperties","default","example"].filter(n=>e[n]).reduce((n,i)=>[...n,`${Fe(mP(i))}: \`${e[i]}\``],[])}o(La,"getSchemaDescriptions");var Fa=o((e,t)=>dP(e,t.schemaSuffix),"getZodSchemaInferedTypeName"),jP=o((e,t)=>wt(t)?`${e.options.tsNamespaces?`${He({type:"models",tag:e.getTagByZodSchemaName(t),options:e.options})}.`:""}${t}`:t,"getImportedZodSchemaName"),Ji=o((e,t,r)=>{if(!wt(t))return t===Ts?"void":t;let n=e.getTagByZodSchemaName(t);return`${e.options.tsNamespaces&&n!==r?`${He({type:"models",tag:n,options:e.options})}.`:""}${Fa(t,e.options)}`},"getImportedZodSchemaInferedTypeName");function MP(e){var t;return e.isEnum?"enum":((t=e.schemaObj)==null?void 0:t.type)??"object"}o(MP,"getZodSchemaType");function kP(e){if(e.schemaObj)return[e.schemaObj.description,...La(e.schemaObj).join(". ")].filter(Boolean)}o(kP,"getZodSchemaDescription");function qP(e,t,r){var n;if(we(t)){let i=e.getZodSchemaNameByRef(t.$ref);return i?Ji(e,i,r):void 0}if(Qu(t)){if(!we(t.items))return`${((n=t.items)==null?void 0:n.type)??"unknown"}[]`;let i=e.getZodSchemaNameByRef(t.items.$ref);return i?`${Ji(e,i,r)}[]`:void 0}if(Ta.some(i=>i in t&&t[i])){let i=t.allOf??t.anyOf??t.oneOf??[];if(i.length>0)return qP(e,i[0],r)}return t.type}o(qP,"getType");function DP(e,t,r){if(!t.schemaObj)return[];let n="[0]",i="[key]",s={},a=o(c=>{var l;if(c.type==="reference")return!0;if(c.type==="composite")return;let u=[...((l=c.data)==null?void 0:l.pathSegments)??[]];if(c.type==="array"?u.push(n):c.type==="property"?u.push(c.propertyName):c.type==="additionalProperties"&&u.push(i),c.schema&&u[u.length-1]!==n){let p=e.resolveObject(c.schema),f=[p.description,...La(p)].filter(Boolean),d=u.join(".");s[d]&&"type"in c.schema&&c.schema.type==="object"||(delete s[d],s[d]={type:qP(e,c.schema,r)??"unknown",description:f.join(". ")})}return jt(c.schema,{data:{pathSegments:[...u]},onSchema:a}),!0},"onSchema");return"allOf"in t.schemaObj&&t.schemaObj.allOf&&t.schemaObj.allOf.forEach(c=>{if(we(c)){let u=e.resolveObject(c);jt(u,{data:{pathSegments:[]},onSchema:a})}}),jt(t.schemaObj,{data:{pathSegments:[]},onSchema:a}),s}o(DP,"getZodSchemaPropertyDescriptions");function ui({resolver:e,tag:t,zodSchemas:r=[],zodSchemasAsTypes:n=[]}){let i="models",s=o(u=>e.getTagByZodSchemaName(u),"getTag"),a=cl({type:i,tag:t,entities:r,getTag:s,getEntityName:o(u=>u,"getEntityName"),options:e.options}),c=cl({type:i,tag:t,entities:n,getTag:s,getEntityName:o(u=>Fa(u,e.options),"getEntityName"),options:e.options});return uD(e.options,a,c)}o(ui,"getModelsImports");function LP({tag:e,endpoints:t,options:r}){return cl({type:"endpoints",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:Ha,options:r})}o(LP,"getEndpointsImports");function FP({tag:e,endpoints:t,options:r}){return cl({type:"acl",tag:e,entities:t,getTag:o(n=>ci(n,r),"getTag"),getEntityName:ka,options:r})}o(FP,"getAclImports");function HP({tags:e,entityName:t,getAliasEntityName:r,type:n,options:i}){let s=new Map;return e.forEach(a=>{let c=`${t}${r?` as ${r(a)}`:""}`;s.has(a)?i.tsNamespaces||s.get(a).bindings.push(c):s.set(a,{bindings:[i.tsNamespaces?He({type:n,tag:a,options:i}):c],from:`${an(i)}${ul({type:n,tag:a,includeTagDir:!0,options:i})}`})}),Array.from(s.values())}o(HP,"getEntityImports");function an(e){let t=qf;return e.importPath==="relative"?t="../":e.importPath==="absolute"?t=e.output:new RegExp(`${kf}`,"g").test(e.output)&&(t=e.output.replace(new RegExp(`.*${kf}`,"g"),qf)),`${t}/`.replace(/\/\//g,"/")}o(an,"getImportPath");function cl({type:e="models",tag:t,entities:r,getTag:n,getEntityName:i,options:s}){let a=new Map;return r.forEach(c=>{let u=n(c);if(a.has(u))s.tsNamespaces||a.get(u).bindings.push(i(c));else{let l=t===u;a.set(u,{bindings:[s.tsNamespaces?He({type:e,tag:u,options:s}):i(c)],from:`${l?"./":an(s)}${ul({type:e,tag:u,includeTagDir:!l,options:s})}`})}}),Array.from(a.values())}o(cl,"getImports");function uD(e,...t){let r=new Map;return t.forEach(n=>{n.forEach(i=>{r.has(i.from)?e.tsNamespaces||r.get(i.from).bindings.push(...i.bindings):r.set(i.from,i)})}),Array.from(r.values()).map(n=>({...n,bindings:Xt(n.bindings)}))}o(uD,"mergeImports");function Xi({fileName:e,extension:t}){return`${e}.${t}`}o(Xi,"getFileNameWithExtension");function BP({type:e,tag:t,options:r,includeTagDir:n=!0}){let i=r.configs[e].outputFileNameSuffix;return t?`${n?`${ri(t)}/`:""}${ri(t)}.${i}`:i}o(BP,"getTagFileNameWithoutExtension");function ul(...e){return BP(...e)}o(ul,"getTagImportPath");function ll(...e){return`${BP(...e)}.ts`}o(ll,"getTagFileName");var He=o(({type:e,tag:t,options:r})=>`${Fe(t)}${r.configs[e].namespaceSuffix}`,"getNamespaceName");function VP(e){return e.standalone?`${an(e)}${Tc.fileName}`:e.restClientImportPath}o(VP,"getAppRestClientImportPath");function UP(e){return e.standalone?`${an(e)}${Cc.reactQueryTypes.fileName}`:e.queryTypesImportPath}o(UP,"getQueryTypesImportPath");function GP(e){return`${an(e)}${Rc.fileName}`}o(GP,"getQueryModulesImportPath");function zP(e){return`${an(e)}${Nc.fileName}`}o(zP,"getMutationEffectsImportPath");function ZP(e){return`${an(e)}${nl.fileName}`}o(ZP,"getAclCheckImportPath");function WP(e){return`${an(e)}${jc.fileName}`}o(WP,"getZodExtendedImportPath");function KP(e){return`${an(e)}${rl.fileName}`}o(KP,"getAppAbilitiesImportPath");function YP(e){return $t(e).with("string",()=>"string").with("number",()=>"number").with("integer",()=>"number").with("boolean",()=>"boolean").exhaustive()}o(YP,"primitiveTypeToTsType");var Ha=o(e=>ri(pt(e.operationName)),"getEndpointName");function QP(e,t){return`${t.tsNamespaces?`${He({type:"endpoints",tag:ci(e,t),options:t})}.`:""}${Ha(e)}`}o(QP,"getImportedEndpointName");var JP=o(e=>e.path.replace(/:([a-zA-Z0-9_]+)/g,"${$1}"),"getEndpointPath");function ci(e,t){var n;let r=t.splitByTags?(n=e.tags)==null?void 0:n[0]:t.defaultTag;return oi(r??t.defaultTag)}o(ci,"getEndpointTag");function ni(e,t,r){let n=t.parameters.map(i=>{var a,c,u,l;let s="string";if(wt(i.zodSchema))s=Ji(e,i.zodSchema);else if((a=i.parameterObject)!=null&&a.schema&&Nt(i.parameterObject.schema)){let p=(u=(c=i.parameterObject)==null?void 0:c.schema)==null?void 0:u.type;p&&Ki(p)&&(s=YP(p))}return{name:Yn(i.name),type:s,paramType:i.type,required:((l=i.parameterObject)==null?void 0:l.required)??!0,parameterObject:i.parameterObject,bodyObject:i.bodyObject}});return r!=null&&r.includeFileParam&&t.mediaUpload&&n.push({name:"file",type:"File",paramType:"Body",required:!0,parameterObject:void 0,bodyObject:void 0}),n.sort((i,s)=>{if(i.required===s.required){let a=["Path","Body","Query","Header"];return a.indexOf(i.paramType)-a.indexOf(s.paramType)}return i.required?-1:1}).filter(i=>(!(r!=null&&r.excludeBodyParam)||i.name!==Ku)&&(!(r!=null&&r.excludePageParam)||i.name!==wa.pageParamName)&&(!(r!=null&&r.includeOnlyRequiredParams)||i.required)).map(i=>({...i,name:r!=null&&r.replacePageParam&&i.name===wa.pageParamName?"pageParam":i.name}))}o(ni,"mapEndpointParamsToFunctionParams");function XP(e){let t=e.parameters.filter(i=>i.type==="Query").map(i=>{let s=oP(i.name)?i.name:`"${i.name}"`,a=Yn(i.name);return{...i,name:s,value:a}}),r={};return e.requestFormat!==km["Content-Type"]&&(r["Content-Type"]=`'${e.requestFormat}'`),e.responseFormat&&e.responseFormat!==km.Accept&&(r.Accept=`'${e.responseFormat}'`),e.parameters.filter(i=>i.type==="Header").forEach(i=>{r[i.name]=Yn(i.name)}),{...t.length>0?{params:t}:{},...Object.keys(r).length?{headers:r}:{}}}o(XP,"getEndpointConfig");function ex(e,t){return t.filter(r=>Jt(r)&&r.parameters.filter(n=>{var i;return(i=n.parameterObject)==null?void 0:i.required}).every(n=>e.parameters.some(i=>i.name===n.name))&&r.response===e.response)}o(ex,"getUpdateQueryEndpoints");var Km=["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with"];function eo(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)&&(r[n]=e[n])}),r}o(eo,"pick");function us(e,t){let r=e.deprecated&&!t.withDeprecatedEndpoints,n=si(e,t),i=$P(n,t);return r||i}o(us,"isOperationExcluded");function Ym({path:e,method:t,operation:r,options:n,tag:i,keepOperationTag:s,keepOperationPrefix:a}){let c=`${t}${EP(e)}`,u=r.operationId?Yn(r.operationId):c;if(n.removeOperationPrefixEndingWith&&a)u=u.split(n.removeOperationPrefixEndingWith).map((p,f)=>f===0?p:Fe(p)).join("");else if(n.removeOperationPrefixEndingWith&&!a){let l=new RegExp(`^.*${n.removeOperationPrefixEndingWith}`);u=u.replace(l,"")}if(n.tsNamespaces&&!s){let l=gP(u,i);l===""?u=t.toLowerCase():Km.includes(l)||(u=l)}return Km.includes(u)?c:u}o(Ym,"getOperationName");function Ba({operationsByTag:e,...t}){let{operation:r,options:n}=t,i=n.splitByTags?si(r,n):n.defaultTag,s=o(a=>{let c=Ym({...t,tag:i,keepOperationTag:a});if(e[i].filter(l=>Ym({...t,operation:l,tag:i,keepOperationTag:a})===c).length===1)return c},"operationName");return s()??s(!0)??Ym({...t,tag:i,keepOperationTag:!0,keepOperationPrefix:!0})}o(Ba,"getUniqueOperationName");function tx(e,t,r){let n=[];for(let i in e.paths){if(Yi(i,r))continue;let s=e.paths[i],a=eo(s,Zi);for(let c in a){let u=a[c];if(!u||us(u,r))continue;let l=Ba({path:i,method:c,operation:u,operationsByTag:t,options:r});n.push(l)}}return n}o(tx,"getUniqueOperationNamesWithoutSplitByTags");function rx(e,t){let r={};for(let n in e.paths){if(Yi(n,t))continue;let i=e.paths[n],s=eo(i,Zi);for(let a in s){let c=s[a];if(!c||us(c,t))continue;let u=t.splitByTags?si(c,t):t.defaultTag;r[u]||(r[u]=[]),r[u].push(c)}}return r}o(rx,"getOperationsByTag");function Va(e){return{type:"invalid-schema",message:e}}o(Va,"getInvalidSchemaError");function nx(e){return{type:"invalid-operation-id",message:`Operation ${e}`}}o(nx,"getInvalidOperationIdError");function ix(e,t){return{type:"missing-path-parameter",message:`Path ${t} is missing [${e.map(({name:r})=>r).join(", ")}]`}}o(ix,"getMissingPathParameterError");function ox(e){return{type:"not-allowed-inline-enum",message:`${e} is missing @IsEnum() and @ApiProperty(enum:, enumName:)`}}o(ox,"getNotAllowedInlineEnumError");function sx(e){return{type:"not-allowed-circular-schema",message:e}}o(sx,"getNotAllowedCircularSchemaError");function ax(e,t,r){return{type:"missing-acl-condition-property",message:`Condition property ${e} is not found in parameters or body in operation ${pl(t,r)}`}}o(ax,"getMissingAclConditionPropertyError");function Qm(e,t,r){return{type:"missing-status-code",message:`Missing HTTP status code ${fl(e)} in operation ${pl(t,r)}`}}o(Qm,"getMissingStatusCodeError");function cx(e,t,r){return{type:"invalid-status-code",message:`Operation ${pl(t,r)} expected HTTP status code ${fl(e.expected)} but received ${fl(e.received)}`}}o(cx,"getInvalidStatusCodeError");function ux(e,t,r){return{type:"multiple-success-status-codes",message:`Operation ${pl(t,r)} has multiple success HTTP status codes: ${e.map(fl).join(", ")}`}}o(ux,"getMultipleSuccessStatusCodesError");function pl(e,t){return e.operationId??`${t.method} ${t.path}`}o(pl,"getOperationDescriptor");function fl(e){return`${e} (${rP[e]})`}o(fl,"getStatusCodeDescription");function lx(e){return e.reduce((t,r)=>({...t,[r.type]:[...t[r.type]??[],r.message]}),{})}o(lx,"groupByType");function cn({schema:e,meta:t,options:r}){let n=[];$t(e.type).with("string",()=>n.push(pD(e,r))).with("number","integer",()=>n.push(hD(e))).with("array",()=>n.push(mD(e))).otherwise(()=>{}),typeof e.description=="string"&&e.description!==""&&r.withDescription&&([`
141
141
  `,"\r",`\r
142
- `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(lD({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?fD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(cn,"getZodChain");function lD({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(lD,"getZodChainablePresence");function fD(e){return e.default!==void 0?`default(${$t(e.type).with("number","integer",()=>_P(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(fD,"getZodChainableDefault");function pD(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${dD(e.pattern)})`),e.format){let n=$t(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(pD,"getZodChainableStringValidations");function dD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=SP(e),`/${e}/`}o(dD,"formatPatternIfNeeded");function hD(e){let t=[];return e.enum?"":(e.type==="integer"&&t.push("int()"),e.minimum!==void 0?e.exclusiveMinimum===!0?t.push(`gt(${e.minimum})`):t.push(`gte(${e.minimum})`):typeof e.exclusiveMinimum=="number"&&t.push(`gt(${e.exclusiveMinimum})`),e.maximum!==void 0?e.exclusiveMaximum===!0?t.push(`lt(${e.maximum})`):t.push(`lte(${e.maximum})`):typeof e.exclusiveMaximum=="number"&&t.push(`lt(${e.exclusiveMaximum})`),e.multipleOf&&t.push(`multipleOf(${e.multipleOf})`),t.join("."))}o(hD,"getZodChainableNumberValidations");function mD(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(mD,"getZodChainableArrayValidations");var to=o(e=>e.reduce((t,r)=>t+r,0),"sum");function dt(e,t){if(!t)return e;if(we(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?er("oneOf")+dt(e,{...t,type:t.type[0]}):e+er("oneOf")+to(t.type.map(r=>dt(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?er("oneOf")+dt(e,t.oneOf[0]):e+er("oneOf")+to(t.oneOf.map(r=>dt(0,r)));if(t.anyOf)return t.anyOf.length===1?er("anyOf")+dt(e,t.anyOf[0]):e+er("anyOf")+to(t.anyOf.map(r=>dt(0,r)));if(t.allOf)return t.allOf.length===1?er("allOf")+dt(e,t.allOf[0]):e+er("allOf")+to(t.allOf.map(r=>dt(0,r)));if(!t.type)return e;if(Ki(t.type))return t.enum?e+fx(t)+er("enum")+to(t.enum.map(r=>dt(0,r))):e+fx(t);if(t.type==="array")return t.items?er("array")+dt(e,t.items):er("array")+dt(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=er("object")+to(r.map(n=>dt(0,n)))}else e+=er("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=dt(0,t.additionalProperties):e+=dt(1))}return e}o(dt,"getOpenAPISchemaComplexity");function fx(e){return $t(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(fx,"complexityByType");function er(e){return $t(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(er,"complexityByComposite");var Jm=class Jm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;we(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${He({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return dt(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Jm,"ZodSchema");var Ua=Jm;function Qe({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Ua(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(we(e))return gD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=bD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=yD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=vD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=_D({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=SD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Qu(e))return e.items?i.assign(`z.array(${Qe({...a,schema:e.items}).getCodeString(n,t.options)}${cn({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let h=e.type?e.type.toLowerCase():void 0;if(h==="object"||e.properties||e.additionalProperties){let b=e.required&&e.required.length>0,g=t.options.withImplicitRequiredProps?!1:e.properties&&!((y=e.required)!=null&&y.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([te,X])=>{var j;let ze={...s,isRequired:g?!0:b?(j=e.required)==null?void 0:j.includes(te):t.options.withImplicitRequiredProps,name:te,isParentPartial:g},$e=X;if(we(X)&&t&&($e=t.getSchemaByRef(X.$ref),!$e))throw new Error(`Schema ${X.$ref} not found`);let G=Qe({...a,schema:X,meta:ze}).getCodeString(n,t.options)+cn({schema:$e,meta:ze,options:t.options});return[te,G]}).map(([te,X])=>`${vP(te)}: ${X}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Qe({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+cn({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let C=g?".partial()":"",T=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${C}${T}${$}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Qe,"getZodSchema");function gD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!we(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(gD,"getReferenceZodSchema");function yD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Nt(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Qe({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>Nt(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
142
+ `].some(s=>String.prototype.includes.call(e.description,s))?n.push(`describe(\`${e.description}\`)`):n.push(`describe("${e.description}")`));let i=n.concat(lD({schema:e,meta:t,options:r}),r.withDefaultValues!==!1?fD(e):[]).filter(Boolean).join(".");return i?`.${i}`:""}o(cn,"getZodChain");function lD({schema:e,meta:t,options:r}){return e.nullable&&!(t!=null&&t.isRequired)?"nullish()":e.nullable||r.replaceOptionalWithNullish&&(t!=null&&t.isParentPartial)?"nullable()":t!=null&&t.isRequired?"":r.replaceOptionalWithNullish?"nullish()":"optional()"}o(lD,"getZodChainablePresence");function fD(e){return e.default!==void 0?`default(${$t(e.type).with("number","integer",()=>_P(e.default)).otherwise(()=>JSON.stringify(e.default))})`:""}o(fD,"getZodChainableDefault");function pD(e,t){let r=[];if(e.enum||(e.minLength!==void 0&&r.push(`min(${e.minLength})`),e.maxLength!==void 0&&r.push(`max(${e.maxLength})`)),e.pattern&&r.push(`regex(${dD(e.pattern)})`),e.format){let n=$t(e.format).with("email",()=>"email()").with("hostname","uri",()=>"url()").with("uuid",()=>"uuid()").with("date-time",()=>`datetime({ offset: true })${t.branded?".brand('datetime')":""}`).otherwise(()=>"");n&&r.push(n)}return r.join(".")}o(pD,"getZodChainableStringValidations");function dD(e){return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),e=SP(e),`/${e}/`}o(dD,"formatPatternIfNeeded");function hD(e){let t=[];return e.enum?"":(e.type==="integer"&&t.push("int()"),e.minimum!==void 0?e.exclusiveMinimum===!0?t.push(`gt(${e.minimum})`):t.push(`gte(${e.minimum})`):typeof e.exclusiveMinimum=="number"&&t.push(`gt(${e.exclusiveMinimum})`),e.maximum!==void 0?e.exclusiveMaximum===!0?t.push(`lt(${e.maximum})`):t.push(`lte(${e.maximum})`):typeof e.exclusiveMaximum=="number"&&t.push(`lt(${e.exclusiveMaximum})`),e.multipleOf&&t.push(`multipleOf(${e.multipleOf})`),t.join("."))}o(hD,"getZodChainableNumberValidations");function mD(e){let t=[];return e.minItems&&t.push(`min(${e.minItems})`),e.maxItems&&t.push(`max(${e.maxItems})`),t.join(".")}o(mD,"getZodChainableArrayValidations");var to=o(e=>e.reduce((t,r)=>t+r,0),"sum");function ht(e,t){if(!t)return e;if(we(t))return e+2;if(Array.isArray(t.type))return t.type.length===1?er("oneOf")+ht(e,{...t,type:t.type[0]}):e+er("oneOf")+to(t.type.map(r=>ht(0,{...t,type:r})));if(t.oneOf)return t.oneOf.length===1?er("oneOf")+ht(e,t.oneOf[0]):e+er("oneOf")+to(t.oneOf.map(r=>ht(0,r)));if(t.anyOf)return t.anyOf.length===1?er("anyOf")+ht(e,t.anyOf[0]):e+er("anyOf")+to(t.anyOf.map(r=>ht(0,r)));if(t.allOf)return t.allOf.length===1?er("allOf")+ht(e,t.allOf[0]):e+er("allOf")+to(t.allOf.map(r=>ht(0,r)));if(!t.type)return e;if(Ki(t.type))return t.enum?e+fx(t)+er("enum")+to(t.enum.map(r=>ht(0,r))):e+fx(t);if(t.type==="array")return t.items?er("array")+ht(e,t.items):er("array")+ht(e);if(t.type==="object"||t.properties||t.additionalProperties){if(t.properties){let r=Object.values(t.properties);e+=er("object")+to(r.map(n=>ht(0,n)))}else e+=er("empty-object");t.additionalProperties&&(typeof t.additionalProperties=="object"?e+=ht(0,t.additionalProperties):e+=ht(1))}return e}o(ht,"getOpenAPISchemaComplexity");function fx(e){return $t(e.type).with("string","number","integer","boolean",()=>1).otherwise(()=>0)}o(fx,"complexityByType");function er(e){return $t(e).with("oneOf",()=>2).with("anyOf",()=>3).with("allOf",()=>2).with("enum","array","empty-object",()=>1).with("object",()=>2).otherwise(()=>0)}o(er,"complexityByComposite");var Jm=class Jm{constructor(t,r,n={referencedBy:[]},i){this.schema=t;this.resolver=r;we(t)&&(this.ref=t.$ref),i&&(this.enumRef=i),this.meta={...n,referencedBy:[...(n==null?void 0:n.referencedBy)??[]]},this.ref&&this.meta.referencedBy.push(this)}code;ref;enumRef;children=[];meta;getCodeString(t,r){var s,a;if(!this.ref&&this.code)return this.code;if(!this.ref)throw new Error("Zod schema is missing both ref and code");let n=(s=this.resolver)==null?void 0:s.getZodSchemaNameByRef(this.ref);if(!n)return this.ref;let i=(a=this.resolver)==null?void 0:a.getTagByZodSchemaName(n);return r!=null&&r.tsNamespaces&&i&&i!==t?`${He({type:"models",tag:i,options:r})}.${n}`:n}get complexity(){return ht(0,this.schema)}assign(t){return this.code=t,this}inherit(t){return t&&t.children.push(this),this}};o(Jm,"ZodSchema");var Ua=Jm;function Qe({schema:e,resolver:t,meta:r,tag:n}){var y;let i=new Ua(e,t,r),s={parent:i.inherit(r==null?void 0:r.parent),referencedBy:[...i.meta.referencedBy]},a={resolver:t,meta:s,tag:n};if(we(e))return gD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});let c=bD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(c)return c;let u=yD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(u)return u;let l=vD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(l)return l;let p=_D({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(p)return p;let f=SD({schema:e,zodSchema:i,resolver:t,meta:s,tag:n});if(f)return f;let d=t.options.allReadonly?".readonly()":"";if(Qu(e))return e.items?i.assign(`z.array(${Qe({...a,schema:e.items}).getCodeString(n,t.options)}${cn({schema:e.items,meta:{...s,isRequired:!0},options:t.options})})${d}`):i.assign(`z.array(z.any())${d}`);let h=e.type?e.type.toLowerCase():void 0;if(h==="object"||e.properties||e.additionalProperties){let b=e.required&&e.required.length>0,g=t.options.withImplicitRequiredProps?!1:e.properties&&!((y=e.required)!=null&&y.length),P="{}";e.properties&&(P="{ "+Object.entries(e.properties).map(([te,X])=>{var j;let ze={...s,isRequired:g?!0:b?(j=e.required)==null?void 0:j.includes(te):t.options.withImplicitRequiredProps,name:te,isParentPartial:g},$e=X;if(we(X)&&t&&($e=t.getSchemaByRef(X.$ref),!$e))throw new Error(`Schema ${X.$ref} not found`);let G=Qe({...a,schema:X,meta:ze}).getCodeString(n,t.options)+cn({schema:$e,meta:ze,options:t.options});return[te,G]}).map(([te,X])=>`${vP(te)}: ${X}`).join(", ")+" }");let $="";e.additionalProperties&&($=`.catchall(${typeof e.additionalProperties=="object"&&Object.keys(e.additionalProperties).length>0?Qe({...a,schema:e.additionalProperties}).getCodeString(n,t.options)+cn({schema:e.additionalProperties,meta:{...s,isRequired:!0},options:t.options}):"z.any()"})`);let C=g?".partial()":"",T=t.options.strictObjects?".strict()":"";return i.assign(`z.object(${P})${C}${T}${$}${d}`)}if(h==="any")return i.assign("z.any()");if(!h)return i.assign("z.unknown()");throw new Error(`Unsupported schema type: ${h}`)}o(Qe,"getZodSchema");function gD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!we(e))return;let s=t.meta.referencedBy.slice(0,-1).map(u=>u.ref?r.getZodSchemaNameByRef(u.ref)??u.ref:void 0).filter(Boolean),a=r.getZodSchemaNameByRef(e.$ref);if(s.length>1&&s.includes(a))return t.assign(r.getCodeByZodSchemaName(t.ref));let c=r.getCodeByZodSchemaName(e.$ref);if(!c){let u=r.getSchemaByRef(e.$ref);if(!u)throw new Error(`Schema ${e.$ref} not found`);c=Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)}return r.getCodeByZodSchemaName(a)||r.setZodSchema(a,c,i),t}o(gD,"getReferenceZodSchema");function yD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){var a;if(!Nt(e)||!e.oneOf)return;if(e.oneOf.length===1){let c=Qe({schema:e.oneOf[0],resolver:r,meta:n,tag:i});return t.assign(c.getCodeString(i,r.options))}let s=(a=e.oneOf)==null?void 0:a.some(c=>Nt(c)&&((c==null?void 0:c.allOf)||[]).length>1);if(e.discriminator&&!s){let c=e.discriminator.propertyName;return t.assign(`
143
143
  z.discriminatedUnion("${c}", [${e.oneOf.map(u=>Qe({schema:u,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])
144
- `)}return t.assign(`z.union([${e.oneOf.map(c=>Qe({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(yD,"getOneOfZodSchema");function bD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!Nt(e)||!Array.isArray(e.type)))return e.type.length===1?Qe({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>Qe({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(bD,"getArrayZodSchema");function vD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Nt(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=Qe({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>Qe({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o(vD,"getAnyOfZodSchema");function _D({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Nt(e)||!e.allOf)return;if(e.allOf.length===1){let f=Qe({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(f.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=sP(e),u=a.map(f=>{let d=Qe({schema:f,resolver:r,meta:n,tag:i});return r&&s(f,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(Qe({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),p=u.slice(1).map(f=>`merge(${f.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${p}`)}o(_D,"getAllOfZodSchema");function SD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Nt(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Ki(s)){if(e.enum){if(s==="string")return ED({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign($t(s).with("integer",()=>"z.number()").with("string",()=>$t(e.format).with("binary",()=>Mc).otherwise(()=>kc)).otherwise(a=>`z.${a}()`))}}o(SD,"getPrimitiveZodSchema");function ED({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!Nt(t))return;let s=ls(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new Ua({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${He({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(ED,"getEnumZodSchema");function ls(e){var t;return`${Rs}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(ls,"getEnumZodSchemaCode");function px(e){return`${Rs}([${e.map(t=>`"${t}"`).join(", ")}])`}o(px,"getEnumZodSchemaCodeFromEnumNames");function fs({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!wt(s)||t.ref===void 0)&&r){if(t.complexity<Vm)return s;let u=sn(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return dt(0,n.getSchemaByRef(t.ref))<Vm?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(fs,"resolveZodSchemaName");function dx({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=OD({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(ax(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(dx,"getEndpointAcl");function OD({resolver:e,endpoint:t,acl:r,name:n}){var f,d,h,y,b,g,P,$,C,T;let i=(d=(f=r[0])==null?void 0:f.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,p=t.parameters.find(({name:A})=>A===s[l]);if(p)c=(h=p.parameterObject)==null?void 0:h.required,a=(y=p.parameterObject)==null?void 0:y.schema,u=`${p.name} ${ri(p.type)} parameter`,l++;else{let A=t.parameters.find(({bodyObject:ze})=>!!ze),X=Object.keys(((b=A==null?void 0:A.bodyObject)==null?void 0:b.content)??{}).find(on);X&&(a=($=(P=(g=A==null?void 0:A.bodyObject)==null?void 0:g.content)==null?void 0:P[X])==null?void 0:$.schema,u=`${Jt(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let A=e.resolveObject(a);a=(C=Object.entries(A.properties??{}).find(([X])=>X===s[l]))==null?void 0:C[1],c=((T=A.required)==null?void 0:T.includes(s[l]))??!1,l++}if(a)return{name:n,type:we(a)?void 0:a.type,zodSchemaName:we(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(OD,"getEndpointAclConditionPropertyType");function hx({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var h,y;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(on);if(!c)return;let u=(y=(h=s.content)==null?void 0:h[c])==null?void 0:y.schema;if(!u)return;let l=Qe({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),p=e.resolveObject(u),f=fs({schema:p,zodSchema:l,fallbackName:sl(Qi(r,n,i)),resolver:e,tag:i}),d=cn({schema:p,meta:l.meta,options:e.options});return{endpointParameter:{name:Ku,type:"Body",description:s.description,zodSchema:f+d,bodyObject:s},requestFormat:c}}o(hx,"getEndpointBody");function mx({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!uP.includes(s.in))return;let a={};if(s.content){let h=Object.keys(s.content??{}),y=h.find(on);if(!y)throw new Error(`Unsupported media type for param ${s.name}: ${h.join(", ")}`);let b=s.content[y];if(!b)throw new Error(`No content with media type for param ${s.name}: ${y}`);a=(b==null?void 0:b.schema)??b}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=NP(Qi(r,n,i),s.name),u;if(PP(s)){let h=Da(c,e.options.enumSuffix,e.options.schemaSuffix),y=px(s["x-enumNames"]);e.setZodSchema(h,y,i),u=h}let l=Qe({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),p=e.resolveObject(a),f=cn({schema:p,meta:l.meta,options:e.options}),d=fs({schema:p,zodSchema:l.assign(l.getCodeString(i)+f),fallbackName:c,resolver:e,tag:i});return{name:$t(s.in).with("path",()=>Wm(s.name)).otherwise(()=>s.name),type:$t(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(mx,"getEndpointParameter");function yx(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(Yi(c,e.options))continue;let u=e.openApiDoc.paths[c],l=eo(u,Zi),p=gx(u.parameters??[]);for(let f in l){let d=l[f];if(!d||us(d,e.options))continue;let h=d.operationId&&d.operationId!==Yn(d.operationId);d.operationId&&h&&e.validationErrors.push(nx(d.operationId));let y=Object.entries({...p,...gx(d.parameters??[])}).map(([,A])=>A),b=Ba({path:c,method:f,operation:d,operationsByTag:e.operationsByTag,options:e.options}),g=e.operationNames.filter(A=>A===b).length<=1,P=si(d,e.options),$={method:f,path:OP(c),operationName:b,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(oi),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let A=hx({resolver:e,operation:d,operationName:b,isUniqueOperationName:g,tag:P});A&&($.parameters.push(A.endpointParameter),$.requestFormat=A.requestFormat)}for(let A of y){let te=mx({resolver:e,param:A,operationName:b,isUniqueOperationName:g,tag:P});te&&$.parameters.push(te)}let C=PD($);C.forEach(A=>{$.parameters.push(A)}),C.length>0&&e.validationErrors.push(ix(C,c));for(let A in d.responses){$.responseStatusCodes.push(A);let te=e.resolveObject(d.responses[A]),ze=Object.keys(te.content??{}).find(tl),$e,G;if(ze?($.responseFormat=ze,$e=(i=(n=te.content)==null?void 0:n[ze])==null?void 0:i.schema):(G=Ts,A==="200"&&e.validationErrors.push(cx({received:"200",expected:"204"},d,$))),$e){let j=Qe({schema:$e,resolver:e,meta:{isRequired:!0},tag:P}),R=e.resolveObject($e);G=fs({schema:R,zodSchema:j,fallbackName:j.ref?void 0:al({statusCode:A,operationName:b,isUniqueOperationName:g,tag:P}),resolver:e,tag:P})+cn({schema:R,meta:j.meta,options:e.options})}if(G){let j=Number(A);Ra(j)&&!$.response?($.response=G,$.responseObject=te,$.responseDescription=te.description):A!=="default"&&el(j)&&$.errors.push({zodSchema:G,status:j,description:te.description})}}$.response||($.response=Ts);let T=Object.keys(d.responses).map(Number).filter(Ra);T.length>1&&e.validationErrors.push(ux(T.map(String),d,$)),$.acl=dx({resolver:e,endpoint:$,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!$.responseStatusCodes.includes("401")&&e.validationErrors.push(Qm("401",d,$)),(a=$.acl)!=null&&a[0]&&!$.responseStatusCodes.includes("403")&&e.validationErrors.push(Qm("403",d,$)),t.push($)}}return t}o(yx,"getEndpointsFromOpenAPIDoc");function gx(e){return Object.fromEntries((e??[]).map(t=>[we(t)?t.$ref:t.name,t]))}o(gx,"getParameters");function PD(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>xD(r))}o(PD,"getMissingPathParameters");function xD(e){return{name:e,type:"Path",zodSchema:kc,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(xD,"getPathParameterFromName");function bx(e,t){let r=$D(e,t),n=wD(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o(bx,"getOpenAPISchemaDependencyGraph");function $D(e,t){let r={},n={};return e.forEach(i=>AD({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o($D,"getRefsDependencyGraph");function wD(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(wD,"getDeepRefsDependencyGraph");function AD({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,jt(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return jt(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(AD,"getSchemaRefsDependencyGraph");function dl(e,t,r){let n=[];return jt(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):we(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(Va(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(Va(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(Va(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Va(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(dl,"getSchemaRefObjs");function vx(e,t){return t.map(i=>Wi(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(vx,"getDeepSchemaRefObjs");function _x(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=Gm(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=Da(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!Xm(e);)ID(e,t+2),t++;if(Xm(e)||e.extractedEnumZodSchemaData.filter(n=>!Sx(e,n)).forEach(n=>{n.zodSchemaName=Da(n.meta.zodSchemaNameSegments[0].map(i=>eg(Fe(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!Xm(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(_x,"resolveExtractedEnumZodSchemaNames");function Xm(e){return e.extractedEnumZodSchemaData.every(t=>Sx(e,t))}o(Xm,"allExtractedEnumZodSchemaNamesAreUnique");function ID(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&CD(n,t)})}o(ID,"additionalResolveExtractedEnumZodSchemaName");function CD(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[eg(Fe(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=Gm(n),s=[i?eg(Fe(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(CD,"suffixWithPreviousSegmentName");function Sx(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(Sx,"isUnique");function eg(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(eg,"sanitizeName");function Ex(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Xt(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(Ex,"resolveExtractedEnumZodSchemaTags");function Ga({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&Ox({schema:e,nameSegments:t,...n}),jt(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),Ox({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(Ga,"updateExtractedEnumZodSchemaData");function Ox({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||we(t)||!t.enum)return;let a=ls(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(ox(r?`${as(r)}.${s[s.length-1]}`:n??s.join(".")))}o(Ox,"handleExtractedEnumZodSchemaDataUpdate");function Px(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=sn(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=ls(l):t[c]=Qe({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(Px,"getZodSchemasFromOpenAPIDoc");function xx(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=sn(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:ls(a)})}),t}o(xx,"getEnumZodSchemasFromOpenAPIDoc");var tg=class tg{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=bx(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=xx(this),this.operationsByTag=rx(t,r),this.operationNames=tx(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(bP)}getSchemaByRef(t){return this.docSchemas[as(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(Wi(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(p=>p.zodSchemaName===t);if(r)return oi(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(p=>p.zodSchemaName===t))==null?void 0:l.tags)??[],a=Xt(i,s),c=a.length===1?a[0]:this.options.defaultTag;return oi(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return we(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=Wi(a),u=as(c),l=sn(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(Yi(a,this.options))continue;let c=this.openApiDoc.paths[a],u=eo(c,Zi);for(let l in u){let p=u[l];if(!p||us(p,this.options))continue;let f=si(p,this.options),d=Ba({path:a,method:l,operation:p,operationsByTag:this.operationsByTag,options:this.options}),h=this.operationNames.filter(P=>P===d).length<=1,y=pt(Qi(d,h,f)),b=[];if((t=p.parameters)==null||t.map(P=>{let $=P,C=$.schema,T=`Operation ${p.operationId??a} parameter ${$.name}`;b.push(...dl(this,C,T)),this.options.extractEnums&&Ga({resolver:this,schema:C,schemaInfo:T,tags:[f],nameSegments:[y,$.name],includeSelf:!0})}),p.requestBody){let P=this.resolveObject(p.requestBody),C=Object.keys(P.content??{}).find(on);if(C){let T=(n=(r=P.content)==null?void 0:r[C])==null?void 0:n.schema,A=`Operation ${p.operationId} request body`;b.push(...dl(this,T,A)),this.options.extractEnums&&Ga({resolver:this,schema:T,schemaInfo:A,tags:[f],nameSegments:[sl(y)]})}}for(let P in p.responses){let $=this.resolveObject(p.responses[P]),T=Object.keys($.content??{}).find(tl);if(T){let A=(s=(i=$.content)==null?void 0:i[T])==null?void 0:s.schema,te=`Operation ${p.operationId} response body`;b.push(...dl(this,A,te)),this.options.extractEnums&&Ga({resolver:this,schema:A,schemaInfo:te,tags:[f],nameSegments:[al({statusCode:P,operationName:d,isUniqueOperationName:h,tag:f})]})}}vx(this,b).forEach(P=>{let $=this.getSchemaDataByRef(P);$&&($.tags.push(f),$.deepRefOperations.push(p))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=Wi(a);Ga({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[as(c)]})}),Ex(this),this.handleDuplicateEnumZodSchemas(),_x(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(tg,"SchemaResolver");var hl=tg;function $x(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o($x,"topologicalSort");function wx(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(wx,"sortObjKeysFromArray");function Ax(e,t){let r=$x(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return wx(t,r)}o(Ax,"sortZodSchemasByTopology");function Ix(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(sx(e.getCircularSchemaChain(s).join(" -> "))),r[sn(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[sn(n,e.options.schemaSuffix)]=i}),r}o(Ix,"wrapCircularZodSchemas");function ml(e,t){let r=new hl(e,t),n=yx(r),i=Px(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=Ix(r,s),s=Ax(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:TD({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(ml,"getDataFromOpenAPIDoc");function TD({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=ci(s,n);Cx(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(Cx(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(TD,"splitDataByTags");function Cx(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(Cx,"getTagElement");var ps=mt(require("fs")),rg=mt(require("path"));function Tx(e){return ps.default.readFileSync(rg.default.join(__dirname,`../${e}`),"utf-8")}o(Tx,"readFileSync");function ng(e){let t=`src/generators/templates/${e}.hbs`;return Tx(t)}o(ng,"readHbsTemplateSync");function Rx(e){let t=`src/assets/${e}`;return Tx(t)}o(Rx,"readAssetSync");function qr({output:e,fileName:t}){return`${e}/${t}`}o(qr,"getOutputFileName");function RD(e,t){let r=rg.default.dirname(e);ps.default.existsSync(r)||ps.default.mkdirSync(r,{recursive:!0}),ps.default.writeFileSync(e,t,"utf-8")}o(RD,"writeFileWithDirSync");function ND({fileName:e,content:t}){RD(e,t)}o(ND,"writeFileSync");function Nx(e){e.forEach(ND)}o(Nx,"writeGenerateFileData");function jx(e,t){let r={...Pe,...t},{resolver:n,data:i}=ml(e,r);if(n.validationErrors.length>0){let s=lx(n.validationErrors);Object.entries(s).forEach(([a,c])=>{console.log(`${Vr.red(`${nP[a]}:`)}
144
+ `)}return t.assign(`z.union([${e.oneOf.map(c=>Qe({schema:c,resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(yD,"getOneOfZodSchema");function bD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!(!Nt(e)||!Array.isArray(e.type)))return e.type.length===1?Qe({schema:{...e,type:e.type[0]},resolver:r,meta:n,tag:i}):t.assign(`z.union([${e.type.map(s=>Qe({schema:{...e,type:s},resolver:r,meta:n,tag:i}).getCodeString(i,r.options)).join(", ")}])`)}o(bD,"getArrayZodSchema");function vD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Nt(e)||!e.anyOf)return;if(e.anyOf.length===1){let a=Qe({schema:e.anyOf[0],resolver:r,meta:n,tag:i});return t.assign(a.getCodeString(i,r.options))}let s=e.anyOf.map(a=>Qe({schema:a,resolver:r,meta:n,tag:i})).map(a=>a.getCodeString(i,r.options)).join(", ");return t.assign(`z.union([${s}])`)}o(vD,"getAnyOfZodSchema");function _D({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Nt(e)||!e.allOf)return;if(e.allOf.length===1){let f=Qe({schema:e.allOf[0],resolver:r,meta:n,tag:i});return t.assign(f.getCodeString(i,r.options))}let{patchRequiredSchemaInLoop:s,noRequiredOnlyAllof:a,composedRequiredSchema:c}=sP(e),u=a.map(f=>{let d=Qe({schema:f,resolver:r,meta:n,tag:i});return r&&s(f,r.getSchemaByRef.bind(r)),d});c.required.length&&u.push(Qe({schema:c,resolver:r,meta:n,tag:i}));let l=u.at(0),p=u.slice(1).map(f=>`merge(${f.getCodeString(i,r.options)})`).join(".");return t.assign(`${l.getCodeString(i,r.options)}.${p}`)}o(_D,"getAllOfZodSchema");function SD({schema:e,zodSchema:t,resolver:r,meta:n,tag:i}){if(!Nt(e))return;let s=e.type?e.type.toLowerCase():void 0;if(s&&Ki(s)){if(e.enum){if(s==="string")return ED({schema:e,zodSchema:t,resolver:r,meta:n,tag:i});if(e.enum.some(a=>typeof a=="string"))return t.assign("z.never()");if(e.enum.length===1){let a=e.enum[0];return t.assign(`z.literal(${a===null?"null":a})`)}return t.assign(`z.union([${e.enum.map(a=>`z.literal(${a===null?"null":a})`).join(", ")}])`)}return t.assign($t(s).with("integer",()=>"z.number()").with("string",()=>$t(e.format).with("binary",()=>Mc).otherwise(()=>kc)).otherwise(a=>`z.${a}()`))}}o(SD,"getPrimitiveZodSchema");function ED({resolver:e,schema:t,zodSchema:r,meta:n,tag:i}){var l;if(!Nt(t))return;let s=ls(t);if(!e.options.extractEnums)return r.assign(s);let a=e.getEnumZodSchemaDataByCode(s);if(a)return((l=r.meta.parent)==null?void 0:l.ref)===e.getRefByZodSchemaName(a.zodSchemaName)?r.assign(a.code):new Ua({$ref:e.getRefByZodSchemaName(a.zodSchemaName)},e,n).inherit(r).assign(s);let c=e.getExtractedEnumZodSchemaDataByCode(s);if(!c)return r.assign(s);if(!c.zodSchemaName||!c.tag)throw new Error(`Enum zod schema name or tag not resolved for code: ${s}`);let u=e.options.tsNamespaces&&c.tag!==i?`${He({type:"models",tag:c.tag,options:e.options})}.`:"";return r.assign(`${u}${c.zodSchemaName}`)}o(ED,"getEnumZodSchema");function ls(e){var t;return`${Rs}([${(t=e.enum)==null?void 0:t.map(r=>r===null?"null":`"${r}"`).join(", ")}])`}o(ls,"getEnumZodSchemaCode");function px(e){return`${Rs}([${e.map(t=>`"${t}"`).join(", ")}])`}o(px,"getEnumZodSchemaCodeFromEnumNames");function fs({schema:e,zodSchema:t,fallbackName:r,resolver:n,tag:i}){var c;let s=t.getCodeString();if((!wt(s)||t.ref===void 0)&&r){if(t.complexity<Vm)return s;let u=sn(r,n.options.schemaSuffix);for(;n.getCodeByZodSchemaName(u);){if((c=n.getZodSchemaNamesByCompositeCode(s))!=null&&c.includes(u))return u;if(n.getCodeByZodSchemaName(u)===u)return u;throw new Error(`Can't uniquely resolve zod schema name: ${u}`)}return n.setZodSchema(u,s,i),n.addZodSchemaForCompositeCode(s,t,u,e),u}let a=n.getCodeByZodSchemaName(s);if(!a&&t.ref&&(a=n.getCodeByZodSchemaName(n.getZodSchemaNameByRef(t.ref))),t.ref&&a)return ht(0,n.getSchemaByRef(t.ref))<Vm?n.getCodeByZodSchemaName(s):s;if(t.ref)return n.getZodSchemaNameByRef(t.ref);throw new Error(`Invalid ref: ${t.ref}`)}o(fs,"resolveZodSchemaName");function dx({resolver:e,endpoint:t,operation:r}){let n=r["x-acl"];return n==null?void 0:n.map(i=>{let s=Object.keys(i.conditions??{}).reduce((a,c)=>{let u=OD({resolver:e,endpoint:t,acl:n,name:c});return u?[...a,u]:(e.validationErrors.push(ax(c,r,t)),a)},[]);return{...i,conditionsTypes:s}})}o(dx,"getEndpointAcl");function OD({resolver:e,endpoint:t,acl:r,name:n}){var f,d,h,y,b,g,P,$,C,T;let i=(d=(f=r[0])==null?void 0:f.conditions)==null?void 0:d[n];if(!i)return;let s=i.replace(/^\$[^.]*\./,"").split("."),a,c,u,l=0,p=t.parameters.find(({name:A})=>A===s[l]);if(p)c=(h=p.parameterObject)==null?void 0:h.required,a=(y=p.parameterObject)==null?void 0:y.schema,u=`${p.name} ${ri(p.type)} parameter`,l++;else{let A=t.parameters.find(({bodyObject:ze})=>!!ze),X=Object.keys(((b=A==null?void 0:A.bodyObject)==null?void 0:b.content)??{}).find(on);X&&(a=($=(P=(g=A==null?void 0:A.bodyObject)==null?void 0:g.content)==null?void 0:P[X])==null?void 0:$.schema,u=`${Jt(t)?"query":"mutation"} data`)}for(;a&&l<s.length;){let A=e.resolveObject(a);a=(C=Object.entries(A.properties??{}).find(([X])=>X===s[l]))==null?void 0:C[1],c=((T=A.required)==null?void 0:T.includes(s[l]))??!1,l++}if(a)return{name:n,type:we(a)?void 0:a.type,zodSchemaName:we(a)?e.getZodSchemaNameByRef(a.$ref):void 0,required:c,info:u}}o(OD,"getEndpointAclConditionPropertyType");function hx({resolver:e,operation:t,operationName:r,isUniqueOperationName:n,tag:i}){var h,y;let s=e.resolveObject(t.requestBody);if(!s)return;let c=Object.keys(s.content??{}).find(on);if(!c)return;let u=(y=(h=s.content)==null?void 0:h[c])==null?void 0:y.schema;if(!u)return;let l=Qe({schema:u,resolver:e,meta:{isRequired:s.required??!0},tag:i}),p=e.resolveObject(u),f=fs({schema:p,zodSchema:l,fallbackName:sl(Qi(r,n,i)),resolver:e,tag:i}),d=cn({schema:p,meta:l.meta,options:e.options});return{endpointParameter:{name:Ku,type:"Body",description:s.description,zodSchema:f+d,bodyObject:s},requestFormat:c}}o(hx,"getEndpointBody");function mx({resolver:e,param:t,operationName:r,isUniqueOperationName:n,tag:i}){let s=e.resolveObject(t);if(!uP.includes(s.in))return;let a={};if(s.content){let h=Object.keys(s.content??{}),y=h.find(on);if(!y)throw new Error(`Unsupported media type for param ${s.name}: ${h.join(", ")}`);let b=s.content[y];if(!b)throw new Error(`No content with media type for param ${s.name}: ${y}`);a=(b==null?void 0:b.schema)??b}else s.schema&&(a=s.schema);e.options.withDescription&&a&&(a.description=(s.description??"").trim());let c=NP(Qi(r,n,i),s.name),u;if(PP(s)){let h=Da(c,e.options.enumSuffix,e.options.schemaSuffix),y=px(s["x-enumNames"]);e.setZodSchema(h,y,i),u=h}let l=Qe({schema:a,resolver:e,meta:{isRequired:s.in==="path"?!0:s.required??!1},tag:i}),p=e.resolveObject(a),f=cn({schema:p,meta:l.meta,options:e.options}),d=fs({schema:p,zodSchema:l.assign(l.getCodeString(i)+f),fallbackName:c,resolver:e,tag:i});return{name:$t(s.in).with("path",()=>Wm(s.name)).otherwise(()=>s.name),type:$t(s.in).with("header",()=>"Header").with("query",()=>"Query").with("path",()=>"Path").run(),zodSchema:d,parameterObject:s,parameterSortingEnumSchemaName:u}}o(mx,"getEndpointParameter");function yx(e){var r,n,i,s,a;let t=[];for(let c in e.openApiDoc.paths){if(Yi(c,e.options))continue;let u=e.openApiDoc.paths[c],l=eo(u,Zi),p=gx(u.parameters??[]);for(let f in l){let d=l[f];if(!d||us(d,e.options))continue;let h=d.operationId&&d.operationId!==Yn(d.operationId);d.operationId&&h&&e.validationErrors.push(nx(d.operationId));let y=Object.entries({...p,...gx(d.parameters??[])}).map(([,A])=>A),b=Ba({path:c,method:f,operation:d,operationsByTag:e.operationsByTag,options:e.options}),g=e.operationNames.filter(A=>A===b).length<=1,P=si(d,e.options),$={method:f,path:OP(c),operationName:b,description:d.description,summary:d.summary,tags:(r=d.tags)==null?void 0:r.map(oi),requestFormat:"application/json",parameters:[],response:"",errors:[],responseStatusCodes:[],mediaUpload:!!d["x-media-upload"],mediaDownload:!!d["x-media-download"]};if(d.requestBody){let A=hx({resolver:e,operation:d,operationName:b,isUniqueOperationName:g,tag:P});A&&($.parameters.push(A.endpointParameter),$.requestFormat=A.requestFormat)}for(let A of y){let te=mx({resolver:e,param:A,operationName:b,isUniqueOperationName:g,tag:P});te&&$.parameters.push(te)}let C=PD($);C.forEach(A=>{$.parameters.push(A)}),C.length>0&&e.validationErrors.push(ix(C,c));for(let A in d.responses){$.responseStatusCodes.push(A);let te=e.resolveObject(d.responses[A]),ze=Object.keys(te.content??{}).find(tl),$e,G;if(ze?($.responseFormat=ze,$e=(i=(n=te.content)==null?void 0:n[ze])==null?void 0:i.schema):(G=Ts,A==="200"&&e.validationErrors.push(cx({received:"200",expected:"204"},d,$))),$e){let j=Qe({schema:$e,resolver:e,meta:{isRequired:!0},tag:P}),R=e.resolveObject($e);G=fs({schema:R,zodSchema:j,fallbackName:j.ref?void 0:al({statusCode:A,operationName:b,isUniqueOperationName:g,tag:P}),resolver:e,tag:P})+cn({schema:R,meta:j.meta,options:e.options})}if(G){let j=Number(A);Ra(j)&&!$.response?($.response=G,$.responseObject=te,$.responseDescription=te.description):A!=="default"&&el(j)&&$.errors.push({zodSchema:G,status:j,description:te.description})}}$.response||($.response=Ts);let T=Object.keys(d.responses).map(Number).filter(Ra);T.length>1&&e.validationErrors.push(ux(T.map(String),d,$)),$.acl=dx({resolver:e,endpoint:$,operation:d}),(s=d.security)!=null&&s[0].Authorization&&!$.responseStatusCodes.includes("401")&&e.validationErrors.push(Qm("401",d,$)),(a=$.acl)!=null&&a[0]&&!$.responseStatusCodes.includes("403")&&e.validationErrors.push(Qm("403",d,$)),t.push($)}}return t}o(yx,"getEndpointsFromOpenAPIDoc");function gx(e){return Object.fromEntries((e??[]).map(t=>[we(t)?t.$ref:t.name,t]))}o(gx,"getParameters");function PD(e){return[...e.path.matchAll(/:([a-zA-Z0-9_]+)/g)].map(r=>r[1]).filter(r=>e.parameters.findIndex(({name:n})=>n===r)===-1).map(r=>xD(r))}o(PD,"getMissingPathParameters");function xD(e){return{name:e,type:"Path",zodSchema:kc,parameterObject:{name:e,required:!0,in:"path",schema:{type:"string"}}}}o(xD,"getPathParameterFromName");function bx(e,t){let r=$D(e,t),n=wD(e,r);return{refsDependencyGraph:r,deepDependencyGraph:n}}o(bx,"getOpenAPISchemaDependencyGraph");function $D(e,t){let r={},n={};return e.forEach(i=>AD({schema:t(i),fromRef:i,getSchemaByRef:t,visitedRefs:r,refsDependencyGraph:n})),n}o($D,"getRefsDependencyGraph");function wD(e,t){let r={},n={},i=o((s,a)=>{n[a].add(s),t[s]&&a!==s&&t[s].forEach(c=>{let u=`${a}__${c}`;r[u]||(r[u]=!0,i(c,a))})},"visit");return e.forEach(s=>{let a=t[s];a&&(n[s]||(n[s]=new Set),a.forEach(c=>i(c,s)))}),n}o(wD,"getDeepRefsDependencyGraph");function AD({schema:e,fromRef:t,getSchemaByRef:r,visitedRefs:n={},refsDependencyGraph:i={}}){let s=o(a=>{if(a.type!=="reference"||!a.data)return;let{schema:c,data:u}=a;if(i[u.fromRef]||(i[u.fromRef]=new Set),i[u.fromRef].add(c.$ref),n[c.$ref])return!0;n[u.fromRef]=!0,jt(r(c.$ref),{data:{fromRef:c.$ref},onSchema:s})},"onSchema");return jt(e,{data:{fromRef:t},onSchema:s}),{visitedRefs:n,refsDependencyGraph:i}}o(AD,"getSchemaRefsDependencyGraph");function dl(e,t,r){let n=[];return jt(t,{onSchema:o(s=>{s.type==="reference"?n.push(s.schema):we(s.parentSchema)&&(s.type==="property"?e.validationErrors.push(Va(`${r} has both reference and properties`)):s.type==="additionalProperties"?e.validationErrors.push(Va(`${r} has both reference and additionalProperties`)):s.type==="array"?e.validationErrors.push(Va(`${r} is both reference and array schema`)):s.type==="composite"&&e.validationErrors.push(Va(`${r} has both reference and composite keyword`)))},"onSchema")}),n}o(dl,"getSchemaRefObjs");function vx(e,t){return t.map(i=>Wi(i.$ref)).reduce((i,s)=>{let a=e.dependencyGraph.deepDependencyGraph[s];return[...i,s,...Array.from(a??[])]},[])}o(vx,"getDeepSchemaRefObjs");function _x(e){e.extractedEnumZodSchemaData.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(s=>s[s.length-1]).filter(Boolean),i=Gm(n);if(!i)throw new Error(`No common last segment found for enum: ${r.code}`);r.zodSchemaName=Da(i,e.options.enumSuffix,e.options.schemaSuffix)});let t=0;for(;t<5&&!Xm(e);)ID(e,t+2),t++;if(Xm(e)||e.extractedEnumZodSchemaData.filter(n=>!Sx(e,n)).forEach(n=>{n.zodSchemaName=Da(n.meta.zodSchemaNameSegments[0].map(i=>eg(Fe(i))).join(""),e.options.enumSuffix,e.options.schemaSuffix)}),!Xm(e))throw new Error("Failed to resolve unique names for enum zod schemas")}o(_x,"resolveExtractedEnumZodSchemaNames");function Xm(e){return e.extractedEnumZodSchemaData.every(t=>Sx(e,t))}o(Xm,"allExtractedEnumZodSchemaNamesAreUnique");function ID(e,t){e.extractedEnumZodSchemaData.forEach(r=>{let n=e.extractedEnumZodSchemaData.filter(({zodSchemaName:i})=>r.zodSchemaName===i);n.length!==1&&CD(n,t)})}o(ID,"additionalResolveExtractedEnumZodSchemaName");function CD(e,t=2){e.forEach(r=>{let n=r.meta.zodSchemaNameSegments.map(i=>i[i.length-t]).filter(Boolean);if(n.length===1){let i=[eg(Fe(n[0])),r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=i}else{let i=Gm(n),s=[i?eg(Fe(i)):"",r.zodSchemaName].filter(Boolean).join("");r.zodSchemaName=s}})}o(CD,"suffixWithPreviousSegmentName");function Sx(e,t){return e.extractedEnumZodSchemaData.filter(({zodSchemaName:r})=>t.zodSchemaName===r).length===1}o(Sx,"isUnique");function eg(e){return e.replace(/(Dto|DTO|Response|Request)/g,"")}o(eg,"sanitizeName");function Ex(e){e.extractedEnumZodSchemaData.forEach(t=>{let r=Xt(t.meta.tags);t.tag=r.length===1?r[0]:e.options.defaultTag})}o(Ex,"resolveExtractedEnumZodSchemaTags");function Ga({schema:e,nameSegments:t=[],includeSelf:r,...n}){r&&Ox({schema:e,nameSegments:t,...n}),jt(e,{data:{nameSegments:t},onSchema:o(s=>{var c;if(s.type==="reference")return!0;let a=[...((c=s.data)==null?void 0:c.nameSegments)??[]];s.type==="property"&&a.push(s.propertyName),Ox({schema:s.schema,nameSegments:[...a],...n})},"onSchema")})}o(Ga,"updateExtractedEnumZodSchemaData");function Ox({resolver:e,schema:t,schemaRef:r,schemaInfo:n,tags:i,nameSegments:s=[]}){if(!t||we(t)||!t.enum)return;let a=ls(t),c=e.extractedEnumZodSchemaData.find(u=>u.code===a);c?(c.meta.zodSchemaNameSegments.push(s),c.meta.tags.push(...i),c.meta.schemaRefs.push(...r?[r]:[]),c.meta.schemas.push(...t?[t]:[])):e.extractedEnumZodSchemaData.push({code:a,meta:{zodSchemaNameSegments:[s],tags:[...i],schemaRefs:r?[r]:[],schemas:t?[t]:[]}}),e.validationErrors.push(ox(r?`${as(r)}.${s[s.length-1]}`:n??s.join(".")))}o(Ox,"handleExtractedEnumZodSchemaDataUpdate");function Px(e){var n;let t={},r={};return Object.entries(((n=e.openApiDoc.components)==null?void 0:n.schemas)??{}).forEach(([i,s])=>{let a=e.getSchemaDataByName(i);if(e.options.excludeRedundantZodSchemas&&(!a||a.deepRefOperations.length===0&&a.tags.length===0))return;let c=sn(i,e.options.schemaSuffix);if(t[c])return;let u=e.getTagByZodSchemaName(c),l=e.resolveObject(s);l.enum?r[c]=ls(l):t[c]=Qe({schema:s,resolver:e,tag:u}).getCodeString(u)}),{zodSchemas:t,enumZodSchemas:r}}o(Px,"getZodSchemasFromOpenAPIDoc");function xx(e){var r;let t=[];return Object.entries(((r=e.openApiDoc.components)==null?void 0:r.schemas)??{}).forEach(([n,i])=>{let s=sn(n,e.options.schemaSuffix),a=e.resolveObject(i);!t.find(c=>c.zodSchemaName===s)&&a.enum&&t.push({zodSchemaName:s,code:ls(a)})}),t}o(xx,"getEnumZodSchemasFromOpenAPIDoc");var tg=class tg{constructor(t,r){this.openApiDoc=t;this.options=r;this.dependencyGraph=bx(this.schemaRefs,this.getSchemaByRef.bind(this)),this.enumZodSchemas=xx(this),this.operationsByTag=rx(t,r),this.operationNames=tx(t,this.operationsByTag,r),this.initialize()}schemaData=[];zodSchemaData=[];compositeZodSchemaData=[];dependencyGraph;enumZodSchemas=[];extractedEnumZodSchemaData=[];operationsByTag={};operationNames=[];validationErrors=[];get docSchemas(){var t;return((t=this.openApiDoc.components)==null?void 0:t.schemas)??{}}get schemaRefs(){return Object.keys(this.docSchemas).map(bP)}getSchemaByRef(t){return this.docSchemas[as(t)]}getSchemaDataByName(t){return this.schemaData.find(r=>r.name===t)}getZodSchemaNameByRef(t){var n,i;let r=((n=this.getSchemaDataByRef(Wi(t)))==null?void 0:n.zodSchemaName)??((i=this.extractedEnumZodSchemaData.find(s=>s.zodSchemaName===t))==null?void 0:i.zodSchemaName);if(!r)throw new Error(`Zod schema not found for ref: ${t}`);return r}getRefByZodSchemaName(t){var r;return(r=this.schemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.ref}getTagByZodSchemaName(t){var u,l;if(!this.options.splitByTags)return this.options.defaultTag;let r=this.extractedEnumZodSchemaData.find(p=>p.zodSchemaName===t);if(r)return oi(r.tag??this.options.defaultTag);let n=this.getRefByZodSchemaName(t),i=n?((u=this.getSchemaDataByRef(n))==null?void 0:u.tags)??[]:[],s=((l=this.zodSchemaData.find(p=>p.zodSchemaName===t))==null?void 0:l.tags)??[],a=Xt(i,s),c=a.length===1?a[0]:this.options.defaultTag;return oi(c??this.options.defaultTag)}getCodeByZodSchemaName(t){var r;return(r=this.zodSchemaData.find(n=>n.zodSchemaName===t))==null?void 0:r.code}getZodSchemaNamesByCompositeCode(t){var r;return(r=this.compositeZodSchemaData.find(n=>n.code===t))==null?void 0:r.zodSchemas.map(n=>n.zodSchemaName)}setZodSchema(t,r,n){let i=this.zodSchemaData.find(s=>s.zodSchemaName===t);i?(i.code=r,i.tags=(i.tags??[]).concat(n)):this.zodSchemaData.push({zodSchemaName:t,code:r,tags:[n]})}addZodSchemaForCompositeCode(t,r,n,i){let s={zodSchemaName:n,zodSchema:r,schema:i},a=this.compositeZodSchemaData.find(c=>c.code===t);a?a.zodSchemas.push(s):this.compositeZodSchemaData.push({code:t,zodSchemas:[s]})}getCompositeZodSchemaByZodSchemaName(t){var n;let r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t));return(n=r==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.zodSchema}getSchemaByCompositeZodSchemaName(t){var r,n;return(n=(r=this.compositeZodSchemaData.find(i=>i.zodSchemas.some(s=>s.zodSchemaName===t)))==null?void 0:r.zodSchemas.find(i=>i.zodSchemaName===t))==null?void 0:n.schema}getEnumZodSchemaDataByCode(t){return this.enumZodSchemas.find(r=>r.code===t)}getExtractedEnumZodSchemaDataByCode(t){return this.extractedEnumZodSchemaData.find(r=>r.code===t)}getExtractedEnumZodSchemaNamesReferencedBySchemaRef(t){return this.extractedEnumZodSchemaData.reduce((r,{zodSchemaName:n,meta:i})=>(n&&i.schemaRefs.includes(t)&&r.push(n),r),[])}getZodSchemas(){return this.zodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>({...t,[r]:n}),{})}getExtractedEnumZodSchemas(){return this.extractedEnumZodSchemaData.reduce((t,{zodSchemaName:r,code:n})=>r?{...t,[r]:n}:t,{})}resolveObject(t){return we(t)?this.getSchemaByRef(t.$ref):t}isSchemaCircular(t){var r;return(r=this.dependencyGraph.deepDependencyGraph[t])==null?void 0:r.has(t)}getCircularSchemaChain(t,r=t,n=[],i=[]){var s,a;return i.includes(r)?[]:(i.push(r),(s=this.dependencyGraph.refsDependencyGraph[r])!=null&&s.has(t)?[...n,r,t]:Array.from(((a=this.dependencyGraph.refsDependencyGraph[r])==null?void 0:a.values())??[]).map(c=>{let u=this.getCircularSchemaChain(t,c,n,i);return u.length>0?[r,...u]:u}).flat())}getBaseUrl(){var r,n;let t=(n=(r=this.openApiDoc.servers)==null?void 0:r[0])==null?void 0:n.url;return this.options.baseUrl===""&&t?t:this.options.baseUrl}getZodSchemaObj(t){let r=this.getRefByZodSchemaName(t);if(r)return this.getSchemaByRef(r);let n=this.getSchemaByCompositeZodSchemaName(t);if(n)return n;let i=this.getExtractedEnumZodSchemaDataByName(t);if(i)return i.meta.schemas.reduce((s,a)=>({...s,...this.resolveObject(a)}),{})}getSchemaDataByRef(t){return this.schemaData.find(r=>r.ref===t)}getExtractedEnumZodSchemaDataByName(t){return this.extractedEnumZodSchemaData.find(({zodSchemaName:r})=>r===t)}initialize(){var t,r,n,i,s;this.schemaRefs.forEach(a=>{let c=Wi(a),u=as(c),l=sn(u,this.options.schemaSuffix);this.schemaData.push({ref:c,name:u,zodSchemaName:l,tags:[],deepRefOperations:[]})});for(let a in this.openApiDoc.paths){if(Yi(a,this.options))continue;let c=this.openApiDoc.paths[a],u=eo(c,Zi);for(let l in u){let p=u[l];if(!p||us(p,this.options))continue;let f=si(p,this.options),d=Ba({path:a,method:l,operation:p,operationsByTag:this.operationsByTag,options:this.options}),h=this.operationNames.filter(P=>P===d).length<=1,y=pt(Qi(d,h,f)),b=[];if((t=p.parameters)==null||t.map(P=>{let $=P,C=$.schema,T=`Operation ${p.operationId??a} parameter ${$.name}`;b.push(...dl(this,C,T)),this.options.extractEnums&&Ga({resolver:this,schema:C,schemaInfo:T,tags:[f],nameSegments:[y,$.name],includeSelf:!0})}),p.requestBody){let P=this.resolveObject(p.requestBody),C=Object.keys(P.content??{}).find(on);if(C){let T=(n=(r=P.content)==null?void 0:r[C])==null?void 0:n.schema,A=`Operation ${p.operationId} request body`;b.push(...dl(this,T,A)),this.options.extractEnums&&Ga({resolver:this,schema:T,schemaInfo:A,tags:[f],nameSegments:[sl(y)]})}}for(let P in p.responses){let $=this.resolveObject(p.responses[P]),T=Object.keys($.content??{}).find(tl);if(T){let A=(s=(i=$.content)==null?void 0:i[T])==null?void 0:s.schema,te=`Operation ${p.operationId} response body`;b.push(...dl(this,A,te)),this.options.extractEnums&&Ga({resolver:this,schema:A,schemaInfo:te,tags:[f],nameSegments:[al({statusCode:P,operationName:d,isUniqueOperationName:h,tag:f})]})}}vx(this,b).forEach(P=>{let $=this.getSchemaDataByRef(P);$&&($.tags.push(f),$.deepRefOperations.push(p))})}}this.options.extractEnums&&(this.schemaRefs.forEach(a=>{var u;let c=Wi(a);Ga({resolver:this,schema:this.getSchemaByRef(c),schemaRef:c,tags:((u=this.getSchemaDataByRef(c))==null?void 0:u.tags)??[],nameSegments:[as(c)]})}),Ex(this),this.handleDuplicateEnumZodSchemas(),_x(this))}handleDuplicateEnumZodSchemas(){let t=this.enumZodSchemas.map(({code:n})=>n),r=this.enumZodSchemas.filter(({code:n})=>t.includes(n));this.schemaData.forEach(n=>{var a,c;let i=(a=r.find(({zodSchemaName:u})=>u===n.zodSchemaName))==null?void 0:a.code;if(!i)return;let s=this.extractedEnumZodSchemaData.find(({code:u})=>u===i);!s||((c=this.getEnumZodSchemaDataByCode(s.code))==null?void 0:c.zodSchemaName)!==n.zodSchemaName||(n.tags.push(...s.meta.tags??[]),s.meta.schemaRefs.forEach(u=>{this.dependencyGraph.refsDependencyGraph[u]||(this.dependencyGraph.refsDependencyGraph[u]=new Set),this.dependencyGraph.refsDependencyGraph[u].add(n.ref),this.dependencyGraph.deepDependencyGraph[u]||(this.dependencyGraph.deepDependencyGraph[u]=new Set),this.dependencyGraph.deepDependencyGraph[u].add(n.ref)}))}),this.extractedEnumZodSchemaData.splice(0,this.extractedEnumZodSchemaData.length,...this.extractedEnumZodSchemaData.filter(({code:n})=>!t.includes(n)))}};o(tg,"SchemaResolver");var hl=tg;function $x(e){let t=[],r={};function n(i,s){Array.isArray(s)||(s=[]),s.push(i),r[i]=!0,e[i]&&e[i].forEach(a=>{s.includes(a)||r[a]||n(a,s.slice(0))}),t.includes(i)||t.push(i)}return o(n,"visit"),Object.keys(e).forEach(i=>n(i,[])),t}o($x,"topologicalSort");function wx(e,t){let r=Object.entries(e),n=r.filter(([i])=>t.includes(i)).sort(([i],[s])=>t.indexOf(i)-t.indexOf(s)).concat(r.filter(([i])=>!t.includes(i)));return Object.fromEntries(n)}o(wx,"sortObjKeysFromArray");function Ax(e,t){let r=$x(e.dependencyGraph.deepDependencyGraph).map(i=>e.getZodSchemaNameByRef(i));return wx(t,r)}o(Ax,"sortZodSchemasByTopology");function Ix(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{let s=e.getRefByZodSchemaName(n);s&&e.isSchemaCircular(s)?(e.validationErrors.push(sx(e.getCircularSchemaChain(s).join(" -> "))),r[sn(n,e.options.schemaSuffix)]=`z.lazy(() => ${i})`):r[sn(n,e.options.schemaSuffix)]=i}),r}o(Ix,"wrapCircularZodSchemas");function ml(e,t){let r=new hl(e,t),n=yx(r),i=Px(r),s={...i.zodSchemas,...r.getZodSchemas(),...i.enumZodSchemas};return s=Ix(r,s),s=Ax(r,s),s={...r.getExtractedEnumZodSchemas(),...s},{resolver:r,data:TD({resolver:r,endpoints:n,zodSchemas:s,options:t})}}o(ml,"getDataFromOpenAPIDoc");function TD({resolver:e,endpoints:t,zodSchemas:r,options:n}){let i=new Map;return n.splitByTags?(t.forEach(s=>{let a=ci(s,n);Cx(a,i).endpoints.push(s)}),Object.entries(r).forEach(([s,a])=>{let c=e.getTagByZodSchemaName(s);c&&(Cx(c,i).zodSchemas[s]=a)}),i):(i.set(n.defaultTag,{endpoints:t,zodSchemas:r}),i)}o(TD,"splitDataByTags");function Cx(e,t){return t.has(e)||t.set(e,{endpoints:[],zodSchemas:{}}),t.get(e)}o(Cx,"getTagElement");var ps=gt(require("fs")),rg=gt(require("path"));function Tx(e){return ps.default.readFileSync(rg.default.join(__dirname,`../${e}`),"utf-8")}o(Tx,"readFileSync");function ng(e){let t=`src/generators/templates/${e}.hbs`;return Tx(t)}o(ng,"readHbsTemplateSync");function Rx(e){let t=`src/assets/${e}`;return Tx(t)}o(Rx,"readAssetSync");function qr({output:e,fileName:t}){return`${e}/${t}`}o(qr,"getOutputFileName");function RD(e,t){let r=rg.default.dirname(e);ps.default.existsSync(r)||ps.default.mkdirSync(r,{recursive:!0}),ps.default.writeFileSync(e,t,"utf-8")}o(RD,"writeFileWithDirSync");function ND({fileName:e,content:t}){RD(e,t)}o(ND,"writeFileSync");function Nx(e){e.forEach(ND)}o(Nx,"writeGenerateFileData");function jx(e,t){let r={...Pe,...t},{resolver:n,data:i}=ml(e,r);if(n.validationErrors.length>0){let s=lx(n.validationErrors);Object.entries(s).forEach(([a,c])=>{console.log(`${Vr.red(`${nP[a]}:`)}
145
145
  ${c.map(u=>`- ${u}`).join(`
146
146
  `)}
147
147
  `)})}else{let s=[...i.keys()].reduce((a,c)=>[...a,...jD(c,r)],[]);console.log(`${Vr.green("Outputs:")}
148
148
  ${s.map(a=>`- ${a}`).join(`
149
149
  `)}
150
- `)}return n.validationErrors}o(jx,"checkOpenAPIDoc");function jD(e,t){return["models","endpoints","queries"].map(r=>qr({output:t.output,fileName:ll({tag:e,type:r,options:t})}))}o(jD,"getOutputFileNames");async function kx({input:e,excludeTags:t,verbose:r,...n}){let i=Date.now();r&&fr("Parsing OpenAPI spec...");let s=await Mx.default.bundle(e);r&&Rn("Parsing finished."),r&&fr("Running check...");let a=jx(s,{input:e,excludeTags:t.split(","),...n});if(r&&fr(`TIME: ${Date.now()-i}ms`),a.length===0)Rn("Check finished.");else throw new Error(`Check finished. Found ${a.length} issues.`)}o(kx,"check");var un=class un{input;splitByTags;defaultTag;excludeTags;excludePathRegex;excludeRedundantZodSchemas;verbose};o(un,"CheckOptions"),Se([Ee({envAlias:"input",demandOption:!0})],un.prototype,"input",2),Se([Ee({envAlias:"splitByTags",default:Pe.splitByTags,type:"boolean"})],un.prototype,"splitByTags",2),Se([Ee({envAlias:"defaultTag",default:Pe.defaultTag})],un.prototype,"defaultTag",2),Se([Ee({envAlias:"excludeTags",default:Pe.excludeTags.join(",")})],un.prototype,"excludeTags",2),Se([Ee({envAlias:"excludePathRegex",default:Pe.excludePathRegex})],un.prototype,"excludePathRegex",2),Se([Ee({envAlias:"excludeRedundantZodSchemas",default:Pe.excludeRedundantZodSchemas,type:"boolean"})],un.prototype,"excludeRedundantZodSchemas",2),Se([Ee({envAlias:"verbose",default:!1,type:"boolean"})],un.prototype,"verbose",2);var ig=un,qx={command:"check",describe:"Check OpenAPI spec",builder:Bc(ig),handler:o(async e=>{let t=await e;return t.verbose&&(Hc(`OpenAPI CodeGen ${Eo()}`),Ms("input",t.input)),kx(t)},"handler")};var t2=mt(Mm()),r2=require("child_process");var Yg=mt(Pn());var pn=mt(Pn());function A$(e){$8(),w8(),A8(e.options),I8(),C8(),T8(),R8(),N8(),j8()}o(A$,"registerAclHbsHelpers");function $8(){pn.default.registerHelper("abilityTypeName",wP)}o($8,"registerAbilityTypeNameHelper");function w8(){pn.default.registerHelper("abilityFunctionName",ka)}o(w8,"registerAbilityFunctionNameHelper");function A8(e){pn.default.registerHelper("importedAbilityFunctionName",t=>AP(t,e))}o(A8,"registerImportedAbilityFunctionNameHelper");function I8(){pn.default.registerHelper("ablityAction",IP)}o(I8,"registerAbilityActionHelper");function C8(){pn.default.registerHelper("ablitySubject",CP)}o(C8,"registerAbilitySubjectHelper");function T8(){pn.default.registerHelper("hasAbilityConditions",il)}o(T8,"registerHasAbilityConditionsHelper");function R8(){pn.default.registerHelper("abilityConditionsTypes",qa)}o(R8,"registerAbilityConditionsTypesHelper");function N8(){pn.default.registerHelper("abilityDescription",TP)}o(N8,"registerAbilityDescriptionHelper");function j8(){pn.default.registerHelper("tagAllAbilitiesName",ol)}o(j8,"registerTagAllAbilitiesNameHelper");var oc=mt(Pn());function I$(){M8(),k8(),q8(),D8()}o(I$,"registerCommonHbsHelpers");function M8(){oc.default.registerHelper("isEqual",(e,t)=>e===t)}o(M8,"registerIsEqualHelper");function k8(){oc.default.registerHelper("commaSeparated",e=>e.join(", "))}o(k8,"registerCommaSeparatedListHelper");function q8(){oc.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
151
- *`))}o(q8,"registerAddAsteriskAfterNewLineHelper");function D8(){oc.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(D8,"registerJsonStringifyHelper");var pi=mt(Pn());function C$(e){L8(),F8(e.options),V8(e),H8(),B8(),U8(e),G8()}o(C$,"registerEndpointsHbsHelpers");function L8(){pi.default.registerHelper("endpointName",Ha)}o(L8,"registerEndpointNameHelper");function F8(e){pi.default.registerHelper("importedEndpointName",t=>QP(t,e))}o(F8,"registerImportedEndpointNameHelper");function H8(){pi.default.registerHelper("endpointPath",JP)}o(H8,"registerEndpointPathHelper");function B8(){pi.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(B8,"registerEndpointBodyHelper");function V8(e){pi.default.registerHelper("endpointParams",(t,r)=>ni(e,t,r.hash))}o(V8,"registerEndpointParamsHelper");function U8(e){pi.default.registerHelper("endpointArgs",(t,r)=>ni(e,t,r.hash).map(n=>n.name).join(", "))}o(U8,"registerEndpointArgsHelper");function G8(){pi.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&Nt(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let f=Object.keys(e.bodyObject.content??{}).find(on);f&&(i=e.bodyObject.content[f],i.schema&&Nt(i.schema)&&(n=i.schema))}if(n){let p=La(n);t.push(...p)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(G8,"registerEndpointParamDescriptionHelper");var T$=mt(Pn());function R$(){z8()}o(R$,"registerImportsHbsHelpers");function z8(){T$.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(z8,"registerBindingsHelper");var kt=mt(Pn());function N$(e){Z8(),W8(),K8(),Y8(e),Q8(),J8(e),X8(e),eF(e),tF(e),rF(e),nF(),iF(),oF(),sF()}o(N$,"registerPartialsHbsHelpers");function Z8(){kt.default.registerHelper("genModelJsDocs",(e,t,r)=>qt("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(Z8,"registerGenerateModelJsDocsHelper");function W8(){kt.default.registerHelper("genImport",e=>qt("import")({import:e}))}o(W8,"registerImportHelper");function K8(){kt.default.registerHelper("genEndpointParams",(e,t)=>qt("endpoint-params")({endpoint:e,options:t}))}o(K8,"registerGenerateEndpointParamsHelper");function Y8(e){kt.default.registerHelper("genEndpointConfig",t=>{let r=XP(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?Kn:"":qt("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===Mc,hasFileDownload:t.mediaDownload,axiosRequestConfigName:Kn,generateParse:e.options.parseRequestParams})})}o(Y8,"registerGenerateEndpointConfigHelper");function Q8(){kt.default.registerHelper("genEndpointParamParse",(e,t)=>{var r;return qt("endpoint-param-parse")({param:e,paramName:t,isQuery:e.type==="Query",zodExtended:Br.name,sortingString:Br.properties.sortingString,parse:Br.properties.parse,addOptional:!((r=e.parameterObject??e.bodyObject)!=null&&r.required)&&(e.parameterSortingEnumSchemaName||wt(e.zodSchema))})})}o(Q8,"registerGenerateEndpointParamParseHelper");function J8(e){kt.default.registerHelper("genQueryKeys",t=>t.length===0?"":qt("query-keys")({queryEndpoints:t,queriesModuleName:Aa,generateInfiniteQueries:e.options.infiniteQueries}))}o(J8,"registerGenerateQueryKeysHelper");function X8(e){kt.default.registerHelper("genQuery",t=>{if(!Jt(t))return;let r=e.options.axiosRequestConfig,n=e.options.checkAcl&&t.acl;return qt("query-use-query")({endpoint:t,queryHook:kr.query,hasQueryFn:ni(e,t).length>0||r||n,hasQueryFnBody:n,hasAxiosRequestConfig:r,axiosRequestConfigName:Kn,axiosRequestConfigType:en,hasAclCheck:n,aclCheckHook:ai})})}o(X8,"registerGenerateQueryHelper");function eF(e){kt.default.registerHelper("genMutation",(t,r)=>{if(!ii(t))return;let n=ex(t,r),i=xP(e,t,n),s=e.options.checkAcl&&t.acl;return qt("query-use-mutation")({endpoint:t,queryHook:kr.mutation,queriesModuleName:Aa,hasAxiosRequestConfig:e.options.axiosRequestConfig,hasMutationFnBody:t.mediaUpload||s,axiosRequestConfigName:Kn,axiosRequestConfigType:en,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:bo.optionsType,updateQueryEndpoints:n,destructuredVariables:i,hasAclCheck:s,aclCheckHook:ai})})}o(eF,"registerGenerateMutationHelper");function tF(e){kt.default.registerHelper("genInfiniteQuery",t=>{if(!e.options.infiniteQueries||!cs(t))return;let r=e.options.checkAcl&&t.acl;return qt("query-use-infinite-query")({endpoint:t,infiniteQueryHook:kr.infiniteQuery,hasQueryFnBody:r,pageParamName:Wu.pageParamName,totalItemsName:Wu.totalItemsName,limitParamName:Wu.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:Kn,axiosRequestConfigType:en,hasAclCheck:r,aclCheckHook:ai})})}o(tF,"registerGenerateInfiniteQueryHelper");function rF(e){kt.default.registerHelper("genQueryJsDocs",(t,r)=>qt("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:bo.optionsType}))}o(rF,"registerGenerateQueryJsDocsHelper");function nF(){kt.default.registerHelper("genCaslAbilityType",e=>qt("casl-ability-type")({endpoint:e,abilityTupleType:bt.abilityTuple}))}o(nF,"registerGenerateCaslAbilityTypeHelper");function iF(){kt.default.registerHelper("genCaslAbilityFunction",e=>qt("casl-ability-function")({endpoint:e}))}o(iF,"registerGenerateCaslAbilityFunctionHelper");function oF(){kt.default.registerHelper("genCaslAbilityQuery",e=>qt("casl-ability-query")({endpoint:e}))}o(oF,"registerGenerateCaslAbilityQueryHelper");function sF(){kt.default.registerHelper("genAclCheckCall",e=>{var i;let t=(i=qa(e))==null?void 0:i.map(s=>s.name),r=e.parameters.map(s=>s.name),n=t==null?void 0:t.every(s=>r.includes(s));return qt("acl-check-call")({endpoint:e,generateAclCheckParams:il(e)&&n})})}o(sF,"registerGenerateAclCheckCallHelper");var Es=mt(Pn());var j$=o((e,t)=>{let r=Jt(e)&&ii(e)&&t;return`use${Fe(pt(e.operationName))}${r?"Mutation":""}`},"getQueryName"),M$=o(e=>`use${Fe(pt(e.operationName))}Infinite`,"getInfiniteQueryName");function k$(){aF(),uF(),lF(),cF(),fF()}o(k$,"registerQueryHbsHelpers");function aF(){Es.default.registerHelper("queryName",(e,t)=>j$(e,t.hash.mutation))}o(aF,"registerQueryNameHelper");function cF(){Es.default.registerHelper("infiniteQueryName",M$)}o(cF,"registerInfiniteQueryNameHelper");function uF(){Es.default.registerHelper("isQuery",Jt)}o(uF,"registerIsQueryHelper");function lF(){Es.default.registerHelper("isMutation",ii)}o(lF,"registerIsMutationHelper");function fF(){Es.default.registerHelper("isInfiniteQuery",e=>cs(e))}o(fF,"registerIsInfiniteQueryHelper");var co=mt(Pn());function q$(e){pF(e.options),dF(e),hF(e),mF(),gF(),yF(e)}o(q$,"registerZodHbsHelpers");function pF(e){co.default.registerHelper("zodInferedType",t=>Fa(t,e))}o(pF,"registerInferedTypeHelper");function dF(e){co.default.registerHelper("importedZodSchemaName",t=>jP(e,t))}o(dF,"registerImportedZodSchemaNameHelper");function hF(e){co.default.registerHelper("importedZodSchemaInferedType",t=>Ji(e,t))}o(hF,"registerImportedZodSchemaInferedTypeHelper");function mF(){co.default.registerHelper("zodSchemaType",e=>MP(e))}o(mF,"registerZodSchemaTypeHelper");function gF(){co.default.registerHelper("zodSchemaDescription",e=>kP(e))}o(gF,"registerZodSchemaDescriptionHelper");function yF(e){co.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>DP(e,t,r))}o(yF,"registerZodSchemaPropertyDescriptionsHelper");function _t(e,t){let r=ng(t);return I$(),R$(),q$(e),C$(e),k$(),A$(e),N$(e),Yg.default.compile(r)}o(_t,"getHbsTemplateDelegate");function qt(e){let t=ng(`partials/${e}`);return Yg.default.compile(t)}o(qt,"getHbsPartialTemplateDelegate");function D$({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:p})=>p&&p.length>0);if(!n||n.length===0)return;let i=n.some(({acl:p})=>(p==null?void 0:p[0].conditions)&&Object.keys(p[0].conditions).length>0),s={bindings:[bt.abilityTuple,...i?[bt.forcedSubject,bt.subject]:[]],from:Ma.from},a=n.reduce((p,f)=>{var h,y;let d=(y=(h=f.acl)==null?void 0:h[0].conditionsTypes)==null?void 0:y.reduce((b,g)=>[...b,...g!=null&&g.zodSchemaName?[g.zodSchemaName]:[]],[]);return[...p,...d??[]]},[]),c=ui({resolver:e,tag:r,zodSchemasAsTypes:Xt(a)});return _t(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:He({type:"acl",tag:r,options:e.options}),endpoints:n})}o(D$,"generateAcl");function L$(e,t){let r={bindings:[bt.pureAbility,...t.length===0?[bt.subject,bt.abilityTuple]:[]],from:Ma.from},n=HP({tags:t,entityName:Na,getAliasEntityName:ol,type:"acl",options:e.options}),i=t.map(a=>He({type:"acl",tag:a,options:e.options}));return _t(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:Na,appAbilities:ja,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i,abilityTuple:bt.abilityTuple,subject:bt.subject})}o(L$,"generateAppAcl");function F$({resolver:e,data:t,tag:r=""}){var $;let n=($=t.get(r))==null?void 0:$.endpoints;if(!n||n.length===0)return;let i={bindings:[Cs],from:VP(e.options)},s=e.options.axiosRequestConfig,a=s,c={bindings:s?[en]:[],from:Yu.from},u=e.options.parseRequestParams,l=n.reduce((C,T)=>[...C,...T.parameters],[]),p=l.filter(C=>!["Path","Header"].includes(C.type)).map(C=>C.parameterSortingEnumSchemaName??C.zodSchema),f=n.map(C=>C.response),d=Xt([...f,...u?p:[]]),h=d.some(C=>!wt(C)),y=e.options.parseRequestParams&&p.length>0,b={bindings:[Br.name],from:WP(e.options)},g=ui({resolver:e,tag:r,zodSchemas:d.filter(wt),zodSchemasAsTypes:Xt(l.map(C=>C.zodSchema).filter(wt))});return _t(e,"endpoints")({appRestClientImport:i,hasAxiosImport:a,axiosImport:c,hasZodImport:h,zodImport:vo,hasZodExtendedImport:y,zodExtendedImport:b,modelsImports:g,includeNamespace:e.options.tsNamespaces,namespace:He({type:"endpoints",tag:r,options:e.options}),restClientName:Cs,hasAxiosRequestConfig:s,axiosRequestConfigName:Kn,axiosRequestConfigType:en,endpoints:n,generateParse:u})}o(F$,"generateEndpoints");function H$(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(B$(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(H$,"getZodSchemaRefs");function B$(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&B$(n).forEach(s=>r.add(s)),r},new Set)}o(B$,"getSchemaRefs");function V$({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,p)=>[...l,...H$(e,p)],[]).filter(l=>!n[l]),s=ui({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[p,f])=>{let d=e.getRefByZodSchemaName(p);return{...l,[p]:{code:f,isCircular:!!d&&e.isSchemaCircular(d),isEnum:RP(f),schemaObj:e.getZodSchemaObj(p)}}},{});return _t(e,"models")({zodImport:vo,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:He({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(V$,"generateModels");function U$({resolver:e,data:t,tag:r=""}){var $e;let n=($e=t.get(r))==null?void 0:$e.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:G})=>G),a=i||s,c={defaultImport:s?qm:void 0,bindings:i?[en]:[],from:Yu.from},u=n.filter(Jt),l=u.filter(G=>cs(G)),p=n.filter(ii),f={bindings:[...u.length>0?[kr.query]:[],...e.options.infiniteQueries&&l.length>0?[kr.infiniteQuery]:[],...p.length>0?[kr.mutation]:[]],from:iP.from},d=e.options.mutationEffects,h={bindings:[Lf],from:GP(e.options)},y=d&&p.length>0,b={bindings:[...p.length>0?[bo.optionsType,bo.hookName]:[]],from:zP(e.options)},g=n.filter(G=>G.acl),P=e.options.checkAcl&&g.length>0,$={bindings:[ai],from:ZP(e.options)},C={bindings:[...u.length>0?[Ac.query]:[],...e.options.infiniteQueries&&l.length>0?[Ac.infiniteQuery]:[],...p.length>0?[Ac.mutation]:[]],from:UP(e.options)},T=n.reduce((G,j)=>[...G,...j.parameters],[]),A=ui({resolver:e,tag:r,zodSchemasAsTypes:Xt(T.map(G=>G.zodSchema).filter(wt))}),te=LP({tag:r,endpoints:n,options:e.options}),X=FP({tag:r,endpoints:g,options:e.options});return _t(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:f,hasMutationEffects:d,queryModulesImport:h,hasMutationEffectsImport:y,mutationEffectsImport:b,hasAclCheck:P,aclCheckImport:$,queryTypesImport:C,modelsImports:A,endpointsImports:te,aclImports:X,includeNamespace:e.options.tsNamespaces,tag:r,namespace:He({type:"queries",tag:r,options:e.options}),queriesModuleName:Aa,queryModuleEnum:Lf,endpoints:n,queryEndpoints:u})}o(U$,"generateQueries");function G$(e){return _t(e,"acl-check")({abilityContextImport:{...ib,from:e.options.abilityContextImportPath},caslAbilityTupleImport:{...Ma,bindings:[bt.abilityTuple]},appAbilitiesImport:{bindings:[ja],from:KP(e.options)},errorHandlingImport:{...Ic,from:e.options.errorHandlingImportPath},abilityContext:Df,appAbilities:ja,errorHandler:Tn.ErrorHandler,sharedErrorHandler:Tn.SharedErrorHandler,aclCheckHook:ai})}o(G$,"generateAclCheck");function z$(e){return _t(e,"app-rest-client")({appRestClientName:Cs,baseUrl:e.getBaseUrl()})}o(z$,"generateAppRestClient");function Z$({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:He({type:"queries",tag:s,options:e.options})})}),_t(e,"query-modules")({modules:r})}o(Z$,"generateQueryModules");function W$(e){return _t(e,"zod")({zodImport:vo,zodExtension:Br.name,sortingString:Br.properties.sortingString,parse:Br.properties.parse,errorHandler:Tn.ErrorHandler,sharedErrorHandler:Tn.SharedErrorHandler,errorHandlingImport:{...Ic,from:e.options.errorHandlingImportPath}})}o(W$,"generateZod");function K$(e,t){return t.options.acl?[{fileName:qr({output:t.options.output,fileName:Xi(rl)}),content:L$(t,e)},...t.options.checkAcl?[{fileName:qr({output:t.options.output,fileName:Xi(nl)}),content:G$(t)}]:[]]:[]}o(K$,"getAclFiles");function Y$(e,t){return t.options.mutationEffects?[...X$([ob,Nc],t),{fileName:qr({output:t.options.output,fileName:Xi(Rc)}),content:Z$({resolver:t,data:e})}]:[]}o(Y$,"getMutationEffectsFiles");function Q$(e){return e.options.standalone?[...X$(Object.values(Cc),e),{fileName:qr({output:e.options.output,fileName:Xi(Tc)}),content:z$(e)}]:[]}o(Q$,"getStandaloneFiles");function J$(e,t){return t.options.parseRequestParams?[{fileName:qr({output:t.options.output,fileName:Xi(jc)}),content:W$(t)}]:[]}o(J$,"getZodExtendedFiles");function X$(e,t){return e.reduce((r,n)=>[...r,bF(n,t)],[])}o(X$,"getAssetFiles");function bF(e,t){let r=Xi(e);return{fileName:qr({output:t.options.output,fileName:r}),content:Rx(r)}}o(bF,"getAssetFile");function e2(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...Pe,...t,importPath:r},{resolver:i,data:s}=ml(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:V$,endpoints:F$,queries:U$,acl:D$};return s.forEach((p,f)=>{u.forEach(d=>{let h=l[d]({resolver:i,data:s,tag:f});if(h){let y=qr({output:n.output,fileName:ll({tag:f,type:d,options:n})});a.push({fileName:y,content:h}),d==="acl"&&c.push(f)}})}),a.push(...K$(c,i),...Y$(s,i),...J$(s,i),...Q$(i)),a}o(e2,"generateCodeFromOpenAPIDoc");async function n2({input:e,excludeTags:t,monorepo:r,prettier:n,verbose:i,...s}){let a=Date.now();i&&fr("Parsing OpenAPI spec...");let c=await t2.default.bundle(e);i&&Rn("Parsing finished."),i&&fr("Generating code...");let u=r?"monorepoTemplate":"template",l=e2(c,{input:e,excludeTags:t.split(","),restClientImportPath:ur.appRestClient[u],errorHandlingImportPath:ur.errorHandling[u],queryTypesImportPath:ur.queryTypes[u],abilityContextImportPath:ur.abilityContext[u],...s});i&&Rn("Generation finished."),i&&fr("Writing files..."),Nx(l),i&&Rn("Writing finished."),n&&vF({output:s.output,verbose:i}),i&&fr(`TIME: ${Date.now()-a}ms`)}o(n2,"generate");function vF({output:e,verbose:t}){t&&fr("Running Prettier..."),(0,r2.exec)(`prettier --write ${e} `,n=>{t&&(n?ks(n,"Prettier error"):Rn("Prettier finished."))})}o(vF,"execPrettier");var Ce=class Ce{input;output;tsNamespaces;splitByTags;defaultTag;excludeTags;excludePathRegex;excludeRedundantZodSchemas;importPath;extractEnums;removeOperationPrefixEndingWith;acl;checkAcl;standalone;baseUrl;branded;replaceOptionalWithNullish;infiniteQueries;mutationEffects;parseRequestParams;axiosRequestConfig;monorepo;prettier;verbose};o(Ce,"GenerateOptions"),Se([Ee({envAlias:"input",demandOption:!0})],Ce.prototype,"input",2),Se([Ee({envAlias:"output",default:Pe.output})],Ce.prototype,"output",2),Se([Ee({envAlias:"tsNamespaces",default:Pe.tsNamespaces,type:"boolean"})],Ce.prototype,"tsNamespaces",2),Se([Ee({envAlias:"splitByTags",default:Pe.splitByTags,type:"boolean"})],Ce.prototype,"splitByTags",2),Se([Ee({envAlias:"defaultTag",default:Pe.defaultTag})],Ce.prototype,"defaultTag",2),Se([Ee({envAlias:"excludeTags",default:Pe.excludeTags.join(",")})],Ce.prototype,"excludeTags",2),Se([Ee({envAlias:"excludePathRegex",default:Pe.excludePathRegex})],Ce.prototype,"excludePathRegex",2),Se([Ee({envAlias:"excludeRedundantZodSchemas",default:Pe.excludeRedundantZodSchemas,type:"boolean"})],Ce.prototype,"excludeRedundantZodSchemas",2),Se([Ee({envAlias:"importPath",default:Pe.importPath})],Ce.prototype,"importPath",2),Se([Ee({envAlias:"extractEnums",default:Pe.extractEnums,type:"boolean"})],Ce.prototype,"extractEnums",2),Se([Ee({envAlias:"removeOperationPrefixEndingWith",default:Pe.removeOperationPrefixEndingWith})],Ce.prototype,"removeOperationPrefixEndingWith",2),Se([Ee({envAlias:"acl",default:Pe.acl,type:"boolean"})],Ce.prototype,"acl",2),Se([Ee({envAlias:"checkAcl",default:Pe.checkAcl,type:"boolean"})],Ce.prototype,"checkAcl",2),Se([Ee({envAlias:"standalone",default:Pe.standalone,type:"boolean"})],Ce.prototype,"standalone",2),Se([Ee({envAlias:"baseUrl",default:Pe.baseUrl})],Ce.prototype,"baseUrl",2),Se([Ee({envAlias:"branded",default:Pe.branded,type:"boolean"})],Ce.prototype,"branded",2),Se([Ee({envAlias:"replaceOptionalWithNullish",default:Pe.replaceOptionalWithNullish,type:"boolean"})],Ce.prototype,"replaceOptionalWithNullish",2),Se([Ee({envAlias:"infiniteQueries",default:Pe.infiniteQueries,type:"boolean"})],Ce.prototype,"infiniteQueries",2),Se([Ee({envAlias:"mutationEffects",default:Pe.mutationEffects,type:"boolean"})],Ce.prototype,"mutationEffects",2),Se([Ee({envAlias:"parseRequestParams",default:Pe.parseRequestParams,type:"boolean"})],Ce.prototype,"parseRequestParams",2),Se([Ee({envAlias:"axiosRequestConfig",default:Pe.axiosRequestConfig,type:"boolean"})],Ce.prototype,"axiosRequestConfig",2),Se([Ee({envAlias:"monorepo",default:!1,type:"boolean"})],Ce.prototype,"monorepo",2),Se([Ee({envAlias:"prettier",default:!0,type:"boolean"})],Ce.prototype,"prettier",2),Se([Ee({envAlias:"verbose",default:!1,type:"boolean"})],Ce.prototype,"verbose",2);var Qg=Ce,i2={command:"generate",describe:"Generate code from OpenAPI spec",builder:Bc(Qg),handler:o(async e=>{let t=await e;return t.verbose&&(Hc(`OpenAPI CodeGen ${Eo()}`),Ms("input",t.input),Ms("output",t.output)),n2(t)},"handler")};nb(ff(process.argv)).version(Eo()||"unknown").scriptName("openapi-codegen").command(i2).command(qx).help().demandCommand(1).strictCommands(!0).showHelpOnFail(!0).fail((e,t)=>{e&&ks(e),t&&ks(t),fr("Use '--help' for more info"),process.exit(1)}).parse();
150
+ `)}return n.validationErrors}o(jx,"checkOpenAPIDoc");function jD(e,t){return["models","endpoints","queries"].map(r=>qr({output:t.output,fileName:ll({tag:e,type:r,options:t})}))}o(jD,"getOutputFileNames");async function kx({input:e,excludeTags:t,verbose:r,...n}){let i=Date.now();r&&fr("Parsing OpenAPI spec...");let s=await Mx.default.bundle(e);r&&Rn("Parsing finished."),r&&fr("Running check...");let a=jx(s,{input:e,excludeTags:t.split(","),...n});if(r&&fr(`TIME: ${Date.now()-i}ms`),a.length===0)Rn("Check finished.");else throw new Error(`Check finished. Found ${a.length} issues.`)}o(kx,"check");var un=class un{input;splitByTags;defaultTag;excludeTags;excludePathRegex;excludeRedundantZodSchemas;verbose};o(un,"CheckOptions"),Se([Ee({envAlias:"input",demandOption:!0})],un.prototype,"input",2),Se([Ee({envAlias:"splitByTags",default:Pe.splitByTags,type:"boolean"})],un.prototype,"splitByTags",2),Se([Ee({envAlias:"defaultTag",default:Pe.defaultTag})],un.prototype,"defaultTag",2),Se([Ee({envAlias:"excludeTags",default:Pe.excludeTags.join(",")})],un.prototype,"excludeTags",2),Se([Ee({envAlias:"excludePathRegex",default:Pe.excludePathRegex})],un.prototype,"excludePathRegex",2),Se([Ee({envAlias:"excludeRedundantZodSchemas",default:Pe.excludeRedundantZodSchemas,type:"boolean"})],un.prototype,"excludeRedundantZodSchemas",2),Se([Ee({envAlias:"verbose",default:!1,type:"boolean"})],un.prototype,"verbose",2);var ig=un,qx={command:"check",describe:"Check OpenAPI spec",builder:Bc(ig),handler:o(async e=>{let t=await e;return t.verbose&&(Hc(`OpenAPI CodeGen ${Eo()}`),Ms("input",t.input)),kx(t)},"handler")};var t2=gt(Mm()),r2=require("child_process");var Yg=gt(Pn());var pn=gt(Pn());function A$(e){$8(),w8(),A8(e.options),I8(),C8(),T8(),R8(),N8(),j8()}o(A$,"registerAclHbsHelpers");function $8(){pn.default.registerHelper("abilityTypeName",wP)}o($8,"registerAbilityTypeNameHelper");function w8(){pn.default.registerHelper("abilityFunctionName",ka)}o(w8,"registerAbilityFunctionNameHelper");function A8(e){pn.default.registerHelper("importedAbilityFunctionName",t=>AP(t,e))}o(A8,"registerImportedAbilityFunctionNameHelper");function I8(){pn.default.registerHelper("ablityAction",IP)}o(I8,"registerAbilityActionHelper");function C8(){pn.default.registerHelper("ablitySubject",CP)}o(C8,"registerAbilitySubjectHelper");function T8(){pn.default.registerHelper("hasAbilityConditions",il)}o(T8,"registerHasAbilityConditionsHelper");function R8(){pn.default.registerHelper("abilityConditionsTypes",qa)}o(R8,"registerAbilityConditionsTypesHelper");function N8(){pn.default.registerHelper("abilityDescription",TP)}o(N8,"registerAbilityDescriptionHelper");function j8(){pn.default.registerHelper("tagAllAbilitiesName",ol)}o(j8,"registerTagAllAbilitiesNameHelper");var oc=gt(Pn());function I$(){M8(),k8(),q8(),D8()}o(I$,"registerCommonHbsHelpers");function M8(){oc.default.registerHelper("isEqual",(e,t)=>e===t)}o(M8,"registerIsEqualHelper");function k8(){oc.default.registerHelper("commaSeparated",e=>e.join(", "))}o(k8,"registerCommaSeparatedListHelper");function q8(){oc.default.registerHelper("addAsteriskAfterNewLine",e=>e.replace(/\n/g,`
151
+ *`))}o(q8,"registerAddAsteriskAfterNewLineHelper");function D8(){oc.default.registerHelper("jsonStringify",e=>JSON.stringify(e,null,2))}o(D8,"registerJsonStringifyHelper");var pi=gt(Pn());function C$(e){L8(),F8(e.options),V8(e),H8(),B8(),U8(e),G8()}o(C$,"registerEndpointsHbsHelpers");function L8(){pi.default.registerHelper("endpointName",Ha)}o(L8,"registerEndpointNameHelper");function F8(e){pi.default.registerHelper("importedEndpointName",t=>QP(t,e))}o(F8,"registerImportedEndpointNameHelper");function H8(){pi.default.registerHelper("endpointPath",JP)}o(H8,"registerEndpointPathHelper");function B8(){pi.default.registerHelper("endpointBody",e=>e.parameters.find(t=>t.type==="Body"))}o(B8,"registerEndpointBodyHelper");function V8(e){pi.default.registerHelper("endpointParams",(t,r)=>ni(e,t,r.hash))}o(V8,"registerEndpointParamsHelper");function U8(e){pi.default.registerHelper("endpointArgs",(t,r)=>ni(e,t,r.hash).map(n=>n.name).join(", "))}o(U8,"registerEndpointArgsHelper");function G8(){pi.default.registerHelper("endpointParamDescription",e=>{var s,a,c,u,l;let t=[`${e.paramType} parameter`],r=((s=e.parameterObject)==null?void 0:s.description)||((a=e.bodyObject)==null?void 0:a.description);r&&t.push(r);let n,i;if((c=e.parameterObject)!=null&&c.schema&&Nt(e.parameterObject.schema)&&(n=(u=e.parameterObject)==null?void 0:u.schema),(l=e.bodyObject)!=null&&l.content){let f=Object.keys(e.bodyObject.content??{}).find(on);f&&(i=e.bodyObject.content[f],i.schema&&Nt(i.schema)&&(n=i.schema))}if(n){let p=La(n);t.push(...p)}return i!=null&&i.example&&t.push(`Example: \`${i.example}\``),t.join(". ")})}o(G8,"registerEndpointParamDescriptionHelper");var T$=gt(Pn());function R$(){z8()}o(R$,"registerImportsHbsHelpers");function z8(){T$.default.registerHelper("importNames",(e,t)=>[...t?[t]:[],...e?[`{ ${e.join(", ")} }`]:[]].join(", "))}o(z8,"registerBindingsHelper");var kt=gt(Pn());function N$(e){Z8(),W8(),K8(),Y8(e),Q8(),J8(e),X8(e),eF(e),tF(e),rF(e),nF(),iF(),oF(),sF()}o(N$,"registerPartialsHbsHelpers");function Z8(){kt.default.registerHelper("genModelJsDocs",(e,t,r)=>qt("model-js-docs")({name:e,zodSchema:t,tag:r}))}o(Z8,"registerGenerateModelJsDocsHelper");function W8(){kt.default.registerHelper("genImport",e=>qt("import")({import:e}))}o(W8,"registerImportHelper");function K8(){kt.default.registerHelper("genEndpointParams",(e,t)=>qt("endpoint-params")({endpoint:e,options:t}))}o(K8,"registerGenerateEndpointParamsHelper");function Y8(e){kt.default.registerHelper("genEndpointConfig",t=>{let r=XP(t),n=e.options.axiosRequestConfig;return Object.keys(r).length===0?n?Kn:"":qt("endpoint-config")({endpointConfig:r,hasAxiosRequestConfig:n,hasBlobResponse:t.response===Mc,hasFileDownload:t.mediaDownload,axiosRequestConfigName:Kn,generateParse:e.options.parseRequestParams})})}o(Y8,"registerGenerateEndpointConfigHelper");function Q8(){kt.default.registerHelper("genEndpointParamParse",(e,t)=>{var r;return qt("endpoint-param-parse")({param:e,paramName:t,isQuery:e.type==="Query",zodExtended:Br.name,sortingString:Br.properties.sortingString,parse:Br.properties.parse,addOptional:!((r=e.parameterObject??e.bodyObject)!=null&&r.required)&&(e.parameterSortingEnumSchemaName||wt(e.zodSchema))})})}o(Q8,"registerGenerateEndpointParamParseHelper");function J8(e){kt.default.registerHelper("genQueryKeys",t=>t.length===0?"":qt("query-keys")({queryEndpoints:t,queriesModuleName:Aa,generateInfiniteQueries:e.options.infiniteQueries}))}o(J8,"registerGenerateQueryKeysHelper");function X8(e){kt.default.registerHelper("genQuery",t=>{if(!Jt(t))return;let r=e.options.axiosRequestConfig,n=e.options.checkAcl&&t.acl;return qt("query-use-query")({endpoint:t,queryHook:kr.query,hasQueryFn:ni(e,t).length>0||r||n,hasQueryFnBody:n,hasAxiosRequestConfig:r,axiosRequestConfigName:Kn,axiosRequestConfigType:en,hasAclCheck:n,aclCheckHook:ai})})}o(X8,"registerGenerateQueryHelper");function eF(e){kt.default.registerHelper("genMutation",(t,r)=>{if(!ii(t))return;let n=ex(t,r),i=xP(e,t,n),s=e.options.checkAcl&&t.acl;return qt("query-use-mutation")({endpoint:t,queryHook:kr.mutation,queriesModuleName:Aa,hasAxiosRequestConfig:e.options.axiosRequestConfig,hasMutationFnBody:t.mediaUpload||s,axiosRequestConfigName:Kn,axiosRequestConfigType:en,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:bo.optionsType,updateQueryEndpoints:n,destructuredVariables:i,hasAclCheck:s,aclCheckHook:ai})})}o(eF,"registerGenerateMutationHelper");function tF(e){kt.default.registerHelper("genInfiniteQuery",t=>{if(!e.options.infiniteQueries||!cs(t))return;let r=e.options.checkAcl&&t.acl;return qt("query-use-infinite-query")({endpoint:t,infiniteQueryHook:kr.infiniteQuery,hasQueryFnBody:r,pageParamName:Wu.pageParamName,totalItemsName:Wu.totalItemsName,limitParamName:Wu.limitParamName,hasAxiosRequestConfig:e.options.axiosRequestConfig,axiosRequestConfigName:Kn,axiosRequestConfigType:en,hasAclCheck:r,aclCheckHook:ai})})}o(tF,"registerGenerateInfiniteQueryHelper");function rF(e){kt.default.registerHelper("genQueryJsDocs",(t,r)=>qt("query-js-docs")({endpoint:t,query:r.hash.query,mutation:r.hash.mutation,infiniteQuery:r.hash.infiniteQuery,hasMutationEffects:e.options.mutationEffects,mutationEffectsType:bo.optionsType}))}o(rF,"registerGenerateQueryJsDocsHelper");function nF(){kt.default.registerHelper("genCaslAbilityType",e=>qt("casl-ability-type")({endpoint:e,abilityTupleType:dt.abilityTuple}))}o(nF,"registerGenerateCaslAbilityTypeHelper");function iF(){kt.default.registerHelper("genCaslAbilityFunction",e=>qt("casl-ability-function")({endpoint:e}))}o(iF,"registerGenerateCaslAbilityFunctionHelper");function oF(){kt.default.registerHelper("genCaslAbilityQuery",e=>qt("casl-ability-query")({endpoint:e}))}o(oF,"registerGenerateCaslAbilityQueryHelper");function sF(){kt.default.registerHelper("genAclCheckCall",e=>{var i;let t=(i=qa(e))==null?void 0:i.map(s=>s.name),r=e.parameters.map(s=>s.name),n=t==null?void 0:t.every(s=>r.includes(s));return qt("acl-check-call")({endpoint:e,generateAclCheckParams:il(e)&&n})})}o(sF,"registerGenerateAclCheckCallHelper");var Es=gt(Pn());var j$=o((e,t)=>{let r=Jt(e)&&ii(e)&&t;return`use${Fe(pt(e.operationName))}${r?"Mutation":""}`},"getQueryName"),M$=o(e=>`use${Fe(pt(e.operationName))}Infinite`,"getInfiniteQueryName");function k$(){aF(),uF(),lF(),cF(),fF()}o(k$,"registerQueryHbsHelpers");function aF(){Es.default.registerHelper("queryName",(e,t)=>j$(e,t.hash.mutation))}o(aF,"registerQueryNameHelper");function cF(){Es.default.registerHelper("infiniteQueryName",M$)}o(cF,"registerInfiniteQueryNameHelper");function uF(){Es.default.registerHelper("isQuery",Jt)}o(uF,"registerIsQueryHelper");function lF(){Es.default.registerHelper("isMutation",ii)}o(lF,"registerIsMutationHelper");function fF(){Es.default.registerHelper("isInfiniteQuery",e=>cs(e))}o(fF,"registerIsInfiniteQueryHelper");var co=gt(Pn());function q$(e){pF(e.options),dF(e),hF(e),mF(),gF(),yF(e)}o(q$,"registerZodHbsHelpers");function pF(e){co.default.registerHelper("zodInferedType",t=>Fa(t,e))}o(pF,"registerInferedTypeHelper");function dF(e){co.default.registerHelper("importedZodSchemaName",t=>jP(e,t))}o(dF,"registerImportedZodSchemaNameHelper");function hF(e){co.default.registerHelper("importedZodSchemaInferedType",t=>Ji(e,t))}o(hF,"registerImportedZodSchemaInferedTypeHelper");function mF(){co.default.registerHelper("zodSchemaType",e=>MP(e))}o(mF,"registerZodSchemaTypeHelper");function gF(){co.default.registerHelper("zodSchemaDescription",e=>kP(e))}o(gF,"registerZodSchemaDescriptionHelper");function yF(e){co.default.registerHelper("zodSchemaPropertyDescriptions",(t,r)=>DP(e,t,r))}o(yF,"registerZodSchemaPropertyDescriptionsHelper");function _t(e,t){let r=ng(t);return I$(),R$(),q$(e),C$(e),k$(),A$(e),N$(e),Yg.default.compile(r)}o(_t,"getHbsTemplateDelegate");function qt(e){let t=ng(`partials/${e}`);return Yg.default.compile(t)}o(qt,"getHbsPartialTemplateDelegate");function D$({resolver:e,data:t,tag:r=""}){var l;let n=(l=t.get(r))==null?void 0:l.endpoints.filter(({acl:p})=>p&&p.length>0);if(!n||n.length===0)return;let i=n.some(({acl:p})=>(p==null?void 0:p[0].conditions)&&Object.keys(p[0].conditions).length>0),s={bindings:[dt.abilityTuple,...i?[dt.forcedSubject,dt.subject]:[]],from:Ma.from},a=n.reduce((p,f)=>{var h,y;let d=(y=(h=f.acl)==null?void 0:h[0].conditionsTypes)==null?void 0:y.reduce((b,g)=>[...b,...g!=null&&g.zodSchemaName?[g.zodSchemaName]:[]],[]);return[...p,...d??[]]},[]),c=ui({resolver:e,tag:r,zodSchemasAsTypes:Xt(a)});return _t(e,"acl")({caslAbilityTupleImport:s,modelsImports:c,includeNamespace:e.options.tsNamespaces,namespace:He({type:"acl",tag:r,options:e.options}),endpoints:n})}o(D$,"generateAcl");function L$(e,t){let r={bindings:[dt.pureAbility,...t.length===0?[dt.subjectType,dt.abilityTuple]:[]],from:Ma.from},n=HP({tags:t,entityName:Na,getAliasEntityName:ol,type:"acl",options:e.options}),i=t.map(a=>He({type:"acl",tag:a,options:e.options}));return _t(e,"app-acl")({caslAbilityTupleImport:r,imports:n,allAbilities:Na,appAbilities:ja,includeNamespace:e.options.tsNamespaces,tags:t,namespaces:i,abilityTuple:dt.abilityTuple,subjectType:dt.subjectType})}o(L$,"generateAppAcl");function F$({resolver:e,data:t,tag:r=""}){var $;let n=($=t.get(r))==null?void 0:$.endpoints;if(!n||n.length===0)return;let i={bindings:[Cs],from:VP(e.options)},s=e.options.axiosRequestConfig,a=s,c={bindings:s?[en]:[],from:Yu.from},u=e.options.parseRequestParams,l=n.reduce((C,T)=>[...C,...T.parameters],[]),p=l.filter(C=>!["Path","Header"].includes(C.type)).map(C=>C.parameterSortingEnumSchemaName??C.zodSchema),f=n.map(C=>C.response),d=Xt([...f,...u?p:[]]),h=d.some(C=>!wt(C)),y=e.options.parseRequestParams&&p.length>0,b={bindings:[Br.name],from:WP(e.options)},g=ui({resolver:e,tag:r,zodSchemas:d.filter(wt),zodSchemasAsTypes:Xt(l.map(C=>C.zodSchema).filter(wt))});return _t(e,"endpoints")({appRestClientImport:i,hasAxiosImport:a,axiosImport:c,hasZodImport:h,zodImport:vo,hasZodExtendedImport:y,zodExtendedImport:b,modelsImports:g,includeNamespace:e.options.tsNamespaces,namespace:He({type:"endpoints",tag:r,options:e.options}),restClientName:Cs,hasAxiosRequestConfig:s,axiosRequestConfigName:Kn,axiosRequestConfigType:en,endpoints:n,generateParse:u})}o(F$,"generateEndpoints");function H$(e,t){let r=e.getRefByZodSchemaName(t);if(r){let i=Array.from(e.dependencyGraph.refsDependencyGraph[r]??[]).map(a=>e.getZodSchemaNameByRef(a)),s=e.getExtractedEnumZodSchemaNamesReferencedBySchemaRef(r);return[...i,...s]}let n=e.getCompositeZodSchemaByZodSchemaName(t);return n?Array.from(B$(n)).map(i=>e.getZodSchemaNameByRef(i)):[]}o(H$,"getZodSchemaRefs");function B$(e){return e.children.reduce((r,n)=>{let i=n.ref??n.enumRef;return i&&r.add(i),n.children.length>0&&B$(n).forEach(s=>r.add(s)),r},new Set)}o(B$,"getSchemaRefs");function V$({resolver:e,data:t,tag:r=""}){var u;let n=(u=t.get(r))==null?void 0:u.zodSchemas;if(!n||Object.keys(n).length===0)return;let i=Object.keys(n).reduce((l,p)=>[...l,...H$(e,p)],[]).filter(l=>!n[l]),s=ui({resolver:e,tag:r,zodSchemas:i}),a=Object.entries(n).reduce((l,[p,f])=>{let d=e.getRefByZodSchemaName(p);return{...l,[p]:{code:f,isCircular:!!d&&e.isSchemaCircular(d),isEnum:RP(f),schemaObj:e.getZodSchemaObj(p)}}},{});return _t(e,"models")({zodImport:vo,modelsImports:s,includeNamespace:e.options.tsNamespaces,namespace:He({type:"models",tag:r,options:e.options}),tag:r,zodSchemasData:a})}o(V$,"generateModels");function U$({resolver:e,data:t,tag:r=""}){var $e;let n=($e=t.get(r))==null?void 0:$e.endpoints;if(!n||n.length===0)return;let i=e.options.axiosRequestConfig,s=n.some(({mediaUpload:G})=>G),a=i||s,c={defaultImport:s?qm:void 0,bindings:i?[en]:[],from:Yu.from},u=n.filter(Jt),l=u.filter(G=>cs(G)),p=n.filter(ii),f={bindings:[...u.length>0?[kr.query]:[],...e.options.infiniteQueries&&l.length>0?[kr.infiniteQuery]:[],...p.length>0?[kr.mutation]:[]],from:iP.from},d=e.options.mutationEffects,h={bindings:[Lf],from:GP(e.options)},y=d&&p.length>0,b={bindings:[...p.length>0?[bo.optionsType,bo.hookName]:[]],from:zP(e.options)},g=n.filter(G=>G.acl),P=e.options.checkAcl&&g.length>0,$={bindings:[ai],from:ZP(e.options)},C={bindings:[...u.length>0?[Ac.query]:[],...e.options.infiniteQueries&&l.length>0?[Ac.infiniteQuery]:[],...p.length>0?[Ac.mutation]:[]],from:UP(e.options)},T=n.reduce((G,j)=>[...G,...j.parameters],[]),A=ui({resolver:e,tag:r,zodSchemasAsTypes:Xt(T.map(G=>G.zodSchema).filter(wt))}),te=LP({tag:r,endpoints:n,options:e.options}),X=FP({tag:r,endpoints:g,options:e.options});return _t(e,"queries")({hasAxiosImport:a,axiosImport:c,queryImport:f,hasMutationEffects:d,queryModulesImport:h,hasMutationEffectsImport:y,mutationEffectsImport:b,hasAclCheck:P,aclCheckImport:$,queryTypesImport:C,modelsImports:A,endpointsImports:te,aclImports:X,includeNamespace:e.options.tsNamespaces,tag:r,namespace:He({type:"queries",tag:r,options:e.options}),queriesModuleName:Aa,queryModuleEnum:Lf,endpoints:n,queryEndpoints:u})}o(U$,"generateQueries");function G$(e){return _t(e,"acl-check")({abilityContextImport:{...ib,from:e.options.abilityContextImportPath},caslAbilityTupleImport:{...Ma,bindings:[dt.abilityTuple]},appAbilitiesImport:{bindings:[ja],from:KP(e.options)},errorHandlingImport:{...Ic,from:e.options.errorHandlingImportPath},abilityContext:Df,appAbilities:ja,errorHandler:Tn.ErrorHandler,sharedErrorHandler:Tn.SharedErrorHandler,aclCheckHook:ai})}o(G$,"generateAclCheck");function z$(e){return _t(e,"app-rest-client")({appRestClientName:Cs,baseUrl:e.getBaseUrl()})}o(z$,"generateAppRestClient");function Z$({resolver:e,data:t}){let r=[];return t.forEach((i,s)=>{var c;let a=(c=t.get(s))==null?void 0:c.endpoints;!a||a.length===0||r.push({tag:s,namespace:He({type:"queries",tag:s,options:e.options})})}),_t(e,"query-modules")({modules:r})}o(Z$,"generateQueryModules");function W$(e){return _t(e,"zod")({zodImport:vo,zodExtension:Br.name,sortingString:Br.properties.sortingString,parse:Br.properties.parse,errorHandler:Tn.ErrorHandler,sharedErrorHandler:Tn.SharedErrorHandler,errorHandlingImport:{...Ic,from:e.options.errorHandlingImportPath}})}o(W$,"generateZod");function K$(e,t){return t.options.acl?[{fileName:qr({output:t.options.output,fileName:Xi(rl)}),content:L$(t,e)},...t.options.checkAcl?[{fileName:qr({output:t.options.output,fileName:Xi(nl)}),content:G$(t)}]:[]]:[]}o(K$,"getAclFiles");function Y$(e,t){return t.options.mutationEffects?[...X$([ob,Nc],t),{fileName:qr({output:t.options.output,fileName:Xi(Rc)}),content:Z$({resolver:t,data:e})}]:[]}o(Y$,"getMutationEffectsFiles");function Q$(e){return e.options.standalone?[...X$(Object.values(Cc),e),{fileName:qr({output:e.options.output,fileName:Xi(Tc)}),content:z$(e)}]:[]}o(Q$,"getStandaloneFiles");function J$(e,t){return t.options.parseRequestParams?[{fileName:qr({output:t.options.output,fileName:Xi(jc)}),content:W$(t)}]:[]}o(J$,"getZodExtendedFiles");function X$(e,t){return e.reduce((r,n)=>[...r,bF(n,t)],[])}o(X$,"getAssetFiles");function bF(e,t){let r=Xi(e);return{fileName:qr({output:t.options.output,fileName:r}),content:Rx(r)}}o(bF,"getAssetFile");function e2(e,t){let r=t.standalone&&t.importPath==="ts"?"relative":t.importPath,n={...Pe,...t,importPath:r},{resolver:i,data:s}=ml(e,n),a=[],c=[],u=["models","endpoints","queries","acl"],l={models:V$,endpoints:F$,queries:U$,acl:D$};return s.forEach((p,f)=>{u.forEach(d=>{let h=l[d]({resolver:i,data:s,tag:f});if(h){let y=qr({output:n.output,fileName:ll({tag:f,type:d,options:n})});a.push({fileName:y,content:h}),d==="acl"&&c.push(f)}})}),a.push(...K$(c,i),...Y$(s,i),...J$(s,i),...Q$(i)),a}o(e2,"generateCodeFromOpenAPIDoc");async function n2({input:e,excludeTags:t,monorepo:r,prettier:n,verbose:i,...s}){let a=Date.now();i&&fr("Parsing OpenAPI spec...");let c=await t2.default.bundle(e);i&&Rn("Parsing finished."),i&&fr("Generating code...");let u=r?"monorepoTemplate":"template",l=e2(c,{input:e,excludeTags:t.split(","),restClientImportPath:ur.appRestClient[u],errorHandlingImportPath:ur.errorHandling[u],queryTypesImportPath:ur.queryTypes[u],abilityContextImportPath:ur.abilityContext[u],...s});i&&Rn("Generation finished."),i&&fr("Writing files..."),Nx(l),i&&Rn("Writing finished."),n&&vF({output:s.output,verbose:i}),i&&fr(`TIME: ${Date.now()-a}ms`)}o(n2,"generate");function vF({output:e,verbose:t}){t&&fr("Running Prettier..."),(0,r2.exec)(`prettier --write ${e} `,n=>{t&&(n?ks(n,"Prettier error"):Rn("Prettier finished."))})}o(vF,"execPrettier");var Ce=class Ce{input;output;tsNamespaces;splitByTags;defaultTag;excludeTags;excludePathRegex;excludeRedundantZodSchemas;importPath;extractEnums;removeOperationPrefixEndingWith;acl;checkAcl;standalone;baseUrl;branded;replaceOptionalWithNullish;infiniteQueries;mutationEffects;parseRequestParams;axiosRequestConfig;monorepo;prettier;verbose};o(Ce,"GenerateOptions"),Se([Ee({envAlias:"input",demandOption:!0})],Ce.prototype,"input",2),Se([Ee({envAlias:"output",default:Pe.output})],Ce.prototype,"output",2),Se([Ee({envAlias:"tsNamespaces",default:Pe.tsNamespaces,type:"boolean"})],Ce.prototype,"tsNamespaces",2),Se([Ee({envAlias:"splitByTags",default:Pe.splitByTags,type:"boolean"})],Ce.prototype,"splitByTags",2),Se([Ee({envAlias:"defaultTag",default:Pe.defaultTag})],Ce.prototype,"defaultTag",2),Se([Ee({envAlias:"excludeTags",default:Pe.excludeTags.join(",")})],Ce.prototype,"excludeTags",2),Se([Ee({envAlias:"excludePathRegex",default:Pe.excludePathRegex})],Ce.prototype,"excludePathRegex",2),Se([Ee({envAlias:"excludeRedundantZodSchemas",default:Pe.excludeRedundantZodSchemas,type:"boolean"})],Ce.prototype,"excludeRedundantZodSchemas",2),Se([Ee({envAlias:"importPath",default:Pe.importPath})],Ce.prototype,"importPath",2),Se([Ee({envAlias:"extractEnums",default:Pe.extractEnums,type:"boolean"})],Ce.prototype,"extractEnums",2),Se([Ee({envAlias:"removeOperationPrefixEndingWith",default:Pe.removeOperationPrefixEndingWith})],Ce.prototype,"removeOperationPrefixEndingWith",2),Se([Ee({envAlias:"acl",default:Pe.acl,type:"boolean"})],Ce.prototype,"acl",2),Se([Ee({envAlias:"checkAcl",default:Pe.checkAcl,type:"boolean"})],Ce.prototype,"checkAcl",2),Se([Ee({envAlias:"standalone",default:Pe.standalone,type:"boolean"})],Ce.prototype,"standalone",2),Se([Ee({envAlias:"baseUrl",default:Pe.baseUrl})],Ce.prototype,"baseUrl",2),Se([Ee({envAlias:"branded",default:Pe.branded,type:"boolean"})],Ce.prototype,"branded",2),Se([Ee({envAlias:"replaceOptionalWithNullish",default:Pe.replaceOptionalWithNullish,type:"boolean"})],Ce.prototype,"replaceOptionalWithNullish",2),Se([Ee({envAlias:"infiniteQueries",default:Pe.infiniteQueries,type:"boolean"})],Ce.prototype,"infiniteQueries",2),Se([Ee({envAlias:"mutationEffects",default:Pe.mutationEffects,type:"boolean"})],Ce.prototype,"mutationEffects",2),Se([Ee({envAlias:"parseRequestParams",default:Pe.parseRequestParams,type:"boolean"})],Ce.prototype,"parseRequestParams",2),Se([Ee({envAlias:"axiosRequestConfig",default:Pe.axiosRequestConfig,type:"boolean"})],Ce.prototype,"axiosRequestConfig",2),Se([Ee({envAlias:"monorepo",default:!1,type:"boolean"})],Ce.prototype,"monorepo",2),Se([Ee({envAlias:"prettier",default:!0,type:"boolean"})],Ce.prototype,"prettier",2),Se([Ee({envAlias:"verbose",default:!1,type:"boolean"})],Ce.prototype,"verbose",2);var Qg=Ce,i2={command:"generate",describe:"Generate code from OpenAPI spec",builder:Bc(Qg),handler:o(async e=>{let t=await e;return t.verbose&&(Hc(`OpenAPI CodeGen ${Eo()}`),Ms("input",t.input),Ms("output",t.output)),n2(t)},"handler")};nb(ff(process.argv)).version(Eo()||"unknown").scriptName("openapi-codegen").command(i2).command(qx).help().demandCommand(1).strictCommands(!0).showHelpOnFail(!0).fail((e,t)=>{e&&ks(e),t&&ks(t),fr("Use '--help' for more info"),process.exit(1)}).parse();
152
152
  /*! Bundled license information:
153
153
 
154
154
  reflect-metadata/Reflect.js: